WO2023082787A1 - Method and apparatus for determining contribution degree of participant in federated learning, and federated learning training method and apparatus - Google Patents

Method and apparatus for determining contribution degree of participant in federated learning, and federated learning training method and apparatus Download PDF

Info

Publication number
WO2023082787A1
WO2023082787A1 PCT/CN2022/116570 CN2022116570W WO2023082787A1 WO 2023082787 A1 WO2023082787 A1 WO 2023082787A1 CN 2022116570 W CN2022116570 W CN 2022116570W WO 2023082787 A1 WO2023082787 A1 WO 2023082787A1
Authority
WO
WIPO (PCT)
Prior art keywords
participant
value
combination
contribution
utility
Prior art date
Application number
PCT/CN2022/116570
Other languages
French (fr)
Chinese (zh)
Inventor
杨程屹
刘嘉
李增祥
Original Assignee
新智我来网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202111326664.3A external-priority patent/CN114116740A/en
Priority claimed from CN202111337898.8A external-priority patent/CN114116707A/en
Priority claimed from CN202111326640.8A external-priority patent/CN114116705A/en
Priority claimed from CN202111590175.9A external-priority patent/CN116384500A/en
Application filed by 新智我来网络科技有限公司 filed Critical 新智我来网络科技有限公司
Publication of WO2023082787A1 publication Critical patent/WO2023082787A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present disclosure relates to the technical field of joint learning, and in particular to a method for determining the contribution degree of a participant in joint learning, a joint learning training method and a device.
  • the federated learning system when measuring the contribution of the participants in the federated learning, the federated learning system is usually used to determine the contribution of each participant to the federated learning model in the federated learning based on the amount of local data of each participant.
  • the local data of each participant may have problems such as uneven data quality and different forms of local data, the existing calculation method of joint learning contribution has low calculation accuracy, inaccurate calculation results, and large amount of calculation data. Relatively large, low computational efficiency and other issues.
  • the embodiments of the present disclosure provide a method for determining the contribution degree of a participant in joint learning, a joint learning training method, and a device to solve the problem of low calculation accuracy in the calculation method of joint learning contribution in the prior art.
  • the calculation results are inaccurate, the amount of calculation data is relatively large, and the calculation efficiency is low.
  • the first aspect of the embodiments of the present disclosure provides a method for determining the contribution of a participant in joint learning, including:
  • the second aspect of the embodiments of the present disclosure provides an apparatus for determining the contribution of a participant in joint learning, including:
  • the construction module is configured to determine the participants of the joint learning, construct all participant combinations based on the participants, and calculate the weight corresponding to each participant combination;
  • the first judging module is configured to determine the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of the participant in the aggregation period according to the utility change value;
  • the second judgment module is configured to select a participant combination from all participant combinations in a predetermined order when the judgment result is yes, and estimate the marginal contribution value of each participant in the selected participant combination, According to the estimation result and the weight of the participant combination, judge whether to use the interpolation function to calculate the utility value of the participant combination;
  • the update module is configured to use an interpolation function to calculate the utility value of the participant combination when the judgment result is yes, and to calculate the utility value of the participant combination by using a preset model derivation method when the judgment result is no, and to calculate the utility value of the participant combination according to the calculated Update the lookup table with the utility value of the participant combination;
  • the calculation module is configured to select each combination of participants in turn until the utility values of all the combinations of participants are calculated, and use the utility values of all the combinations of participants to update the lookup table to obtain a final updated lookup table, so that based on the final
  • the updated lookup table calculates the contribution value of each participant, and determines the contribution of the participant in the joint learning according to the contribution value.
  • the third aspect of the embodiments of the present disclosure provides a method for determining the contribution degree of a participant in joint learning, including:
  • the utility change value is used to determine whether to calculate the contribution value of each participant in the current aggregation period
  • the fourth aspect of the embodiments of the present disclosure provides an apparatus for determining the contribution of a participant in joint learning, including:
  • a determination module configured to determine all participant combinations based on the participants in the joint learning, and calculate the weight of each participant combination in the all participant combinations;
  • a building module configured to determine a first utility value of the joint model before the start of the current aggregation period, and a second utility value of the joint model after the end of the current aggregation period, based on the first utility value and the second utility value Calculating the utility change value, and establishing a lookup table; wherein, the utility change value is used to judge whether to calculate the contribution value of each participant in the current aggregation period;
  • the judging module is configured to, when judging and calculating the contribution value, select a participant combination from all the participant combinations, and calculate the marginal contribution value corresponding to each participant in the participant combination, according to the The marginal contribution value and the weight determine to use the first estimation method or the second estimation method to estimate the utility value of the participant combination;
  • the calculation module is configured to determine the estimation result of the utility value of the participant combination by the first estimation method or the second estimation method, use the estimation result to update the look-up table, and iteratively estimate in turn to obtain each A utility value of the participant combination, and a final lookup table obtained after updating according to the utility value is obtained, so as to use the final lookup table to calculate the contribution value of the participant.
  • the fifth aspect of the embodiments of the present disclosure provides a method for determining the contribution of participants in joint learning, including:
  • participant groups are generated, and a set of participant groups composed of multiple participant groups is determined, and weights of the participant groups are calculated, wherein each of the participant groups includes at least two participants;
  • the sixth aspect of the embodiments of the present disclosure provides an apparatus for determining the contribution of participants in joint learning, including:
  • the generation module is configured to generate a plurality of participant groups based on a joint learning architecture, and determine a participant group set composed of a plurality of the participant groups, and calculate the weights of the participant groups, wherein each of the participant groups
  • the party group contains at least two parties;
  • the establishment module is configured to determine the aggregation period in the joint learning, obtain the utility change value corresponding to the joint learning model before and after the aggregation period, and establish a lookup table, and judge whether to calculate each in the aggregation period according to the utility change value. Contribution value of participants;
  • the judging module is configured to randomly generate a full permutation combination by using the participant groups in the participant group set when the judgment result is yes, and according to the order of the participants in the participant group in the full permutation combination Generate a plurality of sub-combinations, calculate the estimated value of the marginal contribution value when the participant joins the sub-combination, and judge whether to use an interpolation function to evaluate the participants according to the estimated value of the marginal contribution value and the weight of the participant group The utility value of the new participant group formed after adding the sub-combination is calculated;
  • the update module is configured to use an interpolation function to calculate the utility value of the new participant group when the judgment result is yes, and to calculate the utility value of the new participant group by using a preset model derivation method when the judgment result is no value, and update the lookup table according to the calculated utility value of the new participant group;
  • the calculation module is configured to calculate the marginal contribution value of the participant based on the updated lookup table, and judge whether the marginal contribution value of the participant is converged, and when the judgment result is yes, the converged marginal contribution value As the contribution value of the participant, when the judgment result is no, a new full permutation combination is generated until the contribution value of all converged participants is calculated, and the participant is determined according to the contribution value The degree of contribution in the joint learning.
  • the seventh aspect of the embodiments of the present disclosure provides a joint learning training method, including:
  • the local model obtained by the initial model training of the participants of the joint learning according to the local data is obtained, and the aggregation operation is performed on the local models of the participants to obtain the joint model;
  • the eighth aspect of the embodiments of the present disclosure provides a joint learning and training device, including:
  • the aggregation module is configured to obtain a local model obtained by the participants of the federated learning through initial model training based on the local data during the current round of the federated learning, and perform an aggregation operation on the local models of the participants to obtain the joint model;
  • the calculation module is configured to use a preset joint learning contribution value algorithm to calculate the contribution value of each of the participants to the joint model in the current round of aggregation period, and obtain the corresponding joint learning contribution value;
  • the fusion module is configured to obtain an initial index of each of the participants, perform a fusion operation on the joint learning contribution value and the initial index, and obtain a contribution index of each of the participants, wherein the initial index is used for Characterize the initial contribution of the participants to the joint learning;
  • a training module configured to calculate the training rounds of the participant in the next round of aggregation period according to the contribution index, so that the participant will, in the next round of aggregation period, based on the training rounds
  • the local model is trained until the training of the joint model reaches a preset target.
  • the ninth aspect of the embodiments of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and operable on the processor, and the aforementioned method is implemented when the processor executes the program .
  • a tenth aspect of the embodiments of the present disclosure provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the aforementioned method is implemented.
  • the preset model deduction method to calculate the utility value of the participant combination, and update the lookup table according to the calculated utility value of the participant combination; select each participant combination in turn until all participants are calculated.
  • the utility value of the party combination is used to update the lookup table by using the utility value of all the participants combined to obtain the final updated lookup table, so that the contribution value of each participant can be calculated based on the final updated lookup table, and determined according to the contribution value Contribution of participants in joint learning.
  • the present disclosure can improve the calculation accuracy of the contribution value in joint learning, reduce the amount of calculation data, and make the calculation result of the contribution value more accurate and the calculation efficiency higher.
  • FIG. 1 is a schematic diagram of a joint learning architecture provided by an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of a method for determining the contribution of a participant in joint learning provided by an embodiment of the present disclosure
  • Fig. 3 is a schematic flow diagram of a program for calculating a participant's contribution value provided by an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of an apparatus for determining a participant's contribution in joint learning provided by an embodiment of the present disclosure
  • FIG. 5 is a schematic flowchart of another method for determining the contribution of a participant in joint learning provided by an embodiment of the present disclosure
  • Fig. 6 is a schematic flow diagram of a program for calculating a participant's contribution value provided by an embodiment of the present disclosure
  • FIG. 7 is a schematic diagram of another device for determining participant contribution in joint learning provided by an embodiment of the present disclosure.
  • FIG. 8 is a schematic flowchart of another method for determining the contribution of a participant in joint learning provided by an embodiment of the present disclosure
  • FIG. 9 is a schematic flow diagram of a program for calculating participant contribution values provided by an embodiment of the present disclosure.
  • FIG. 10 is a schematic diagram of another device for determining participant contribution in joint learning provided by an embodiment of the present disclosure.
  • FIG. 11 is a schematic flowchart of a joint learning training method provided by an embodiment of the present disclosure.
  • Fig. 12 is a schematic flow chart of calculating the joint learning contribution value of the participants provided by the embodiment of the present disclosure.
  • Fig. 13 is a schematic diagram of a joint learning and training device provided by an embodiment of the present disclosure.
  • Fig. 14 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • Federated learning refers to the comprehensive utilization of various AI (Artificial Intelligence, artificial intelligence) technologies on the premise of ensuring data security and user privacy, and joint multi-party cooperation to jointly mine data value and generate new intelligent business models and models based on joint modeling.
  • Federated learning has at least the following characteristics:
  • Participating nodes control the weakly centralized joint training mode of their own data to ensure data privacy and security in the process of co-creating intelligence.
  • the joint learning system determines the contribution of each participant to the joint learning model according to the amount of local data of each participant, but because the local data of each participant may have uneven data quality, the format or form of the local data Different, the data features of each participant overlap more and other problems, resulting in low calculation efficiency of the contribution of the joint learning model in the joint learning, and the accuracy of the joint learning contribution of each participant is also low. This will lead to insufficient evaluation of the fairness and impartiality of each participant's contribution when using the joint learning contribution to distribute the benefits of each participant in the later stage.
  • FIG. 1 is a schematic diagram of a joint learning architecture provided by an embodiment of the present disclosure.
  • the architecture of joint learning may include a server (central node) 101 , and participants 102 , 103 , and 104 .
  • the basic model can be established by the server 101, and the server 101 sends the model to the participant 102, the participant 103 and the participant 104 with which a communication connection is established.
  • the basic model can also be uploaded to the server 101 after being created by any participant, and the server 101 sends the model to other participants that have established communication connections with it.
  • Participant 102, participant 103 and participant 104 build a model according to the downloaded basic structure and model parameters, use local data for model training, obtain updated model parameters, and encrypt and upload the updated model parameters to the server 101.
  • the server 101 aggregates the model parameters sent by the participant 102 , the participant 103 and the participant 104 to obtain the global model parameters, and returns the global model parameters to the participant 102 , the participant 103 and the participant 104 .
  • the participant 102, the participant 103 and the participant 104 iterate their models according to the received global model parameters until the models finally converge, thereby realizing the training of the models.
  • the data uploaded by participant 102, participant 103, and participant 104 are model parameters, local data will not be uploaded to server 101, and all participants can share the final model parameters, so data can be guaranteed Co-modeling is achieved on the basis of privacy. It should be noted that the number of participants is not limited to the above three, but can be set according to needs, which is not limited in this embodiment of the present disclosure.
  • Fig. 2 is a schematic flow chart of a method for determining a participant's contribution in joint learning provided by an embodiment of the present disclosure.
  • the method for determining the contribution degree of a participant in the joint learning in FIG. 2 may be executed by a server of the joint learning.
  • the method for determining the contribution of the participants in the joint learning may specifically include:
  • S202 Determine the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of the participant in the aggregation period according to the utility change value;
  • each participant corresponds to a node in the joint learning framework
  • each node corresponds to a participant device.
  • the participant device can be a PC, tablet computer, smart phone, smart wearable device, etc., and each participant device
  • the federated learning framework also has a node that provides services for the client (that is, the server).
  • the server can be a server for performing aggregation operations.
  • the server can coordinate multiple clients to perform joint learning to obtain a joint learning model.
  • the server may be an independent physical server, or a server cluster or cloud computing server composed of multiple physical servers.
  • the combination of participants refers to the mutual arrangement and combination of individuals of all participants in the joint learning, and is a combination of participants composed of individuals of the participants.
  • the parties are A, B, and C respectively, then the following combinations of parties can be formed among them: A, B, C, AB, BC, and AC.
  • an aggregation cycle refers to a round of training for the federated learning model.
  • Each participant client uses local data to train the local model.
  • the trained local model is obtained parameter and send it to the server.
  • All participants will upload their own local model parameters in each aggregation round, and the server will perform a weighted average to obtain a joint model, so each participant will make its own contribution in each round.
  • the round here means The server performs a complete training of the joint learning model.
  • the embodiments of the present disclosure by determining the participants of the joint learning, construct all participant combinations based on the participants, and calculate the weight corresponding to each participant combination; determine the utility change value corresponding to the joint learning model before and after the aggregation period And establish a lookup table, judge whether to calculate the contribution value of the participants in the aggregation period according to the utility change value; when the judgment result is yes, select a participant combination from all the participant combinations in the predetermined order, and calculate According to the estimation result and the weight of the participant combination, judge whether to use the interpolation function to calculate the utility value of the participant combination; when the judgment result is yes, use the interpolation function Calculate the utility value of the participant combination.
  • the preset model deduction method to calculate the utility value of the participant combination, and update the lookup table according to the calculated utility value of the participant combination; select each A participant combination, until the utility value of all the participant combinations is calculated, the lookup table is updated by using the utility value of all the participant combinations, and the final updated lookup table is obtained, so that based on the final updated lookup table, each The contribution value of the participant, according to the contribution value to determine the contribution of the participant in the joint learning.
  • the present disclosure can improve the calculation accuracy of the contribution value in joint learning, reduce the amount of calculation data, and make the calculation result of the contribution value more accurate and the calculation efficiency higher.
  • the program for calculating the contribution value of the participants may specifically include the following:
  • constructing all participant combinations based on the participants, and calculating the weight corresponding to each participant combination includes: constructing all participants according to the number of participants from the fewest to the largest according to all participants in the joint learning Party combination, all participant combinations include multiple participant combinations, and the weight is calculated according to the number of participants in each participant combination; where, the weight is used to represent the probability that the participant combination appears in all the participant combinations.
  • each participant combination corresponds to a sub-combination S mentioned above.
  • the weight of the sub-combination S it is based on the number of participants in each sub-combination.
  • a participant Corresponding to the elements in a set that is, the weight corresponding to the participant combination is calculated according to the number of elements in the participant combination.
  • the weight corresponding to each sub-combination can be considered as the probability of the sub-combination appearing in the overall participant combination.
  • determining the utility change value corresponding to the joint learning model before and after the aggregation period and establishing a lookup table includes: for each aggregation period, determining the initial utility value and the final utility value of the aggregation period, and combining the final utility value with the initial utility The difference between the values is used as the utility change value, and a lookup table containing all participant combinations corresponding to the aggregation period is established; the lookup table is initialized so that the lookup table excludes the combination of the empty set participant and the full set participant combination The initial utility value of other participant combinations other than 0; wherein, the lookup table is used to store the utility values corresponding to all participant combinations.
  • v 0 can also be understood as the current aggregation period before the start of the current aggregation period.
  • the difference in different expressions does not constitute a limit to the essential meaning of v 0 , and the above two expressions are equivalent.
  • judging whether to calculate the contribution value of the participant in the aggregation period according to the utility change value includes: comparing the utility change value of the aggregation period with a preset first cut-off threshold, when the utility change of the aggregation period When the value is less than the first truncation threshold, and the utility change value of two consecutive rounds of aggregation periods is less than the first truncation threshold, it is judged that the contribution value of each participant in the aggregation period is 0; otherwise, the contribution of each participant in the aggregation period value is calculated.
  • the purpose of this embodiment of the present disclosure is to evaluate the changes in the utility value of the joint model in the current round before formally calculating the contribution value of each participant. Whether the utility value of the joint model has been improved, that is, whether the performance of the joint model itself has been improved. If the improvement in model performance is small, it can be considered that the contribution value of each participant in this round is 0; The performance improvement of the learning model is relatively large, so continue to perform the following calculations, that is, specifically calculate the contribution value of each participant in this round. This disclosure can judge in advance whether it is necessary to further calculate the contribution value of the participant, or directly count the contribution value of the participant in the current round as 0, thereby avoiding an invalid calculation process and improving calculation efficiency.
  • a participant combination is selected from all participant combinations in a predetermined order, and the marginal contribution value of each participant in the selected participant combination is estimated, including: The arrangement order of the combination of participants is selected in turn, and the participants in the selected combination of participants are iterated sequentially, so as to estimate the marginal contribution value generated when the participant joins the combination of participants, and obtain the marginal contribution An estimate of the value.
  • a participant combination P is sequentially selected from all participant combinations Ps in the current round, and the selection order and enumeration here are all possible
  • the order of the participant combinations Ps is the same, that is, the combination with a small number of participants is selected first, and then the combination with a large number of participants is selected progressively.
  • each participant combination P estimate the marginal contribution value of each participant in the participant combination, that is, calculate the The marginal contribution value generated during the combination; below in conjunction with a specific embodiment, the estimation process of the marginal contribution value of each participant in the participant combination P will be described in detail, which may specifically include the following:
  • an interpolation function to calculate the utility value of the participant combination, including: calculating the estimated value of the marginal contribution value corresponding to the participant and the corresponding participant Combined weight product, and compare the product with the preset second truncation threshold; when the product corresponding to each participant in the participant combination is less than or equal to the preset second truncation threshold, it is judged to use the interpolation function Calculate the utility value of the participant combination; otherwise, use the preset model deduction method to calculate the utility value of the participant combination.
  • the marginal contribution value of each participant in the above participant combination P satisfies the above formula
  • other judgment criteria can also be set, such as The marginal contribution value of any participant in the participant combination P does not satisfy the above formula, or half of the participants in the participant combination P do not satisfy the above formula, or there is any proportion of participants in the participant combination P that does not satisfy the above formula formulas and more.
  • the marginal contribution value of each participant in the participant combination is estimated by amplifying the utility value, and the estimated value Multiply with the weight of the participant combination, and compare the product with the second cut-off threshold, so as to judge whether to use the interpolation function to calculate the utility value of the participant combination, or to use the model deduction to calculate the utility value of the participant combination; because the model The complexity of the deduction is very high, and the amount of calculation is large.
  • using an interpolation function to calculate the utility value of the participant combination includes: based on the utility value of the participant combination calculated in the historical iteration process, and the corresponding utility value when the participant combination is a complete set of participant combinations, using a preset The set interpolation function estimates the utility value of the participant combination, obtains the estimated value corresponding to the utility value of the participant combination, and updates the lookup table according to the estimated value.
  • the principle of the interpolation function to calculate the utility value is to use the calculated utility value of the subcombination to estimate the utility value of the participant combination, that is, to calculate the utility value of the participant combination according to the utility value of the subcombination in the previous iteration process.
  • Approximation processing for example, for the participant combination (1, 2, 3), the values of v(1, 2), v(2, 3), v(1, 3) can be used to estimate v(1, 2, 3), and the value of v(1, 2),, v(2, 3), v(1, 3) already exists in the v_lut lookup table.
  • the implementation method of the interpolation function interpolate( ) is:
  • mean(VS_hist), v N , sub-combination P and full combination N are used as the input of the function, calculated and output.
  • the method of calculating the average value (that is, the mean in the formula) is used to calculate the estimated utility value of the participant combination P, but in practical applications, in addition to the method of calculating the average value,
  • the utility estimation value of the participant combination P can also be calculated by calculating the maximum value, the minimum value or the median value.
  • the mean in the above formula can be directly replaced by max; when the minimum value method is used for calculation, the mean in the above formula can be directly replaced by min. Therefore, the calculation method of the interpolation function does not constitute a Limitations on the technical solution of the application.
  • the utility value of the participant combination is calculated using a preset model derivation method, and the lookup table is updated according to the calculated utility value of the participant combination, including: aggregating the model parameters corresponding to the participant combination , and perform model deduction on the model corresponding to the participant combination, aggregate the weights of each participant in the participant combination to obtain the weight of the participant combination, perform model deduction on the standard verification set for the participant combination, and calculate the participation
  • the real utility value of the square combination is used to update the lookup table.
  • calculating the contribution value of each participant based on the final updated lookup table includes: using the preset Shapley The value calculation formula calculates the contribution value corresponding to each participant, where the contribution value is used to represent the contribution of the participant to the joint learning model trained in the aggregation cycle in the joint learning.
  • the entire participant combination Ps is cycled once to obtain the final updated v_lut lookup table, and the corresponding utility of the participant combination in the lookup table is obtained. Values are substituted into the preset Shapley value calculation formula in turn to calculate the contribution value corresponding to each participant, and then the contribution value of each contributor in the current aggregation period can be obtained.
  • Shapley Value is a method for fairly distributing benefits based on the average marginal contribution of individual i joining combination S, and its computational complexity is O(2 n ), where n is the total number of individuals. Its calculation formula is:
  • the Shapley value (that is, the Shapley value) considers all possible orders in which individual i joins the sub-combination, where N represents the full combination, S represents the sub-combination in a certain arrangement, V( ⁇ ) represents the utility function, and the
  • , where T is the total communication round, which can be set to ⁇ ⁇ U *0.01.
  • Fig. 4 is a schematic structural diagram of an apparatus for determining a participant's contribution in joint learning provided by an embodiment of the present disclosure. As shown in Figure 4, the means for determining the contribution of participants in this joint learning include:
  • the construction module 401 is configured to determine the participants of the joint learning, construct all participant combinations based on the participants, and calculate the weight corresponding to each participant combination;
  • the first judging module 402 is configured to determine the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of the participant in the aggregation period according to the utility change value;
  • the second judging module 403 is configured to, when the judging result is yes, select a participant combination from all participant combinations in a predetermined order, and estimate the marginal contribution value of each participant in the selected participant combination , according to the estimation result and the weight of the participant combination, judge whether to use the interpolation function to calculate the utility value of the participant combination;
  • the update module 404 is configured to use an interpolation function to calculate the utility value of the participant combination when the judgment result is yes, and to calculate the utility value of the participant combination by using a preset model derivation method when the judgment result is no, and calculate according to Update the lookup table with the utility value of the obtained participant combination;
  • the calculation module 405 is configured to select each participant combination in turn until the utility values of all participant combinations are calculated, and update the lookup table by using the utility values of all participant combinations to obtain a final updated lookup table, so that based on The final updated lookup table calculates the contribution value of each participant, and determines the contribution of the participant in the joint learning according to the contribution value.
  • the construction module 401 in FIG. 4 constructs all participant combinations according to the number of participants from the fewest to the largest according to all participants in the joint learning. All participant combinations include multiple participant combinations. According to The number of participants in each participant combination calculates the weight; wherein, the weight is used to represent the probability that the participant combination appears in all the participant combinations.
  • the first judgment module 402 in FIG. 4 determines the initial utility value and the final utility value of the aggregation period for each aggregation period, and uses the difference between the final utility value and the initial utility value as the utility change value, And establish a lookup table containing all participant combinations corresponding to the aggregation cycle; perform an initialization operation on the lookup table so that the initial utility values of other participant combinations in the lookup table except the empty set participant combination and the full set participant combination are 0; among them, the lookup table is used to store the utility values corresponding to the combinations of all participants.
  • the first judging module 402 in FIG. 4 compares the utility change value of the aggregation period with the preset first cut-off threshold, and when the utility change value of the aggregation period is less than the first cut-off threshold, and multiple rounds of aggregation When the utility change values of the period are all less than the first cut-off threshold, it is judged that the contribution value of each participant in the aggregation period is 0; otherwise, the contribution value of each participant in the aggregation period is calculated.
  • the second judging module 403 in FIG. 4 sequentially selects the participant combinations according to the arrangement order of the participant combinations in all the participant combinations, and iterates the participants in the selected participant combinations sequentially. , in order to estimate the marginal contribution value generated when the participant joins the participant combination, and obtain the estimated value of the marginal contribution value.
  • the second judging module 403 in FIG. 4 calculates the product of the estimated value of the participant's corresponding marginal contribution value and the weight of the participant's corresponding participant combination, and compares the product with the preset second cut-off threshold ; When the product corresponding to each participant in the participant combination is less than or equal to the preset second cut-off threshold, it is judged to use the interpolation function to calculate the utility value of the participant combination; otherwise, use the preset model derivation method Computes the utility value for a combination of parties.
  • the update module 404 in FIG. 4 uses a preset interpolation function to update the participant's The utility value of the combination is estimated, and the estimated value corresponding to the utility value of the participant combination is obtained, and the lookup table is updated according to the estimated value.
  • the update module 404 in FIG. 4 aggregates the model parameters corresponding to the participant combination, performs model deduction on the model corresponding to the participant combination, and aggregates the weight of each participant in the participant combination to obtain The weight of the participant combination, the model deduction of the participant combination on the standard verification set is calculated to obtain the real utility value of the participant combination, and the lookup table is updated using the real utility value.
  • the calculation module 405 in FIG. 4 calculates the contribution value corresponding to each participant by using the preset Shapley value calculation formula according to the utility value of each participant combination in the finally updated lookup table , where the contribution value is used to represent the contribution of the participants to the joint learning model trained in the aggregation cycle in the joint learning.
  • Fig. 5 is a schematic flowchart of another method for determining the contribution of a participant in joint learning provided by an embodiment of the present disclosure.
  • the method for determining the contribution degree of a participant in the joint learning in FIG. 2 may be executed by a server of the joint learning.
  • the method for determining the contribution of the participants in the joint learning may specifically include:
  • S504. Determine the estimation result of the utility value of the participant combination by the first estimation method or the second estimation method, use the estimation result to update the lookup table, and iteratively estimate the utility value of each participant combination in turn, and obtain the basis utility value
  • the final lookup table obtained after the update is used to calculate the contribution value of the participant using the final lookup table.
  • all participant combinations are determined based on the participants in the joint learning, and the weight of each participant combination in all participant combinations is calculated; the first joint model of the joint model before the current aggregation cycle starts A utility value, and the second utility value of the joint model after the end of the current aggregation period, calculate the utility change value based on the first utility value and the second utility value, and establish a lookup table; wherein, the utility change value is used to judge whether to calculate the current The contribution value of each participant in the aggregation period; when judging and calculating the contribution value, select a participant combination from all participant combinations, and calculate the marginal contribution value corresponding to each participant in the participant combination, according to the marginal contribution value and Weight, to judge the utility value of the participant combination by using the first estimation method or the second estimation method; determine the estimation result of the utility value of the participant combination by the first estimation method or the second estimation method, and use the estimation result to look up the table Update, and iteratively estimate the utility value of each participant
  • FIG. 6 the program for calculating the contribution value of the participants may specifically include the following:
  • determining all participant combinations based on the participants in the joint learning, and calculating the weight of each participant combination in all the participant combinations includes: determining the participants in the joint learning, dividing the participants according to the number from Enumerate multiple participant combinations sequentially in the least-most way, and use the set of multiple participant combinations as all participant combinations; calculate the weight corresponding to the participant combination based on the number of participants in the participant combination, where, The weight is used to represent the probability that the participant combination appears in all the participant combinations.
  • each participant combination corresponds to a sub-combination S mentioned above.
  • the weight of the sub-combination S it is based on the number of participants in each sub-combination.
  • a participant Corresponding to the elements in a set that is, the weight corresponding to the participant combination is calculated according to the number of elements in the participant combination.
  • the weight corresponding to each sub-combination can be considered as the probability of the sub-combination appearing in the overall participant combination.
  • v 0 can also be understood as the current aggregation period before the start of the current aggregation period.
  • the difference in different expressions does not constitute a limit to the essential meaning of v 0 , and the above two expressions are equivalent.
  • the utility change value is used to determine whether to calculate the contribution value of each participant in the current aggregation period, including: comparing the utility change value of the joint model corresponding to the current aggregation period with the preset first cut-off threshold, when When the utility change value is less than the first truncation threshold, it is judged that the contribution value of each participant in the current aggregation period is 0; otherwise, the contribution value of each participant in the current aggregation period is recalculated.
  • the calculation ends, and
  • the contribution value of each participant in the current aggregation period is regarded as 0, that is, each participant does not make a contribution in the current aggregation period.
  • the purpose of this embodiment of the present disclosure is to evaluate the changes in the utility value of the joint model in the current round before formally calculating the contribution value of each participant. Whether the utility value of the joint model has been improved, that is, whether the performance of the joint model itself has been improved. If the improvement in model performance is small, it can be considered that the contribution value of each participant in this round is 0; The performance improvement of the model is relatively large, so continue to perform the following calculations, that is, specifically calculate the contribution value of each participant in this round. This disclosure can judge in advance whether it is necessary to further calculate the contribution value of the participant, or directly count the contribution value of the participant in the current round as 0, thereby avoiding an invalid calculation process and improving calculation efficiency.
  • a participant combination is selected from all participant combinations, and the marginal contribution value corresponding to each participant in the participant combination is calculated, including: according to the arrangement order of each participant combination in all participant combinations , select a participant combination from all participant combinations in turn, and randomly select a participant from the participant combination; divide a sub-combination from the participant combination according to the participant, and calculate the margin generated when the participant joins the sub-combination Contribution value, iterates the participants in the participant combination in order to calculate the marginal contribution value corresponding to each participant; where, the sub-combination is a set of participants in the participant combination except randomly selected participants .
  • a participant combination P is sequentially selected from all participant combinations Ps in the current round, and the selection order and enumeration here are all possible
  • the order of the participant combinations Ps is the same, that is, the combination with a small number of participants is selected first, and then the combination with a large number of participants is selected progressively.
  • each participant combination P estimate the marginal contribution value of each participant in the participant combination, that is, calculate the The marginal contribution value generated during the combination; below in conjunction with a specific embodiment, the estimation process of the marginal contribution value of each participant in the participant combination P will be described in detail, which may specifically include the following:
  • the first estimation method or the second estimation method to estimate the utility value of the participant combination, including: calculating the marginal contribution value of the participant and the participant combination to which the participant belongs The product between the weights, and compare the product with the preset second truncation threshold; when the product corresponding to each participant in the participant combination is less than or equal to the second truncation threshold, it is judged to use the first estimation method Estimate the utility value of the participant combination; otherwise, use the second estimation method to estimate the utility value of the participant combination.
  • the utility value of the participant combination P does not need to be deduced at this time, and the utility value of the subcombination can be directly used to determine Estimate the utility value of the participant combination P. If the marginal contribution value of one participant is not satisfied, it is necessary to model the participant combination P and calculate the utility value.
  • the marginal contribution value of each participant in the above participant combination P satisfies the above formula
  • other judgment criteria can also be set, such as The marginal contribution value of any participant in the participant combination P does not satisfy the above formula, or half of the participants in the participant combination P do not satisfy the above formula, or there is any proportion of participants in the participant combination P that does not satisfy the above formula formulas and more.
  • the marginal contribution value of each participant in the participant combination is estimated by amplifying the utility value, and the estimated value Multiply with the weight of the participant combination, and compare the product with the second cut-off threshold, so as to judge whether to use the utility value of the sub-combination to estimate the utility value of the participant combination, or to calculate the utility value of the participant combination by model deduction; Due to the high complexity of model deduction and the large amount of calculation, by adding the above-mentioned judgment means, for the combination of participants that do not need to do model deduction, the utility value of the sub-combination that has been calculated in the previous iteration process can be directly used to estimate The utility value of the participant combination, thus improving the calculation speed of the contribution value.
  • using the first estimation method to estimate the utility value of the participant combination includes: obtaining the utility value corresponding to the sub-combination in the participant combination from a lookup table, and averaging the utility values corresponding to the sub-combination , the calculation of the maximum value or minimum value, using the calculated average value, maximum value or minimum value as the estimated value of the utility value of the combination of participants, and updating the lookup table according to the estimated value.
  • the first estimation method is to use the utility value corresponding to the sub-combination in the participant combination to estimate the utility value of the participant combination.
  • the calculated utility value of the sub-combination to estimate the utility value of the participant combination , by calculating the average, maximum or minimum value among the utility values of the subcombinations, so as to approximate the utility value of the participant combination, for example, for the participant combination (1, 2, 3).
  • the value of v(1,2,3) can be estimated by the average, maximum or minimum value of v(1,2), v(2,3), v(1,3), and v(1, 2), the values of v(2, 3), v(1, 3) already exist in the v_lut lookup table.
  • V(P) mean(VS_hist)
  • V(P) represents the utility value of the participant combination
  • VS_hist represents the utility value corresponding to the sub-combination
  • the method of calculating the mean value (i.e. the mean in the formula) is used to calculate the utility estimate of the participant combination P, but in practical applications, in addition to the method of calculating the mean value, there is also
  • the utility estimation value of the participant combination P can be calculated by calculating the maximum value or the minimum value.
  • the mean in the above formula can be directly replaced by max; when the minimum value method is used for calculation, the mean in the above formula can be directly replaced by min. Therefore, the calculation method of the above utility value does not constitute Restrictions on the technical solution of this application.
  • using the second estimation method to estimate the utility value of the participant combination includes: aggregating the model parameters corresponding to the participant combination, and performing model deduction on the model corresponding to the participant combination, and calculating the participant combination
  • the weight of each participant is aggregated to obtain the weight of the participant combination, and the model deduction is carried out on the standard verification set for the participant combination, and the real utility value of the participant combination is calculated, and the lookup table is updated using the real utility value.
  • obtaining the final lookup table obtained after updating according to the utility value, so as to use the final lookup table to calculate the contribution value of the participant includes: obtaining the utility value of the participant combination in the final lookup table, using the preset The Shapley value formula is used to calculate the contribution value corresponding to each participant, where the contribution value is used to represent the contribution value of the participant to the joint model trained in the aggregation cycle in the joint learning.
  • the entire participant combination Ps is cycled once to obtain the final updated v_lut lookup table, and the corresponding utility of the participant combination in the lookup table is obtained. Values are substituted into the preset Shapley value calculation formula in turn to calculate the contribution value corresponding to each participant, and then the contribution value of each contributor in the current aggregation period can be obtained.
  • Shapley Value is a method for fairly distributing benefits based on the average marginal contribution of individual i joining combination S, and its computational complexity is O(2 n ), where n is the total number of individuals. Its calculation formula is:
  • the Shapley value (that is, the Shapley value) considers all possible orders in which individual i joins the sub-combination, where N represents the full combination, S represents the sub-combination in a certain arrangement, V( ⁇ ) represents the utility function ,
  • , where T is the total communication round, which can be set to ⁇ ⁇ U *0.01.
  • Fig. 7 is a schematic structural diagram of another apparatus for determining a participant's contribution in joint learning provided by an embodiment of the present disclosure. As shown in Figure 7, the means for determining the contribution of participants in this joint learning include:
  • the determining module 701 is configured to determine all participant combinations based on the participants in the joint learning, and calculate the weight of each participant combination in all participant combinations;
  • the establishment module 702 is configured to determine a first utility value of the joint model before the start of the current aggregation period, and a second utility value of the joint model after the end of the current aggregation period, and calculate a utility change based on the first utility value and the second utility value value, and establish a lookup table; among them, the utility change value is used to judge whether to calculate the contribution value of each participant in the current aggregation period;
  • the judging module 703 is configured to select a participant combination from all participant combinations when judging and calculating the contribution value, and calculate the marginal contribution value corresponding to each participant in the participant combination, and judge according to the marginal contribution value and weight Estimate the utility value of the participant combination by using the first estimation method or the second estimation method;
  • the calculation module 704 is configured to determine the estimation result of the utility value of the participant combination by the first estimation method or the second estimation method, use the estimation result to update the lookup table, and iteratively estimate to obtain the utility value of each participant combination , to obtain the final lookup table obtained after updating according to the utility value, so as to use the final lookup table to calculate the contribution value of the participant.
  • the determination module 701 in FIG. 7 determines the participants in the joint learning, and enumerates the participants in order from the least to the largest to obtain a combination of multiple participants.
  • the combination of multiple participants constitutes
  • the set is used as a combination of all participants; the weight corresponding to the combination of participants is calculated based on the number of participants in the combination of participants, where the weight is used to represent the probability that the combination of participants appears in all combinations of participants.
  • the establishment module 702 in FIG. 7 determines the first utility value and the second utility value corresponding to the joint model before and after the current aggregation period, and calculates the difference between the second utility value and the first utility value Value, use the difference as the utility change value, and establish a lookup table containing all participant combinations corresponding to the current aggregation cycle; perform an initialization operation on the lookup table, so that the lookup table excludes the empty set participant combination and the full set participant combination The initial utility value of other participant combinations other than 0; wherein, the lookup table is used to store the utility values corresponding to all participant combinations.
  • the establishment module 702 in FIG. 7 compares the utility change value of the joint model corresponding to the current aggregation period with the preset first cut-off threshold, and when the utility change value is less than the first cut-off threshold, then judge the current aggregation period The contribution value of each participant in the period is 0; otherwise, recalculate the contribution value of each participant in the current aggregation period.
  • the judging module 703 in FIG. 7 sequentially selects a participant combination from all participant combinations according to the arrangement order of each participant combination in all participant combinations, and randomly selects a participant combination from the participant combination. According to the participant's division of a sub-combination from the participant combination, the marginal contribution value generated when the participant joins the sub-combination is calculated, and the participants in the participant combination are iterated in order to calculate the corresponding marginal contribution value; where, the sub-combination is a set of participants in the participant combination except randomly selected participants.
  • the judging module 703 in FIG. 7 calculates the product of the marginal contribution value of the participant and the weight of the participant group to which the participant belongs, and compares the product with the preset second cut-off threshold; when the participant When the product corresponding to each participant in the combination is less than or equal to the second cut-off threshold, it is judged to use the first estimation method to estimate the utility value of the participant combination; otherwise, use the second estimation method to estimate the utility value of the participant combination Make an estimate.
  • the judging module 703 in FIG. 7 obtains the utility value corresponding to the sub-combination in the participant combination from the lookup table, calculates the average value, maximum value or minimum value of the utility value corresponding to the sub-combination, and calculates The obtained average value, maximum value or minimum value is used as an estimated value of the utility value of the participant combination, and the lookup table is updated according to the estimated value.
  • the judging module 703 in FIG. 7 aggregates the model parameters corresponding to the participant combination, performs model deduction on the model corresponding to the participant combination, and aggregates the weight of each participant in the participant combination to obtain The weight of the participant combination, the model deduction of the participant combination on the standard verification set is calculated to obtain the real utility value of the participant combination, and the lookup table is updated using the real utility value.
  • the calculation module 704 in FIG. 7 obtains the utility value of the combination of participants in the final lookup table, and uses the preset Shapley value formula to calculate the contribution value corresponding to each participant, wherein the contribution value is used Yu represents the contribution value of the participant to the joint model trained in the aggregation cycle in the joint learning.
  • Fig. 8 is a schematic flowchart of another method for determining the contribution degree of a participant in joint learning provided by an embodiment of the present disclosure.
  • the method for determining the contribution degree of a participant in the joint learning of FIG. 8 may be executed by a server of the joint learning.
  • the method for determining the contribution of the participants in the joint learning may specifically include:
  • multiple participant groups are generated through a framework based on joint learning, and a set of participant groups composed of multiple participant groups is determined to calculate the weights of the participant groups, where each participant The square group contains at least two participants; determine the aggregation period in the joint learning, obtain the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of each participant in the aggregation period according to the utility change value ;
  • the judgment result is yes, use the participant groups in the participant group set to randomly generate a full permutation combination, and generate multiple subcombinations according to the order of the participants in the participant group in the full permutation combination, and calculate the participants to join the subcombination
  • it is judged whether to use the interpolation function to calculate the utility value of the new participant group formed after the participant joins the sub-combination; when the judgment result
  • FIG. 9 the program for calculating the contribution value of the participants may specifically include the following:
  • generating a plurality of subcombinations according to the order of the participants in the participant group in the full permutation combination, and calculating the estimated value of the contribution margin when the participant joins the subcombination includes: dividing the full permutation combination into Multiple sub-combinations, and determine the next participant corresponding to the last participant of the sub-combination in the full permutation combination, and calculate the estimated value of the marginal contribution value of the next participant when joining the sub-combination.
  • the first j participants are sequentially taken from the full permutation combination P to form a subcombination S, and an estimated value of the marginal contribution generated when the j+1th participant joins the subcombination S is calculated.
  • the full permutation combination is (5, 4 .
  • an interpolation function to calculate the utility value of the new participant group formed after the participant joins the sub-combination, including: calculating the marginal contribution value The product of the estimated value and the weight of the participant group, and compare the product with the preset second cut-off threshold; when the products are all less than or equal to the second cut-off threshold, it is judged to use the interpolation function to calculate the utility of the new participant group value; otherwise, use the preset model derivation method to calculate the utility value of the new participant group.
  • the marginal contribution value generated when the j+1th participant joins the subgroup S satisfies the above formula
  • the utility value corresponding to the new participant group after the j+1th participant joins the subgroup S There is no need to perform deduction, and the interpolation function is directly used to calculate the utility value of the new participant group. If the above formula is not satisfied, it is necessary to perform model deduction for the new participant group and calculate the utility value.
  • the marginal contribution value generated when the j+1th participant joins the subgroup S is estimated by amplifying the utility value , and multiply the estimated value with the weight of the participant group, and compare the product with the second cut-off threshold, so as to determine whether to use the interpolation function to calculate the utility value of the new participant group or to use model deduction to calculate the utility value of the new participant group
  • the utility value of the group due to the high complexity of model deduction and the large amount of calculation, by adding the above-mentioned judgment means, for the new participant group that does not need to do model deduction, the sub-combination calculated in the previous iteration process can be directly used.
  • the utility value is obtained by weighted summation, which improves the calculation speed of the contribution value.
  • using an interpolation function to calculate the utility value of the new participant group includes: based on the utility value of the sub-combination calculated in the historical iteration process, and the corresponding utility value when the participant group is a full set of participant groups, using a preset The set interpolation function calculates the utility value of the new participant group, and updates the lookup table according to the calculation result.
  • the principle of calculating the utility value of the interpolation function is to estimate the utility value of the new participant group with the utility value of the subcombination that has been calculated.
  • the implementation method of the interpolation function interpolate( ) is:
  • v S , v N the sub-combination S and the full combination N are used as the input of the function, and are calculated and output.
  • the utility value of the new participant group is calculated using a preset model derivation method, and the lookup table is updated according to the calculated utility value of the new participant group, including: model parameters of the new participant group Carry out aggregation, and carry out model deduction on the model of the new participant group, aggregate the weight of each participant in the new participant group, and obtain the weight of the new participant group, and the model of the new participant group in the standard verification set Carry out model deduction on the above, calculate the real utility value of the new participant group, and use the real utility value to update the lookup table.
  • based on the updated lookup table calculate the marginal contribution value of the participant, and judge whether the marginal contribution value of the participant is converged, and when the judgment result is yes, use the converged marginal contribution value as the participant's Contribution value, including: according to the utility value of the participant in the updated lookup table after joining the sub-combination, using the preset Shapley value calculation formula to calculate the marginal contribution value of the participant; and according to whether the marginal contribution value of the participant Convergence, when the judgment result is convergence, the marginal contribution value after convergence is used as the contribution value of the participant; where the contribution value is used to indicate the contribution of the participant to the joint learning model trained in the aggregation cycle in the joint learning.
  • Shapley Value is a method for fairly distributing benefits based on the average marginal contribution of individual i joining combination S, and its computational complexity is O( 2n ), where n is the total number of individuals. Its calculation formula is:
  • the Shapley value (that is, the Shapley value) considers all possible orders in which individual i joins the sub-combination, where N represents the full combination, S represents the sub-combination in a certain arrangement, V( ⁇ ) represents the utility function, and the
  • , where T is the total communication round, which can be set to ⁇ ⁇ U *0.01.
  • multiple participant groups are generated, and a set of participant groups composed of multiple participant groups is determined, and weights of the participant groups are calculated, including: determining all participants in the joint learning The number of participants is enumerated in order from the least to the largest to obtain multiple participant groups, and the set of multiple participant groups is used as the set of participant groups, and based on the number of participants in each participant group The quantity calculates the weight corresponding to each participant group; wherein, the weight is used to represent the probability that the participant group appears in the participant group set.
  • participant group set in combination with a specific embodiment, which may specifically include the following:
  • the training has been aggregated for T cycles, recording each aggregation cycle t during the training process, and the local data uploaded by each participant i Model M i (t) , and the joint model M (t) after central aggregation, initialize the model M (0) , have an evaluation function or utility function V( ) for model performance (such as accuracy, loss, etc.), and the joint Learning model aggregation method Agg( ⁇ ), thresholds ⁇ , ⁇ ; where ⁇ represents the first truncated threshold, and ⁇ represents the second truncated threshold.
  • each participant group corresponds to a subcombination S mentioned above.
  • the weight corresponding to the participant group is calculated according to the number of elements in the participant group, and the weight corresponding to each sub-combination can be considered as the probability of the sub-combination appearing in the overall participant group.
  • determining the aggregation period in the joint learning, obtaining the utility change value corresponding to the joint learning model before and after the aggregation period and establishing a lookup table includes: for each aggregation period in the joint learning, determining the joint learning corresponding to the aggregation period The initial utility value and final utility value of the model, calculate the difference between the final utility value and the initial utility value, use the difference as the utility change value, and establish a lookup table containing all participant groups corresponding to the aggregation period; for the lookup table Perform an initialization operation so that the initial utility values of other participant groups in the lookup table except the empty set participant group and the full set participant group are 0; wherein, the lookup table is used to store the corresponding utility values of all participant groups.
  • v 0 can also be understood as the current aggregation period before the start of the current aggregation period.
  • the difference in different expressions does not constitute a limit to the essential meaning of v 0 , and the above two expressions are equivalent.
  • the utility values of other participant groups in the participant group set Ps are set to be 0.
  • judging whether to calculate the contribution value of each participant in the aggregation period according to the utility change value includes: comparing the utility change value of the corresponding joint learning model before and after the aggregation period with the preset first cut-off threshold, when When the utility change value is less than the first truncation threshold, and the utility change values corresponding to multiple consecutive rounds of aggregation periods are all less than the first truncation threshold, it is judged that the contribution value of each participant in the aggregation period is 0; otherwise, the contribution value of each participant in the aggregation period The contribution value is recalculated.
  • the purpose of this embodiment of the present disclosure is to evaluate the changes in the utility value of the joint model in the current round before formally calculating the contribution value of each participant. Whether the utility value of the joint model has been improved, that is, whether the performance of the joint model itself has been improved. If the improvement in model performance is small, it can be considered that the contribution value of each participant in this round is 0; The performance improvement of the learning model is relatively large, so continue to perform the following calculations, that is, specifically calculate the contribution value of each participant in this round. This disclosure can judge in advance whether it is necessary to further calculate the contribution value of the participant, or directly count the contribution value of the participant in the current round as 0, thereby avoiding an invalid calculation process and improving calculation efficiency.
  • Fig. 10 is a schematic structural diagram of another device for determining the contribution degree of a participant in joint learning provided by an embodiment of the present disclosure. As shown in Figure 10, the device for determining the contribution of the participants in the joint learning includes:
  • the generation module 1001 is configured to generate a plurality of participant groups based on a federated learning architecture, and determine a participant group set composed of a plurality of participant groups, and calculate weights of the participant groups, wherein each participant group contains at least two parties;
  • the establishment module 1002 is configured to determine the aggregation period in the joint learning, obtain the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of each participant in the aggregation period according to the utility change value;
  • the judging module 1003 is configured to, when the judging result is yes, use the participant groups in the participant group set to randomly generate a full permutation combination, and generate multiple subcombinations according to the order of the participants in the participant group in the full permutation combination, Calculate the estimated value of the marginal contribution value when the participant joins the sub-combination, and judge whether to use the interpolation function to determine the utility value of the new participant group formed after the participant joins the sub-combination according to the estimated value of the marginal contribution value and the weight of the participant group Calculation;
  • the update module 1004 is configured to use an interpolation function to calculate the utility value of the new participant group when the judgment result is yes, and calculate the utility value of the new participant group by using a preset model derivation method when the judgment result is no, and The lookup table is updated according to the calculated utility value of the new party group;
  • the calculation module 1005 is configured to calculate the marginal contribution value of the participant based on the updated lookup table, and judge whether the marginal contribution value of the participant is converged, and when the judgment result is yes, use the converged marginal contribution value as the participant's When the judgment result is no, a new full permutation combination is generated until the contribution values of all converged participants are calculated, and the contribution of the participants in the joint learning is determined according to the contribution values.
  • the judging module 1003 in FIG. 10 divides the full permutation combination into multiple subcombinations according to the order of the participants, and determines the next participant corresponding to the last participant in the subcombination in the full permutation combination, and calculates the following An estimate of a party's contribution margin when it joins a subgroup.
  • the judging module 1003 in FIG. 10 calculates the product of the estimated value of the marginal contribution value and the weight of the participant group, and compares the product with the preset second truncation threshold; when the products are all less than or equal to the second When the threshold is truncated, it is judged to use the interpolation function to calculate the utility value of the new participant group; otherwise, the utility value of the new participant group is calculated using the preset model derivation method.
  • the update module 1004 in FIG. 10 uses a preset interpolation function to update the new participant's
  • the utility value of the group is calculated, and the lookup table is updated according to the calculation result.
  • the update module 1004 in FIG. 10 aggregates the model parameters of the new participant group, performs model deduction on the model of the new participant group, and aggregates the weight of each participant in the new participant group , get the weight of the new participant group, model the model of the new participant group on the standard verification set, calculate the real utility value of the new participant group, and use the real utility value to update the lookup table.
  • the generating module 1001 in FIG. 10 determines all the participants in the joint learning, enumerates the participants in order from the least to the largest to obtain multiple participant groups, and forms the multiple participant groups
  • the set of is used as a set of participant groups, and the weight corresponding to each participant group is calculated based on the number of participants in each participant group; wherein, the weight is used to represent the probability of a participant group appearing in the participant group set.
  • the first judgment module 1002 in FIG. 10 determines the initial utility value and the final utility value of the joint learning model corresponding to the aggregation period for each aggregation period in the joint learning, and calculates the difference between the final utility value and the initial utility value. The difference between them is used as the utility change value, and a lookup table containing all participant groups corresponding to the aggregation period is established; the lookup table is initialized so that the empty set participant group and the full set participant group are excluded from the lookup table The initial utility value of other participant groups other than the group is 0; wherein, the lookup table is used to store the utility values corresponding to all participant groups.
  • the building module 1002 in FIG. 10 compares the utility change value of the corresponding joint learning model before and after the aggregation period with the preset first cut-off threshold. When the utility change value is less than the first cut-off threshold, and the When the utility change values corresponding to the aggregation period are all less than the first cut-off threshold, it is judged that the contribution value of each participant in the aggregation period is 0; otherwise, the contribution value of each participant in the aggregation period is recalculated.
  • the calculation module 1005 of FIG. 10 calculates the marginal contribution value of the participant according to the utility value of the participant in the updated lookup table after adding the sub-combination, using the preset Shapley value calculation formula; and according to Whether the marginal contribution value of the participant is converged.
  • the converged marginal contribution value is used as the contribution value of the participant; where the contribution value is used to represent the joint learning of the participant for the aggregation cycle training in the joint learning Contribution of the model.
  • Fig. 11 is a schematic flowchart of a joint learning training method provided by an embodiment of the present disclosure.
  • the federated learning training method in FIG. 11 may be executed by a federated learning server.
  • the joint learning training method may specifically include:
  • each participant corresponds to a node in the joint learning framework, and each node corresponds to a participant.
  • Participants can be sensors, rotating machinery equipment, Internet of Things devices, IOT devices, PCs, tablet computers, smart phones, Smart wearable devices, etc., can also be objects such as companies or factories.
  • Each participant has a client terminal of a joint learning participant, but the participant is not limited to the above-mentioned devices or clients.
  • the federated learning framework also has a node that provides services for the client (that is, the server).
  • the server can be a server for performing aggregation operations.
  • the server can coordinate multiple clients to perform joint learning to obtain a joint learning model.
  • the server may be an independent physical server, or a server cluster or cloud computing server composed of multiple physical servers.
  • an aggregation cycle refers to a round of training for the federated learning model.
  • Each participant client uses local data to train the local model.
  • the trained local model is obtained parameter and send it to the server.
  • All participants will upload their own local model parameters in each aggregation round, and the server will perform a weighted average to obtain a joint model, so each participant will make its own contribution in each round.
  • the round here means The server performs a complete training of the joint learning model.
  • the process of calculating the contribution value and calculating the contribution index according to the contribution value in the joint learning of the present disclosure, and determining the training round of the participant in the next round of aggregation cycle according to the contribution index can be performed in The operation to be performed after the aggregation period corresponding to each round in the joint learning process is completed;
  • the degree guides the training rounds of the participants in the next aggregation cycle, so that the participants with higher contributions can participate more in the training and aggregation of the joint model, thereby speeding up the convergence speed and model performance of the joint model.
  • the local model obtained by the initial model training performed by the participants of the federated learning according to the local data is obtained, and the aggregation operation is performed on the local models of the participants to obtain Joint model; use the preset joint learning contribution value algorithm to calculate the contribution value of each participant to the joint model in the current round of aggregation cycle, and obtain the corresponding joint learning contribution value of each participant; obtain each participant's The initial index performs the fusion operation on the joint learning contribution value and the initial index to obtain the contribution index of each participant, where the initial index is used to represent the initial contribution of the participant to the joint learning; according to the contribution index, the next The training rounds in one round of aggregation cycle, so that the participants will train the local model based on the training rounds in the next round of aggregation cycle until the training of the joint model reaches the preset goal.
  • the disclosure can automatically adjust the training rounds of the participants in the next aggregation
  • the local models obtained by the initial model training performed by the participants of the joint learning according to the local data are obtained, including: at the beginning of the current aggregation period of the joint learning, each participant The initial model is downloaded from the preset aggregation server, and the participants use the local data to perform an initial round of local model training on the initial model; where the initial round is the number of rounds obtained by initializing the parameters of the current round of aggregation cycle.
  • the current round of aggregation period here can also be understood as the aggregation period of completed training, that is, the last round of aggregation period.
  • each participant in the federated learning downloaded the initial model from the aggregation server, and performed several rounds of local model training operations on the initial model using local data, that is, each participant downloaded the initial model from the aggregation server,
  • the initial model is trained for several rounds with local data to obtain a local model corresponding to each participant.
  • the initial round may be the initialization model training round preset by the server for each participant.
  • the local training rounds of each participant may be recorded as local_epoch_1, local_epoch_2, local_epoch_i, ... local_epoch_n, where n is an integer greater than or equal to 0.
  • the initial rounds of each participant can be set to the same value.
  • each participant can upload their local model weight M_i (or gradient update) to the aggregation server after completing the local model training of the last round of aggregation cycle, so that the aggregation server can use the federated learning model aggregation algorithm to
  • the local model of each party is aggregated to obtain the joint model M_global, and the parameters of the joint model are sent to each participant.
  • FIG. 12 is a schematic flowchart of the calculation of the joint learning contribution value of the participants provided by an embodiment of the present disclosure. As shown in Figure 12, the calculation process of the joint learning contribution value of the participant may specifically include:
  • all participants are constructed in a manner from the fewest to the largest number of participants to form all participant combinations, and each participant combination corresponds to a participant group.
  • Ps [(1,),(2,),(3,)...,( 1,2),(1,3),(2,3),...P,...N]
  • a subcombination S with 0, 1, 2,...n-1 participants can be obtained, that is, several Participant group.
  • each participant combination corresponds to a sub-combination S.
  • the weight of the sub-combination S it is based on the number of participants in each sub-combination.
  • one participant corresponds to a set elements, that is, calculate the weight corresponding to the participant combination according to the number of elements in the participant combination, and the weight corresponding to each sub-combination can be considered as the probability of the sub-combination appearing in the overall participant combination.
  • v 0 can also be understood as the initial utility value of the current aggregation period before the start of the current aggregation period.
  • a participant combination P is sequentially selected from all the participant combinations Ps in the current round.
  • the calculation method of the utility value of the participant combination is judged, so as to choose to use the interpolation function or the way of model deduction to calculate the utility value of the participant combination, including: according to the participant's The product between the marginal contribution value and the weight of the participant combination, compare the product with the preset cut-off threshold, and when the product corresponding to each participant in the participant combination is less than or equal to the cut-off threshold, choose to use the interpolation function Otherwise, choose to use the model deduction method to calculate the utility value of the participant combination.
  • it is judged to use the utility value of the sub-combination to estimate the utility value of the participant combination P, otherwise, it is judged to use the preset model derivation method to calculate the participant combination P utility value.
  • the marginal contribution value of each participant in the above participant combination P satisfies the above formula
  • other judgment criteria can also be set, such as The marginal contribution value of any participant in the participant combination P does not satisfy the above formula, or half of the participants in the participant combination P do not satisfy the above formula, or there is any proportion of participants in the participant combination P that does not satisfy the above formula formulas and more.
  • the preset interpolation value estimates the utility value of the participant combination, obtains the estimated value corresponding to the utility value of the participant combination, and updates the lookup table according to the estimated value.
  • the lookup table is updated according to the calculated utility value of the participant combination, the model parameters corresponding to the participant combination are aggregated, and the participant combination Carry out model deduction for the corresponding model, aggregate the weight of each participant in the participant combination to obtain the weight of the participant combination, perform model deduction on the standard verification set for the participant combination, and calculate the real utility value of the participant combination , to update the lookup table with the real utility value.
  • the method before obtaining the initial index of each participant and performing the fusion operation on the joint learning contribution value and the initial index, the method further includes: for each participant in the joint learning, according to each participant's report The quality of local data, the amount of local data and/or the cost of joint learning, calculate the initial index corresponding to each participant, and normalize the initial index. The contribution of the joint model training of .
  • the initial index corresponding to the participant when determining the initial index corresponding to the participant, it can be calculated according to the data quality uploaded by each participant or the joint learning cost and other parameters. For example: for a joint learning model training task, suppose there are P1, P2, Pi, ...Pn has a total of N participants, and each participant has a preset or calculated index Qi (the index value after normalization processing), which satisfies the following conditions: if Qi is larger, the participant i pairs of joint The greater the "value" or "function" of the model.
  • the initial index can be determined according to the data quality or data volume reported by the participants, or by the negative or reciprocal of the joint learning cost reported by the participants, if the data quality, data quantity, distribution and other attributes reported by the participants Consistent, then the lower the participant's quotation for the joint learning cost, the more beneficial it is for the training task. Therefore, the initial indicators of each participant can be used as the predicted value of the contribution to the joint model training in the current aggregation period.
  • the fusion operation is performed on the joint learning contribution value and the initial index to obtain the contribution index of each participant, including: obtaining the initial index list generated by the initial index corresponding to all the participants of the joint learning, and The contribution value list generated by the joint learning contribution value corresponding to all the participants; based on the initial index list and the contribution value list, the fusion operation is performed on the joint learning contribution value and the initial index of each participant to obtain the fused contribution index , generate a list of contribution indicators according to the contribution indicators corresponding to all participants.
  • the initial index list [Q1, Q2, Qi..., Qn] is generated according to the initial index corresponding to all participants, and the contribution value list [ ⁇ 1, ⁇ 2 , ⁇ i, ... ⁇ n].
  • the contribution index G corresponding to each participant is calculated by weighted average or averaging.
  • the contribution index G generates a new contribution index list [G1, G2, Gi..., Gn], which is a contribution list obtained by fusing real contribution values. Therefore, the contribution index G can represent the degree of contribution of the participants to the joint model training in the last aggregation cycle. The larger the value of the contribution index G, the higher the contribution of the participants.
  • calculating the training rounds of the participants in the next aggregation period according to the contribution index includes: generating a mapping function according to the pre-established mapping relationship between the contribution index and the training round, and calculating The contribution index corresponding to the participant is used as the input of the mapping function, and the mapping function is used to calculate the training round corresponding to the participant, and the training round is used as the aggregation round when the participant trains the local model in the next round of aggregation cycle.
  • the contribution index G corresponding to the participant calculated according to the foregoing embodiment can be calculated and the contribution index G can be combined with the local training round
  • the contribution index Gi of the participant i in the last aggregation cycle can be used as the input of the mapping function, and the local_epoch_i of the participant i can be automatically calculated by using the mapping function ' (that is, the training round of the participant in the next round of aggregation cycle).
  • each participant downloads the joint model M from the aggregation server, and applies a new training round local_epoch_i', and uses local data to train the local model of the local_epoch_i' round, and repeats the operations in the above embodiments until the joint model reaches convergence or reaches The set maximum aggregation rounds, and finally a joint model that has been trained for T aggregation cycles.
  • the embodiments of the present disclosure calculate the aggregation round of the next round of aggregation cycle according to the contributions made by the participants in this round to the joint model, so that Instruct all participants to apply new aggregation rounds for local model training, so that participants with high contributions can participate more in the training and aggregation of the joint model, thereby speeding up the convergence speed and model performance of the joint model.
  • Fig. 13 is a schematic structural diagram of a joint learning and training device provided by an embodiment of the present disclosure. As shown in Figure 13, the joint learning training device includes:
  • the aggregation module 1301 is configured to obtain the local model obtained by the initial model training performed by the participants of the joint learning according to the local data in the current round of aggregation period of the joint learning, and perform an aggregation operation on the local models of the participants to obtain the joint model;
  • the calculation module 1302 is configured to use the preset joint learning contribution value algorithm to calculate the contribution value of each participant to the joint model in the current round of aggregation period, and obtain the corresponding joint learning contribution value of each participant;
  • the fusion module 1303 is configured to obtain the initial index of each participant, and perform a fusion operation on the joint learning contribution value and the initial index to obtain the contribution index of each participant, wherein the initial index is used to represent the participant's contribution to the joint learning initial contribution;
  • the training module 1304 is configured to calculate the training rounds of the participants in the next aggregation period according to the contribution index, so that the participants can train the local model based on the training rounds in the next aggregation period until the joint model The training achieves the preset target.
  • each participant downloads the initial model from the preset aggregation server, and the participant uses local data to perform the initial round of initial model aggregation.
  • Local model training where, the initial round is the number of rounds obtained by initializing the parameters of the current round of aggregation cycle.
  • the calculation module 1302 in FIG. 13 constructs all participant combinations according to the participants in the joint learning, and calculates the weight corresponding to each participant combination; obtains the utility change corresponding to the joint model before and after the current round of aggregation period Value, according to the utility change value, judge whether to calculate the joint learning contribution value of each participant in the current aggregation cycle; when the judgment result is yes, select any combination of participants, and calculate the The corresponding marginal contribution value; according to the marginal contribution value and weight, judge the calculation method of the utility value of the participant combination, so as to choose to use interpolation function or model deduction to calculate the utility value of the participant combination; according to the utility value of the participant combination
  • the predetermined lookup table is updated, and based on the updated lookup table, the joint learning contribution value of each participant to the joint model is calculated.
  • the calculation module 1302 in FIG. 13 compares the product with a preset cut-off threshold according to the product of the marginal contribution value of the participant and the weight of the participant combination. When each participant in the participant combination When the corresponding products are all less than or equal to the cut-off threshold, choose to use the interpolation function to calculate the utility value of the participant combination, otherwise, choose to use the model deduction method to calculate the utility value of the participant combination.
  • the fusion module 1303 in FIG. 13 acquires the initial index of each participant and performs the fusion operation on the joint learning contribution value and the initial index, for each participant in the joint learning, according to each participant Reported local data quality, local data volume and/or joint learning cost, calculate the initial index corresponding to each participant, and normalize the initial index. Contribution to periodic joint model training.
  • the fusion module 1303 in FIG. 13 obtains the initial indicator list generated by the initial indicators corresponding to all participants in the joint learning, and the contribution value list generated by the joint learning contribution values corresponding to all the participants; based on The list of initial indicators and the list of contribution values, the fusion operation is performed on the joint learning contribution value of each participant and the initial indicators to obtain the fused contribution indicators, and the contribution indicator list is generated according to the contribution indicators corresponding to all participants.
  • the training module 1304 in FIG. 13 generates a mapping function according to the pre-established mapping relationship between the contribution index and the training round, and uses the calculated contribution index corresponding to the participant as the input of the mapping function, Use the mapping function to calculate the training rounds corresponding to the participants, and use the training rounds as the aggregation rounds when the participants train the local model in the next round of aggregation cycle.
  • FIG. 14 is a schematic structural diagram of an electronic device 14 provided by an embodiment of the present disclosure.
  • the electronic device 14 of this embodiment includes: a processor 1401 , a memory 1402 , and a computer program 1403 stored in the memory 1402 and capable of running on the processor 1401 .
  • the processor 1401 executes the computer program 1403
  • the steps in the foregoing method embodiments are implemented.
  • the processor 1401 executes the computer program 1403 the functions of the modules/units in the foregoing device embodiments are implemented.
  • the computer program 1403 can be divided into one or more modules/units, and one or more modules/units are stored in the memory 1402 and executed by the processor 1401 to complete the present disclosure.
  • One or more modules/units may be a series of computer program instruction segments capable of accomplishing specific functions, and the instruction segments are used to describe the execution process of the computer program 1403 in the electronic device 14 .
  • the electronic equipment 14 may be electronic equipment such as desktop computers, notebooks, palmtop computers, and cloud servers.
  • the electronic device 14 may include but not limited to a processor 1401 and a memory 1402 .
  • FIG. 5 is only an example of the electronic device 14, and does not constitute a limitation to the electronic device 14. It may include more or less components than shown in the figure, or combine certain components, or different components. , for example, an electronic device may also include an input and output device, a network access device, a bus, and the like.
  • the processor 1401 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), on-site Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • CPU Central Processing Unit
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the storage 1402 may be an internal storage unit of the electronic device 14 , for example, a hard disk or a memory of the electronic device 14 .
  • the memory 1402 can also be an external storage device of the electronic device 14, for example, a plug-in hard disk equipped on the electronic device 14, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card ( Flash Card), etc. Further, the memory 1402 may also include both an internal storage unit of the electronic device 14 and an external storage device.
  • the memory 1402 is used to store computer programs and other programs and data required by the electronic device.
  • the memory 1402 can also be used to temporarily store data that has been output or will be output.
  • the disclosed apparatus/computer equipment and methods may be implemented in other ways.
  • the device/computer device embodiments described above are only illustrative, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, and multiple units or components can be Incorporation may either be integrated into another system, or some features may be omitted, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • a unit described as a separate component may or may not be physically separated, and a component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • an integrated module/unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the present disclosure realizes all or part of the processes in the methods of the above embodiments, and can also be completed by instructing related hardware through computer programs.
  • the computer programs can be stored in computer-readable storage media, and the computer programs can be processed. When executed by the controller, the steps in the above-mentioned method embodiments can be realized.
  • a computer program may include computer program code, which may be in source code form, object code form, executable file, or some intermediate form or the like.
  • the computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (Read-Only Memory, ROM), random access Memory (Random Access Memory, RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in computer readable media may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, computer readable media may not Including electrical carrier signals and telecommunication signals.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A method and apparatus for determining a contribution degree of a participant in federated learning, and a federated learning training method and apparatus. The method for determining the contribution degree of the participant in federated learning comprises: constructing all participant combinations, and calculating the weight of each participant combination; determining a utility change value of a federated learning model before and after an aggregation period, establishing a lookup table, and according to the utility change value, determining whether to calculate a contribution value of each participant; selecting one participant combination from all participant combinations, estimating a marginal contribution value of the participant, and according to an estimation result and the weight, determining whether to calculate the utility value of the participant combination by using an interpolation function; and updating the lookup table according to the utility value of the participant combination, sequentially selecting the participant combinations until the utility values of all participant combinations are calculated, using the utility values of the participant combinations to update the lookup table, and on the basis of a finally updated lookup table, calculating the contribution value of the participant.

Description

联合学习中确定参与方贡献度的方法、联合学习训练方法及装置Method for determining participant contribution in joint learning, joint learning training method and device 技术领域technical field
本公开涉及联合学习技术领域,尤其涉及一种联合学习中确定参与方贡献度的方法、联合学习训练方法及装置。The present disclosure relates to the technical field of joint learning, and in particular to a method for determining the contribution degree of a participant in joint learning, a joint learning training method and a device.
背景技术Background technique
随着人工智能以及分布式机器学习技术的发展,通过联合不同参与方进行机器学习的联合学习方法成为一种训练人工智能模型的主流趋势。联合学习作为一种新型的分布式机器学习框架,满足了多个客户端在数据安全的要求下进行模型训练的需求。With the development of artificial intelligence and distributed machine learning technology, the joint learning method of machine learning by combining different participants has become a mainstream trend in training artificial intelligence models. As a new type of distributed machine learning framework, federated learning meets the needs of multiple clients for model training under the requirements of data security.
现有技术中,在对联合学习中参与方的贡献度进行衡量时,通常利用联合学习系统基于各参与方的本地数据量,来确定各参与方在联合学习中对联合学习模型的贡献度。但是,由于各参与方的本地数据可能存在数据质量参差不齐,本地数据的形式不同等问题,导致现有的联合学习贡献度的计算方法,存在计算精度低,计算结果不准确,计算数据量比较大,计算效率低等问题。In the prior art, when measuring the contribution of the participants in the federated learning, the federated learning system is usually used to determine the contribution of each participant to the federated learning model in the federated learning based on the amount of local data of each participant. However, because the local data of each participant may have problems such as uneven data quality and different forms of local data, the existing calculation method of joint learning contribution has low calculation accuracy, inaccurate calculation results, and large amount of calculation data. Relatively large, low computational efficiency and other issues.
鉴于上述现有技术中的问题,需要提供一种能够提升贡献值的计算精度,降低计算数据量,使贡献值的计算结果更准确,计算效率更高的确定联合学习参与方贡献度的方法。In view of the above-mentioned problems in the prior art, it is necessary to provide a method for determining the contribution of joint learning participants that can improve the calculation accuracy of the contribution value, reduce the amount of calculation data, make the calculation result of the contribution value more accurate, and have higher calculation efficiency.
发明内容Contents of the invention
有鉴于此,本公开实施例提供了一种联合学习中确定参与方贡献度的方法、联合学习训练方法及装置,以解决现有技术存在的联合学习贡献度的计算方法,存在计算精度低,计算结果不准确,计算数据量比较大,计算效率低的问题。In view of this, the embodiments of the present disclosure provide a method for determining the contribution degree of a participant in joint learning, a joint learning training method, and a device to solve the problem of low calculation accuracy in the calculation method of joint learning contribution in the prior art. The calculation results are inaccurate, the amount of calculation data is relatively large, and the calculation efficiency is low.
本公开实施例的第一方面,提供了一种联合学习中确定参与方贡献度的方法,包括:The first aspect of the embodiments of the present disclosure provides a method for determining the contribution of a participant in joint learning, including:
确定联合学习的参与方,基于参与方构造全部参与方组合,并计算每个参与方组合对应的权重;Determine the participants of the joint learning, construct all participant combinations based on the participants, and calculate the weight corresponding to each participant combination;
确定聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据效用变化值判断是否对聚合周期内参与方的贡献值进行计算;Determine the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of the participants in the aggregation period according to the utility change value;
当判断结果为是时,按照预定顺序从全部参与方组合中选取一个参与方组合,并对选取的参与方组合中的每一个参与方的边际贡献值进行估计,根据估计结果以及参与方组合的权重,判断是否采用插值函数对参与方组合的效用值进行计算;When the judgment result is yes, select a participant combination from all the participant combinations according to the predetermined order, and estimate the marginal contribution value of each participant in the selected participant combination, according to the estimation result and the participant combination Weight, to determine whether to use the interpolation function to calculate the utility value of the participant combination;
当判断结果为是时,利用插值函数计算参与方组合的效用值,当判断结果为否时,利用预设的模型推演方式计算参与方组合的效用值,并依据计算出的参与方组合的效用值对查找表进行更新;When the judgment result is yes, use the interpolation function to calculate the utility value of the participant combination; when the judgment result is no, use the preset model deduction method to calculate the utility value of the participant combination, and use the calculated The value updates the lookup table;
依次选取每一个参与方组合,直至计算得到所有参与方组合的效用值,利用所有参与方组合的效用值对查找表进行更新,得到最终更新后的查找表,以便基于最终更新后的查找表,计算每个参与方的贡献值,根据贡献值确定参与方在联合学习中的贡献度。Select each participant combination in turn until the utility value of all participant combinations is calculated, and use the utility values of all participant combinations to update the lookup table to obtain the final updated lookup table, so that based on the final updated lookup table, Calculate the contribution value of each participant, and determine the contribution of the participant in the joint learning according to the contribution value.
本公开实施例的第二方面,提供了一种联合学习中确定参与方贡献度的装置,包括:The second aspect of the embodiments of the present disclosure provides an apparatus for determining the contribution of a participant in joint learning, including:
构造模块,被配置为确定联合学习的参与方,基于参与方构造全部参与方组合,并计算每个参与方组合对应的权重;The construction module is configured to determine the participants of the joint learning, construct all participant combinations based on the participants, and calculate the weight corresponding to each participant combination;
第一判断模块,被配置为确定聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据效用变化值判断是否对聚合周期内参与方的贡献值进行计算;The first judging module is configured to determine the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of the participant in the aggregation period according to the utility change value;
第二判断模块,被配置为当判断结果为是时,按照预定顺序从全部参与方组合中选取一个参与方组合,并对选取的参与方组合中的每一个参与方的边际贡献值进行估计,根据估计结果以及参与方组合的权重,判断是否采用插值函数对参与方组合的效用值进行计算;The second judgment module is configured to select a participant combination from all participant combinations in a predetermined order when the judgment result is yes, and estimate the marginal contribution value of each participant in the selected participant combination, According to the estimation result and the weight of the participant combination, judge whether to use the interpolation function to calculate the utility value of the participant combination;
更新模块,被配置为当判断结果为是时,利用插值函数计算参与方组合的效用值,当判断结果为否时,利用预设的模型推演方式计算参与方组合的效用值,并依据计算出的参与方组合的效用值对查找表进行更新;The update module is configured to use an interpolation function to calculate the utility value of the participant combination when the judgment result is yes, and to calculate the utility value of the participant combination by using a preset model derivation method when the judgment result is no, and to calculate the utility value of the participant combination according to the calculated Update the lookup table with the utility value of the participant combination;
计算模块,被配置为依次选取每一个参与方组合,直至计算得到所有参与方组合的效用值,利用所有参与方组合的效用值对查找表进行更新,得到最终更新后的查找表,以便基于最终更新后的查找表,计算每个参与方的贡献值,根据贡献值确定参与方在联合学习中的贡献度。The calculation module is configured to select each combination of participants in turn until the utility values of all the combinations of participants are calculated, and use the utility values of all the combinations of participants to update the lookup table to obtain a final updated lookup table, so that based on the final The updated lookup table calculates the contribution value of each participant, and determines the contribution of the participant in the joint learning according to the contribution value.
本公开实施例的第三方面,提供了一种联合学习中确定参与方贡献度的方法,包括:The third aspect of the embodiments of the present disclosure provides a method for determining the contribution degree of a participant in joint learning, including:
基于联合学习中的参与方确定全部参与方组合,并计算所述全部参与方组合中每一个参与方组合的权重;determining all participant combinations based on the participants in the joint learning, and calculating the weight of each participant combination in the all participant combinations;
确定当前聚合周期开始前的联合模型的第一效用值,以及当前聚合周期结束后的联合模型的第二效用值,基于所述第一效用值与所述第二效用值计算效用变化值,并建立查找表;其中,所述效用变化值用于判断是否计算所述当前聚合周期内各个参与方的贡献值;determining a first utility value of the joint model before the start of the current aggregation period, and a second utility value of the joint model after the end of the current aggregation period, calculating a utility change value based on the first utility value and the second utility value, and Establish a lookup table; wherein, the utility change value is used to determine whether to calculate the contribution value of each participant in the current aggregation period;
当判断计算所述贡献值时,从所述全部参与方组合中选取一个参与方组合,并计算所述参与方组合中每一个参与方对应的边际贡献值,根据所述边际贡献值以及所述权重,判断利用第一估计方式或者第二估计方式对所述参与方组合的效用值进行估计;When judging and calculating the contribution value, select a participant combination from all the participant combinations, and calculate the marginal contribution value corresponding to each participant in the participant combination, according to the marginal contribution value and the Weight, judging whether to use the first estimation method or the second estimation method to estimate the utility value of the participant combination;
确定所述第一估计方式或者第二估计方式对所述参与方组合的效用值的估计结果,利用所述估计结果对所述查找表进行更新,并依次迭代估计得到每一个所述参与方组合的效用值,获取依据所述效用值进行更新后得到的最终查找表,以便利用所述最终查找表对所述参与方的贡献值进行计算。determining the estimation result of the utility value of the participant combination by the first estimation method or the second estimation method, using the estimation result to update the lookup table, and iteratively estimating in turn to obtain each participant combination The utility value of , and obtain the final lookup table obtained after updating according to the utility value, so as to use the final lookup table to calculate the contribution value of the participant.
本公开实施例的第四方面,提供了一种联合学习中确定参与方贡献度的装置,包括:The fourth aspect of the embodiments of the present disclosure provides an apparatus for determining the contribution of a participant in joint learning, including:
确定模块,被配置为基于联合学习中的参与方确定全部参与方组合,并计算所述全部参与方组合中每一个参与方组合的权重;A determination module configured to determine all participant combinations based on the participants in the joint learning, and calculate the weight of each participant combination in the all participant combinations;
建立模块,被配置为确定当前聚合周期开始前的联合模型的第一效用值,以及当前聚合周期结束后的联合模型的第二效用值,基于所述第一效用值与所述第二效用值计算效用变化值,并建立查找表;其中,所述效用变化值用于判断是否计算所述当前聚合周期内各个参与方的贡献值;A building module configured to determine a first utility value of the joint model before the start of the current aggregation period, and a second utility value of the joint model after the end of the current aggregation period, based on the first utility value and the second utility value Calculating the utility change value, and establishing a lookup table; wherein, the utility change value is used to judge whether to calculate the contribution value of each participant in the current aggregation period;
判断模块,被配置为当判断计算所述贡献值时,从所述全部参与方组合中选取一个参与方组合,并计算所述参与方组合中每一个参与方对应的边际贡献值,根据所述边际贡献值以及所述权重,判断利用第一估计方式或者第二估计方式对所述参与方组合的效用值进行估计;The judging module is configured to, when judging and calculating the contribution value, select a participant combination from all the participant combinations, and calculate the marginal contribution value corresponding to each participant in the participant combination, according to the The marginal contribution value and the weight determine to use the first estimation method or the second estimation method to estimate the utility value of the participant combination;
计算模块,被配置为确定所述第一估计方式或者第二估计方式对所述参与方组合的效用值的估计结果,利用所述估计结果对所述查找表进行更新,并依次迭代估计得到每一个所述参与方组合的效用值,获取依据所述效用值进行更新后得到的最终查找表,以便利用所述最终查找表对所述参与方的贡献值进行计算。The calculation module is configured to determine the estimation result of the utility value of the participant combination by the first estimation method or the second estimation method, use the estimation result to update the look-up table, and iteratively estimate in turn to obtain each A utility value of the participant combination, and a final lookup table obtained after updating according to the utility value is obtained, so as to use the final lookup table to calculate the contribution value of the participant.
本公开实施例的第五方面,提供了一种确定联合学习中参与方贡献度的方法,包括:The fifth aspect of the embodiments of the present disclosure provides a method for determining the contribution of participants in joint learning, including:
基于联合学习的架构,生成多个参与方组,并确定由多个所述参与方组构成的参与方组集合,计算所述参与方组的权重,其中每个所述参与方组包含至少两个参与方;Based on the framework of joint learning, multiple participant groups are generated, and a set of participant groups composed of multiple participant groups is determined, and weights of the participant groups are calculated, wherein each of the participant groups includes at least two participants;
确定所述联合学习中的聚合周期,获取所述聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据所述效用变化值判断是否计算所述聚合周期内各个参与方的贡献值;Determine the aggregation period in the joint learning, obtain the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of each participant in the aggregation period according to the utility change value;
当判断结果为是时,利用所述参与方组集合中的参与方组随机生成一个全排列组合,并根据所述全排列组合中所述参与方组中的参与方顺序生成多个子组合,计算参与方加入所述子组合时的边际贡献值的估计值,根据所述边际贡献值的估计值以及所述参与方组的权重,判断是否采用插值函数对所述参与方加入所述子组合后形成的新参与方组的效用值进行计算;When the judgment result is yes, use the participant groups in the participant group set to randomly generate a full permutation combination, and generate multiple subcombinations according to the order of the participants in the participant group in the full permutation combination, calculate The estimated value of the marginal contribution value when the participant joins the sub-combination, according to the estimated value of the marginal contribution value and the weight of the participant group, it is judged whether to use an interpolation function to add the participant to the sub-combination Calculate the utility value of the new participant group formed;
当判断结果为是时,利用插值函数计算所述新参与方组的效用值,当判断结果为否时,利用预设的模型推演方式计算所述新参与方组的效用值,并依据计算出的所述新参与方组的效用值对所述查找表进行更新;When the judgment result is yes, use the interpolation function to calculate the utility value of the new participant group, when the judgment result is no, use the preset model derivation method to calculate the utility value of the new participant group, and calculate updating the lookup table with the utility value of the new party group;
基于更新后的查找表,计算所述参与方的边际贡献值,并判断所述参与方的边际贡献值是否收敛,当判断结果为是时,将收敛后的边际贡献值作为所述参与方的贡献值,当判断结果为否时,生成一个新的全排列组合,直至计算得到所有收敛后的所述参与方的贡献值,根据所述贡献值确定所述参与方在所述联合学习中的贡献度。Based on the updated lookup table, calculate the marginal contribution value of the participant, and judge whether the marginal contribution value of the participant is converged, and when the judgment result is yes, use the converged marginal contribution value as the participant's Contribution value, when the judgment result is no, generate a new full permutation combination until the calculation of the contribution value of all the participants after convergence, and determine the contribution of the participant in the joint learning according to the contribution value contribution.
本公开实施例的第六方面,提供了一种确定联合学习中参与方贡献度的装置,包括:The sixth aspect of the embodiments of the present disclosure provides an apparatus for determining the contribution of participants in joint learning, including:
生成模块,被配置为基于联合学习的架构,生成多个参与方组,并确定由多个所述参与方组构成的参与方组集合,计算所述参与方组的权重,其中每个所述参与方组包含至少两个参与方;The generation module is configured to generate a plurality of participant groups based on a joint learning architecture, and determine a participant group set composed of a plurality of the participant groups, and calculate the weights of the participant groups, wherein each of the participant groups The party group contains at least two parties;
建立模块,被配置为确定所述联合学习中的聚合周期,获取所述聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据所述效用变化值判断是否计算所述聚合周期内各个参与方的贡献值;The establishment module is configured to determine the aggregation period in the joint learning, obtain the utility change value corresponding to the joint learning model before and after the aggregation period, and establish a lookup table, and judge whether to calculate each in the aggregation period according to the utility change value. Contribution value of participants;
判断模块,被配置为当判断结果为是时,利用所述参与方组集合中的参与方组随机生成一个全排列组合,并根据所述全排列组合中所述参与方组中的参与方顺序生成多个子组合,计算参与方加入所述子组合时的边际贡献值的估计值,根据所述边际贡献值的估计值以及所述参与方组的权重,判断是否采用插值函数对所述参与方加入所述子组合后形成的新参与方组的效用值进行计算;The judging module is configured to randomly generate a full permutation combination by using the participant groups in the participant group set when the judgment result is yes, and according to the order of the participants in the participant group in the full permutation combination Generate a plurality of sub-combinations, calculate the estimated value of the marginal contribution value when the participant joins the sub-combination, and judge whether to use an interpolation function to evaluate the participants according to the estimated value of the marginal contribution value and the weight of the participant group The utility value of the new participant group formed after adding the sub-combination is calculated;
更新模块,被配置为当判断结果为是时,利用插值函数计算所述新参与方组的效用值,当判断结果为否时,利用预设的模型推演方式计算所述新参与方组的效用值,并依据计算出的所述新参与方组的效用值对所述查找表进行更新;The update module is configured to use an interpolation function to calculate the utility value of the new participant group when the judgment result is yes, and to calculate the utility value of the new participant group by using a preset model derivation method when the judgment result is no value, and update the lookup table according to the calculated utility value of the new participant group;
计算模块,被配置为基于更新后的查找表,计算所述参与方的边际贡献值,并判断所述参与方的边际贡献值是否收敛,当判断结果为是时,将收敛后的边际贡献值作为所述参与方的贡献值,当判断结果为否时,生成一个新的全排列组合,直至计算得到所有收敛后的所述参与方的贡献值,根据所述贡献值确定所述参与方在所述联合学习中的贡献度。The calculation module is configured to calculate the marginal contribution value of the participant based on the updated lookup table, and judge whether the marginal contribution value of the participant is converged, and when the judgment result is yes, the converged marginal contribution value As the contribution value of the participant, when the judgment result is no, a new full permutation combination is generated until the contribution value of all converged participants is calculated, and the participant is determined according to the contribution value The degree of contribution in the joint learning.
本公开实施例的第七方面,提供了一种联合学习训练方法,包括:The seventh aspect of the embodiments of the present disclosure provides a joint learning training method, including:
在联合学习的本轮聚合周期内,获取联合学习的参与方根据本地数据进行初始模型训练得到的本地模型,对所述参与方的本地模型执行聚合操作,得到联合模型;In the current round of aggregation cycle of the joint learning, the local model obtained by the initial model training of the participants of the joint learning according to the local data is obtained, and the aggregation operation is performed on the local models of the participants to obtain the joint model;
利用预设的联合学习贡献值算法,对所述本轮聚合周期内每个所述参与方对所述联合模型的贡献值进行计算,得到每个所述参与方对应的联合学习贡献值;Using a preset joint learning contribution value algorithm, calculate the contribution value of each of the participants to the joint model in the current round of aggregation period, and obtain the joint learning contribution value corresponding to each of the participants;
获取每个所述参与方的初始指标,对所述联合学习贡献值以及初始指标执行融合操作,得到每个所述参与方的贡献度指标,其中所述初始指标用于表征所述参与方对联合学习的初始贡献度;Obtain the initial index of each of the participants, perform a fusion operation on the joint learning contribution value and the initial index, and obtain the contribution index of each of the participants, wherein the initial index is used to represent the contribution of the participant to The initial contribution of joint learning;
根据所述贡献度指标计算所述参与方在下一轮聚合周期内的训练轮次,以使所述参与方在所述下一轮聚合周期内,基于所述训练轮次对本地模型进行训练,直至对所述联合模型的训练达到预设目标。calculating the training rounds of the participant in the next aggregation period according to the contribution index, so that the participant can train the local model based on the training rounds in the next aggregation period, Until the training of the joint model reaches the preset target.
本公开实施例的第八方面,提供了一种联合学习训练装置,包括:The eighth aspect of the embodiments of the present disclosure provides a joint learning and training device, including:
聚合模块,被配置为在联合学习的本轮聚合周期内,获取联合学习的参与方根据本地数据进行初始模型训练得到的本地模型,对所述参与方的本地模型执行聚合操作,得到联合模型;The aggregation module is configured to obtain a local model obtained by the participants of the federated learning through initial model training based on the local data during the current round of the federated learning, and perform an aggregation operation on the local models of the participants to obtain the joint model;
计算模块,被配置为利用预设的联合学习贡献值算法,对所述本轮聚合周期内每个所述参与方对所述联合模型的贡献值进行计算,得到每个所述参与方对应的联合学习贡献值;The calculation module is configured to use a preset joint learning contribution value algorithm to calculate the contribution value of each of the participants to the joint model in the current round of aggregation period, and obtain the corresponding joint learning contribution value;
融合模块,被配置为获取每个所述参与方的初始指标,对所述联合学习贡献值以及初始指标执行融合操作,得到每个所述参与方的贡献度指标,其中所述初始指标用于表征所述参与方对联合学习的初始贡献度;The fusion module is configured to obtain an initial index of each of the participants, perform a fusion operation on the joint learning contribution value and the initial index, and obtain a contribution index of each of the participants, wherein the initial index is used for Characterize the initial contribution of the participants to the joint learning;
训练模块,被配置为根据所述贡献度指标计算所述参与方在下一轮聚合周期内的训练轮次,以使所述参与方在所述下一轮聚合周期内,基于所述训练轮次对本地模型进行训练,直至对所述联合模型的训练达到预设目标。A training module configured to calculate the training rounds of the participant in the next round of aggregation period according to the contribution index, so that the participant will, in the next round of aggregation period, based on the training rounds The local model is trained until the training of the joint model reaches a preset target.
本公开实施例的第九方面,提供了一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现前述的方法。The ninth aspect of the embodiments of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and operable on the processor, and the aforementioned method is implemented when the processor executes the program .
本公开实施例的第十方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现前述的方法。A tenth aspect of the embodiments of the present disclosure provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the aforementioned method is implemented.
本公开实施例采用的上述至少一个技术方案能够达到以下有益效果:The at least one technical solution adopted in the embodiments of the present disclosure can achieve the following beneficial effects:
通过确定联合学习的参与方,基于参与方构造全部参与方组合,并计算每个参与方组合对应的权重;确定聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据效用变化值判断是否对聚合周期内参与方的贡献值进行计算;当判断结果为是时,按照预定顺序从全部参与方组合中选取一个参与方组合,并对选取的参与方组合中的每一个参与方的边际贡献值进行估计,根据估计结果以及参与方组合的权重,判断是否采用插值函数对参与方组合的效用值进行计算;当判断结果为是时,利用插值函数计算参与方组合的效用值,当判断结果为否时,利用预设的模型推演方式计算参与方组合的效用值,并依据计算出的参与方组合的效用值对查找表进行更新;依次选取每一个参与方组合,直至计算得到所有参与方组合的效用值,利用所有参与方组合的效用值对查找表进行更新,得到最终更新后的查找表,以便基于最终更新后的查找表,计算每个参与方的贡献值,根据贡献值确定参与方在联合学习中的贡献度。本公开能够提升联合学习中贡献值的计算精度,降低计算数据量,使贡献值的计算结果更准确,计算效率更高。By determining the participants of the joint learning, construct all participant combinations based on the participants, and calculate the weight corresponding to each participant combination; determine the utility change value corresponding to the joint learning model before and after the aggregation cycle and establish a lookup table, and judge according to the utility change value Whether to calculate the contribution value of the participants in the aggregation period; when the judgment result is yes, select a participant combination from all the participant combinations according to the predetermined order, and calculate the margin of each participant in the selected participant combination According to the estimation result and the weight of the participant combination, judge whether to use the interpolation function to calculate the utility value of the participant combination; when the judgment result is yes, use the interpolation function to calculate the utility value of the participant combination. When the result is no, use the preset model deduction method to calculate the utility value of the participant combination, and update the lookup table according to the calculated utility value of the participant combination; select each participant combination in turn until all participants are calculated. The utility value of the party combination is used to update the lookup table by using the utility value of all the participants combined to obtain the final updated lookup table, so that the contribution value of each participant can be calculated based on the final updated lookup table, and determined according to the contribution value Contribution of participants in joint learning. The present disclosure can improve the calculation accuracy of the contribution value in joint learning, reduce the amount of calculation data, and make the calculation result of the contribution value more accurate and the calculation efficiency higher.
附图说明Description of drawings
为了更清楚地说明本公开实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following will briefly introduce the drawings that need to be used in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only of the present disclosure For some embodiments, those skilled in the art can also obtain other drawings based on these drawings without creative efforts.
图1是本公开实施例提供的一种联合学习的架构示意图;FIG. 1 is a schematic diagram of a joint learning architecture provided by an embodiment of the present disclosure;
图2是本公开实施例提供的一种联合学习中确定参与方贡献度的方法的流程示意图;FIG. 2 is a schematic flowchart of a method for determining the contribution of a participant in joint learning provided by an embodiment of the present disclosure;
图3是本公开实施例提供的计算参与方贡献值的程序流程示意图;Fig. 3 is a schematic flow diagram of a program for calculating a participant's contribution value provided by an embodiment of the present disclosure;
图4是本公开实施例提供的一种联合学习中确定参与方贡献度的装置的示意图;FIG. 4 is a schematic diagram of an apparatus for determining a participant's contribution in joint learning provided by an embodiment of the present disclosure;
图5是本公开实施例提供的另一种联合学习中确定参与方贡献度的方法的流程示意图;FIG. 5 is a schematic flowchart of another method for determining the contribution of a participant in joint learning provided by an embodiment of the present disclosure;
图6是本公开实施例提供的计算参与方贡献值的程序流程示意图;Fig. 6 is a schematic flow diagram of a program for calculating a participant's contribution value provided by an embodiment of the present disclosure;
图7是本公开实施例提供的另一种联合学习中确定参与方贡献度的装置的示意图;FIG. 7 is a schematic diagram of another device for determining participant contribution in joint learning provided by an embodiment of the present disclosure;
图8是本公开实施例提供的又一种联合学习中确定参与方贡献度的方法的流程示意图;FIG. 8 is a schematic flowchart of another method for determining the contribution of a participant in joint learning provided by an embodiment of the present disclosure;
图9是本公开实施例提供的计算参与方贡献值的程序流程示意图;FIG. 9 is a schematic flow diagram of a program for calculating participant contribution values provided by an embodiment of the present disclosure;
图10是本公开实施例提供的又一种联合学习中确定参与方贡献度的装置的示意图;FIG. 10 is a schematic diagram of another device for determining participant contribution in joint learning provided by an embodiment of the present disclosure;
图11是本公开实施例提供的一种联合学习训练方法的流程示意图;FIG. 11 is a schematic flowchart of a joint learning training method provided by an embodiment of the present disclosure;
图12是本公开实施例提供的对参与方的联合学习贡献值进行计算的流程示意图;Fig. 12 is a schematic flow chart of calculating the joint learning contribution value of the participants provided by the embodiment of the present disclosure;
图13是本公开实施例提供的一种联合学习训练装置的示意图;Fig. 13 is a schematic diagram of a joint learning and training device provided by an embodiment of the present disclosure;
图14是本公开实施例提供的电子设备的结构示意图。Fig. 14 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本公开实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本公开。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本公开的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and techniques are presented for a thorough understanding of the embodiments of the present disclosure. It will be apparent, however, to one skilled in the art that the present disclosure may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present disclosure with unnecessary detail.
联合学习是指在确保数据安全及用户隐私的前提下,综合利用多种AI(Artificial Intelligence,人工智能)技术,联合多方合作共同挖掘数据价值,催生基于联合建模的新的智能业态和模式。联合学习至少具有以下特点:Federated learning refers to the comprehensive utilization of various AI (Artificial Intelligence, artificial intelligence) technologies on the premise of ensuring data security and user privacy, and joint multi-party cooperation to jointly mine data value and generate new intelligent business models and models based on joint modeling. Federated learning has at least the following characteristics:
(1)参与节点控制自有数据的弱中心化联合训练模式,确保共创智能过程中的数据隐私安全。(1) Participating nodes control the weakly centralized joint training mode of their own data to ensure data privacy and security in the process of co-creating intelligence.
(2)在不同应用场景下,利用筛选和/或组合AI算法、隐私保护计算,建立多种模型聚合优化策略,以获取高层次、高质量的模型。(2) In different application scenarios, use screening and/or combining AI algorithms and privacy-preserving calculations to establish multiple model aggregation optimization strategies to obtain high-level, high-quality models.
(3)在确保数据安全及用户隐私的前提下,基于多种模型聚合优化策略,获取提升联合学习引擎的效能方法,其中效能方法可以是通过解决包括计算架构并行、大规模跨域网络下的信息交互、智能感知、异常处理机制等,提升联合学习引擎的整体效能。(3) On the premise of ensuring data security and user privacy, based on a variety of model aggregation optimization strategies, obtain a performance method to improve the joint learning engine, where the performance method can be solved by solving problems including parallel computing architecture and large-scale cross-domain network Information interaction, intelligent perception, exception handling mechanism, etc., improve the overall performance of the joint learning engine.
(4)获取各场景下多方用户的需求,通过互信机制,确定合理评估各联合参与方的真实贡献度,进行分配激励。(4) Obtain the needs of multi-party users in each scenario, determine and reasonably evaluate the true contribution of each joint participant through the mutual trust mechanism, and distribute incentives.
基于上述方式,可以建立基于联合学习的AI技术生态,充分发挥行业数据价值,推动垂直领域的场景落地。Based on the above methods, it is possible to establish an AI technology ecology based on joint learning, give full play to the value of industry data, and promote the implementation of scenarios in vertical fields.
目前随着联合学习参与方以及计算数据量的增加,如何精准快速地评估联合学习中各参与方对联合学习模型训练的贡献度成为亟需解决的问题。现有技术中,联合学习系统根据各参与方的本地数据量确定各参与方对联合学习模型的贡献度,但由于各参与方的本地数据可能存在数据质量参差不齐,本地数据的格式或形式不同,各参与方的数据特征重叠较多等问题,导致在联合学习中对联合学习模型的贡献度的计算效率较低,并且各参与方的联合学习贡献度的准确率也较低。这将会导致后期利用联合学习贡献度对各参与方的收益进行分配时,对各参与方贡献度的公平性和公正性的评估不足。At present, with the increase in the number of participants in federated learning and the amount of computing data, how to accurately and quickly evaluate the contribution of each participant in federated learning to the training of the federated learning model has become an urgent problem to be solved. In the existing technology, the joint learning system determines the contribution of each participant to the joint learning model according to the amount of local data of each participant, but because the local data of each participant may have uneven data quality, the format or form of the local data Different, the data features of each participant overlap more and other problems, resulting in low calculation efficiency of the contribution of the joint learning model in the joint learning, and the accuracy of the joint learning contribution of each participant is also low. This will lead to insufficient evaluation of the fairness and impartiality of each participant's contribution when using the joint learning contribution to distribute the benefits of each participant in the later stage.
鉴于以上现有技术中的问题,需要提供一种基于沙普利值计算法则,结合各参与方加入参与方组合时产生的边际贡献值,对联合学习中各参与方的贡献度进行计算的方法。基于本公开的实施例,能够提升联合学习中对各参与方的联合学习模型训练的贡献值进行精确计算,并降低计算量,使得贡献值的计算结果更加准确,计算效率更高。In view of the above problems in the prior art, it is necessary to provide a method for calculating the contribution of each participant in joint learning based on the Shapley value calculation rule, combined with the marginal contribution value generated when each participant joins the participant combination . Based on the embodiments of the present disclosure, the accurate calculation of the contribution value of each participant's joint learning model training in joint learning can be improved, and the amount of calculation can be reduced, so that the calculation result of the contribution value is more accurate and the calculation efficiency is higher.
图1是本公开实施例提供的一种联合学习的架构示意图。如图1所示,联合学习的架构可以包括服务器(中心节点)101以及参与方102、参与方103和参与方104。FIG. 1 is a schematic diagram of a joint learning architecture provided by an embodiment of the present disclosure. As shown in FIG. 1 , the architecture of joint learning may include a server (central node) 101 , and participants 102 , 103 , and 104 .
在联合学习过程中,基本模型可以通过服务器101建立,服务器101将该模型发送至与其建立通信连接的参与方102、参与方103和参与方104。基本模型还可以是任一参与方建立后上传至服务器101,服务器101将该模型发送至与其建立通信连接的其他参与方。参与方102、参与方103和参与方104根据下载的基本结构和模型参数构建模型,利用本地数据进行模型训练,获得更新的模型参数,并将更新的模型参数加密上传至服务器101。服务器101对参与方102、参与方103和参与方104发送的模型参数进行聚合,获得全局模型参数,并将全局模型参数传回至参与方102、参与方103和参与方104。参与方102、参与方103和参与方104根据接收的全局模型参数对各自的模型进行迭代,直到模型最终收敛,从而实现对模型的训练。在联合学习过程中,参与方102、参与方103和参与方104上传的数据为模型参数,本地数据并不会上传至服务器101,且所有参与方可以共享最终的模型参数,因此可以在保证数据隐私的基础上实现共同建模。需要说明的是,参与方的数量不限于如上所述的三个,而是可以根据需要进行设置,本公开实施例对此不作限制。In the joint learning process, the basic model can be established by the server 101, and the server 101 sends the model to the participant 102, the participant 103 and the participant 104 with which a communication connection is established. The basic model can also be uploaded to the server 101 after being created by any participant, and the server 101 sends the model to other participants that have established communication connections with it. Participant 102, participant 103 and participant 104 build a model according to the downloaded basic structure and model parameters, use local data for model training, obtain updated model parameters, and encrypt and upload the updated model parameters to the server 101. The server 101 aggregates the model parameters sent by the participant 102 , the participant 103 and the participant 104 to obtain the global model parameters, and returns the global model parameters to the participant 102 , the participant 103 and the participant 104 . The participant 102, the participant 103 and the participant 104 iterate their models according to the received global model parameters until the models finally converge, thereby realizing the training of the models. In the joint learning process, the data uploaded by participant 102, participant 103, and participant 104 are model parameters, local data will not be uploaded to server 101, and all participants can share the final model parameters, so data can be guaranteed Co-modeling is achieved on the basis of privacy. It should be noted that the number of participants is not limited to the above three, but can be set according to needs, which is not limited in this embodiment of the present disclosure.
图2是本公开实施例提供的一种联合学习中确定参与方贡献度的方法的流程示意图。图2的联合学习中确定参与方贡献度的方法可以由联合学习的服务器执行。如图2所示,该联合学习中确定参与方贡献度的方法具体可以包括:Fig. 2 is a schematic flow chart of a method for determining a participant's contribution in joint learning provided by an embodiment of the present disclosure. The method for determining the contribution degree of a participant in the joint learning in FIG. 2 may be executed by a server of the joint learning. As shown in Figure 2, the method for determining the contribution of the participants in the joint learning may specifically include:
S201,确定联合学习的参与方,基于参与方构造全部参与方组合,并计算每个参与方组合对应的权重;S201, determine the participants of the joint learning, construct all participant combinations based on the participants, and calculate the weight corresponding to each participant combination;
S202,确定聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据效用变化值判断是否对聚合周期内参与方的贡献值进行计算;S202. Determine the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of the participant in the aggregation period according to the utility change value;
S203,当判断结果为是时,按照预定顺序从全部参与方组合中选取一个参与方组合,并对选取的参 与方组合中的每一个参与方的边际贡献值进行估计,根据估计结果以及参与方组合的权重,判断是否采用插值函数对参与方组合的效用值进行计算;S203, when the judgment result is yes, select a participant combination from all participant combinations according to a predetermined order, and estimate the marginal contribution value of each participant in the selected participant combination, according to the estimation result and the participant Combination weight, judging whether to use the interpolation function to calculate the utility value of the participant combination;
S204,当判断结果为是时,利用插值函数计算参与方组合的效用值,当判断结果为否时,利用预设的模型推演方式计算参与方组合的效用值,并依据计算出的参与方组合的效用值对查找表进行更新;S204, when the judgment result is yes, use the interpolation function to calculate the utility value of the participant combination; when the judgment result is no, use the preset model deduction method to calculate the utility value of the participant combination, and calculate Update the lookup table with the utility value of ;
S205,依次选取每一个参与方组合,直至计算得到所有参与方组合的效用值,利用所有参与方组合的效用值对查找表进行更新,得到最终更新后的查找表,以便基于最终更新后的查找表,计算每个参与方的贡献值,根据贡献值确定参与方在联合学习中的贡献度。S205. Select each participant combination in turn until the utility values of all participant combinations are calculated, and use the utility values of all participant combinations to update the lookup table to obtain the final updated lookup table, so that based on the final updated lookup table table, calculate the contribution value of each participant, and determine the contribution of the participant in the joint learning according to the contribution value.
具体地,每个参与方对应联合学习框架中的一个节点,每个节点对应一个参与方设备,参与方设备可以是PC、平板电脑、智能手机、智能可穿戴设备等,每个参与方设备上具有联合学习参与方的客户终端,但参与方设备并不局限于上述这些设备或者客户端。联合学习框架中还具有为客户端提供服务的节点(即服务端),服务端可以是用于执行聚合操作的服务器,服务端可以协调多个客户端进行联合学习以得到联合学习模型。服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者云计算服务器。Specifically, each participant corresponds to a node in the joint learning framework, and each node corresponds to a participant device. The participant device can be a PC, tablet computer, smart phone, smart wearable device, etc., and each participant device There are client terminals of joint learning participants, but the participant devices are not limited to the above-mentioned devices or clients. The federated learning framework also has a node that provides services for the client (that is, the server). The server can be a server for performing aggregation operations. The server can coordinate multiple clients to perform joint learning to obtain a joint learning model. The server may be an independent physical server, or a server cluster or cloud computing server composed of multiple physical servers.
进一步地,参与方组合是指在联合学习中所有参与方的个体之间的相互排列组合,是由参与方的个体所组成的参与方组合,例如:在一个联合学习框架中一共有3个参与方,分别为A、B、C,那么它们之间可以形成以下参与方组合:A、B、C、AB、BC、AC。Furthermore, the combination of participants refers to the mutual arrangement and combination of individuals of all participants in the joint learning, and is a combination of participants composed of individuals of the participants. The parties are A, B, and C respectively, then the following combinations of parties can be formed among them: A, B, C, AB, BC, and AC.
进一步地,在联合学习中一个聚合周期是指对联合学习模型进行的一轮训练,各参与方客户端利用本地数据对本地模型进行训练,当本地模型训练达到收敛时,得到训练后的本地模型参数,并将其发送给服务端。所有参与方在每个聚合轮次都会上传自己的本地模型参数,服务器进行加权平均得出一个联合模型来,因此每个参与方在每一轮次都会做出自己的贡献,此处的轮表示服务端对联合学习模型进行一次完整的训练。Furthermore, in federated learning, an aggregation cycle refers to a round of training for the federated learning model. Each participant client uses local data to train the local model. When the local model training reaches convergence, the trained local model is obtained parameter and send it to the server. All participants will upload their own local model parameters in each aggregation round, and the server will perform a weighted average to obtain a joint model, so each participant will make its own contribution in each round. The round here means The server performs a complete training of the joint learning model.
根据本公开实施例提供的技术方案,通过确定联合学习的参与方,基于参与方构造全部参与方组合,并计算每个参与方组合对应的权重;确定聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据效用变化值判断是否对聚合周期内参与方的贡献值进行计算;当判断结果为是时,按照预定顺序从全部参与方组合中选取一个参与方组合,并对选取的参与方组合中的每一个参与方的边际贡献值进行估计,根据估计结果以及参与方组合的权重,判断是否采用插值函数对参与方组合的效用值进行计算;当判断结果为是时,利用插值函数计算参与方组合的效用值,当判断结果为否时,利用预设的模型推演方式计算参与方组合的效用值,并依据计算出的参与方组合的效用值对查找表进行更新;依次选取每一个参与方组合,直至计算得到所有参与方组合的效用值,利用所有参与方组合的效用值对查找表进行更新,得到最终更新后的查找表,以便基于最终更新后的查找表,计算每个参与方的贡献值,根据贡献值确定参与方在联合学习中的贡献度。本公开能够提升联合学习中贡献值的计算精度,降低计算数据量,使贡献值的计算结果更准确,计算效率更高。According to the technical solution provided by the embodiments of the present disclosure, by determining the participants of the joint learning, construct all participant combinations based on the participants, and calculate the weight corresponding to each participant combination; determine the utility change value corresponding to the joint learning model before and after the aggregation period And establish a lookup table, judge whether to calculate the contribution value of the participants in the aggregation period according to the utility change value; when the judgment result is yes, select a participant combination from all the participant combinations in the predetermined order, and calculate According to the estimation result and the weight of the participant combination, judge whether to use the interpolation function to calculate the utility value of the participant combination; when the judgment result is yes, use the interpolation function Calculate the utility value of the participant combination. When the judgment result is no, use the preset model deduction method to calculate the utility value of the participant combination, and update the lookup table according to the calculated utility value of the participant combination; select each A participant combination, until the utility value of all the participant combinations is calculated, the lookup table is updated by using the utility value of all the participant combinations, and the final updated lookup table is obtained, so that based on the final updated lookup table, each The contribution value of the participant, according to the contribution value to determine the contribution of the participant in the joint learning. The present disclosure can improve the calculation accuracy of the contribution value in joint learning, reduce the amount of calculation data, and make the calculation result of the contribution value more accurate and the calculation efficiency higher.
下面结合具体的程序流程示意图,对本公开在联合学习中对各参与方的贡献值计算的循环过程进行详细说明,图3是本公开实施例提供的计算参与方贡献值的程序流程示意图。如图3所示,该计算参与方贡献值的程序中具体可以包括以下内容:The cyclic process of calculating the contribution value of each participant in the joint learning of the present disclosure will be described in detail below in combination with a specific program flow diagram. FIG. As shown in Figure 3, the program for calculating the contribution value of the participants may specifically include the following:
在一些实施例中,基于参与方构造全部参与方组合,并计算每个参与方组合对应的权重,包括:根据联合学习中的所有参与方,按照参与方数量从少至多的方式构造出全部参与方组合,全部参与方组合中包含多个参与方组合,根据每个参与方组合中参与方的个数计算权重;其中,权重用于表示参与方组合在全部参与方组合中出现的概率。In some embodiments, constructing all participant combinations based on the participants, and calculating the weight corresponding to each participant combination, includes: constructing all participants according to the number of participants from the fewest to the largest according to all participants in the joint learning Party combination, all participant combinations include multiple participant combinations, and the weight is calculated according to the number of participants in each participant combination; where, the weight is used to represent the probability that the participant combination appears in all the participant combinations.
具体地,下面结合一个具体实施例对联合学习的参与方以及构造全部参与方组合的过程进行详细说明,具体可以包括以下内容:Specifically, the following will describe in detail the participants of the joint learning and the process of constructing a combination of all participants in combination with a specific embodiment, which may specifically include the following:
假设有N个参与方1,2,…i…n-1,n的联合学习,训练一共进行了T个周期的聚合,记录训练过程中每个聚合周期t,每个参与方i上传的本地模型M i (t),以及中心聚合后的联合模型M (t),初始化模型M (0),有对模型性能(如准确率、loss等)的评估函数或效用函数V(·),联合学习模型聚合方法Agg(·),阈值λ,η;其中,λ表示第一截断阈值,η表示第二截断阈值。 Assuming that there are N participants 1, 2, ... i...n-1, n joint learning, the training has been aggregated for T cycles, and each aggregation cycle t in the training process is recorded, and the local data uploaded by each participant i Model M i (t) , and the joint model M (t) after central aggregation, initialize the model M (0) , have an evaluation function or utility function V( ) for model performance (such as accuracy, loss, etc.), and the joint Learning model aggregation method Agg(·), thresholds λ, η; where λ represents the first truncated threshold, and η represents the second truncated threshold.
进一步地,首先根据联合学习中的所有参与方,按照参与方数量从少到多枚举全部可能的参与方组合Ps=[(1,),(2,),(3,)…,(1,2),(1,3),(2,3),…P,…N];对每个具有0,1,2,…n-1个参与方的子组合S,计算权重w |S|=|S|!(|N| -|S|-1)!/|N|!。 Further, firstly, according to all participants in the joint learning, enumerate all possible participant combinations Ps=[(1,),(2,),(3,)...,(1 ,2),(1,3),(2,3),…P,…N]; for each subcombination S with 0, 1, 2,…n-1 participants, calculate the weight w |S | = |S|! (|N| - |S|-1)! /|N|! .
需要说明的是,每一个参与方组合对应上述的一个子组合S,在对子组合S的权重进行计算时,依据的是每个子组合中参与方的个数,在参与方组合中一个参与方对应一个集合中的元素,即根据参与方 组合中的元素个数来计算参与方组合对应的权重,每个子组合对应的权重可以认为是该子组合在整体参与方组合中出现的概率。It should be noted that each participant combination corresponds to a sub-combination S mentioned above. When calculating the weight of the sub-combination S, it is based on the number of participants in each sub-combination. In a participant combination, a participant Corresponding to the elements in a set, that is, the weight corresponding to the participant combination is calculated according to the number of elements in the participant combination. The weight corresponding to each sub-combination can be considered as the probability of the sub-combination appearing in the overall participant combination.
在一些实施例中,确定聚合周期前后联合学习模型对应的效用变化值并建立查找表,包括:针对每个聚合周期,确定聚合周期的初始效用值和最终效用值,将最终效用值与初始效用值之间的差值作为效用变化值,并建立聚合周期对应的包含所有参与方组合的查找表;对查找表执行初始化操作,以使查找表中除空集参与方组合和全集参与方组合之外的其他参与方组合的初始效用值为0;其中,查找表用于存储所有参与方组合对应的效用值。In some embodiments, determining the utility change value corresponding to the joint learning model before and after the aggregation period and establishing a lookup table includes: for each aggregation period, determining the initial utility value and the final utility value of the aggregation period, and combining the final utility value with the initial utility The difference between the values is used as the utility change value, and a lookup table containing all participant combinations corresponding to the aggregation period is established; the lookup table is initialized so that the lookup table excludes the combination of the empty set participant and the full set participant combination The initial utility value of other participant combinations other than 0; wherein, the lookup table is used to store the utility values corresponding to all participant combinations.
具体地,计算每个聚合周期开始时以及结束后,联合学习模型对应的效用值,并建立查找表,即对于每个聚合周期来说,可以先计算本聚合周期的最终效用值与本聚合周期的初始效用值,下面结合一个具体实施例,对聚合周期的初始效用值和最终效用值的计算过程进行详细说明,具体可以包括以下内容:Specifically, calculate the utility value corresponding to the joint learning model at the beginning and after the end of each aggregation period, and establish a lookup table, that is, for each aggregation period, you can first calculate the final utility value of this aggregation period and this aggregation period The calculation process of the initial utility value and the final utility value of the aggregation cycle will be described in detail below in conjunction with a specific embodiment, which may specifically include the following:
对每个聚合周期t,分别计算v N=V(M (t)),v 0=V(M (t-1)),并建立查找表v_lut={():v0,(1,):0,(2,):0,(3,):0…,(1,2):0,(1,3):0,(2,3):0,…N:vN},其中,v N表示当前聚合周期结束后联合模型的最终效用值,v 0表示当前聚合周期对应的上一聚合周期结束后的联合模型的效用值,当然v 0也可以理解为当前聚合周期开始前,当前聚合周期的初始效用值,不同表述方式上的差别不构成对v 0本质含义的限定,且上述两种表述方式是等价的。 For each aggregation period t, calculate v N =V(M (t) ), v 0 =V(M (t-1) ), and establish a lookup table v_lut={():v0,(1,): 0,(2,):0,(3,):0…,(1,2):0,(1,3):0,(2,3):0,…N:vN}, where, v N indicates the final utility value of the joint model after the end of the current aggregation period, and v 0 indicates the utility value of the joint model after the previous aggregation period corresponding to the current aggregation period. Of course, v 0 can also be understood as the current aggregation period before the start of the current aggregation period. For the initial utility value of the period, the difference in different expressions does not constitute a limit to the essential meaning of v 0 , and the above two expressions are equivalent.
进一步地,在对查找表执行初始化操作时,除空集()和全集N对应的参与方组合之外,令全部参与方组合Ps中的其他参与方组合的效用值为0。通过建立v_lut查找表,并利用查找表对参与方组合的效用值进行缓存,从而记录已经计算过的效用值,可以为后续贡献值计算降低计算量,避免重复计算。Further, when performing the initialization operation on the lookup table, except for the participant combinations corresponding to the empty set ( ) and the full set N, let the utility values of other participant combinations in all participant combinations Ps be 0. By establishing a v_lut lookup table and using the lookup table to cache the utility value of the participant combination, so as to record the calculated utility value, it is possible to reduce the amount of calculation for subsequent contribution value calculations and avoid repeated calculations.
在一些实施例中,根据效用变化值判断是否对聚合周期内参与方的贡献值进行计算,包括:将聚合周期的效用变化值与预设的第一截断阈值进行比较,当聚合周期的效用变化值小于第一截断阈值,且连续两轮聚合周期的效用变化值均小于第一截断阈值时,则判断聚合周期内各参与方的贡献值为0;否则,对聚合周期内各参与方的贡献值进行计算。In some embodiments, judging whether to calculate the contribution value of the participant in the aggregation period according to the utility change value includes: comparing the utility change value of the aggregation period with a preset first cut-off threshold, when the utility change of the aggregation period When the value is less than the first truncation threshold, and the utility change value of two consecutive rounds of aggregation periods is less than the first truncation threshold, it is judged that the contribution value of each participant in the aggregation period is 0; otherwise, the contribution of each participant in the aggregation period value is calculated.
具体地,通过计算本聚合周期的最终效用值与本聚合周期的初始效用值,如果本聚合周期对应的最终效用值与初始效用值之间的差值小于第一截断阈值,且如果连续两轮聚合周期,最终效用值与初始效用值之间的差值都小于第一截断阈值时,则结束计算,并将当前聚合周期内各参与方的贡献值视为0,即各参与方没有在当前聚合周期内做出贡献。下面结合一个具体实施例,对利用计算器判断是否对本聚合周期内各参与方的贡献值进行计算的过程进行详细说明,具体可以包括以下内容:Specifically, by calculating the final utility value of this aggregation period and the initial utility value of this aggregation period, if the difference between the final utility value and the initial utility value corresponding to this aggregation period is less than the first cut-off threshold, and if two consecutive rounds In the aggregation period, when the difference between the final utility value and the initial utility value is less than the first truncation threshold, the calculation ends, and the contribution value of each participant in the current aggregation period is regarded as 0, that is, each participant is not in the current Contribute during the aggregation period. The following is a detailed description of the process of using a calculator to determine whether to calculate the contribution value of each participant in this aggregation cycle in combination with a specific embodiment, which may specifically include the following:
如果|v N-v 0|≤λ,则计数器加1,如果计数器超过1(计数器的值大于等于2),则本聚合周期t内各个参与方i的贡献值
Figure PCTCN2022116570-appb-000001
则返回上一步骤,否则继续执行下一步骤;换言之,通过将当前聚合周期前后产生的聚合模型所对应的最终效用值与初始效用值做差,并将差值与第一截断阈值进行比较,当差值小于第一截断阈值时,计数器的数值加1,如果计算器大于或等于2(即连续两轮聚合周期所产生的聚合模型的效用变化值均小于阈值),则判断本聚合周期内各参与方的贡献值为0。
If |v N -v 0 |≤λ, add 1 to the counter, if the counter exceeds 1 (the value of the counter is greater than or equal to 2), then the contribution value of each participant i in this aggregation period t
Figure PCTCN2022116570-appb-000001
Then return to the previous step, otherwise continue to the next step; in other words, by making a difference between the final utility value corresponding to the aggregation model generated before and after the current aggregation cycle and the initial utility value, and comparing the difference with the first cut-off threshold, When the difference is less than the first truncation threshold, add 1 to the value of the counter. If the counter is greater than or equal to 2 (that is, the utility change value of the aggregation model generated by two consecutive rounds of aggregation cycles is less than the threshold value), then it is judged that within the aggregation cycle The contribution value of each participant is 0.
本公开实施例这样做的目的在于,在正式计算每个参与方的贡献值之前,先对本轮联合模型效用值的变化情况做一下评估,根据评估结果可判断在经过本轮聚合训练之后的联合模型的效用值有没有得到提升,即联合模型本身的性能有没有提升,如果模型性能的提升量很少,就可以认为各个参与方在本轮的贡献值都为0;如果本轮发现联合学习模型的性能提升比较大,那就继续执行下面计算,即具体计算每个参与方在本轮的贡献值是多少。本公开能够提前判断是否需要对参与方的贡献值做进一步计算,还是直接将参与方在本轮的贡献值算作为0,从而避免了无效的计算过程,提升了计算效率。The purpose of this embodiment of the present disclosure is to evaluate the changes in the utility value of the joint model in the current round before formally calculating the contribution value of each participant. Whether the utility value of the joint model has been improved, that is, whether the performance of the joint model itself has been improved. If the improvement in model performance is small, it can be considered that the contribution value of each participant in this round is 0; The performance improvement of the learning model is relatively large, so continue to perform the following calculations, that is, specifically calculate the contribution value of each participant in this round. This disclosure can judge in advance whether it is necessary to further calculate the contribution value of the participant, or directly count the contribution value of the participant in the current round as 0, thereby avoiding an invalid calculation process and improving calculation efficiency.
在一些实施例中,按照预定顺序从全部参与方组合中选取一个参与方组合,并对选取的参与方组合中的每一个参与方的边际贡献值进行估计,包括:按照全部参与方组合中参与方组合的排列顺序,依次对参与方组合进行选取,并对选取出的参与方组合内的参与方依次进行迭代,以便对参与方加入参与方组合时产生的边际贡献值进行估计,得到边际贡献值的估计值。In some embodiments, a participant combination is selected from all participant combinations in a predetermined order, and the marginal contribution value of each participant in the selected participant combination is estimated, including: The arrangement order of the combination of participants is selected in turn, and the participants in the selected combination of participants are iterated sequentially, so as to estimate the marginal contribution value generated when the participant joins the combination of participants, and obtain the marginal contribution An estimate of the value.
具体地,当判断需要对各个参与方在本轮的贡献值做计算时,从本轮的全部参与方组合Ps中按顺序取出一种参与方组合P,此处的选取顺序与枚举全部可能的参与方组合Ps时的顺序一致,即先取参与方数量少的组合,再递进式选取参与方数量较多的组合。Specifically, when it is judged that the contribution value of each participant in the current round needs to be calculated, a participant combination P is sequentially selected from all participant combinations Ps in the current round, and the selection order and enumeration here are all possible The order of the participant combinations Ps is the same, that is, the combination with a small number of participants is selected first, and then the combination with a large number of participants is selected progressively.
进一步地,在依次选取每一种参与方组合P的过程中,对每个参与方组合P,估计该参与方组合中每个参与方的边际贡献值,即计算每一个参与方加入该参与方组合时所产生的边际贡献值;下面结合一个具体实施例,对参与方组合P中每个参与方的边际贡献值的估计过程进行详细说明,具体可以包括以下内容:Further, in the process of sequentially selecting each participant combination P, for each participant combination P, estimate the marginal contribution value of each participant in the participant combination, that is, calculate the The marginal contribution value generated during the combination; below in conjunction with a specific embodiment, the estimation process of the marginal contribution value of each participant in the participant combination P will be described in detail, which may specifically include the following:
对P中的每一个参与方j,可将P分割为{j}和S=P\{j}两个子集,也即P=S∪{j};计算j加入S产生的边际贡献,在计算边际贡献时,由于实际的边际贡献应当为Δ j_real=v S∪{j}-v S=V(S∪{j})-V(S)=V(P)-V(S);但是,V(P)的值暂时还无法确定,因此采用缩放原理,将V(P)放大成v N,从而将j的边际贡献估计为Δ j_est=v N-v S=v_lut[N]-v_lut[S],并将v S添加至列表VS_hist(对应另外一个缓存表),由于v S已在上一个组合P’中计算过,此处只需从查找表v_lut中获取,无需计算V(M S (t))。 For each participant j in P, P can be divided into two subsets {j} and S=P\{j}, that is, P=S∪{j}; calculate the marginal contribution generated by adding j to S, in When calculating the marginal contribution, since the actual marginal contribution should be Δ j_real =v S∪{j} -v S =V(S∪{j})-V(S)=V(P)-V(S); but , the value of V(P) cannot be determined temporarily, so the scaling principle is used to enlarge V(P) to v N , so that the marginal contribution of j is estimated as Δ j_est =v N -v S =v_lut[N]-v_lut [S], and add v S to the list VS_hist (corresponding to another cache table), since v S has been calculated in the previous combination P', here only needs to be obtained from the lookup table v_lut, no need to calculate V(M S (t) ).
进一步地,利用上述计算方式对参与方组合P中的每一个元素(参与方j)做一次循环,直至参与方组合P中的每一个元素都循环计算一次,最终估计得到每个参与方组合中的每一个参与方对应的边际贡献值。Further, use the above calculation method to perform a cycle for each element (participant j) in the participant combination P, until each element in the participant combination P is cyclically calculated once, and finally estimate that in each participant combination The marginal contribution value corresponding to each participant.
在一些实施例中,根据估计结果以及参与方组合的权重,判断是否采用插值函数对参与方组合的效用值进行计算,包括:计算参与方对应的边际贡献值的估计值与参与方对应参与方组合的权重的乘积,并将乘积与预设的第二截断阈值进行比较;当参与方组合中每个参与方对应的乘积均小于或等于预设的第二截断阈值时,则判断采用插值函数对参与方组合的效用值进行计算;否则,利用预设的模型推演方式计算参与方组合的效用值。In some embodiments, according to the estimation result and the weight of the participant combination, it is judged whether to use an interpolation function to calculate the utility value of the participant combination, including: calculating the estimated value of the marginal contribution value corresponding to the participant and the corresponding participant Combined weight product, and compare the product with the preset second truncation threshold; when the product corresponding to each participant in the participant combination is less than or equal to the preset second truncation threshold, it is judged to use the interpolation function Calculate the utility value of the participant combination; otherwise, use the preset model deduction method to calculate the utility value of the participant combination.
具体地,根据参与方的边际贡献值与参与方所对应的参与方组合的权重的乘积与第二截断阈值之间的关系,判断是否对参与方组合的效用值进行计算;下面结合具体实施例,对上述乘积的计算以及判断过程进行详细说明,具体可以包括以下内容:Specifically, according to the relationship between the product of the marginal contribution value of the participant and the weight of the participant combination corresponding to the participant and the second cut-off threshold, it is judged whether to calculate the utility value of the participant combination; the following is combined with specific embodiments , to describe the calculation and judgment process of the above product in detail, which may specifically include the following:
计算参与方j的边际贡献值与参与方j所在参与方组合P的权重的乘积|Δ j_est*w |S||,如果参与方组合P中全部参与方j均满足|Δ j_est*w |S||≤η*|vN-v0|,则判断使用插值函数对参与方组合P的效用值进行计算,否则,判断利用预设的模型推演方式计算参与方组合P的效用值。 Calculate the product |Δ j_est *w | S|| || ≤η*|vN-v0|, then judge to use the interpolation function to calculate the utility value of the participant combination P, otherwise, judge to use the preset model deduction method to calculate the utility value of the participant combination P.
也就是说,如果参与方组合P中的每个参与方对应的边际贡献值都满足上述公式,那此时参与方组合P的效用值就无需再进行推演了,直接采用插值函数计算参与方组合P的效用值,如果有一个参与方的边际贡献值不满足,就需要对参与方组合P进行模型推演并计算效用值。In other words, if the marginal contribution value of each participant in the participant combination P satisfies the above formula, then the utility value of the participant combination P does not need to be deduced at this time, and the interpolation function is directly used to calculate the participant combination The utility value of P, if the marginal contribution value of one participant is not satisfied, it is necessary to perform model deduction on the participant combination P and calculate the utility value.
需要说明的是,上述参与方组合P中的每个参与方对应的边际贡献值都满足上述公式时仅仅是一种可选的实施例,除此之外,还可以设置成其他判断标准,比如参与方组合P中的任意一个参与方的边际贡献值不满足上述公式,或者参与方组合P中有一半的参与方不满足上述公式,或者参与方组合P中存在任意比例的参与方不满足上述公式等等。It should be noted that when the marginal contribution value of each participant in the above participant combination P satisfies the above formula, it is only an optional embodiment. In addition, other judgment criteria can also be set, such as The marginal contribution value of any participant in the participant combination P does not satisfy the above formula, or half of the participants in the participant combination P do not satisfy the above formula, or there is any proportion of participants in the participant combination P that does not satisfy the above formula formulas and more.
根据本公开实施例提供的技术方案,为了提前判断是否对参与方组合进行模型推演,通过放大效用值的方式,对参与方组合中的每一个参与方的边际贡献值进行估计,并将估计值与参与方组合的权重相乘,将乘积与第二截断阈值进行比较,从而判断采用插值函数的方式计算参与方组合的效用值,还是采用模型推演的方式计算参与方组合的效用值;由于模型推演的复杂度很高,计算量较大,因此,通过增加上述判断手段,对于无需做模型推演的参与方组合,可直接利用之前迭代过程中计算的子组合的效用值进行加权求和得到,从而提升了贡献值的计算速度。According to the technical solution provided by the embodiments of the present disclosure, in order to judge in advance whether to perform model derivation on the participant combination, the marginal contribution value of each participant in the participant combination is estimated by amplifying the utility value, and the estimated value Multiply with the weight of the participant combination, and compare the product with the second cut-off threshold, so as to judge whether to use the interpolation function to calculate the utility value of the participant combination, or to use the model deduction to calculate the utility value of the participant combination; because the model The complexity of the deduction is very high, and the amount of calculation is large. Therefore, by adding the above-mentioned judgment means, for the combination of participants that does not need to do model deduction, it can be directly obtained by weighting and summing the utility values of the sub-combinations calculated in the previous iteration process. Thus, the calculation speed of the contribution value is improved.
在一些实施例中,利用插值函数计算参与方组合的效用值,包括:基于历史迭代过程中计算的参与方组合的效用值、以及参与方组合为全集参与方组合时对应的效用值,利用预设的插值函数对参与方组合的效用值进行估计,得到参与方组合的效用值所对应的估计值,并根据估计值对查找表进行更新。In some embodiments, using an interpolation function to calculate the utility value of the participant combination includes: based on the utility value of the participant combination calculated in the historical iteration process, and the corresponding utility value when the participant combination is a complete set of participant combinations, using a preset The set interpolation function estimates the utility value of the participant combination, obtains the estimated value corresponding to the utility value of the participant combination, and updates the lookup table according to the estimated value.
具体地,插值函数计算效用值的原理是,用已经计算过的子组合的效用值去估计参与方组合的效用值,即根据之前迭代过程中子组合的效用值对参与方组合的效用值做近似处理,例如,对于参与方组合(1,2,3)来说,可以用v(1,2),,v(2,3),v(1,3)的值来估计v(1,2,3)的值,而v(1,2),,v(2,3),v(1,3)的值已经存在于v_lut查找表中。Specifically, the principle of the interpolation function to calculate the utility value is to use the calculated utility value of the subcombination to estimate the utility value of the participant combination, that is, to calculate the utility value of the participant combination according to the utility value of the subcombination in the previous iteration process. Approximation processing, for example, for the participant combination (1, 2, 3), the values of v(1, 2), v(2, 3), v(1, 3) can be used to estimate v(1, 2, 3), and the value of v(1, 2),, v(2, 3), v(1, 3) already exists in the v_lut lookup table.
进一步地,插值函数的计算公式V(P)=interpolate(mean(VS_hist),v N,P,N),根据该计算公式得到参与方组合P的效用估计值并更新查找表v_lut[P]=V(P)。其中,插值函数interpolate(·)的实现方法为: Further, the calculation formula of the interpolation function V(P)=interpolate(mean(VS_hist),v N ,P,N), according to the calculation formula, obtain the utility estimate of the participant combination P and update the lookup table v_lut[P]= V(P). Among them, the implementation method of the interpolation function interpolate( ) is:
Figure PCTCN2022116570-appb-000002
Figure PCTCN2022116570-appb-000002
上述插值函数的计算公式中,将mean(VS_hist),v N,子组合P和全组合N作为函数的输入,计算并输出。 In the calculation formula of the above interpolation function, mean(VS_hist), v N , sub-combination P and full combination N are used as the input of the function, calculated and output.
进一步地,在上述插值函数的计算公式中,采用求平均值的方式(即公式中的mean)来计算参与方组合P的效用估计值,但是在实际应用中,除了求平均值的方式外,还可以采用计算最大值、最小值或者中位数的方式来计算参与方组合P的效用估计值。当采用最大值方法计算时,可直接将上述公式中的mean替换为max,当采用最小值方法计算时,可直接将上述公式中的mean替换为min,因此,插值函数的计算方式不构成对本申请技术方案的限定。Furthermore, in the calculation formula of the interpolation function above, the method of calculating the average value (that is, the mean in the formula) is used to calculate the estimated utility value of the participant combination P, but in practical applications, in addition to the method of calculating the average value, The utility estimation value of the participant combination P can also be calculated by calculating the maximum value, the minimum value or the median value. When the maximum value method is used for calculation, the mean in the above formula can be directly replaced by max; when the minimum value method is used for calculation, the mean in the above formula can be directly replaced by min. Therefore, the calculation method of the interpolation function does not constitute a Limitations on the technical solution of the application.
在一些实施例中,利用预设的模型推演方式计算参与方组合的效用值,并依据计算出的参与方组合的效用值对查找表进行更新,包括:对参与方组合对应的模型参数进行聚合,并对参与方组合对应的模型进行模型推演,对参与方组合中每个参与方的权重进行聚合,得到参与方组合的权重,对参与方组合在标准验证集上进行模型推演,计算得到参与方组合的真实效用值,利用真实效用值对查找表进行更新。In some embodiments, the utility value of the participant combination is calculated using a preset model derivation method, and the lookup table is updated according to the calculated utility value of the participant combination, including: aggregating the model parameters corresponding to the participant combination , and perform model deduction on the model corresponding to the participant combination, aggregate the weights of each participant in the participant combination to obtain the weight of the participant combination, perform model deduction on the standard verification set for the participant combination, and calculate the participation The real utility value of the square combination is used to update the lookup table.
具体地,模型推演采用公式V(P)=V(M P (t))=V(Agg(P)),根据该计算公式得到参与方组合P的真实效用值并更新查找表v_lut[P]=V(P)。 Specifically, the model deduction adopts the formula V(P)=V(M P (t) )=V(Agg(P)), according to this calculation formula, the real utility value of the participant combination P is obtained and the lookup table v_lut[P] is updated =V(P).
在一些实施例中,基于最终更新后的查找表,计算每个参与方的贡献值,包括:根据最终更新后的查找表中的每个参与方组合的效用值,利用预设的沙普利值计算公式,计算每个参与方对应的贡献值,其中,贡献值用于表示参与方在联合学习中对聚合周期训练的联合学习模型的贡献度。In some embodiments, calculating the contribution value of each participant based on the final updated lookup table includes: using the preset Shapley The value calculation formula calculates the contribution value corresponding to each participant, where the contribution value is used to represent the contribution of the participant to the joint learning model trained in the aggregation cycle in the joint learning.
具体地,根据以上实施例中参与方组合P的效用值的计算过程,将整个参与方组合Ps都循环一遍,从而得到最终更新后的v_lut查找表,将查找表中的参与方组合对应的效用值依次代入到预设的沙普利值计算公式中去,计算每一个参与方对应的贡献值,即可得到每个贡献方在当前聚合周期内的贡献值。Specifically, according to the calculation process of the utility value of the participant combination P in the above embodiment, the entire participant combination Ps is cycled once to obtain the final updated v_lut lookup table, and the corresponding utility of the participant combination in the lookup table is obtained. Values are substituted into the preset Shapley value calculation formula in turn to calculate the contribution value corresponding to each participant, and then the contribution value of each contributor in the current aggregation period can be obtained.
进一步地,Shapley Value是根据个体i加入组合S产生的边际贡献的平均值,公平的进行利益分配的方法,其计算复杂度是O(2 n),n为个体总数。其计算公式为: Furthermore, Shapley Value is a method for fairly distributing benefits based on the average marginal contribution of individual i joining combination S, and its computational complexity is O(2 n ), where n is the total number of individuals. Its calculation formula is:
Figure PCTCN2022116570-appb-000003
Figure PCTCN2022116570-appb-000003
Shapley值(即沙普利值)考虑个体i加入子组合的全部可能的顺序,其中N表示全组合,S表示某个排列情况下的子组合,V(·)表示效用函数,|·|符号表示求集合中元素的数量,[V(S∪{i})–V(S)]表示i加入子组合S后的边际效用,权重w |S|=|S|!(|N|-|S|-1)!/|N|!表示该组合出现的概率。 The Shapley value (that is, the Shapley value) considers all possible orders in which individual i joins the sub-combination, where N represents the full combination, S represents the sub-combination in a certain arrangement, V(·) represents the utility function, and the |·| symbol Indicates the number of elements in the set, [V(S∪{i})–V(S)] indicates the marginal utility of i added to the sub-combination S, and the weight w |S| = |S|! (|N|-|S|-1)! /|N|! Indicates the probability of the combination occurring.
进一步地,重复以上步骤,获得每个参与方i在全部T个聚合周期的贡献值,累加得到参与方i对联合模型的贡献值;即将所有聚合周期按照上面的方式计算一遍,得到每一个参与方在每一个聚合周期对应的贡献值,然后进行累加得到总的贡献值。Further, repeat the above steps to obtain the contribution value of each participant i in all T aggregation periods, and accumulate the contribution value of participant i to the joint model; that is, calculate all the aggregation periods according to the above method, and obtain each participant i Party’s corresponding contribution value in each aggregation cycle, and then accumulate to get the total contribution value.
进一步地,采用以下方式对第一截断阈值λ进行设置:设最终的联合模型效用函数相对于初始模型的边际增益为Δ U=|V(M (T))-V(M (0))|,其中T为总通讯轮次,可设置λ=Δ U*0.01。第二截断阈值η可用于表示贡献值的误差水平,可将其设置为η=1e-3~1e-5 Further, the first truncation threshold λ is set in the following manner: Let the marginal gain of the final joint model utility function relative to the initial model be Δ U =|V(M (T) )-V(M (0) )| , where T is the total communication round, which can be set to λ=Δ U *0.01. The second truncation threshold η can be used to represent the error level of the contribution value, which can be set as η=1e-3˜1e-5 .
下述为本公开装置实施例,可以用于执行本公开方法实施例。对于本公开装置实施例中未披露的细节,请参照本公开方法实施例。The following are device embodiments of the present disclosure, which can be used to implement the method embodiments of the present disclosure. For details not disclosed in the disclosed device embodiments, please refer to the disclosed method embodiments.
图4是本公开实施例提供的一种联合学习中确定参与方贡献度的装置的结构示意图。如图4所示,该联合学习中确定参与方贡献度的装置包括:Fig. 4 is a schematic structural diagram of an apparatus for determining a participant's contribution in joint learning provided by an embodiment of the present disclosure. As shown in Figure 4, the means for determining the contribution of participants in this joint learning include:
构造模块401,被配置为确定联合学习的参与方,基于参与方构造全部参与方组合,并计算每个参与方组合对应的权重;The construction module 401 is configured to determine the participants of the joint learning, construct all participant combinations based on the participants, and calculate the weight corresponding to each participant combination;
第一判断模块402,被配置为确定聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据效用变化值判断是否对聚合周期内参与方的贡献值进行计算;The first judging module 402 is configured to determine the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of the participant in the aggregation period according to the utility change value;
第二判断模块403,被配置为当判断结果为是时,按照预定顺序从全部参与方组合中选取一个参与方组合,并对选取的参与方组合中的每一个参与方的边际贡献值进行估计,根据估计结果以及参与方组合的权重,判断是否采用插值函数对参与方组合的效用值进行计算;The second judging module 403 is configured to, when the judging result is yes, select a participant combination from all participant combinations in a predetermined order, and estimate the marginal contribution value of each participant in the selected participant combination , according to the estimation result and the weight of the participant combination, judge whether to use the interpolation function to calculate the utility value of the participant combination;
更新模块404,被配置为当判断结果为是时,利用插值函数计算参与方组合的效用值,当判断结果为否时,利用预设的模型推演方式计算参与方组合的效用值,并依据计算出的参与方组合的效用值对查找表进行更新;The update module 404 is configured to use an interpolation function to calculate the utility value of the participant combination when the judgment result is yes, and to calculate the utility value of the participant combination by using a preset model derivation method when the judgment result is no, and calculate according to Update the lookup table with the utility value of the obtained participant combination;
计算模块405,被配置为依次选取每一个参与方组合,直至计算得到所有参与方组合的效用值,利用所有参与方组合的效用值对查找表进行更新,得到最终更新后的查找表,以便基于最终更新后的查找表,计算每个参与方的贡献值,根据贡献值确定参与方在联合学习中的贡献度。The calculation module 405 is configured to select each participant combination in turn until the utility values of all participant combinations are calculated, and update the lookup table by using the utility values of all participant combinations to obtain a final updated lookup table, so that based on The final updated lookup table calculates the contribution value of each participant, and determines the contribution of the participant in the joint learning according to the contribution value.
在一些实施例中,图4的构造模块401根据联合学习中的所有参与方,按照参与方数量从少至多的方式构造出全部参与方组合,全部参与方组合中包含多个参与方组合,根据每个参与方组合中参与方的个数计算权重;其中,权重用于表示参与方组合在全部参与方组合中出现的概率。In some embodiments, the construction module 401 in FIG. 4 constructs all participant combinations according to the number of participants from the fewest to the largest according to all participants in the joint learning. All participant combinations include multiple participant combinations. According to The number of participants in each participant combination calculates the weight; wherein, the weight is used to represent the probability that the participant combination appears in all the participant combinations.
在一些实施例中,图4的第一判断模块402针对每个聚合周期,确定聚合周期的初始效用值和最终效用值,将最终效用值与初始效用值之间的差值作为效用变化值,并建立聚合周期对应的包含所有参与方组合的查找表;对查找表执行初始化操作,以使查找表中除空集参与方组合和全集参与方组合之外的其他参与方组合的初始效用值为0;其中,查找表用于存储所有参与方组合对应的效用值。In some embodiments, the first judgment module 402 in FIG. 4 determines the initial utility value and the final utility value of the aggregation period for each aggregation period, and uses the difference between the final utility value and the initial utility value as the utility change value, And establish a lookup table containing all participant combinations corresponding to the aggregation cycle; perform an initialization operation on the lookup table so that the initial utility values of other participant combinations in the lookup table except the empty set participant combination and the full set participant combination are 0; among them, the lookup table is used to store the utility values corresponding to the combinations of all participants.
在一些实施例中,图4的第一判断模块402将聚合周期的效用变化值与预设的第一截断阈值进行比较,当聚合周期的效用变化值小于第一截断阈值,且连续多轮聚合周期的效用变化值均小于第一截断阈值时,则判断聚合周期内各参与方的贡献值为0;否则,对聚合周期内各参与方的贡献值进行计算。In some embodiments, the first judging module 402 in FIG. 4 compares the utility change value of the aggregation period with the preset first cut-off threshold, and when the utility change value of the aggregation period is less than the first cut-off threshold, and multiple rounds of aggregation When the utility change values of the period are all less than the first cut-off threshold, it is judged that the contribution value of each participant in the aggregation period is 0; otherwise, the contribution value of each participant in the aggregation period is calculated.
在一些实施例中,图4的第二判断模块403按照全部参与方组合中参与方组合的排列顺序,依次对参与方组合进行选取,并对选取出的参与方组合内的参与方依次进行迭代,以便对参与方加入参与方组合时产生的边际贡献值进行估计,得到边际贡献值的估计值。In some embodiments, the second judging module 403 in FIG. 4 sequentially selects the participant combinations according to the arrangement order of the participant combinations in all the participant combinations, and iterates the participants in the selected participant combinations sequentially. , in order to estimate the marginal contribution value generated when the participant joins the participant combination, and obtain the estimated value of the marginal contribution value.
在一些实施例中,图4的第二判断模块403计算参与方对应的边际贡献值的估计值与参与方对应参与方组合的权重的乘积,并将乘积与预设的第二截断阈值进行比较;当参与方组合中每个参与方对应的乘积均小于或等于预设的第二截断阈值时,则判断采用插值函数对参与方组合的效用值进行计算;否则,利用预设的模型推演方式计算参与方组合的效用值。In some embodiments, the second judging module 403 in FIG. 4 calculates the product of the estimated value of the participant's corresponding marginal contribution value and the weight of the participant's corresponding participant combination, and compares the product with the preset second cut-off threshold ; When the product corresponding to each participant in the participant combination is less than or equal to the preset second cut-off threshold, it is judged to use the interpolation function to calculate the utility value of the participant combination; otherwise, use the preset model derivation method Computes the utility value for a combination of parties.
在一些实施例中,图4的更新模块404基于历史迭代过程中计算的参与方组合的效用值、以及参与方组合为全集参与方组合时对应的效用值,利用预设的插值函数对参与方组合的效用值进行估计,得到参与方组合的效用值所对应的估计值,并根据估计值对查找表进行更新。In some embodiments, the update module 404 in FIG. 4 uses a preset interpolation function to update the participant's The utility value of the combination is estimated, and the estimated value corresponding to the utility value of the participant combination is obtained, and the lookup table is updated according to the estimated value.
在一些实施例中,图4的更新模块404对参与方组合对应的模型参数进行聚合,并对参与方组合对应的模型进行模型推演,对参与方组合中每个参与方的权重进行聚合,得到参与方组合的权重,对参与方组合在标准验证集上进行模型推演,计算得到参与方组合的真实效用值,利用真实效用值对查找表进行更新。In some embodiments, the update module 404 in FIG. 4 aggregates the model parameters corresponding to the participant combination, performs model deduction on the model corresponding to the participant combination, and aggregates the weight of each participant in the participant combination to obtain The weight of the participant combination, the model deduction of the participant combination on the standard verification set is calculated to obtain the real utility value of the participant combination, and the lookup table is updated using the real utility value.
在一些实施例中,图4的计算模块405根据最终更新后的查找表中的每个参与方组合的效用值,利用预设的沙普利值计算公式,计算每个参与方对应的贡献值,其中,贡献值用于表示参与方在联合学习中对聚合周期训练的联合学习模型的贡献度。In some embodiments, the calculation module 405 in FIG. 4 calculates the contribution value corresponding to each participant by using the preset Shapley value calculation formula according to the utility value of each participant combination in the finally updated lookup table , where the contribution value is used to represent the contribution of the participants to the joint learning model trained in the aggregation cycle in the joint learning.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本公开实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.
图5是本公开实施例提供的另一种联合学习中确定参与方贡献度的方法的流程示意图。图2的联合学习中确定参与方贡献度的方法可以由联合学习的服务器执行。如图2所示,该联合学习中确定参与方贡献度的方法具体可以包括:Fig. 5 is a schematic flowchart of another method for determining the contribution of a participant in joint learning provided by an embodiment of the present disclosure. The method for determining the contribution degree of a participant in the joint learning in FIG. 2 may be executed by a server of the joint learning. As shown in Figure 2, the method for determining the contribution of the participants in the joint learning may specifically include:
S501,基于联合学习中的参与方确定全部参与方组合,并计算全部参与方组合中每一个参与方组合的权重;S501. Determine all participant combinations based on the participants in the joint learning, and calculate the weight of each participant combination in all participant combinations;
S502,确定当前聚合周期开始前的联合模型的第一效用值,以及当前聚合周期结束后的联合模型的第二效用值,基于第一效用值与第二效用值计算效用变化值,并建立查找表;其中,效用变化值用于判断是否计算当前聚合周期内各个参与方的贡献值;S502. Determine the first utility value of the joint model before the start of the current aggregation period, and the second utility value of the joint model after the end of the current aggregation period, calculate the utility change value based on the first utility value and the second utility value, and establish a search Table; among them, the utility change value is used to judge whether to calculate the contribution value of each participant in the current aggregation period;
S503,当判断计算贡献值时,从全部参与方组合中选取一个参与方组合,并计算参与方组合中每一个参与方对应的边际贡献值,根据边际贡献值以及权重,判断利用第一估计方式或者第二估计方式对参与方组合的效用值进行估计;S503, when judging and calculating the contribution value, select a participant combination from all the participant combinations, and calculate the marginal contribution value corresponding to each participant in the participant combination, and judge to use the first estimation method according to the marginal contribution value and weight Or the second estimation method estimates the utility value of the participant combination;
S504,确定第一估计方式或者第二估计方式对参与方组合的效用值的估计结果,利用估计结果对查找表进行更新,并依次迭代估计得到每一个参与方组合的效用值,获取依据效用值进行更新后得到的最终查找表,以便利用最终查找表对参与方的贡献值进行计算。S504. Determine the estimation result of the utility value of the participant combination by the first estimation method or the second estimation method, use the estimation result to update the lookup table, and iteratively estimate the utility value of each participant combination in turn, and obtain the basis utility value The final lookup table obtained after the update is used to calculate the contribution value of the participant using the final lookup table.
根据本公开实施例提供的技术方案,通过基于联合学习中的参与方确定全部参与方组合,并计算全部参与方组合中每一个参与方组合的权重;确定当前聚合周期开始前的联合模型的第一效用值,以及当前聚合周期结束后的联合模型的第二效用值,基于第一效用值与第二效用值计算效用变化值,并建立查找表;其中,效用变化值用于判断是否计算当前聚合周期内各个参与方的贡献值;当判断计算贡献值时,从全部参与方组合中选取一个参与方组合,并计算参与方组合中每一个参与方对应的边际贡献值,根据边际贡献值以及权重,判断利用第一估计方式或者第二估计方式对参与方组合的效用值进行估计;确定 第一估计方式或者第二估计方式对参与方组合的效用值的估计结果,利用估计结果对查找表进行更新,并依次迭代估计得到每一个参与方组合的效用值,获取依据效用值进行更新后得到的最终查找表,以便利用最终查找表对参与方的贡献值进行计算。本公开能够提升联合学习中贡献值的计算精度,降低计算数据量,使贡献值的计算结果更准确,计算效率更高。According to the technical solution provided by the embodiments of the present disclosure, all participant combinations are determined based on the participants in the joint learning, and the weight of each participant combination in all participant combinations is calculated; the first joint model of the joint model before the current aggregation cycle starts A utility value, and the second utility value of the joint model after the end of the current aggregation period, calculate the utility change value based on the first utility value and the second utility value, and establish a lookup table; wherein, the utility change value is used to judge whether to calculate the current The contribution value of each participant in the aggregation period; when judging and calculating the contribution value, select a participant combination from all participant combinations, and calculate the marginal contribution value corresponding to each participant in the participant combination, according to the marginal contribution value and Weight, to judge the utility value of the participant combination by using the first estimation method or the second estimation method; determine the estimation result of the utility value of the participant combination by the first estimation method or the second estimation method, and use the estimation result to look up the table Update, and iteratively estimate the utility value of each participant combination in turn, and obtain the final lookup table obtained after updating according to the utility value, so as to use the final lookup table to calculate the contribution value of the participants. The present disclosure can improve the calculation accuracy of the contribution value in joint learning, reduce the amount of calculation data, and make the calculation result of the contribution value more accurate and the calculation efficiency higher.
下面结合具体的程序流程示意图,对本公开在联合学习中对各参与方的贡献值计算的循环过程进行详细说明,图6是本公开实施例提供的计算参与方贡献值的程序流程示意图。如图6所示,该计算参与方贡献值的程序中具体可以包括以下内容:The cyclic process of calculating the contribution value of each participant in the joint learning of the present disclosure will be described in detail below in combination with a specific schematic diagram of the program flow. FIG. As shown in Figure 6, the program for calculating the contribution value of the participants may specifically include the following:
在一些实施例中,基于联合学习中的参与方确定全部参与方组合,并计算全部参与方组合中每一个参与方组合的权重,包括:确定联合学习中的参与方,将参与方按照数量从少至多的方式依次进行枚举得到多个参与方组合,将多个参与方组合所构成的集合作为全部参与方组合;基于参与方组合中参与方的数量计算参与方组合对应的权重,其中,权重用于表示参与方组合在全部参与方组合中出现的概率。In some embodiments, determining all participant combinations based on the participants in the joint learning, and calculating the weight of each participant combination in all the participant combinations includes: determining the participants in the joint learning, dividing the participants according to the number from Enumerate multiple participant combinations sequentially in the least-most way, and use the set of multiple participant combinations as all participant combinations; calculate the weight corresponding to the participant combination based on the number of participants in the participant combination, where, The weight is used to represent the probability that the participant combination appears in all the participant combinations.
具体地,下面结合一个具体实施例对联合学习的参与方以及构造全部参与方组合的过程进行详细说明,具体可以包括以下内容:Specifically, the following will describe in detail the participants of the joint learning and the process of constructing a combination of all participants in combination with a specific embodiment, which may specifically include the following:
假设有N个参与方1,2,…i…n-1,n的联合学习,训练一共进行了T个周期的聚合,记录训练过程中每个聚合周期t,每个参与方i上传的本地模型M i (t),以及中心聚合后的联合模型M (t),初始化模型M (0),有对模型性能(如准确率、loss等)的评估函数或效用函数V(·),联合模型聚合方法Agg(·),阈值λ,η;其中,λ表示第一截断阈值,η表示第二截断阈值。 Assuming that there are N participants 1, 2, ... i...n-1, n joint learning, the training has been aggregated for T cycles, and each aggregation cycle t in the training process is recorded, and the local data uploaded by each participant i Model M i (t) , and the joint model M (t) after central aggregation, initialize the model M (0) , have an evaluation function or utility function V( ) for model performance (such as accuracy, loss, etc.), and the joint Model aggregation method Agg(·), thresholds λ, η; where λ represents the first truncation threshold, and η represents the second truncation threshold.
进一步地,首先根据联合学习中的所有参与方,按照参与方数量从少到多枚举全部可能的参与方组合Ps=[(1,),(2,),(3,)…,(1,2),(1,3),(2,3),…P,…N];对每个具有0,1,2,…n-1个参与方的子组合S,计算权重w |S|=|S|!(|N|-|S|-1)!/|N|!。 Further, firstly, according to all participants in the joint learning, enumerate all possible participant combinations Ps=[(1,),(2,),(3,)...,(1 ,2),(1,3),(2,3),…P,…N]; for each subcombination S with 0, 1, 2,…n-1 participants, calculate the weight w |S | = |S|! (|N|-|S|-1)! /|N|! .
需要说明的是,每一个参与方组合对应上述的一个子组合S,在对子组合S的权重进行计算时,依据的是每个子组合中参与方的个数,在参与方组合中一个参与方对应一个集合中的元素,即根据参与方组合中的元素个数来计算参与方组合对应的权重,每个子组合对应的权重可以认为是该子组合在整体参与方组合中出现的概率。It should be noted that each participant combination corresponds to a sub-combination S mentioned above. When calculating the weight of the sub-combination S, it is based on the number of participants in each sub-combination. In a participant combination, a participant Corresponding to the elements in a set, that is, the weight corresponding to the participant combination is calculated according to the number of elements in the participant combination. The weight corresponding to each sub-combination can be considered as the probability of the sub-combination appearing in the overall participant combination.
在一些实施例中,确定当前聚合周期开始前的联合模型的第一效用值,以及当前聚合周期结束后的联合模型的第二效用值,基于第一效用值与第二效用值计算效用变化值,并建立查找表,包括:确定当前聚合周期开始前以及结束后,联合模型对应的第一效用值和第二效用值,计算第二效用值与第一效用值之间的差值,将差值作为效用变化值,并建立当前聚合周期对应的包含所有参与方组合的查找表;对查找表执行初始化操作,以使查找表中除空集参与方组合和全集参与方组合之外的其他参与方组合的初始效用值为0;其中,查找表用于存储所有参与方组合对应的效用值。In some embodiments, determine the first utility value of the joint model before the start of the current aggregation period, and the second utility value of the joint model after the end of the current aggregation period, and calculate the utility change value based on the first utility value and the second utility value , and establish a lookup table, including: determine the first utility value and the second utility value corresponding to the joint model before and after the current aggregation period, calculate the difference between the second utility value and the first utility value, and convert the difference value as the utility change value, and establish a lookup table containing all participant combinations corresponding to the current aggregation cycle; perform an initialization operation on the lookup table so that all participants in the lookup table except the empty set participant combination and the full set participant combination The initial utility value of the combination of parties is 0; wherein, the lookup table is used to store the corresponding utility values of all combinations of participants.
具体地,计算每个聚合周期开始时以及结束后,联合模型对应的效用值,并建立查找表,即对于每个聚合周期来说,可以先计算本聚合周期(即当前聚合周期)的最终效用值与本聚合周期的初始效用值,下面结合一个具体实施例,对聚合周期的初始效用值和最终效用值的计算过程进行详细说明,具体可以包括以下内容:Specifically, calculate the utility value corresponding to the joint model at the beginning and after the end of each aggregation period, and establish a lookup table, that is, for each aggregation period, you can first calculate the final utility of this aggregation period (that is, the current aggregation period) value and the initial utility value of this aggregation period, the calculation process of the initial utility value and the final utility value of the aggregation period will be described in detail in combination with a specific embodiment, which may specifically include the following:
对每个聚合周期t,分别计算v N=V(M (t)),v 0=V(M (t-1)),并建立查找表v_lut={():v0,(1,):0,(2,):0,(3,):0…,(1,2):0,(1,3):0,(2,3):0,…N:vN},其中,v N表示当前聚合周期结束后联合模型的最终效用值,v 0表示当前聚合周期对应的上一聚合周期结束后的联合模型的效用值,当然v 0也可以理解为当前聚合周期开始前,当前聚合周期的初始效用值,不同表述方式上的差别不构成对v 0本质含义的限定,且上述两种表述方式是等价的。 For each aggregation period t, calculate v N =V(M (t) ), v 0 =V(M (t-1) ), and establish a lookup table v_lut={():v0,(1,): 0,(2,):0,(3,):0…,(1,2):0,(1,3):0,(2,3):0,…N:vN}, where, v N indicates the final utility value of the joint model after the end of the current aggregation period, and v 0 indicates the utility value of the joint model after the previous aggregation period corresponding to the current aggregation period. Of course, v 0 can also be understood as the current aggregation period before the start of the current aggregation period. For the initial utility value of the period, the difference in different expressions does not constitute a limit to the essential meaning of v 0 , and the above two expressions are equivalent.
进一步地,在对查找表执行初始化操作时,除空集()和全集N对应的参与方组合之外,令全部参与方组合Ps中的其他参与方组合的效用值为0。通过建立v_lut查找表,并利用查找表对参与方组合的效用值进行缓存,从而记录已经计算过的效用值,可以为后续贡献值计算降低计算量,避免重复计算。Further, when performing the initialization operation on the lookup table, except for the participant combinations corresponding to the empty set ( ) and the full set N, let the utility values of other participant combinations in all participant combinations Ps be 0. By establishing a v_lut lookup table and using the lookup table to cache the utility value of the participant combination, so as to record the calculated utility value, it is possible to reduce the amount of calculation for subsequent contribution value calculations and avoid repeated calculations.
在一些实施例中,效用变化值用于判断是否计算当前聚合周期内各个参与方的贡献值,包括:将当前聚合周期对应联合模型的效用变化值与预设的第一截断阈值进行比较,当效用变化值小于第一截断阈值时,则判断当前聚合周期内各个参与方的贡献值为0;否则,对当前聚合周期内各个参与方的贡献值进行重新计算。In some embodiments, the utility change value is used to determine whether to calculate the contribution value of each participant in the current aggregation period, including: comparing the utility change value of the joint model corresponding to the current aggregation period with the preset first cut-off threshold, when When the utility change value is less than the first truncation threshold, it is judged that the contribution value of each participant in the current aggregation period is 0; otherwise, the contribution value of each participant in the current aggregation period is recalculated.
具体地,通过计算本聚合周期的最终效用值与本聚合周期的初始效用值,如果本聚合周期对应的最终效用值与初始效用值之间的差值小于第一截断阈值,则结束计算,并将当前聚合周期内各参与方的贡 献值视为0,即各参与方没有在当前聚合周期内做出贡献。下面结合一个具体实施例,对判断是否对本聚合周期内各参与方的贡献值进行计算的过程进行详细说明,具体可以包括以下内容:Specifically, by calculating the final utility value of this aggregation period and the initial utility value of this aggregation period, if the difference between the final utility value corresponding to this aggregation period and the initial utility value is less than the first cut-off threshold, the calculation ends, and The contribution value of each participant in the current aggregation period is regarded as 0, that is, each participant does not make a contribution in the current aggregation period. The following is a detailed description of the process of judging whether to calculate the contribution value of each participant in this aggregation cycle in combination with a specific embodiment, which may specifically include the following:
在当前聚合周期内,如果判断|v N-v 0|≤λ,那么本聚合周期t内各个参与方i的贡献值
Figure PCTCN2022116570-appb-000004
且返回上一步骤,否则继续执行下一步骤;换言之,通过将当前聚合周期前后产生的聚合模型所对应的最终效用值与初始效用值做差,并将差值与第一截断阈值进行比较,当差值小于第一截断阈值时,则直接将本聚合周期内各参与方的贡献值判断为0。
In the current aggregation period, if it is judged that |v N -v 0 |≤λ, then the contribution value of each participant i in this aggregation period t
Figure PCTCN2022116570-appb-000004
And return to the previous step, otherwise continue to the next step; in other words, by making a difference between the final utility value corresponding to the aggregation model generated before and after the current aggregation cycle and the initial utility value, and comparing the difference with the first cut-off threshold, When the difference is smaller than the first truncation threshold, the contribution value of each participant in this aggregation period is directly judged as 0.
本公开实施例这样做的目的在于,在正式计算每个参与方的贡献值之前,先对本轮联合模型效用值的变化情况做一下评估,根据评估结果可判断在经过本轮聚合训练之后的联合模型的效用值有没有得到提升,即联合模型本身的性能有没有提升,如果模型性能的提升量很少,就可以认为各个参与方在本轮的贡献值都为0;如果本轮发现联合模型的性能提升比较大,那就继续执行下面计算,即具体计算每个参与方在本轮的贡献值是多少。本公开能够提前判断是否需要对参与方的贡献值做进一步计算,还是直接将参与方在本轮的贡献值算作为0,从而避免了无效的计算过程,提升了计算效率。The purpose of this embodiment of the present disclosure is to evaluate the changes in the utility value of the joint model in the current round before formally calculating the contribution value of each participant. Whether the utility value of the joint model has been improved, that is, whether the performance of the joint model itself has been improved. If the improvement in model performance is small, it can be considered that the contribution value of each participant in this round is 0; The performance improvement of the model is relatively large, so continue to perform the following calculations, that is, specifically calculate the contribution value of each participant in this round. This disclosure can judge in advance whether it is necessary to further calculate the contribution value of the participant, or directly count the contribution value of the participant in the current round as 0, thereby avoiding an invalid calculation process and improving calculation efficiency.
在一些实施例中,从全部参与方组合中选取一个参与方组合,并计算参与方组合中每一个参与方对应的边际贡献值,包括:按照全部参与方组合中每个参与方组合的排列顺序,依次从全部参与方组合中选取一个参与方组合,并从参与方组合中随机选取一个参与方;根据参与方从参与方组合中划分出一个子组合,计算参与方加入子组合时产生的边际贡献值,对参与方组合内的参与方依次进行迭代,以便计算得到每一个参与方对应的边际贡献值;其中,子组合为参与方组合中除随机选取的参与方以外的参与方组成的集合。In some embodiments, a participant combination is selected from all participant combinations, and the marginal contribution value corresponding to each participant in the participant combination is calculated, including: according to the arrangement order of each participant combination in all participant combinations , select a participant combination from all participant combinations in turn, and randomly select a participant from the participant combination; divide a sub-combination from the participant combination according to the participant, and calculate the margin generated when the participant joins the sub-combination Contribution value, iterates the participants in the participant combination in order to calculate the marginal contribution value corresponding to each participant; where, the sub-combination is a set of participants in the participant combination except randomly selected participants .
具体地,当判断需要对各个参与方在本轮的贡献值做计算时,从本轮的全部参与方组合Ps中按顺序取出一种参与方组合P,此处的选取顺序与枚举全部可能的参与方组合Ps时的顺序一致,即先取参与方数量少的组合,再递进式选取参与方数量较多的组合。Specifically, when it is judged that the contribution value of each participant in the current round needs to be calculated, a participant combination P is sequentially selected from all participant combinations Ps in the current round, and the selection order and enumeration here are all possible The order of the participant combinations Ps is the same, that is, the combination with a small number of participants is selected first, and then the combination with a large number of participants is selected progressively.
进一步地,在依次选取每一种参与方组合P的过程中,对每个参与方组合P,估计该参与方组合中每个参与方的边际贡献值,即计算每一个参与方加入该参与方组合时所产生的边际贡献值;下面结合一个具体实施例,对参与方组合P中每个参与方的边际贡献值的估计过程进行详细说明,具体可以包括以下内容:Further, in the process of sequentially selecting each participant combination P, for each participant combination P, estimate the marginal contribution value of each participant in the participant combination, that is, calculate the The marginal contribution value generated during the combination; below in conjunction with a specific embodiment, the estimation process of the marginal contribution value of each participant in the participant combination P will be described in detail, which may specifically include the following:
对P中的每一个参与方j,可将P分割为{j}和S=P\{j}两个子集,也即P=S∪{j};计算j加入S产生的边际贡献,在计算边际贡献时,由于实际的边际贡献应当为Δ j_real=v S∪{j}-v S=V(S∪{j})-V(S)=V(P)-V(S);但是,V(P)的值暂时还无法确定,因此采用缩放原理,将V(P)放大成v N,从而将j的边际贡献估计为Δ j_est=v N-v S=v_lut[N]-v_lut[S],并将v S添加至列表VS_hist(对应另外一个缓存表),由于v S已在上一个组合P’中计算过,此处只需从查找表v_lut中获取,无需计算V(M S (t))。 For each participant j in P, P can be divided into two subsets {j} and S=P\{j}, that is, P=S∪{j}; calculate the marginal contribution generated by adding j to S, in When calculating the marginal contribution, since the actual marginal contribution should be Δ j_real =v S∪{j} -v S =V(S∪{j})-V(S)=V(P)-V(S); but , the value of V(P) cannot be determined temporarily, so the scaling principle is used to enlarge V(P) to v N , so that the marginal contribution of j is estimated as Δ j_est =v N -v S =v_lut[N]-v_lut [S], and add v S to the list VS_hist (corresponding to another cache table), since v S has been calculated in the previous combination P', here only needs to be obtained from the lookup table v_lut, no need to calculate V(M S (t) ).
进一步地,利用上述计算方式对参与方组合P中的每一个元素(参与方i)做一次循环,直至参与方组合P中的每一个元素都循环计算一次,最终估计得到每个参与方组合中的每一个参与方对应的边际贡献值。Further, use the above calculation method to perform a cycle for each element in the participant combination P (participant i) until each element in the participant combination P is calculated in a cycle, and finally estimated to obtain The marginal contribution value corresponding to each participant.
在一些实施例中,根据边际贡献值以及权重,判断利用第一估计方式或者第二估计方式对参与方组合的效用值进行估计,包括:计算参与方的边际贡献值与参与方所属参与方组合的权重之间的乘积,并将乘积与预设的第二截断阈值进行比较;当参与方组合中每个参与方对应的乘积均小于或等于第二截断阈值时,则判断利用第一估计方式对参与方组合的效用值进行估计;否则,利用第二估计方式对参与方组合的效用值进行估计。In some embodiments, according to the marginal contribution value and the weight, it is judged to use the first estimation method or the second estimation method to estimate the utility value of the participant combination, including: calculating the marginal contribution value of the participant and the participant combination to which the participant belongs The product between the weights, and compare the product with the preset second truncation threshold; when the product corresponding to each participant in the participant combination is less than or equal to the second truncation threshold, it is judged to use the first estimation method Estimate the utility value of the participant combination; otherwise, use the second estimation method to estimate the utility value of the participant combination.
具体地,根据参与方的边际贡献值与参与方所对应的参与方组合的权重的乘积与第二截断阈值之间的关系,判断是否对参与方组合的效用值进行计算;下面结合具体实施例,对上述乘积的计算以及判断过程进行详细说明,具体可以包括以下内容:Specifically, according to the relationship between the product of the marginal contribution value of the participant and the weight of the participant combination corresponding to the participant and the second cut-off threshold, it is judged whether to calculate the utility value of the participant combination; the following is combined with specific embodiments , to describe the calculation and judgment process of the above product in detail, which may specifically include the following:
计算参与方j的边际贡献值与参与方j所在参与方组合P的权重的乘积|Δ j_est*w |S||,如果参与方组合P中全部参与方j均满足|Δ j_est*w |S||≤η*|vN-v0|,则判断使用子组合的效用值对参与方组合P的效用值进行估计,否则,判断利用预设的模型推演方式计算参与方组合P的效用值。 Calculate the product | Δ j_est *w | S|| || ≤η*|vN-v0|, it is judged to use the utility value of the subcombination to estimate the utility value of the participant combination P, otherwise, it is judged to use the preset model derivation method to calculate the utility value of the participant combination P.
也就是说,如果参与方组合P中的每个参与方对应的边际贡献值都满足上述公式,那此时参与方组合P的效用值就无需再进行推演了,直接利用子组合的效用值来估计参与方组合P的效用值,如果有一 个参与方的边际贡献值不满足,就需要对参与方组合P进行模型推演并计算效用值。That is to say, if the marginal contribution value of each participant in the participant combination P satisfies the above formula, then the utility value of the participant combination P does not need to be deduced at this time, and the utility value of the subcombination can be directly used to determine Estimate the utility value of the participant combination P. If the marginal contribution value of one participant is not satisfied, it is necessary to model the participant combination P and calculate the utility value.
需要说明的是,上述参与方组合P中的每个参与方对应的边际贡献值都满足上述公式时仅仅是一种可选的实施例,除此之外,还可以设置成其他判断标准,比如参与方组合P中的任意一个参与方的边际贡献值不满足上述公式,或者参与方组合P中有一半的参与方不满足上述公式,或者参与方组合P中存在任意比例的参与方不满足上述公式等等。It should be noted that when the marginal contribution value of each participant in the above participant combination P satisfies the above formula, it is only an optional embodiment. In addition, other judgment criteria can also be set, such as The marginal contribution value of any participant in the participant combination P does not satisfy the above formula, or half of the participants in the participant combination P do not satisfy the above formula, or there is any proportion of participants in the participant combination P that does not satisfy the above formula formulas and more.
根据本公开实施例提供的技术方案,为了提前判断是否对参与方组合进行模型推演,通过放大效用值的方式,对参与方组合中的每一个参与方的边际贡献值进行估计,并将估计值与参与方组合的权重相乘,将乘积与第二截断阈值进行比较,从而判断利用子组合的效用值来估计参与方组合的效用值,还是采用模型推演的方式计算参与方组合的效用值;由于模型推演的复杂度很高,计算量较大,因此,通过增加上述判断手段,对于无需做模型推演的参与方组合,可直接利用之前迭代过程中已经计算过的子组合的效用值来估计参与方组合的效用值,从而提升了贡献值的计算速度。According to the technical solution provided by the embodiments of the present disclosure, in order to judge in advance whether to perform model derivation on the participant combination, the marginal contribution value of each participant in the participant combination is estimated by amplifying the utility value, and the estimated value Multiply with the weight of the participant combination, and compare the product with the second cut-off threshold, so as to judge whether to use the utility value of the sub-combination to estimate the utility value of the participant combination, or to calculate the utility value of the participant combination by model deduction; Due to the high complexity of model deduction and the large amount of calculation, by adding the above-mentioned judgment means, for the combination of participants that do not need to do model deduction, the utility value of the sub-combination that has been calculated in the previous iteration process can be directly used to estimate The utility value of the participant combination, thus improving the calculation speed of the contribution value.
在一些实施例中,利用第一估计方式对参与方组合的效用值进行估计,包括:从查找表中获取参与方组合中的子组合对应的效用值,对子组合对应的效用值进行平均值、最大值或者最小值的计算,将计算得到的平均值、最大值或者最小值作为参与方组合的效用值的估计值,并根据估计值对查找表进行更新。In some embodiments, using the first estimation method to estimate the utility value of the participant combination includes: obtaining the utility value corresponding to the sub-combination in the participant combination from a lookup table, and averaging the utility values corresponding to the sub-combination , the calculation of the maximum value or minimum value, using the calculated average value, maximum value or minimum value as the estimated value of the utility value of the combination of participants, and updating the lookup table according to the estimated value.
具体地,第一估计方式为利用参与方组合中的子组合对应的效用值对参与方组合的效用值进行估计,在利用已经计算过的子组合的效用值去估计参与方组合的效用值时,通过计算子组合的效用值之间的平均值、最大值或者最小值的方式,从而对参与方组合的效用值做近似处理,例如,对于参与方组合(1,2,3)来说,可以用v(1,2),v(2,3),v(1,3)的平均值、最大值或者最小值值来估计v(1,2,3)的值,而v(1,2),v(2,3),v(1,3)的值已经存在于v_lut查找表中。Specifically, the first estimation method is to use the utility value corresponding to the sub-combination in the participant combination to estimate the utility value of the participant combination. When using the calculated utility value of the sub-combination to estimate the utility value of the participant combination , by calculating the average, maximum or minimum value among the utility values of the subcombinations, so as to approximate the utility value of the participant combination, for example, for the participant combination (1, 2, 3), The value of v(1,2,3) can be estimated by the average, maximum or minimum value of v(1,2), v(2,3), v(1,3), and v(1, 2), the values of v(2, 3), v(1, 3) already exist in the v_lut lookup table.
进一步地,以计算子组合的效用值之间的平均值为例,对参与方组合的效用值的计算过程进行详细说明,具体可以包括以下公式:Further, taking the calculation of the average value between the utility values of the sub-combinations as an example, the calculation process of the utility value of the participant combination is described in detail, which may specifically include the following formula:
V(P)=mean(VS_hist)V(P)=mean(VS_hist)
其中,V(P)表示参与方组合的效用值,VS_hist表示子组合对应的效用值;根据该平均值计算公式即可得到参与方组合P的效用估计值并更新查找表v_lut[P]=V(P)。Among them, V(P) represents the utility value of the participant combination, and VS_hist represents the utility value corresponding to the sub-combination; according to the average calculation formula, the utility estimate of the participant combination P can be obtained and the lookup table v_lut[P]=V can be updated (P).
进一步地,在上述计算公式中,采用的是求平均值的方式(即公式中的mean)来计算参与方组合P的效用估计值,但是在实际应用中,除了求平均值的方式外,还可以采用计算最大值或者最小值等方式来计算参与方组合P的效用估计值。当采用最大值方法计算时,可直接将上述公式中的mean替换为max,当采用最小值方法计算时,可直接将上述公式中的mean替换为min,因此,上述效用值的计算方式不构成对本申请技术方案的限定。Furthermore, in the above calculation formula, the method of calculating the mean value (i.e. the mean in the formula) is used to calculate the utility estimate of the participant combination P, but in practical applications, in addition to the method of calculating the mean value, there is also The utility estimation value of the participant combination P can be calculated by calculating the maximum value or the minimum value. When the maximum value method is used for calculation, the mean in the above formula can be directly replaced by max; when the minimum value method is used for calculation, the mean in the above formula can be directly replaced by min. Therefore, the calculation method of the above utility value does not constitute Restrictions on the technical solution of this application.
在一些实施例中,利用第二估计方式对参与方组合的效用值进行估计,包括:对参与方组合对应的模型参数进行聚合,并对参与方组合对应的模型进行模型推演,对参与方组合中每个参与方的权重进行聚合,得到参与方组合的权重,对参与方组合在标准验证集上进行模型推演,计算得到参与方组合的真实效用值,利用真实效用值对查找表进行更新。In some embodiments, using the second estimation method to estimate the utility value of the participant combination includes: aggregating the model parameters corresponding to the participant combination, and performing model deduction on the model corresponding to the participant combination, and calculating the participant combination The weight of each participant is aggregated to obtain the weight of the participant combination, and the model deduction is carried out on the standard verification set for the participant combination, and the real utility value of the participant combination is calculated, and the lookup table is updated using the real utility value.
具体地,第二估计方式为利用预设的模型推演方式计算参与方组合的效用值,模型推演采用公式V(P)=V(M P (t))=V(Agg(P)),根据该计算公式得到参与方组合P的真实效用值并更新查找表v_lut[P]=V(P)。 Specifically, the second estimation method is to use the preset model derivation method to calculate the utility value of the participant combination, and the model deduction adopts the formula V(P)=V(M P (t) )=V(Agg(P)), according to The calculation formula obtains the real utility value of the participant combination P and updates the lookup table v_lut[P]=V(P).
在一些实施例中,获取依据效用值进行更新后得到的最终查找表,以便利用最终查找表对参与方的贡献值进行计算,包括:获取最终查找表中参与方组合的效用值,利用预设的沙普利值公式,分别计算每个参与方对应的贡献值,其中,贡献值用于表示参与方在联合学习中对聚合周期训练的联合模型的贡献值。In some embodiments, obtaining the final lookup table obtained after updating according to the utility value, so as to use the final lookup table to calculate the contribution value of the participant, includes: obtaining the utility value of the participant combination in the final lookup table, using the preset The Shapley value formula is used to calculate the contribution value corresponding to each participant, where the contribution value is used to represent the contribution value of the participant to the joint model trained in the aggregation cycle in the joint learning.
具体地,根据以上实施例中参与方组合P的效用值的计算过程,将整个参与方组合Ps都循环一遍,从而得到最终更新后的v_lut查找表,将查找表中的参与方组合对应的效用值依次代入到预设的沙普利值计算公式中去,计算每一个参与方对应的贡献值,即可得到每个贡献方在当前聚合周期内的贡献值。Specifically, according to the calculation process of the utility value of the participant combination P in the above embodiment, the entire participant combination Ps is cycled once to obtain the final updated v_lut lookup table, and the corresponding utility of the participant combination in the lookup table is obtained. Values are substituted into the preset Shapley value calculation formula in turn to calculate the contribution value corresponding to each participant, and then the contribution value of each contributor in the current aggregation period can be obtained.
进一步地,Shapley Value是根据个体i加入组合S产生的边际贡献的平均值,公平的进行利益分配的方法,其计算复杂度是O(2 n),n为个体总数。其计算公式为: Furthermore, Shapley Value is a method for fairly distributing benefits based on the average marginal contribution of individual i joining combination S, and its computational complexity is O(2 n ), where n is the total number of individuals. Its calculation formula is:
Figure PCTCN2022116570-appb-000005
Figure PCTCN2022116570-appb-000005
Shapley值(即沙普利值)考虑个体i加入子组合的全部可能的顺序,其中N表示全组合,S表示某个排列情况下的子组合,V(·)表示效用函数 |·|符号表示求集合中元素的数量,[V(S∪{i})–V(S)]表示i加入子组合S后的边际效用,权重w |S|=|S|!(|N|-|S|-1)!/|N|!表示该组合出现的概率。 The Shapley value (that is, the Shapley value) considers all possible orders in which individual i joins the sub-combination, where N represents the full combination, S represents the sub-combination in a certain arrangement, V(·) represents the utility function , |·| symbol Indicates the number of elements in the set, [V(S∪{i})–V(S)] indicates the marginal utility of i added to the sub-combination S, and the weight w |S| = |S|! (|N|-|S|-1)! /|N|! Indicates the probability of the combination occurring.
进一步地,重复以上步骤,获得每个参与方i在全部T个聚合周期的贡献值,累加得到参与方i对联合模型的贡献值;即将所有聚合周期按照上面的方式计算一遍,得到每一个参与方在每一个聚合周期对应的贡献值,然后进行累加得到总的贡献值。Further, repeat the above steps to obtain the contribution value of each participant i in all T aggregation periods, and accumulate the contribution value of participant i to the joint model; that is, calculate all the aggregation periods according to the above method, and obtain each participant i Party’s corresponding contribution value in each aggregation cycle, and then accumulate to get the total contribution value.
进一步地,采用以下方式对第一截断阈值λ进行设置:设最终的联合模型效用函数相对于初始模型的边际增益为Δ U=|V(M (T))-V(M (0))|,其中T为总通讯轮次,可设置λ=Δ U*0.01。第二截断阈值η可用于表示贡献值的误差水平,可将其设置为η=1e-3~1e-5 Further, the first truncation threshold λ is set in the following manner: Let the marginal gain of the final joint model utility function relative to the initial model be Δ U =|V(M (T) )-V(M (0) )| , where T is the total communication round, which can be set to λ=Δ U *0.01. The second truncation threshold η can be used to represent the error level of the contribution value, which can be set as η=1e-3˜1e-5 .
图7是本公开实施例提供的另一种联合学习中确定参与方贡献度的装置的结构示意图。如图7所示,该联合学习中确定参与方贡献度的装置包括:Fig. 7 is a schematic structural diagram of another apparatus for determining a participant's contribution in joint learning provided by an embodiment of the present disclosure. As shown in Figure 7, the means for determining the contribution of participants in this joint learning include:
确定模块701,被配置为基于联合学习中的参与方确定全部参与方组合,并计算全部参与方组合中每一个参与方组合的权重;The determining module 701 is configured to determine all participant combinations based on the participants in the joint learning, and calculate the weight of each participant combination in all participant combinations;
建立模块702,被配置为确定当前聚合周期开始前的联合模型的第一效用值,以及当前聚合周期结束后的联合模型的第二效用值,基于第一效用值与第二效用值计算效用变化值,并建立查找表;其中,效用变化值用于判断是否计算当前聚合周期内各个参与方的贡献值;The establishment module 702 is configured to determine a first utility value of the joint model before the start of the current aggregation period, and a second utility value of the joint model after the end of the current aggregation period, and calculate a utility change based on the first utility value and the second utility value value, and establish a lookup table; among them, the utility change value is used to judge whether to calculate the contribution value of each participant in the current aggregation period;
判断模块703,被配置为当判断计算贡献值时,从全部参与方组合中选取一个参与方组合,并计算参与方组合中每一个参与方对应的边际贡献值,根据边际贡献值以及权重,判断利用第一估计方式或者第二估计方式对参与方组合的效用值进行估计;The judging module 703 is configured to select a participant combination from all participant combinations when judging and calculating the contribution value, and calculate the marginal contribution value corresponding to each participant in the participant combination, and judge according to the marginal contribution value and weight Estimate the utility value of the participant combination by using the first estimation method or the second estimation method;
计算模块704,被配置为确定第一估计方式或者第二估计方式对参与方组合的效用值的估计结果,利用估计结果对查找表进行更新,并依次迭代估计得到每一个参与方组合的效用值,获取依据效用值进行更新后得到的最终查找表,以便利用最终查找表对参与方的贡献值进行计算。The calculation module 704 is configured to determine the estimation result of the utility value of the participant combination by the first estimation method or the second estimation method, use the estimation result to update the lookup table, and iteratively estimate to obtain the utility value of each participant combination , to obtain the final lookup table obtained after updating according to the utility value, so as to use the final lookup table to calculate the contribution value of the participant.
在一些实施例中,图7的确定模块701确定联合学习中的参与方,将参与方按照数量从少至多的方式依次进行枚举得到多个参与方组合,将多个参与方组合所构成的集合作为全部参与方组合;基于参与方组合中参与方的数量计算参与方组合对应的权重,其中,权重用于表示参与方组合在全部参与方组合中出现的概率。In some embodiments, the determination module 701 in FIG. 7 determines the participants in the joint learning, and enumerates the participants in order from the least to the largest to obtain a combination of multiple participants. The combination of multiple participants constitutes The set is used as a combination of all participants; the weight corresponding to the combination of participants is calculated based on the number of participants in the combination of participants, where the weight is used to represent the probability that the combination of participants appears in all combinations of participants.
在一些实施例中,图7的建立模块702确定当前聚合周期开始前以及结束后,联合模型对应的第一效用值和第二效用值,计算第二效用值与第一效用值之间的差值,将差值作为效用变化值,并建立当前聚合周期对应的包含所有参与方组合的查找表;对查找表执行初始化操作,以使查找表中除空集参与方组合和全集参与方组合之外的其他参与方组合的初始效用值为0;其中,查找表用于存储所有参与方组合对应的效用值。In some embodiments, the establishment module 702 in FIG. 7 determines the first utility value and the second utility value corresponding to the joint model before and after the current aggregation period, and calculates the difference between the second utility value and the first utility value Value, use the difference as the utility change value, and establish a lookup table containing all participant combinations corresponding to the current aggregation cycle; perform an initialization operation on the lookup table, so that the lookup table excludes the empty set participant combination and the full set participant combination The initial utility value of other participant combinations other than 0; wherein, the lookup table is used to store the utility values corresponding to all participant combinations.
在一些实施例中,图7的建立模块702将当前聚合周期对应联合模型的效用变化值与预设的第一截断阈值进行比较,当效用变化值小于第一截断阈值时,则判断当前聚合周期内各个参与方的贡献值为0;否则,对当前聚合周期内各个参与方的贡献值进行重新计算。In some embodiments, the establishment module 702 in FIG. 7 compares the utility change value of the joint model corresponding to the current aggregation period with the preset first cut-off threshold, and when the utility change value is less than the first cut-off threshold, then judge the current aggregation period The contribution value of each participant in the period is 0; otherwise, recalculate the contribution value of each participant in the current aggregation period.
在一些实施例中,图7的判断模块703按照全部参与方组合中每个参与方组合的排列顺序,依次从全部参与方组合中选取一个参与方组合,并从参与方组合中随机选取一个参与方;根据参与方从参与方组合中划分出一个子组合,计算参与方加入子组合时产生的边际贡献值,对参与方组合内的参与方依次进行迭代,以便计算得到每一个参与方对应的边际贡献值;其中,子组合为参与方组合中除随机选取的参与方以外的参与方组成的集合。In some embodiments, the judging module 703 in FIG. 7 sequentially selects a participant combination from all participant combinations according to the arrangement order of each participant combination in all participant combinations, and randomly selects a participant combination from the participant combination. According to the participant's division of a sub-combination from the participant combination, the marginal contribution value generated when the participant joins the sub-combination is calculated, and the participants in the participant combination are iterated in order to calculate the corresponding marginal contribution value; where, the sub-combination is a set of participants in the participant combination except randomly selected participants.
在一些实施例中,图7的判断模块703计算参与方的边际贡献值与参与方所属参与方组合的权重之间的乘积,并将乘积与预设的第二截断阈值进行比较;当参与方组合中每个参与方对应的乘积均小于或等于第二截断阈值时,则判断利用第一估计方式对参与方组合的效用值进行估计;否则,利用第二估计方式对参与方组合的效用值进行估计。In some embodiments, the judging module 703 in FIG. 7 calculates the product of the marginal contribution value of the participant and the weight of the participant group to which the participant belongs, and compares the product with the preset second cut-off threshold; when the participant When the product corresponding to each participant in the combination is less than or equal to the second cut-off threshold, it is judged to use the first estimation method to estimate the utility value of the participant combination; otherwise, use the second estimation method to estimate the utility value of the participant combination Make an estimate.
在一些实施例中,图7的判断模块703从查找表中获取参与方组合中的子组合对应的效用值,对子组合对应的效用值进行平均值、最大值或者最小值的计算,将计算得到的平均值、最大值或者最小值作为参与方组合的效用值的估计值,并根据估计值对查找表进行更新。In some embodiments, the judging module 703 in FIG. 7 obtains the utility value corresponding to the sub-combination in the participant combination from the lookup table, calculates the average value, maximum value or minimum value of the utility value corresponding to the sub-combination, and calculates The obtained average value, maximum value or minimum value is used as an estimated value of the utility value of the participant combination, and the lookup table is updated according to the estimated value.
在一些实施例中,图7的判断模块703对参与方组合对应的模型参数进行聚合,并对参与方组合对 应的模型进行模型推演,对参与方组合中每个参与方的权重进行聚合,得到参与方组合的权重,对参与方组合在标准验证集上进行模型推演,计算得到参与方组合的真实效用值,利用真实效用值对查找表进行更新。In some embodiments, the judging module 703 in FIG. 7 aggregates the model parameters corresponding to the participant combination, performs model deduction on the model corresponding to the participant combination, and aggregates the weight of each participant in the participant combination to obtain The weight of the participant combination, the model deduction of the participant combination on the standard verification set is calculated to obtain the real utility value of the participant combination, and the lookup table is updated using the real utility value.
在一些实施例中,图7的计算模块704获取最终查找表中参与方组合的效用值,利用预设的沙普利值公式,分别计算每个参与方对应的贡献值,其中,贡献值用于表示参与方在联合学习中对聚合周期训练的联合模型的贡献值。In some embodiments, the calculation module 704 in FIG. 7 obtains the utility value of the combination of participants in the final lookup table, and uses the preset Shapley value formula to calculate the contribution value corresponding to each participant, wherein the contribution value is used Yu represents the contribution value of the participant to the joint model trained in the aggregation cycle in the joint learning.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本公开实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.
图8是本公开实施例提供的又一种确定联合学习中参与方贡献度的方法的流程示意图。图8的联合学习中确定参与方贡献度的方法可以由联合学习的服务器执行。如图8所示,该确定联合学习中参与方贡献度的方法具体可以包括:Fig. 8 is a schematic flowchart of another method for determining the contribution degree of a participant in joint learning provided by an embodiment of the present disclosure. The method for determining the contribution degree of a participant in the joint learning of FIG. 8 may be executed by a server of the joint learning. As shown in Figure 8, the method for determining the contribution of the participants in the joint learning may specifically include:
S801,基于联合学习的架构,生成多个参与方组,并确定由多个参与方组构成的参与方组集合,计算参与方组的权重,其中每个参与方组包含至少两个参与方;S801. Based on the framework of joint learning, generate multiple participant groups, determine a participant group set composed of multiple participant groups, and calculate the weights of the participant groups, wherein each participant group includes at least two participants;
S802,确定联合学习中的聚合周期,获取聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据效用变化值判断是否计算聚合周期内各个参与方的贡献值;S802. Determine the aggregation period in the joint learning, obtain the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of each participant in the aggregation period according to the utility change value;
S803,当判断结果为是时,利用参与方组集合中的参与方组随机生成一个全排列组合,并根据全排列组合中参与方组中的参与方顺序生成多个子组合,计算参与方加入子组合时的边际贡献值的估计值,根据边际贡献值的估计值以及参与方组的权重,判断是否采用插值函数对参与方加入子组合后形成的新参与方组的效用值进行计算;S803, when the judgment result is yes, use the participant groups in the participant group set to randomly generate a full permutation combination, and generate a plurality of subcombinations according to the order of the participants in the participant group in the full permutation combination, and calculate the participant joining subcombination The estimated value of the marginal contribution value at the time of combination, according to the estimated value of the marginal contribution value and the weight of the participant group, judge whether to use an interpolation function to calculate the utility value of the new participant group formed after the participant joins the sub-combination;
S804,当判断结果为是时,利用插值函数计算新参与方组的效用值,当判断结果为否时,利用预设的模型推演方式计算新参与方组的效用值,并依据计算出的新参与方组的效用值对查找表进行更新;S804, when the judgment result is yes, use the interpolation function to calculate the utility value of the new participant group; when the judgment result is no, use the preset model deduction method to calculate the utility value of the new participant group, and calculate The utility value of the participant group updates the lookup table;
S805,基于更新后的查找表,计算参与方的边际贡献值,并判断参与方的边际贡献值是否收敛,当判断结果为是时,将收敛后的边际贡献值作为参与方的贡献值,当判断结果为否时,生成一个新的全排列组合,直至计算得到所有收敛后的参与方的贡献值,根据贡献值确定参与方在联合学习中的贡献度。S805, based on the updated lookup table, calculate the marginal contribution value of the participant, and judge whether the marginal contribution value of the participant is converged, and when the judgment result is yes, use the converged marginal contribution value as the contribution value of the participant, when When the judgment result is no, a new full permutation combination is generated until the contribution values of all converged participants are calculated, and the contribution of the participants in the joint learning is determined according to the contribution values.
根据本公开实施例提供的技术方案,通过基于联合学习的架构,生成多个参与方组,并确定由多个参与方组构成的参与方组集合,计算参与方组的权重,其中每个参与方组包含至少两个参与方;确定联合学习中的聚合周期,获取聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据效用变化值判断是否计算聚合周期内各个参与方的贡献值;当判断结果为是时,利用参与方组集合中的参与方组随机生成一个全排列组合,并根据全排列组合中参与方组中的参与方顺序生成多个子组合,计算参与方加入子组合时的边际贡献值的估计值,根据边际贡献值的估计值以及参与方组的权重,判断是否采用插值函数对参与方加入子组合后形成的新参与方组的效用值进行计算;当判断结果为是时,利用插值函数计算新参与方组的效用值,当判断结果为否时,利用预设的模型推演方式计算新参与方组的效用值,并依据计算出的新参与方组的效用值对查找表进行更新;基于更新后的查找表,计算参与方的边际贡献值,并判断参与方的边际贡献值是否收敛,当判断结果为是时,将收敛后的边际贡献值作为参与方的贡献值,当判断结果为否时,生成一个新的全排列组合,直至计算得到所有收敛后的参与方的贡献值,根据贡献值确定参与方在联合学习中的贡献度。本公开能够提升联合学习中贡献值的计算精度,降低计算数据量,使贡献值的计算结果更准确,计算效率更高。According to the technical solution provided by the embodiments of the present disclosure, multiple participant groups are generated through a framework based on joint learning, and a set of participant groups composed of multiple participant groups is determined to calculate the weights of the participant groups, where each participant The square group contains at least two participants; determine the aggregation period in the joint learning, obtain the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of each participant in the aggregation period according to the utility change value ; When the judgment result is yes, use the participant groups in the participant group set to randomly generate a full permutation combination, and generate multiple subcombinations according to the order of the participants in the participant group in the full permutation combination, and calculate the participants to join the subcombination According to the estimated value of the marginal contribution value and the weight of the participant group, it is judged whether to use the interpolation function to calculate the utility value of the new participant group formed after the participant joins the sub-combination; when the judgment result When it is yes, use the interpolation function to calculate the utility value of the new participant group; when the judgment result is no, use the preset model deduction method to calculate the utility value of the new participant group, and based on the calculated utility of the new participant group value to update the lookup table; based on the updated lookup table, calculate the marginal contribution value of the participant, and judge whether the marginal contribution value of the participant is converged, and when the judgment result is yes, use the converged marginal contribution value as the participant When the judgment result is no, a new full permutation combination is generated until the contribution values of all converged participants are calculated, and the contribution of the participants in the joint learning is determined according to the contribution values. The present disclosure can improve the calculation accuracy of the contribution value in joint learning, reduce the amount of calculation data, and make the calculation result of the contribution value more accurate and the calculation efficiency higher.
下面结合具体的程序流程示意图,对本公开在联合学习中对各参与方的贡献值计算的循环过程进行详细说明,图9是本公开实施例提供的计算参与方贡献值的程序流程示意图。如图9所示,该计算参与方贡献值的程序中具体可以包括以下内容:The cyclic process of calculating the contribution value of each participant in the joint learning of the present disclosure will be described in detail below in combination with a specific schematic diagram of the program flow. FIG. As shown in Figure 9, the program for calculating the contribution value of the participants may specifically include the following:
在一些实施例中,根据全排列组合中参与方组中参与方顺序生成多个子组合,计算参与方加入子组合时的边际贡献值的估计值,包括:按照参与方顺序将全排列组合划分成多个子组合,并确定全排列组合中的子组合的最后一个参与方所对应的下一个参与方,计算下一个参与方加入子组合时的边际贡献值的估计值。In some embodiments, generating a plurality of subcombinations according to the order of the participants in the participant group in the full permutation combination, and calculating the estimated value of the contribution margin when the participant joins the subcombination includes: dividing the full permutation combination into Multiple sub-combinations, and determine the next participant corresponding to the last participant of the sub-combination in the full permutation combination, and calculate the estimated value of the marginal contribution value of the next participant when joining the sub-combination.
具体地,当判断需要对各参与方在本轮的贡献值做计算时,首先从本轮聚合周期的参与方组集合Ps中随机生成一个全排列组合P,并令k=0,例如:假设一个参与方组集合Ps中包含元素1、2、3、4、5,这5个元素分别对应5个参与方,根据这5个参与方可以生成以下全排列组合:(1、2、3、4、5)、(2、3、4、5、1)、(3、4、5、1、2)、(4、5、1、2、3)、(5、4、3、2、1)……。在随机生成一个全排列组合之后,再将该全排列组合中的参与方划分成多个子组合。Specifically, when it is judged that it is necessary to calculate the contribution value of each participant in the current round, first randomly generate a full permutation combination P from the participant group set Ps in the current round of aggregation period, and set k=0, for example: suppose A participant group set Ps contains elements 1, 2, 3, 4, and 5. These 5 elements correspond to 5 participants respectively. According to these 5 participants, the following full permutations and combinations can be generated: (1, 2, 3, 4, 5), (2, 3, 4, 5, 1), (3, 4, 5, 1, 2), (4, 5, 1, 2, 3), (5, 4, 3, 2, 1)……. After randomly generating a full permutation combination, the participants in the full permutation combination are divided into multiple sub-combinations.
进一步地,在根据全排列组合计算参与方的边际贡献值时,可以采用以下方式:Further, when calculating the marginal contribution value of a participant based on the full permutation combination, the following methods can be used:
从全排列组合P中依次取出前j个参与方构成子组合S,计算第j+1个参与方加入子组合S时产生的边际贡献的一个估计值,例如:全排列组合为(5、4、3、2、1),那么可以先取出前1个参与方(即 元素5),形成子组合(5),并计算第2个参与方(即元素4)加入子组合(5)时产生的边际贡献的估计值。在实际应用中,可以采用以下公式对边际贡献进行估计,即Δ j+1_est=v N-v S=v_lut[N]-v_lut[S],由于v S已在上一个组合S’中计算过,此处只需从查找表v_lut中获取,无需计算V(M S (t))。 The first j participants are sequentially taken from the full permutation combination P to form a subcombination S, and an estimated value of the marginal contribution generated when the j+1th participant joins the subcombination S is calculated. For example, the full permutation combination is (5, 4 . An estimate of the contribution margin. In practical applications, the following formula can be used to estimate the marginal contribution, that is, Δ j+1_est =v N -v S =v_lut[N]-v_lut[S], since v S has been calculated in the previous combination S' , here only needs to be obtained from the lookup table v_lut, no need to calculate V(M S (t) ).
进一步地,利用上述计算方式对当前全排列组合中,所有形成的子组合S,以及第j+1个参与方加入子组合S时产生的边际贡献值做一次循环,直至对当前全排列组合中的每一种子组合的情形计算一次,最终估计得到参与方在加入子组合时的边际贡献值。Further, use the above calculation method to perform a loop on all the sub-combinations S formed in the current full permutation combination, and the marginal contribution value generated when the j+1th participant joins the sub-combination S, until the current full permutation combination The situation of each sub-combination is calculated once, and finally the marginal contribution value of the participant when joining the sub-combination is estimated.
在一些实施例中,根据边际贡献值的估计值以及参与方组的权重,判断是否采用插值函数对参与方加入子组合后形成的新参与方组的效用值进行计算,包括:计算边际贡献值的估计值与参与方组的权重的乘积,并将乘积与预设的第二截断阈值进行比较;当乘积均小于或等于第二截断阈值时,则判断采用插值函数计算新参与方组的效用值;否则,利用预设的模型推演方式计算新参与方组的效用值。In some embodiments, according to the estimated value of the marginal contribution value and the weight of the participant group, it is judged whether to use an interpolation function to calculate the utility value of the new participant group formed after the participant joins the sub-combination, including: calculating the marginal contribution value The product of the estimated value and the weight of the participant group, and compare the product with the preset second cut-off threshold; when the products are all less than or equal to the second cut-off threshold, it is judged to use the interpolation function to calculate the utility of the new participant group value; otherwise, use the preset model derivation method to calculate the utility value of the new participant group.
具体地,根据边际贡献值的估计值与参与方组的权重的乘积与第二截断阈值之间的关系,判断是否对新参与方组的效用值进行计算;下面结合具体实施例,对上述乘积的计算以及判断过程进行详细说明,具体可以包括以下内容:Specifically, according to the relationship between the product of the estimated value of the marginal contribution value and the weight of the participant group and the second cut-off threshold, it is judged whether to calculate the utility value of the new participant group; The calculation and judgment process will be described in detail, which may include the following:
计算第j+1个参与方加入子组合S时产生的边际贡献值与子组合S对应的权重的乘积|Δ j+1_est*w |S||,如果该乘积满足|Δ j+1_est* w |S||≤η*|vN-v0|,则判断使用插值函数对新参与方组的效用值进行计算,否则,判断利用预设的模型推演方式计算新参与方组的效用值。 Calculate the product |Δ j+1_est *w |S| | of the marginal contribution value generated when the j+1th participant joins the sub-combination S and the weight corresponding to the sub-combination S, if the product satisfies |Δ j+1_est * w |S| |≤η*|vN-v0|, then judge to use the interpolation function to calculate the utility value of the new participant group, otherwise, judge to use the preset model derivation method to calculate the utility value of the new participant group.
也就是说,如果第j+1个参与方加入子组合S时产生的边际贡献值满足上述公式,那此时第j+1个参与方加入子组合S后的新参与方组对应的效用值就无需再进行推演了,直接采用插值函数计算新参与方组的效用值,如果不满足上述公式,就需要对新参与方组进行模型推演并计算效用值。That is to say, if the marginal contribution value generated when the j+1th participant joins the subgroup S satisfies the above formula, then the utility value corresponding to the new participant group after the j+1th participant joins the subgroup S There is no need to perform deduction, and the interpolation function is directly used to calculate the utility value of the new participant group. If the above formula is not satisfied, it is necessary to perform model deduction for the new participant group and calculate the utility value.
根据本公开实施例提供的技术方案,为了提前判断是否对新参与方组进行模型推演,通过放大效用值的方式,对第j+1个参与方加入子组合S时产生的边际贡献值进行估计,并将估计值与参与方组的权重相乘,将乘积与第二截断阈值进行比较,从而判断采用插值函数的方式计算新参与方组的效用值,还是采用模型推演的方式计算新参与方组的效用值;由于模型推演的复杂度很高,计算量较大,因此,通过增加上述判断手段,对于无需做模型推演的新参与方组,可直接利用之前迭代过程中计算的子组合的效用值进行加权求和得到,从而提升了贡献值的计算速度。According to the technical solution provided by the embodiments of the present disclosure, in order to judge in advance whether to perform model deduction on the new participant group, the marginal contribution value generated when the j+1th participant joins the subgroup S is estimated by amplifying the utility value , and multiply the estimated value with the weight of the participant group, and compare the product with the second cut-off threshold, so as to determine whether to use the interpolation function to calculate the utility value of the new participant group or to use model deduction to calculate the utility value of the new participant group The utility value of the group; due to the high complexity of model deduction and the large amount of calculation, by adding the above-mentioned judgment means, for the new participant group that does not need to do model deduction, the sub-combination calculated in the previous iteration process can be directly used. The utility value is obtained by weighted summation, which improves the calculation speed of the contribution value.
在一些实施例中,利用插值函数计算新参与方组的效用值,包括:基于历史迭代过程中计算的子组合的效用值、以及参与方组为全集参与方组时对应的效用值,利用预设的插值函数对新参与方组的效用值进行计算,并根据计算结果对查找表进行更新。In some embodiments, using an interpolation function to calculate the utility value of the new participant group includes: based on the utility value of the sub-combination calculated in the historical iteration process, and the corresponding utility value when the participant group is a full set of participant groups, using a preset The set interpolation function calculates the utility value of the new participant group, and updates the lookup table according to the calculation result.
具体地,插值函数计算效用值的原理是,用已经计算过的子组合的效用值去估计新参与方组的效用值,插值函数的计算公式为V(S∪{j+1})=interpolate(v S,v N,S,N),根据该计算公式得到新参与方组的效用估计值,即得到新参与方组S∪{j+1}对应的效用估计值,并更新查找表v_lut[S∪{j+1}]=V(S∪{j+1})。其中,插值函数interpolate(·)的实现方法为: Specifically, the principle of calculating the utility value of the interpolation function is to estimate the utility value of the new participant group with the utility value of the subcombination that has been calculated. The calculation formula of the interpolation function is V(S∪{j+1})=interpolate (v S ,v N ,S,N), according to the calculation formula, get the utility estimate of the new participant group, that is, get the utility estimate corresponding to the new participant group S∪{j+1}, and update the lookup table v_lut [S∪{j+1}]=V(S∪{j+1}). Among them, the implementation method of the interpolation function interpolate( ) is:
Figure PCTCN2022116570-appb-000006
Figure PCTCN2022116570-appb-000006
上述插值函数的计算公式中,将v S,v N,子组合S和全组合N作为函数的输入,计算并输出。 In the calculation formula of the above-mentioned interpolation function, v S , v N , the sub-combination S and the full combination N are used as the input of the function, and are calculated and output.
在一些实施例中,利用预设的模型推演方式计算新参与方组的效用值,并依据计算出的新参与方组的效用值对查找表进行更新,包括:对新参与方组的模型参数进行聚合,并对新参与方组的模型进行模型推演,对新参与方组中的每一个参与方的权重进行聚合,得到新参与方组的权重,对新参与方组的模型在标准验证集上进行模型推演,计算得到新参与方组的真实效用值,利用真实效用值对查找表进行更新。In some embodiments, the utility value of the new participant group is calculated using a preset model derivation method, and the lookup table is updated according to the calculated utility value of the new participant group, including: model parameters of the new participant group Carry out aggregation, and carry out model deduction on the model of the new participant group, aggregate the weight of each participant in the new participant group, and obtain the weight of the new participant group, and the model of the new participant group in the standard verification set Carry out model deduction on the above, calculate the real utility value of the new participant group, and use the real utility value to update the lookup table.
具体地,模型推演采用公式V(S∪{j+1})=V(M S∪{j+1}( t))=V(Agg(S∪{j+1})),根据该计算公式得到新参与方组的真实效用值并更新查找表v_lut[S∪{j+1}]=V(S∪{j+1})。 Specifically, the model deduction uses the formula V(S∪{j+1})=V(M S∪{j+1} ( t ))=V(Agg(S∪{j+1})), according to the calculation The formula obtains the real utility value of the new participant group and updates the lookup table v_lut[S∪{j+1}]=V(S∪{j+1}).
在一些实施例中,基于更新后的查找表,计算参与方的边际贡献值,并判断参与方的边际贡献值是否收敛,当判断结果为是时,将收敛后的边际贡献值作为参与方的贡献值,包括:根据更新后的查找表中参与方加入子组合后的效用值,利用预设的沙普利值计算公式,计算参与方的边际贡献值;并根据参 与方的边际贡献值是否收敛,当判断结果为收敛时,将收敛后的边际贡献值作为参与方的贡献值;其中,贡献值用于表示参与方在联合学习中对聚合周期训练的联合学习模型的贡献度。In some embodiments, based on the updated lookup table, calculate the marginal contribution value of the participant, and judge whether the marginal contribution value of the participant is converged, and when the judgment result is yes, use the converged marginal contribution value as the participant's Contribution value, including: according to the utility value of the participant in the updated lookup table after joining the sub-combination, using the preset Shapley value calculation formula to calculate the marginal contribution value of the participant; and according to whether the marginal contribution value of the participant Convergence, when the judgment result is convergence, the marginal contribution value after convergence is used as the contribution value of the participant; where the contribution value is used to indicate the contribution of the participant to the joint learning model trained in the aggregation cycle in the joint learning.
具体地,根据更新后的v_lut查找表,计算参与方i的边际贡献值
Figure PCTCN2022116570-appb-000007
如果
Figure PCTCN2022116570-appb-000008
则表示当前全排列组合中的参与方i的边际贡献值已经收敛,此时,直接将
Figure PCTCN2022116570-appb-000009
作为第t个聚合周期各个参与方i的贡献值
Figure PCTCN2022116570-appb-000010
否则,使k=k+1,并重新生成一个新的全排列组合P,重复以上实施例的步骤,计算全排列组合P中各个参与方的贡献值。
Specifically, according to the updated v_lut lookup table, calculate the marginal contribution value of participant i
Figure PCTCN2022116570-appb-000007
if
Figure PCTCN2022116570-appb-000008
It means that the marginal contribution value of participant i in the current full permutation combination has converged. At this time, directly set
Figure PCTCN2022116570-appb-000009
As the contribution value of each participant i in the t-th aggregation cycle
Figure PCTCN2022116570-appb-000010
Otherwise, let k=k+1, and regenerate a new full permutation combination P, repeat the steps of the above embodiment, and calculate the contribution value of each participant in the full permutation combination P.
这里,对于阈值θ的设置,θ可表示蒙特卡洛方法是否收敛的判断条件,在实际应用中,可以设置θ=1e-3~1e-5 Here, for the setting of the threshold θ, θ can represent the condition for judging whether the Monte Carlo method converges, and in practical applications, θ=1e-3~1e-5 can be set .
基于以上实施例中全排列组合P中各个参与方的贡献值的计算过程,将所有的全排列组合都循环一遍,得到每一个参与方i在全部T个聚合周期的贡献值,累加得到参与方i对联合模型的贡献值
Figure PCTCN2022116570-appb-000011
Based on the calculation process of the contribution value of each participant in the full permutation combination P in the above embodiment, all the full permutation combinations are cycled once to obtain the contribution value of each participant i in all T aggregation periods, and the accumulation is obtained by the participant Contribution value of i to the joint model
Figure PCTCN2022116570-appb-000011
进一步地,Shapley Value是根据个体i加入组合S产生的边际贡献的平均值,公平的进行利益分配的方法,其计算复杂度是O( 2n),n为个体总数。其计算公式为: Furthermore, Shapley Value is a method for fairly distributing benefits based on the average marginal contribution of individual i joining combination S, and its computational complexity is O( 2n ), where n is the total number of individuals. Its calculation formula is:
Figure PCTCN2022116570-appb-000012
Figure PCTCN2022116570-appb-000012
Shapley值(即沙普利值)考虑个体i加入子组合的全部可能的顺序,其中N表示全组合,S表示某个排列情况下的子组合,V(·)表示效用函数,|·|符号表示求集合中元素的数量,[V(S∪{i})–V(S)]表示i加入子组合S后的边际效用,权重w |S|=|S|!(|N|-|S|-1)!/|N|!表示该组合出现的概率。 The Shapley value (that is, the Shapley value) considers all possible orders in which individual i joins the sub-combination, where N represents the full combination, S represents the sub-combination in a certain arrangement, V(·) represents the utility function, and the |·| symbol Indicates the number of elements in the set, [V(S∪{i})–V(S)] indicates the marginal utility of i added to the sub-combination S, and the weight w |S| = |S|! (|N|-|S|-1)! /|N|! Indicates the probability of the combination occurring.
进一步地,重复以上步骤,获得每一个参与方i在全部T个聚合周期的贡献值,累加得到参与方i对联合模型的贡献值;即将所有聚合周期按照上面的方式计算一遍,得到每一个参与方在每一个聚合周期对应的贡献值,然后进行累加得到总的贡献值。Further, repeat the above steps to obtain the contribution value of each participant i in all T aggregation periods, and accumulate the contribution value of participant i to the joint model; that is, calculate all the aggregation periods according to the above method, and obtain each participant i Party’s corresponding contribution value in each aggregation cycle, and then accumulate to get the total contribution value.
进一步地,采用以下方式对第一截断阈值λ进行设置:设最终的联合模型效用函数相对于初始模型的边际增益为Δ U=|V(M (T))-V(M (0))|,其中T为总通讯轮次,可设置λ=Δ U*0.01。第二截断阈值η可用于表示贡献值的误差水平,可将其设置为η=1e-3~1e-5。 Further, the first truncation threshold λ is set in the following manner: Let the marginal gain of the final joint model utility function relative to the initial model be Δ U =|V(M (T) )-V(M (0) )| , where T is the total communication round, which can be set to λ=Δ U *0.01. The second truncation threshold η can be used to represent the error level of the contribution value, and can be set as η=1e-3˜1e-5.
在一些实施例中,基于联合学习的架构,生成多个参与方组,并确定由多个参与方组构成的参与方组集合,计算参与方组的权重,包括:确定联合学习中的所有参与方,将参与方按照数量从少至多的方式依次进行枚举得到多个参与方组,将多个参与方组所构成的集合作为参与方组集合,并基于每一个参与方组中参与方的数量计算每一个参与方组对应的权重;其中,权重用于表示参与方组在参与方组集合中出现的概率。In some embodiments, based on the framework of joint learning, multiple participant groups are generated, and a set of participant groups composed of multiple participant groups is determined, and weights of the participant groups are calculated, including: determining all participants in the joint learning The number of participants is enumerated in order from the least to the largest to obtain multiple participant groups, and the set of multiple participant groups is used as the set of participant groups, and based on the number of participants in each participant group The quantity calculates the weight corresponding to each participant group; wherein, the weight is used to represent the probability that the participant group appears in the participant group set.
具体地,下面结合一个具体实施例对联合学习的参与方以及构造参与方组集合的过程进行详细说明,具体可以包括以下内容:Specifically, the following will describe in detail the participants of the joint learning and the process of constructing a participant group set in combination with a specific embodiment, which may specifically include the following:
假设有N个参与方1,2,…i…n-1,n的联合学习,训练一共进行了T个周期的聚合,记录训练过程中每一个聚合周期t,每一个参与方i上传的本地模型M i (t),以及中心聚合后的联合模型M (t),初始化模型M (0),有对模型性能(如准确率、loss等)的评估函数或效用函数V(·),联合学习模型聚合方法Agg(·),阈值λ,η;其中,λ表示第一截断阈值,η表示第二截断阈值。 Assuming that there are N participants 1, 2, ... i...n-1, n joint learning, the training has been aggregated for T cycles, recording each aggregation cycle t during the training process, and the local data uploaded by each participant i Model M i (t) , and the joint model M (t) after central aggregation, initialize the model M (0) , have an evaluation function or utility function V( ) for model performance (such as accuracy, loss, etc.), and the joint Learning model aggregation method Agg(·), thresholds λ, η; where λ represents the first truncated threshold, and η represents the second truncated threshold.
进一步地,首先根据联合学习中的所有参与方,按照参与方数量从少到多枚举全部可能的参与方组Ps=[(1,),(2,),(3,)…,(1,2),(1,3),(2,3),…P,…N];对每一个具有0,1,2,…n-1个参与方的子组合S,计算权重w |S|=|S|!(|N|-|S| -1)!/|N|!。 Further, first enumerate all possible participant groups Ps=[(1,),(2,),(3,)...,(1 ,2),(1,3),(2,3),…P,…N]; for each subcombination S with 0, 1, 2,…n-1 participants, calculate the weight w |S | = |S|! (|N|-|S| -1 )! /|N|! .
需要说明的是,每一个参与方组对应上述的一个子组合S,在对子组合S的权重进行计算时,依据的是每一个子组合中参与方的个数,在参与方组中一个参与方对应一个集合中的元素,即根据参与方组中的元素个数来计算参与方组对应的权重,每一个子组合对应的权重可以认为是该子组合在整体参与方组中出现的概率。It should be noted that each participant group corresponds to a subcombination S mentioned above. When calculating the weight of the subcombination S, it is based on the number of participants in each subcombination. The party corresponds to the elements in a set, that is, the weight corresponding to the participant group is calculated according to the number of elements in the participant group, and the weight corresponding to each sub-combination can be considered as the probability of the sub-combination appearing in the overall participant group.
在一些实施例中,确定联合学习中的聚合周期,获取聚合周期前后联合学习模型对应的效用变化值 并建立查找表,包括:针对联合学习中的每一个聚合周期,确定聚合周期对应的联合学习模型的初始效用值和最终效用值,计算最终效用值与初始效用值之间的差值,将差值作为效用变化值,并建立聚合周期对应的包含所有参与方组的查找表;对查找表执行初始化操作,以使查找表中除空集参与方组和全集参与方组之外的其他参与方组的初始效用值为0;其中,查找表用于存储所有参与方组对应的效用值。In some embodiments, determining the aggregation period in the joint learning, obtaining the utility change value corresponding to the joint learning model before and after the aggregation period and establishing a lookup table includes: for each aggregation period in the joint learning, determining the joint learning corresponding to the aggregation period The initial utility value and final utility value of the model, calculate the difference between the final utility value and the initial utility value, use the difference as the utility change value, and establish a lookup table containing all participant groups corresponding to the aggregation period; for the lookup table Perform an initialization operation so that the initial utility values of other participant groups in the lookup table except the empty set participant group and the full set participant group are 0; wherein, the lookup table is used to store the corresponding utility values of all participant groups.
具体地,计算每一个聚合周期开始前以及结束后,联合学习模型对应的效用值,并建立查找表,即对于每一个聚合周期来说,可以先计算本聚合周期的最终效用值与本聚合周期的初始效用值,下面结合一个具体实施例,对聚合周期的初始效用值和最终效用值的计算过程进行详细说明,具体可以包括以下内容:Specifically, calculate the utility value corresponding to the joint learning model before and after each aggregation period, and establish a lookup table, that is, for each aggregation period, you can first calculate the final utility value of this aggregation period and this aggregation period The calculation process of the initial utility value and the final utility value of the aggregation cycle will be described in detail below in conjunction with a specific embodiment, which may specifically include the following:
对每一个聚合周期t,分别计算 vN=V(M (t)),v 0=V(M (t-1)),并建立查找表v_lut={():v0,(1,):0,(2,):0,(3,):0…,(1,2):0,(1,3):0,(2,3):0,…N:vN},其中,v N表示当前聚合周期结束后联合模型的最终效用值,v 0表示当前聚合周期对应的上一聚合周期结束后的联合模型的效用值,当然v 0也可以理解为当前聚合周期开始前,当前聚合周期的初始效用值,不同表述方式上的差别不构成对v 0本质含义的限定,且上述两种表述方式是等价的。 For each aggregation period t, calculate v N=V(M (t) ), v 0 =V(M (t-1) ), and establish a lookup table v_lut={():v0,(1,): 0,(2,):0,(3,):0…,(1,2):0,(1,3):0,(2,3):0,…N:vN}, where, v N indicates the final utility value of the joint model after the end of the current aggregation period, and v 0 indicates the utility value of the joint model after the previous aggregation period corresponding to the current aggregation period. Of course, v 0 can also be understood as the current aggregation period before the start of the current aggregation period. For the initial utility value of the period, the difference in different expressions does not constitute a limit to the essential meaning of v 0 , and the above two expressions are equivalent.
进一步地,在对查找表执行初始化操作时,除空集()和全集N对应的参与方组之外,令参与方组集合Ps中的其他参与方组的效用值为0。通过建立v_lut查找表,并利用查找表对参与方组的效用值进行缓存,从而记录已经计算过的效用值,可以为后续贡献值计算降低计算量,避免重复计算。Further, when performing the initialization operation on the lookup table, except for the participant groups corresponding to the empty set ( ) and the full set N, the utility values of other participant groups in the participant group set Ps are set to be 0. By establishing a v_lut lookup table and using the lookup table to cache the utility value of the participant group, so as to record the calculated utility value, the amount of calculation can be reduced for subsequent contribution value calculations and double calculations can be avoided.
在一些实施例中,根据效用变化值判断是否计算聚合周期内各个参与方的贡献值,包括:将聚合周期前后对应的联合学习模型的效用变化值与预设的第一截断阈值进行比较,当效用变化值小于第一截断阈值,且连续多轮聚合周期对应的效用变化值均小于第一截断阈值时,判断聚合周期内各个参与方的贡献值为0;否则,对聚合周期内各个参与方的贡献值进行重新计算。In some embodiments, judging whether to calculate the contribution value of each participant in the aggregation period according to the utility change value includes: comparing the utility change value of the corresponding joint learning model before and after the aggregation period with the preset first cut-off threshold, when When the utility change value is less than the first truncation threshold, and the utility change values corresponding to multiple consecutive rounds of aggregation periods are all less than the first truncation threshold, it is judged that the contribution value of each participant in the aggregation period is 0; otherwise, the contribution value of each participant in the aggregation period The contribution value is recalculated.
具体地,通过计算本聚合周期的最终效用值与本聚合周期的初始效用值,如果本聚合周期对应的最终效用值与初始效用值之间的差值小于第一截断阈值,且如果连续两轮聚合周期,最终效用值与初始效用值之间的差值都小于第一截断阈值时,则结束计算,并将当前聚合周期内各参与方的贡献值视为0,即各参与方没有在当前聚合周期内做出贡献。下面结合一个具体实施例,对利用计算器判断是否对本聚合周期内各参与方的贡献值进行计算的过程进行详细说明,具体可以包括以下内容:Specifically, by calculating the final utility value of this aggregation period and the initial utility value of this aggregation period, if the difference between the final utility value and the initial utility value corresponding to this aggregation period is less than the first cut-off threshold, and if two consecutive rounds In the aggregation period, when the difference between the final utility value and the initial utility value is less than the first truncation threshold, the calculation ends, and the contribution value of each participant in the current aggregation period is regarded as 0, that is, each participant is not in the current Contribute during the aggregation period. The following is a detailed description of the process of using a calculator to determine whether to calculate the contribution value of each participant in this aggregation cycle in combination with a specific embodiment, which may specifically include the following:
如果|v N-v 0|≤λ,则计数器加1,如果计数器超过1(计数器的值大于等于2),则本聚合周期t内各个参与方i的贡献值
Figure PCTCN2022116570-appb-000013
则返回上一步骤,否则继续执行下一步骤;换言之,通过将当前聚合周期前后产生的聚合模型所对应的最终效用值与初始效用值做差,并将差值与第一截断阈值进行比较,当差值小于第一截断阈值时,计数器的数值加1,如果计算器大于或等于2(即连续两轮聚合周期所产生的聚合模型的效用变化值均小于阈值),则判断本聚合周期内各参与方的贡献值为0。
If |v N -v 0 |≤λ, add 1 to the counter, if the counter exceeds 1 (the value of the counter is greater than or equal to 2), then the contribution value of each participant i in this aggregation period t
Figure PCTCN2022116570-appb-000013
Then return to the previous step, otherwise continue to the next step; in other words, by making a difference between the final utility value corresponding to the aggregation model generated before and after the current aggregation cycle and the initial utility value, and comparing the difference with the first cut-off threshold, When the difference is less than the first truncation threshold, add 1 to the value of the counter. If the counter is greater than or equal to 2 (that is, the utility change value of the aggregation model generated by two consecutive rounds of aggregation cycles is less than the threshold value), then it is judged that within the aggregation cycle The contribution value of each participant is 0.
本公开实施例这样做的目的在于,在正式计算每一个参与方的贡献值之前,先对本轮联合模型效用值的变化情况做一下评估,根据评估结果可判断在经过本轮聚合训练之后的联合模型的效用值有没有得到提升,即联合模型本身的性能有没有提升,如果模型性能的提升量很少,就可以认为各个参与方在本轮的贡献值都为0;如果本轮发现联合学习模型的性能提升比较大,那就继续执行下面计算,即具体计算每一个参与方在本轮的贡献值是多少。本公开能够提前判断是否需要对参与方的贡献值做进一步计算,还是直接将参与方在本轮的贡献值算作为0,从而避免了无效的计算过程,提升了计算效率。The purpose of this embodiment of the present disclosure is to evaluate the changes in the utility value of the joint model in the current round before formally calculating the contribution value of each participant. Whether the utility value of the joint model has been improved, that is, whether the performance of the joint model itself has been improved. If the improvement in model performance is small, it can be considered that the contribution value of each participant in this round is 0; The performance improvement of the learning model is relatively large, so continue to perform the following calculations, that is, specifically calculate the contribution value of each participant in this round. This disclosure can judge in advance whether it is necessary to further calculate the contribution value of the participant, or directly count the contribution value of the participant in the current round as 0, thereby avoiding an invalid calculation process and improving calculation efficiency.
下述为本公开装置实施例,可以用于执行本公开方法实施例。对于本公开装置实施例中未披露的细节,请参照本公开方法实施例。The following are device embodiments of the present disclosure, which can be used to implement the method embodiments of the present disclosure. For details not disclosed in the disclosed device embodiments, please refer to the disclosed method embodiments.
图10是本公开实施例提供的又一种确定联合学习中参与方贡献度的装置的结构示意图。如图10所示,该确定联合学习中参与方贡献度的装置包括:Fig. 10 is a schematic structural diagram of another device for determining the contribution degree of a participant in joint learning provided by an embodiment of the present disclosure. As shown in Figure 10, the device for determining the contribution of the participants in the joint learning includes:
生成模块1001,被配置为基于联合学习的架构,生成多个参与方组,并确定由多个参与方组构成的参与方组集合,计算参与方组的权重,其中每个参与方组包含至少两个参与方;The generation module 1001 is configured to generate a plurality of participant groups based on a federated learning architecture, and determine a participant group set composed of a plurality of participant groups, and calculate weights of the participant groups, wherein each participant group contains at least two parties;
建立模块1002,被配置为确定联合学习中的聚合周期,获取聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据效用变化值判断是否计算聚合周期内各个参与方的贡献值;The establishment module 1002 is configured to determine the aggregation period in the joint learning, obtain the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of each participant in the aggregation period according to the utility change value;
判断模块1003,被配置为当判断结果为是时,利用参与方组集合中的参与方组随机生成一个全排列组合,并根据全排列组合中参与方组中的参与方顺序生成多个子组合,计算参与方加入子组合时的边际贡献值的估计值,根据边际贡献值的估计值以及参与方组的权重,判断是否采用插值函数对参与方加入子组合后形成的新参与方组的效用值进行计算;The judging module 1003 is configured to, when the judging result is yes, use the participant groups in the participant group set to randomly generate a full permutation combination, and generate multiple subcombinations according to the order of the participants in the participant group in the full permutation combination, Calculate the estimated value of the marginal contribution value when the participant joins the sub-combination, and judge whether to use the interpolation function to determine the utility value of the new participant group formed after the participant joins the sub-combination according to the estimated value of the marginal contribution value and the weight of the participant group Calculation;
更新模块1004,被配置为当判断结果为是时,利用插值函数计算新参与方组的效用值,当判断结 果为否时,利用预设的模型推演方式计算新参与方组的效用值,并依据计算出的新参与方组的效用值对查找表进行更新;The update module 1004 is configured to use an interpolation function to calculate the utility value of the new participant group when the judgment result is yes, and calculate the utility value of the new participant group by using a preset model derivation method when the judgment result is no, and The lookup table is updated according to the calculated utility value of the new party group;
计算模块1005,被配置为基于更新后的查找表,计算参与方的边际贡献值,并判断参与方的边际贡献值是否收敛,当判断结果为是时,将收敛后的边际贡献值作为参与方的贡献值,当判断结果为否时,生成一个新的全排列组合,直至计算得到所有收敛后的参与方的贡献值,根据贡献值确定参与方在联合学习中的贡献度。The calculation module 1005 is configured to calculate the marginal contribution value of the participant based on the updated lookup table, and judge whether the marginal contribution value of the participant is converged, and when the judgment result is yes, use the converged marginal contribution value as the participant's When the judgment result is no, a new full permutation combination is generated until the contribution values of all converged participants are calculated, and the contribution of the participants in the joint learning is determined according to the contribution values.
在一些实施例中,图10的判断模块1003按照参与方顺序将全排列组合划分成多个子组合,并确定全排列组合中的子组合的最后一个参与方所对应的下一个参与方,计算下一个参与方加入子组合时的边际贡献值的估计值。In some embodiments, the judging module 1003 in FIG. 10 divides the full permutation combination into multiple subcombinations according to the order of the participants, and determines the next participant corresponding to the last participant in the subcombination in the full permutation combination, and calculates the following An estimate of a party's contribution margin when it joins a subgroup.
在一些实施例中,图10的判断模块1003计算边际贡献值的估计值与参与方组的权重的乘积,并将乘积与预设的第二截断阈值进行比较;当乘积均小于或等于第二截断阈值时,则判断采用插值函数计算新参与方组的效用值;否则,利用预设的模型推演方式计算新参与方组的效用值。In some embodiments, the judging module 1003 in FIG. 10 calculates the product of the estimated value of the marginal contribution value and the weight of the participant group, and compares the product with the preset second truncation threshold; when the products are all less than or equal to the second When the threshold is truncated, it is judged to use the interpolation function to calculate the utility value of the new participant group; otherwise, the utility value of the new participant group is calculated using the preset model derivation method.
在一些实施例中,图10的更新模块1004基于历史迭代过程中计算的子组合的效用值、以及参与方组为全集参与方组时对应的效用值,利用预设的插值函数对新参与方组的效用值进行计算,并根据计算结果对查找表进行更新。In some embodiments, the update module 1004 in FIG. 10 uses a preset interpolation function to update the new participant's The utility value of the group is calculated, and the lookup table is updated according to the calculation result.
在一些实施例中,图10的更新模块1004对新参与方组的模型参数进行聚合,并对新参与方组的模型进行模型推演,对新参与方组中的每一个参与方的权重进行聚合,得到新参与方组的权重,对新参与方组的模型在标准验证集上进行模型推演,计算得到新参与方组的真实效用值,利用真实效用值对查找表进行更新。In some embodiments, the update module 1004 in FIG. 10 aggregates the model parameters of the new participant group, performs model deduction on the model of the new participant group, and aggregates the weight of each participant in the new participant group , get the weight of the new participant group, model the model of the new participant group on the standard verification set, calculate the real utility value of the new participant group, and use the real utility value to update the lookup table.
在一些实施例中,图10的生成模块1001确定联合学习中的所有参与方,将参与方按照数量从少至多的方式依次进行枚举得到多个参与方组,将多个参与方组所构成的集合作为参与方组集合,并基于每一个参与方组中参与方的数量计算每一个参与方组对应的权重;其中,权重用于表示参与方组在参与方组集合中出现的概率。In some embodiments, the generating module 1001 in FIG. 10 determines all the participants in the joint learning, enumerates the participants in order from the least to the largest to obtain multiple participant groups, and forms the multiple participant groups The set of is used as a set of participant groups, and the weight corresponding to each participant group is calculated based on the number of participants in each participant group; wherein, the weight is used to represent the probability of a participant group appearing in the participant group set.
在一些实施例中,图10的第一判断模块1002针对联合学习中的每一个聚合周期,确定聚合周期对应的联合学习模型的初始效用值和最终效用值,计算最终效用值与初始效用值之间的差值,将差值作为效用变化值,并建立聚合周期对应的包含所有参与方组的查找表;对查找表执行初始化操作,以使查找表中除空集参与方组和全集参与方组之外的其他参与方组的初始效用值为0;其中,查找表用于存储所有参与方组对应的效用值。In some embodiments, the first judgment module 1002 in FIG. 10 determines the initial utility value and the final utility value of the joint learning model corresponding to the aggregation period for each aggregation period in the joint learning, and calculates the difference between the final utility value and the initial utility value. The difference between them is used as the utility change value, and a lookup table containing all participant groups corresponding to the aggregation period is established; the lookup table is initialized so that the empty set participant group and the full set participant group are excluded from the lookup table The initial utility value of other participant groups other than the group is 0; wherein, the lookup table is used to store the utility values corresponding to all participant groups.
在一些实施例中,图10的建立模块1002将聚合周期前后对应的联合学习模型的效用变化值与预设的第一截断阈值进行比较,当效用变化值小于第一截断阈值,且连续多轮聚合周期对应的效用变化值均小于第一截断阈值时,判断聚合周期内各个参与方的贡献值为0;否则,对聚合周期内各个参与方的贡献值进行重新计算。In some embodiments, the building module 1002 in FIG. 10 compares the utility change value of the corresponding joint learning model before and after the aggregation period with the preset first cut-off threshold. When the utility change value is less than the first cut-off threshold, and the When the utility change values corresponding to the aggregation period are all less than the first cut-off threshold, it is judged that the contribution value of each participant in the aggregation period is 0; otherwise, the contribution value of each participant in the aggregation period is recalculated.
在一些实施例中,图10的计算模块1005根据更新后的查找表中参与方加入子组合后的效用值,利用预设的沙普利值计算公式,计算参与方的边际贡献值;并根据参与方的边际贡献值是否收敛,当判断结果为收敛时,将收敛后的边际贡献值作为参与方的贡献值;其中,贡献值用于表示参与方在联合学习中对聚合周期训练的联合学习模型的贡献度。In some embodiments, the calculation module 1005 of FIG. 10 calculates the marginal contribution value of the participant according to the utility value of the participant in the updated lookup table after adding the sub-combination, using the preset Shapley value calculation formula; and according to Whether the marginal contribution value of the participant is converged. When the judgment result is convergent, the converged marginal contribution value is used as the contribution value of the participant; where the contribution value is used to represent the joint learning of the participant for the aggregation cycle training in the joint learning Contribution of the model.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本公开实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.
图11是本公开实施例提供的一种联合学习训练方法的流程示意图。图11的联合学习训练方法可以由联合学习的服务器执行。如图11所示,该联合学习训练方法具体可以包括:Fig. 11 is a schematic flowchart of a joint learning training method provided by an embodiment of the present disclosure. The federated learning training method in FIG. 11 may be executed by a federated learning server. As shown in Figure 11, the joint learning training method may specifically include:
S1101,在联合学习的本轮聚合周期内,获取联合学习的参与方根据本地数据进行初始模型训练得到的本地模型,对参与方的本地模型执行聚合操作,得到联合模型;S1101. In the current round of aggregation cycle of the joint learning, obtain the local model obtained by the initial model training performed by the participants of the joint learning according to the local data, and perform an aggregation operation on the local models of the participants to obtain the joint model;
S1102,利用预设的联合学习贡献值算法,对本轮聚合周期内每个参与方对联合模型的贡献值进行计算,得到每个参与方对应的联合学习贡献值;S1102. Using the preset joint learning contribution value algorithm, calculate the contribution value of each participant to the joint model in the current aggregation cycle, and obtain the joint learning contribution value corresponding to each participant;
S1103,获取每个参与方的初始指标,对联合学习贡献值以及初始指标执行融合操作,得到每个参与方的贡献度指标,其中初始指标用于表征参与方对联合学习的初始贡献度;S1103. Obtain the initial index of each participant, perform a fusion operation on the joint learning contribution value and the initial index, and obtain the contribution index of each participant, where the initial index is used to represent the initial contribution of the participant to the joint learning;
S1104,根据贡献度指标计算参与方在下一轮聚合周期内的训练轮次,以使参与方在下一轮聚合周期内,基于训练轮次对本地模型进行训练,直至对联合模型的训练达到预设目标。S1104. Calculate the training rounds of the participants in the next aggregation cycle according to the contribution index, so that the participants can train the local model based on the training rounds in the next aggregation cycle until the training of the joint model reaches the preset Target.
具体地,每个参与方对应联合学习框架中的一个节点,每个节点对应一个参与方,参与方既可以是传感器、旋转机械设备、物联网设备、IOT设备、PC、平板电脑、智能手机、智能可穿戴设备等,还可以是公司或者工厂等对象。每个参与方上具有联合学习参与方的客户终端,但参与方并不局限于上述这些设备或者客户端。联合学习框架中还具有为客户端提供服务的节点(即服务端),服务端可以是用于 执行聚合操作的服务器,服务端可以协调多个客户端进行联合学习以得到联合学习模型。服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者云计算服务器。Specifically, each participant corresponds to a node in the joint learning framework, and each node corresponds to a participant. Participants can be sensors, rotating machinery equipment, Internet of Things devices, IOT devices, PCs, tablet computers, smart phones, Smart wearable devices, etc., can also be objects such as companies or factories. Each participant has a client terminal of a joint learning participant, but the participant is not limited to the above-mentioned devices or clients. The federated learning framework also has a node that provides services for the client (that is, the server). The server can be a server for performing aggregation operations. The server can coordinate multiple clients to perform joint learning to obtain a joint learning model. The server may be an independent physical server, or a server cluster or cloud computing server composed of multiple physical servers.
进一步地,在联合学习中一个聚合周期是指对联合学习模型进行的一轮训练,各参与方客户端利用本地数据对本地模型进行训练,当本地模型训练达到收敛时,得到训练后的本地模型参数,并将其发送给服务端。所有参与方在每个聚合轮次都会上传自己的本地模型参数,服务器进行加权平均得出一个联合模型来,因此每个参与方在每一轮次都会做出自己的贡献,此处的轮表示服务端对联合学习模型进行一次完整的训练。Furthermore, in federated learning, an aggregation cycle refers to a round of training for the federated learning model. Each participant client uses local data to train the local model. When the local model training reaches convergence, the trained local model is obtained parameter and send it to the server. All participants will upload their own local model parameters in each aggregation round, and the server will perform a weighted average to obtain a joint model, so each participant will make its own contribution in each round. The round here means The server performs a complete training of the joint learning model.
进一步地,需要说明的是,本公开联合学习中的贡献值计算以及根据贡献值计算贡献度指标,并根据贡献度指标确定参与方在下一轮聚合周期内的训练轮次的过程,可以是在联合学习过程中的每一轮次对应的聚合周期完成之后,所执行的操作;换言之,本公开的实施例是在每完成一个轮次的聚合周期之后,根据参与方在本轮聚合周期的贡献程度,指导参与方在下一轮聚合周期的训练轮次,从而使得贡献度更高的参与方能够更多的参与联合模型的训练和聚合,从而快联合模型的收敛速度和模型性能。Further, it should be noted that the process of calculating the contribution value and calculating the contribution index according to the contribution value in the joint learning of the present disclosure, and determining the training round of the participant in the next round of aggregation cycle according to the contribution index can be performed in The operation to be performed after the aggregation period corresponding to each round in the joint learning process is completed; The degree guides the training rounds of the participants in the next aggregation cycle, so that the participants with higher contributions can participate more in the training and aggregation of the joint model, thereby speeding up the convergence speed and model performance of the joint model.
根据本公开实施例提供的技术方案,通过在联合学习的本轮聚合周期内,获取联合学习的参与方根据本地数据进行初始模型训练得到的本地模型,对参与方的本地模型执行聚合操作,得到联合模型;利用预设的联合学习贡献值算法,对本轮聚合周期内每个参与方对联合模型的贡献值进行计算,得到每个参与方对应的联合学习贡献值;获取每个参与方的初始指标,对联合学习贡献值以及初始指标执行融合操作,得到每个参与方的贡献度指标,其中初始指标用于表征参与方对联合学习的初始贡献度;根据贡献度指标计算参与方在下一轮聚合周期内的训练轮次,以使参与方在下一轮聚合周期内,基于训练轮次对本地模型进行训练,直至对联合模型的训练达到预设目标。本公开能够根据参与方在联合学习中的表现,自动调整参与方在下一聚合周期的训练轮次,从而提升联合学习的收敛速度和模型性能。According to the technical solution provided by the embodiments of the present disclosure, during the current round of aggregation period of the federated learning, the local model obtained by the initial model training performed by the participants of the federated learning according to the local data is obtained, and the aggregation operation is performed on the local models of the participants to obtain Joint model; use the preset joint learning contribution value algorithm to calculate the contribution value of each participant to the joint model in the current round of aggregation cycle, and obtain the corresponding joint learning contribution value of each participant; obtain each participant's The initial index performs the fusion operation on the joint learning contribution value and the initial index to obtain the contribution index of each participant, where the initial index is used to represent the initial contribution of the participant to the joint learning; according to the contribution index, the next The training rounds in one round of aggregation cycle, so that the participants will train the local model based on the training rounds in the next round of aggregation cycle until the training of the joint model reaches the preset goal. The disclosure can automatically adjust the training rounds of the participants in the next aggregation cycle according to the performance of the participants in the joint learning, thereby improving the convergence speed and model performance of the joint learning.
在一些实施例中,在联合学习的本轮聚合周期内,获取联合学习的参与方根据本地数据进行初始模型训练得到的本地模型,包括:在联合学习的本轮聚合周期开始时,各个参与方从预设的聚合服务器中下载初始模型,参与方利用本地数据对初始模型进行初始轮次的本地模型训练;其中,初始轮次为对本轮聚合周期的参数进行初始化得到的轮次数值。In some embodiments, during the current aggregation period of the joint learning, the local models obtained by the initial model training performed by the participants of the joint learning according to the local data are obtained, including: at the beginning of the current aggregation period of the joint learning, each participant The initial model is downloaded from the preset aggregation server, and the participants use the local data to perform an initial round of local model training on the initial model; where the initial round is the number of rounds obtained by initializing the parameters of the current round of aggregation cycle.
具体地,这里的本轮聚合周期也可以理解为已完成训练的聚合周期,即上一轮聚合周期。在上一轮聚合周期中,联合学习的各个参与方分别从聚合服务器中下载初始模型,并利用本地数据对初始模型执行若干轮的本地模型训练操作,即各个参与方从聚合服务器下载初始模型,用本地数据训练初始模型若干轮,得到每个参与方对应的本地模型。Specifically, the current round of aggregation period here can also be understood as the aggregation period of completed training, that is, the last round of aggregation period. In the previous round of aggregation cycle, each participant in the federated learning downloaded the initial model from the aggregation server, and performed several rounds of local model training operations on the initial model using local data, that is, each participant downloaded the initial model from the aggregation server, The initial model is trained for several rounds with local data to obtain a local model corresponding to each participant.
进一步地,初始轮次可以是服务器为每个参与方预先设定的初始化模型训练轮次,例如,可以将各个参与方的本地训练轮次记为local_epoch_1,local_epoch_2,local_epoch_i,…local_epoch_n,其中,n为大于等于0的整数。在实际应用中,可以将各个参与方的初始轮次设置为相同数值。Further, the initial round may be the initialization model training round preset by the server for each participant. For example, the local training rounds of each participant may be recorded as local_epoch_1, local_epoch_2, local_epoch_i, ... local_epoch_n, where n is an integer greater than or equal to 0. In practical applications, the initial rounds of each participant can be set to the same value.
进一步地,各个参与方在完成上一轮聚合周期的本地模型训练之后,可以将各自的本地模型权重M_i(或梯度更新)上传到聚合服务器,以便聚合服务器利用联合学习模型聚合算法,对所有参与方的本地模型进行聚合,得到联合模型M_global,并将联合模型的参数下发给各个参与方。Further, each participant can upload their local model weight M_i (or gradient update) to the aggregation server after completing the local model training of the last round of aggregation cycle, so that the aggregation server can use the federated learning model aggregation algorithm to The local model of each party is aggregated to obtain the joint model M_global, and the parameters of the joint model are sent to each participant.
在一些实施例中,在应用联合学习模型聚合算法对全部参与方的本地模型聚合完成之后,应用基于Shapley值的参与方贡献值算法,分别计算各个参与方在本轮聚合周期中对联合模型做出的贡献值(即Shapley值)。下面结合附图以及具体实施例,对每个参与方对应的贡献值的计算过程进行详细说明,图12是本公开实施例提供的对参与方的联合学习贡献值进行计算的流程示意图。如图12所示,该参与方的联合学习贡献值的计算过程具体可以包括:In some embodiments, after applying the joint learning model aggregation algorithm to aggregate the local models of all participants, apply the participant contribution value algorithm based on the Shapley value to calculate the contribution of each participant to the joint model in the current round of aggregation cycle. The contribution value (that is, the Shapley value). The calculation process of the contribution value corresponding to each participant will be described in detail below with reference to the accompanying drawings and specific embodiments. FIG. 12 is a schematic flowchart of the calculation of the joint learning contribution value of the participants provided by an embodiment of the present disclosure. As shown in Figure 12, the calculation process of the joint learning contribution value of the participant may specifically include:
S1201,根据联合学习中的参与方,构造全部的参与方组合,并计算每个参与方组合对应的权重;S1201. Construct all participant combinations according to the participants in the joint learning, and calculate the weight corresponding to each participant combination;
S1202,获取本轮聚合周期前后联合模型对应的效用变化值,根据效用变化值判断是否对各个参与方在本轮聚合周期的联合学习贡献值进行计算;S1202. Obtain the utility change value corresponding to the joint model before and after the current round of aggregation period, and judge whether to calculate the joint learning contribution value of each participant in the current round of aggregation period according to the utility change value;
S1203,当判断结果为是时,选取任意一个参与方组合,并计算参与方组合中的每一个参与方对应的边际贡献值;S1203, when the judgment result is yes, select any combination of participants, and calculate the marginal contribution value corresponding to each participant in the combination of participants;
S1204,根据边际贡献值以及权重,对参与方组合的效用值的计算方式进行判断,以便选择利用插值函数或者模型推演的方式计算参与方组合的效用值;S1204, according to the marginal contribution value and the weight, judge the calculation method of the utility value of the participant combination, so as to choose to calculate the utility value of the participant combination by using an interpolation function or model deduction;
S1205,根据参与方组合的效用值对预定的查找表进行更新,并基于更新后的查找表,计算每个参与方对联合模型的联合学习贡献值。S1205. Update the predetermined lookup table according to the utility value of the combination of participants, and calculate the joint learning contribution value of each participant to the joint model based on the updated lookup table.
具体地,首先根据联合学习的全部参与方,将全部参与方按照参与方数量从少至多的方式构造出全部的参与方组合,每个参与方组合即对应一个参与方组。例如,假设某个联合学习中有n个参与方,按照参与方数量从少到多枚举全部可能的参与方组合Ps=[(1,),(2,),(3,)…,(1,2),(1,3),(2,3),…P,…N],因此可以得到具有0,1,2,…n-1个 参与方的子组合S,即得到若干个参与方组。对每个具有0,1,2,…n-1个参与方的子组合S,计算权重w |S|=|S|!(|N|-|S|-1)!/|N|!。 Specifically, firstly, according to all the participants in the joint learning, all participants are constructed in a manner from the fewest to the largest number of participants to form all participant combinations, and each participant combination corresponds to a participant group. For example, assuming that there are n participants in a joint learning, enumerate all possible participant combinations Ps=[(1,),(2,),(3,)...,( 1,2),(1,3),(2,3),…P,…N], so a subcombination S with 0, 1, 2,…n-1 participants can be obtained, that is, several Participant group. For each subcombination S with 0, 1, 2, ... n-1 participants, calculate the weight w |S| = |S|! (|N|-|S|-1)! /|N|! .
在这里,每一个参与方组合对应一个子组合S,在对子组合S的权重进行计算时,依据的是每个子组合中参与方的个数,在参与方组合中一个参与方对应一个集合中的元素,即根据参与方组合中的元素个数来计算参与方组合对应的权重,每个子组合对应的权重可以认为是该子组合在整体参与方组合中出现的概率。Here, each participant combination corresponds to a sub-combination S. When calculating the weight of the sub-combination S, it is based on the number of participants in each sub-combination. In the participant combination, one participant corresponds to a set elements, that is, calculate the weight corresponding to the participant combination according to the number of elements in the participant combination, and the weight corresponding to each sub-combination can be considered as the probability of the sub-combination appearing in the overall participant combination.
进一步地,计算聚合周期开始时以及结束后,联合模型对应的效用值,并建立查找表,即对于每个聚合周期来说,可以先计算本聚合周期的最终效用值与本聚合周期的初始效用值。例如,对聚合周期t,分别计算v N=V(M (t)),v 0=V(M (t-1)),并建立查找表,其中,v N表示当前聚合周期结束后联合模型的最终效用值,v 0表示当前聚合周期对应的上一聚合周期结束后的联合模型的效用值,当然v 0也可以理解为当前聚合周期开始前,当前聚合周期的初始效用值。 Further, calculate the utility value corresponding to the joint model at the beginning and after the aggregation period, and establish a lookup table, that is, for each aggregation period, you can first calculate the final utility value of this aggregation period and the initial utility of this aggregation period value. For example, for the aggregation period t, calculate v N =V(M (t) ), v 0 =V(M (t-1) ), and establish a lookup table, where v N represents the joint model after the current aggregation period v 0 represents the utility value of the joint model after the previous aggregation period corresponding to the current aggregation period. Of course, v 0 can also be understood as the initial utility value of the current aggregation period before the start of the current aggregation period.
进一步地,当判断需要对各个参与方在本轮聚合周期的贡献值做计算时,从本轮的全部参与方组合Ps中按顺序取出一种参与方组合P。对P中的每一个子参与方j,可将P分割为{j}和S=P\{j}两个子集,也即P=S∪{j};计算j加入S产生的边际贡献,在计算边际贡献时,由于实际的边际贡献应当为Δ j_real=v S∪{j}-v S=V(S∪{j})-V(S)=V(P)-V(S);但是,V(P)的值暂时还无法确定,因此采用缩放原理,将V(P)放大成v N,从而将j的边际贡献估计为Δ j_est=v N-v S=v_lut[N]-v_lut[S],并将v S添加至列表VS_hist(对应另外一个缓存表),由于v S已在上一个组合P’中计算过,此处只需从查找表v_lut中获取,无需计算V(M S (t))。 Further, when it is judged that it is necessary to calculate the contribution value of each participant in the current round of aggregation period, a participant combination P is sequentially selected from all the participant combinations Ps in the current round. For each sub-participant j in P, P can be divided into two subsets {j} and S=P\{j}, that is, P=S∪{j}; calculate the marginal contribution generated by adding j to S, When calculating the marginal contribution, the actual marginal contribution should be Δ j_real =v S∪{j} -v S =V(S∪{j})-V(S)=V(P)-V(S); However, the value of V(P) cannot be determined for the time being, so the scaling principle is used to enlarge V(P) to v N , so that the marginal contribution of j is estimated as Δ j_est =v N -v S =v_lut[N]- v_lut[S], and v S is added to the list VS_hist (corresponding to another cache table), since v S has been calculated in the previous combination P', here only needs to be obtained from the lookup table v_lut, no need to calculate V( M S (t) ).
在一些实施例中,根据边际贡献值以及权重,对参与方组合的效用值的计算方式进行判断,以便选择利用插值函数或者模型推演的方式计算参与方组合的效用值,包括:根据参与方的边际贡献值与参与方组合的权重之间的乘积,将乘积与预设的截断阈值进行比较,当参与方组合中每个参与方对应的乘积均小于或等于截断阈值时,则选择利用插值函数的方式计算参与方组合的效用值,否则,选择利用模型推演的方式计算参与方组合的效用值。In some embodiments, according to the marginal contribution value and the weight, the calculation method of the utility value of the participant combination is judged, so as to choose to use the interpolation function or the way of model deduction to calculate the utility value of the participant combination, including: according to the participant's The product between the marginal contribution value and the weight of the participant combination, compare the product with the preset cut-off threshold, and when the product corresponding to each participant in the participant combination is less than or equal to the cut-off threshold, choose to use the interpolation function Otherwise, choose to use the model deduction method to calculate the utility value of the participant combination.
具体地,可以根据参与方的边际贡献值与参与方对应参与方组合的权重的乘积与截断阈值之间的关系,判断是否对参与方组合的效用值进行计算。在实际应用中,计算参与方j的边际贡献值与参与方j所在参与方组合P的权重的乘积|Δ j_est*w |S||,如果参与方组合P中全部参与方j均满足|Δ j_est*w |S||≤η*|vN-v0|,则判断使用子组合的效用值对参与方组合P的效用值进行估计,否则,判断利用预设的模型推演方式计算参与方组合P的效用值。 Specifically, it may be determined whether to calculate the utility value of the participant combination according to the relationship between the product of the participant's marginal contribution value and the weight of the participant corresponding to the participant combination and the cut-off threshold. In practical applications, calculate the product |Δ j_est *w |S| j_est *w |S| |≤η*|vN-v0|, it is judged to use the utility value of the sub-combination to estimate the utility value of the participant combination P, otherwise, it is judged to use the preset model derivation method to calculate the participant combination P utility value.
需要说明的是,上述参与方组合P中的每个参与方对应的边际贡献值都满足上述公式时仅仅是一种可选的实施例,除此之外,还可以设置成其他判断标准,比如参与方组合P中的任意一个参与方的边际贡献值不满足上述公式,或者参与方组合P中有一半的参与方不满足上述公式,或者参与方组合P中存在任意比例的参与方不满足上述公式等等。It should be noted that when the marginal contribution value of each participant in the above participant combination P satisfies the above formula, it is only an optional embodiment. In addition, other judgment criteria can also be set, such as The marginal contribution value of any participant in the participant combination P does not satisfy the above formula, or half of the participants in the participant combination P do not satisfy the above formula, or there is any proportion of participants in the participant combination P that does not satisfy the above formula formulas and more.
进一步地,在利用插值函数计算参与方组合的效用值时,基于历史迭代过程中计算的参与方组合的效用值、以及参与方组合为全集参与方组合时对应的效用值,利用预设的插值函数对参与方组合的效用值进行估计,得到参与方组合的效用值所对应的估计值,并根据估计值对查找表进行更新。Further, when using the interpolation function to calculate the utility value of the participant combination, based on the utility value of the participant combination calculated in the historical iteration process and the corresponding utility value when the participant combination is a complete set of participant combinations, the preset interpolation value The function estimates the utility value of the participant combination, obtains the estimated value corresponding to the utility value of the participant combination, and updates the lookup table according to the estimated value.
进一步地,在利用模型推演的方式计算参与方组合的效用值时,根据计算出的参与方组合的效用值对查找表进行更新,对参与方组合对应的模型参数进行聚合,并对参与方组合对应的模型进行模型推演,对参与方组合中每个参与方的权重进行聚合,得到参与方组合的权重,对参与方组合在标准验证集上进行模型推演,计算得到参与方组合的真实效用值,利用真实效用值对查找表进行更新。Further, when using model deduction to calculate the utility value of the participant combination, the lookup table is updated according to the calculated utility value of the participant combination, the model parameters corresponding to the participant combination are aggregated, and the participant combination Carry out model deduction for the corresponding model, aggregate the weight of each participant in the participant combination to obtain the weight of the participant combination, perform model deduction on the standard verification set for the participant combination, and calculate the real utility value of the participant combination , to update the lookup table with the real utility value.
在一些实施例中,在获取每个参与方的初始指标,对联合学习贡献值以及初始指标执行融合操作之前,该方法还包括:针对联合学习中的每个参与方,根据每个参与方上报的本地数据质量、本地数据量和/或联合学习成本,计算每个参与方对应的初始指标,并对初始指标进行归一化处理,初始指标用于表示预估的参与方对本轮聚合周期的联合模型训练的贡献度。In some embodiments, before obtaining the initial index of each participant and performing the fusion operation on the joint learning contribution value and the initial index, the method further includes: for each participant in the joint learning, according to each participant's report The quality of local data, the amount of local data and/or the cost of joint learning, calculate the initial index corresponding to each participant, and normalize the initial index. The contribution of the joint model training of .
具体地,在确定参与方对应的初始指标时,可以根据各个参与方上传的数据质量或者联合学习成本等参数进行计算得到,例如:对一个联合学习模型训练任务,假设有P1,P2,Pi,…Pn共N个参与方,每个参与方均具有一个预先设置或计算的指标Qi(归一化处理后的指标值),该指标满足以下条件:若 Qi越大,该参与方i对联合模型的“价值”或者“作用”就越大。Specifically, when determining the initial index corresponding to the participant, it can be calculated according to the data quality uploaded by each participant or the joint learning cost and other parameters. For example: for a joint learning model training task, suppose there are P1, P2, Pi, ...Pn has a total of N participants, and each participant has a preset or calculated index Qi (the index value after normalization processing), which satisfies the following conditions: if Qi is larger, the participant i pairs of joint The greater the "value" or "function" of the model.
进一步地,初始指标可以根据参与方报告的数据质量或数据量来确定,也可以由参与方报告的联合学习成本的负数或倒数来确定,如果参与方上报的数据质量、数据数量、分布等属性一致,那么参与方对联合学习成本的报价越低则对训练任务越有利。因此,可以将各个参与方的初始指标作为对本轮聚合周期内的联合模型训练的贡献度的预测值。Further, the initial index can be determined according to the data quality or data volume reported by the participants, or by the negative or reciprocal of the joint learning cost reported by the participants, if the data quality, data quantity, distribution and other attributes reported by the participants Consistent, then the lower the participant's quotation for the joint learning cost, the more beneficial it is for the training task. Therefore, the initial indicators of each participant can be used as the predicted value of the contribution to the joint model training in the current aggregation period.
在一些实施例中,对联合学习贡献值以及初始指标执行融合操作,得到每个参与方的贡献度指标,包括:获取由联合学习的全部参与方所对应的初始指标生成的初始指标列表,以及由全部参与方所对应的联合学习贡献值生成的贡献值列表;基于初始指标列表以及贡献值列表,对每个参与方的联合学习贡献值以及初始指标执行融合操作,得到融合后的贡献度指标,根据全部参与方所对应的贡献度指标生成贡献度指标列表。In some embodiments, the fusion operation is performed on the joint learning contribution value and the initial index to obtain the contribution index of each participant, including: obtaining the initial index list generated by the initial index corresponding to all the participants of the joint learning, and The contribution value list generated by the joint learning contribution value corresponding to all the participants; based on the initial index list and the contribution value list, the fusion operation is performed on the joint learning contribution value and the initial index of each participant to obtain the fused contribution index , generate a list of contribution indicators according to the contribution indicators corresponding to all participants.
具体地,根据全部参与方所对应的初始指标生成初始指标列表[Q1,Q2,Qi…,Qn],以及基于计算得到的全部参与方所对应的联合学习贡献值生成贡献值列表[φ1,φ2,φi,…φn]。根据获得的上述初始指标列表以及贡献值列表,基于两个列表中的数据,采用加权平均或者求平均值等方式,计算得到每个参与方对应的贡献度指标G,根据每个参与方对应的贡献度指标G生成新的贡献度指标列表[G1,G2,Gi…,Gn],该贡献度指标列表是融合了真实贡献值所得到的贡献度列表。因此,贡献度指标G可以表征参与方在上一轮聚合周期,对联合模型训练的贡献程度,贡献度指标G的数值越大,表示参与方的贡献程度越高。Specifically, the initial index list [Q1, Q2, Qi..., Qn] is generated according to the initial index corresponding to all participants, and the contribution value list [φ1, φ2 , φi, ... φn]. According to the above-mentioned initial index list and contribution value list obtained, based on the data in the two lists, the contribution index G corresponding to each participant is calculated by weighted average or averaging. The contribution index G generates a new contribution index list [G1, G2, Gi..., Gn], which is a contribution list obtained by fusing real contribution values. Therefore, the contribution index G can represent the degree of contribution of the participants to the joint model training in the last aggregation cycle. The larger the value of the contribution index G, the higher the contribution of the participants.
在一些实施例中,根据贡献度指标计算参与方在下一轮聚合周期内的训练轮次,包括:根据预先建立的贡献度指标与训练轮次之间的映射关系,生成映射函数,将计算得到的参与方对应的贡献度指标作为映射函数的输入,利用映射函数计算参与方对应的训练轮次,将训练轮次作为参与方在下一轮聚合周期内对本地模型进行训练时的聚合轮次。In some embodiments, calculating the training rounds of the participants in the next aggregation period according to the contribution index includes: generating a mapping function according to the pre-established mapping relationship between the contribution index and the training round, and calculating The contribution index corresponding to the participant is used as the input of the mapping function, and the mapping function is used to calculate the training round corresponding to the participant, and the training round is used as the aggregation round when the participant trains the local model in the next round of aggregation cycle.
具体地,在对每个参与方对应的下一轮聚合周期的训练轮次进行计算之前,可以根据前述实施例计算得到的参与方对应的贡献度指标G,将贡献度指标G与本地训练轮次local_epoch_i建立一种正相关的映射关系(例如线性或非线性的映射关系),并根据建立的映射关系生成映射函数local_epoch_i’=f(Gi)。Specifically, before calculating the training round of the next round of aggregation period corresponding to each participant, the contribution index G corresponding to the participant calculated according to the foregoing embodiment can be calculated and the contribution index G can be combined with the local training round A positively correlated mapping relationship (for example, a linear or nonlinear mapping relationship) is established for local_epoch_i times, and a mapping function local_epoch_i'=f(Gi) is generated according to the established mapping relationship.
进一步地,在基于映射函数对参与方的训练轮次进行计算时,可以将参与方i在上一轮聚合周期的贡献度指标Gi作为映射函数的输入,利用映射函数自动计算参与方i的local_epoch_i’的值(即参与方在下一轮聚合周期的训练轮次)。在实际应用中,参与方对应的贡献度指标Gi越大,计算出来的local_epoch_i’的值也越大,最大可达到设定的本地训练轮次上限;贡献度指标Gi越小,local_epoch_i’的值也越小,最低可降为0,表示该参与方在下一轮次的聚合周期不参与联合模型训练或聚合。Furthermore, when calculating the training round of a participant based on the mapping function, the contribution index Gi of the participant i in the last aggregation cycle can be used as the input of the mapping function, and the local_epoch_i of the participant i can be automatically calculated by using the mapping function ' (that is, the training round of the participant in the next round of aggregation cycle). In practical applications, the larger the contribution index Gi corresponding to the participant, the greater the calculated value of local_epoch_i', which can reach the upper limit of the set local training round; the smaller the contribution index Gi, the larger the value of local_epoch_i' The smaller it is, the lowest can be reduced to 0, which means that the participant will not participate in joint model training or aggregation in the next round of aggregation cycle.
最后,各个参与方从聚合服务器下载联合模型M,并应用新的训练轮次local_epoch_i’,并利用本地数据训练local_epoch_i’轮的本地模型,重复以上实施例中的操作,直至联合模型达到收敛或者达到设定的最大聚合轮次,最终得到训练了T个聚合周期的联合模型。Finally, each participant downloads the joint model M from the aggregation server, and applies a new training round local_epoch_i', and uses local data to train the local model of the local_epoch_i' round, and repeats the operations in the above embodiments until the joint model reaches convergence or reaches The set maximum aggregation rounds, and finally a joint model that has been trained for T aggregation cycles.
根据本公开实施例提供的技术方案,本公开的实施例在每一轮模型聚合之后,根据本轮各参与方对联合模型做出的贡献,来计算下一轮聚合周期的聚合轮次,从而指导各参与方应用新的聚合轮次进行本地模型的训练,使得贡献高高的参与方能够更多的参与联合模型的训练和聚合,从而加快联合模型的收敛速度和模型性能。According to the technical solutions provided by the embodiments of the present disclosure, after each round of model aggregation, the embodiments of the present disclosure calculate the aggregation round of the next round of aggregation cycle according to the contributions made by the participants in this round to the joint model, so that Instruct all participants to apply new aggregation rounds for local model training, so that participants with high contributions can participate more in the training and aggregation of the joint model, thereby speeding up the convergence speed and model performance of the joint model.
下述为本公开装置实施例,可以用于执行本公开方法实施例。对于本公开装置实施例中未披露的细节,请参照本公开方法实施例。The following are device embodiments of the present disclosure, which can be used to implement the method embodiments of the present disclosure. For details not disclosed in the disclosed device embodiments, please refer to the disclosed method embodiments.
图13是本公开实施例提供的联合学习训练装置的结构示意图。如图13所示,该联合学习训练装置包括:Fig. 13 is a schematic structural diagram of a joint learning and training device provided by an embodiment of the present disclosure. As shown in Figure 13, the joint learning training device includes:
聚合模块1301,被配置为在联合学习的本轮聚合周期内,获取联合学习的参与方根据本地数据进行初始模型训练得到的本地模型,对参与方的本地模型执行聚合操作,得到联合模型;The aggregation module 1301 is configured to obtain the local model obtained by the initial model training performed by the participants of the joint learning according to the local data in the current round of aggregation period of the joint learning, and perform an aggregation operation on the local models of the participants to obtain the joint model;
计算模块1302,被配置为利用预设的联合学习贡献值算法,对本轮聚合周期内每个参与方对联合模型的贡献值进行计算,得到每个参与方对应的联合学习贡献值;The calculation module 1302 is configured to use the preset joint learning contribution value algorithm to calculate the contribution value of each participant to the joint model in the current round of aggregation period, and obtain the corresponding joint learning contribution value of each participant;
融合模块1303,被配置为获取每个参与方的初始指标,对联合学习贡献值以及初始指标执行融合操作,得到每个参与方的贡献度指标,其中初始指标用于表征参与方对联合学习的初始贡献度;The fusion module 1303 is configured to obtain the initial index of each participant, and perform a fusion operation on the joint learning contribution value and the initial index to obtain the contribution index of each participant, wherein the initial index is used to represent the participant's contribution to the joint learning initial contribution;
训练模块1304,被配置为根据贡献度指标计算参与方在下一轮聚合周期内的训练轮次,以使参与方在下一轮聚合周期内,基于训练轮次对本地模型进行训练,直至对联合模型的训练达到预设目标。The training module 1304 is configured to calculate the training rounds of the participants in the next aggregation period according to the contribution index, so that the participants can train the local model based on the training rounds in the next aggregation period until the joint model The training achieves the preset target.
在一些实施例中,图13的聚合模块1301在联合学习的本轮聚合周期开始时,各个参与方从预设的聚合服务器中下载初始模型,参与方利用本地数据对初始模型进行初始轮次的本地模型训练;其中,初 始轮次为对本轮聚合周期的参数进行初始化得到的轮次数值。In some embodiments, when the aggregation module 1301 of FIG. 13 starts the current round of aggregation cycle of joint learning, each participant downloads the initial model from the preset aggregation server, and the participant uses local data to perform the initial round of initial model aggregation. Local model training; where, the initial round is the number of rounds obtained by initializing the parameters of the current round of aggregation cycle.
在一些实施例中,图13的计算模块1302根据联合学习中的参与方,构造全部的参与方组合,并计算每个参与方组合对应的权重;获取本轮聚合周期前后联合模型对应的效用变化值,根据效用变化值判断是否对各个参与方在本轮聚合周期的联合学习贡献值进行计算;当判断结果为是时,选取任意一个参与方组合,并计算参与方组合中的每一个参与方对应的边际贡献值;根据边际贡献值以及权重,对参与方组合的效用值的计算方式进行判断,以便选择利用插值函数或者模型推演的方式计算参与方组合的效用值;根据参与方组合的效用值对预定的查找表进行更新,并基于更新后的查找表,计算每个参与方对联合模型的联合学习贡献值。In some embodiments, the calculation module 1302 in FIG. 13 constructs all participant combinations according to the participants in the joint learning, and calculates the weight corresponding to each participant combination; obtains the utility change corresponding to the joint model before and after the current round of aggregation period Value, according to the utility change value, judge whether to calculate the joint learning contribution value of each participant in the current aggregation cycle; when the judgment result is yes, select any combination of participants, and calculate the The corresponding marginal contribution value; according to the marginal contribution value and weight, judge the calculation method of the utility value of the participant combination, so as to choose to use interpolation function or model deduction to calculate the utility value of the participant combination; according to the utility value of the participant combination The predetermined lookup table is updated, and based on the updated lookup table, the joint learning contribution value of each participant to the joint model is calculated.
在一些实施例中,图13的计算模块1302根据参与方的边际贡献值与参与方组合的权重之间的乘积,将乘积与预设的截断阈值进行比较,当参与方组合中每个参与方对应的乘积均小于或等于截断阈值时,则选择利用插值函数的方式计算参与方组合的效用值,否则,选择利用模型推演的方式计算参与方组合的效用值。In some embodiments, the calculation module 1302 in FIG. 13 compares the product with a preset cut-off threshold according to the product of the marginal contribution value of the participant and the weight of the participant combination. When each participant in the participant combination When the corresponding products are all less than or equal to the cut-off threshold, choose to use the interpolation function to calculate the utility value of the participant combination, otherwise, choose to use the model deduction method to calculate the utility value of the participant combination.
在一些实施例中,图13的融合模块1303在获取每个参与方的初始指标,对联合学习贡献值以及初始指标执行融合操作之前,针对联合学习中的每个参与方,根据每个参与方上报的本地数据质量、本地数据量和/或联合学习成本,计算每个参与方对应的初始指标,并对初始指标进行归一化处理,初始指标用于表示预估的参与方对本轮聚合周期的联合模型训练的贡献度。In some embodiments, before the fusion module 1303 in FIG. 13 acquires the initial index of each participant and performs the fusion operation on the joint learning contribution value and the initial index, for each participant in the joint learning, according to each participant Reported local data quality, local data volume and/or joint learning cost, calculate the initial index corresponding to each participant, and normalize the initial index. Contribution to periodic joint model training.
在一些实施例中,图13的融合模块1303获取由联合学习的全部参与方所对应的初始指标生成的初始指标列表,以及由全部参与方所对应的联合学习贡献值生成的贡献值列表;基于初始指标列表以及贡献值列表,对每个参与方的联合学习贡献值以及初始指标执行融合操作,得到融合后的贡献度指标,根据全部参与方所对应的贡献度指标生成贡献度指标列表。In some embodiments, the fusion module 1303 in FIG. 13 obtains the initial indicator list generated by the initial indicators corresponding to all participants in the joint learning, and the contribution value list generated by the joint learning contribution values corresponding to all the participants; based on The list of initial indicators and the list of contribution values, the fusion operation is performed on the joint learning contribution value of each participant and the initial indicators to obtain the fused contribution indicators, and the contribution indicator list is generated according to the contribution indicators corresponding to all participants.
在一些实施例中,图13的训练模块1304根据预先建立的贡献度指标与训练轮次之间的映射关系,生成映射函数,将计算得到的参与方对应的贡献度指标作为映射函数的输入,利用映射函数计算参与方对应的训练轮次,将训练轮次作为参与方在下一轮聚合周期内对本地模型进行训练时的聚合轮次。In some embodiments, the training module 1304 in FIG. 13 generates a mapping function according to the pre-established mapping relationship between the contribution index and the training round, and uses the calculated contribution index corresponding to the participant as the input of the mapping function, Use the mapping function to calculate the training rounds corresponding to the participants, and use the training rounds as the aggregation rounds when the participants train the local model in the next round of aggregation cycle.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本公开实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.
图14是本公开实施例提供的电子设备14的结构示意图。如图5所示,该实施例的电子设备14包括:处理器1401、存储器1402以及存储在该存储器1402中并且可以在处理器1401上运行的计算机程序1403。处理器1401执行计算机程序1403时实现上述各个方法实施例中的步骤。或者,处理器1401执行计算机程序1403时实现上述各装置实施例中各模块/单元的功能。FIG. 14 is a schematic structural diagram of an electronic device 14 provided by an embodiment of the present disclosure. As shown in FIG. 5 , the electronic device 14 of this embodiment includes: a processor 1401 , a memory 1402 , and a computer program 1403 stored in the memory 1402 and capable of running on the processor 1401 . When the processor 1401 executes the computer program 1403, the steps in the foregoing method embodiments are implemented. Alternatively, when the processor 1401 executes the computer program 1403, the functions of the modules/units in the foregoing device embodiments are implemented.
示例性地,计算机程序1403可以被分割成一个或多个模块/单元,一个或多个模块/单元被存储在存储器1402中,并由处理器1401执行,以完成本公开。一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述计算机程序1403在电子设备14中的执行过程。Exemplarily, the computer program 1403 can be divided into one or more modules/units, and one or more modules/units are stored in the memory 1402 and executed by the processor 1401 to complete the present disclosure. One or more modules/units may be a series of computer program instruction segments capable of accomplishing specific functions, and the instruction segments are used to describe the execution process of the computer program 1403 in the electronic device 14 .
电子设备14可以是桌上型计算机、笔记本、掌上电脑及云端服务器等电子设备。电子设备14可以包括但不仅限于处理器1401和存储器1402。本领域技术人员可以理解,图5仅仅是电子设备14的示例,并不构成对电子设备14的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如,电子设备还可以包括输入输出设备、网络接入设备、总线等。The electronic equipment 14 may be electronic equipment such as desktop computers, notebooks, palmtop computers, and cloud servers. The electronic device 14 may include but not limited to a processor 1401 and a memory 1402 . Those skilled in the art can understand that FIG. 5 is only an example of the electronic device 14, and does not constitute a limitation to the electronic device 14. It may include more or less components than shown in the figure, or combine certain components, or different components. , for example, an electronic device may also include an input and output device, a network access device, a bus, and the like.
处理器1401可以是中央处理单元(Central Processing Unit,CPU),也可以是其它通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 1401 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), on-site Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
存储器1402可以是电子设备14的内部存储单元,例如,电子设备14的硬盘或内存。存储器1402也可以是电子设备14的外部存储设备,例如,电子设备14上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器1402还可以既包括电子设备14的内部存储单元也包括外部存储设备。存储器1402用于存储计算机程序以及电子设备所需的其它程序和数据。存储器1402还可以用于暂时地存储已经输出或者将要输出的数据。The storage 1402 may be an internal storage unit of the electronic device 14 , for example, a hard disk or a memory of the electronic device 14 . The memory 1402 can also be an external storage device of the electronic device 14, for example, a plug-in hard disk equipped on the electronic device 14, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card ( Flash Card), etc. Further, the memory 1402 may also include both an internal storage unit of the electronic device 14 and an external storage device. The memory 1402 is used to store computer programs and other programs and data required by the electronic device. The memory 1402 can also be used to temporarily store data that has been output or will be output.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述 系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used for illustration. In practical applications, the above-mentioned functions can be assigned to different functional units, Completion of modules means that the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit, and the above-mentioned integrated units may adopt hardware It can also be implemented in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units and modules in the above-mentioned system, reference may be made to the corresponding process in the foregoing method embodiments, and details are not repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the descriptions of each embodiment have their own emphases, and for parts that are not detailed or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本公开的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementation should not be considered beyond the scope of the present disclosure.
在本公开所提供的实施例中,应该理解到,所揭露的装置/计算机设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/计算机设备实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in the present disclosure, it should be understood that the disclosed apparatus/computer equipment and methods may be implemented in other ways. For example, the device/computer device embodiments described above are only illustrative, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, and multiple units or components can be Incorporation may either be integrated into another system, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。A unit described as a separate component may or may not be physically separated, and a component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本公开实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,计算机程序可以存储在计算机可读存储介质中,该计算机程序在被处理器执行时,可以实现上述各个方法实施例的步骤。计算机程序可以包括计算机程序代码,计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。计算机可读介质可以包括:能够携带计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、电载波信号、电信信号以及软件分发介质等。需要说明的是,计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如,在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。If an integrated module/unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present disclosure realizes all or part of the processes in the methods of the above embodiments, and can also be completed by instructing related hardware through computer programs. The computer programs can be stored in computer-readable storage media, and the computer programs can be processed. When executed by the controller, the steps in the above-mentioned method embodiments can be realized. A computer program may include computer program code, which may be in source code form, object code form, executable file, or some intermediate form or the like. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (Read-Only Memory, ROM), random access Memory (Random Access Memory, RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in computer readable media may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, computer readable media may not Including electrical carrier signals and telecommunication signals.
以上实施例仅用以说明本公开的技术方案,而非对其限制;尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本公开各实施例技术方案的精神和范围,均应包含在本公开的保护范围之内。The above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be described in the foregoing embodiments Modifications to the technical solutions recorded, or equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in this disclosure. within the scope of protection.

Claims (20)

  1. 一种联合学习中确定参与方贡献度的方法,其特征在于,包括:A method for determining the contribution of a participant in joint learning, characterized by comprising:
    确定联合学习的参与方,基于所述参与方构造全部参与方组合,并计算每个参与方组合对应的权重;Determine the participants of the joint learning, construct all participant combinations based on the participants, and calculate the weight corresponding to each participant combination;
    确定聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据所述效用变化值判断是否对所述聚合周期内参与方的贡献值进行计算;Determine the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of the participant in the aggregation period according to the utility change value;
    当判断结果为是时,按照预定顺序从所述全部参与方组合中选取一个参与方组合,并对选取的所述参与方组合中的每一个参与方的边际贡献值进行估计,根据估计结果以及所述参与方组合的权重,判断是否采用插值函数对所述参与方组合的效用值进行计算;When the judgment result is yes, select a participant combination from all the participant combinations according to a predetermined order, and estimate the marginal contribution value of each participant in the selected participant combination, according to the estimation result and The weight of the combination of participants, judging whether to use an interpolation function to calculate the utility value of the combination of participants;
    当判断结果为是时,利用插值函数计算所述参与方组合的效用值,当判断结果为否时,利用预设的模型推演方式计算所述参与方组合的效用值,并依据计算出的所述参与方组合的效用值对所述查找表进行更新;When the judgment result is yes, use the interpolation function to calculate the utility value of the combination of participants; when the judgment result is no, use the preset model deduction method to calculate the utility value of the combination of participants, and calculate updating the lookup table with the utility value of the combination of the participants;
    依次选取每一个参与方组合,直至计算得到所有所述参与方组合的效用值,利用所有所述参与方组合的效用值对所述查找表进行更新,得到最终更新后的查找表,以便基于所述最终更新后的查找表,计算每个所述参与方的贡献值,根据所述贡献值确定所述参与方在所述联合学习中的贡献度。Select each participant combination in turn until the utility values of all the participant combinations are calculated, and update the lookup table using the utility values of all the participant combinations to obtain a final updated lookup table, so that based on the The final updated lookup table is used to calculate the contribution value of each participant, and the contribution degree of the participant in the joint learning is determined according to the contribution value.
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述参与方构造全部参与方组合,并计算每个参与方组合对应的权重,包括:根据所述联合学习中的所有所述参与方,按照参与方数量从少至多的方式构造出所述全部参与方组合,所述全部参与方组合中包含多个所述参与方组合,根据每个所述参与方组合中参与方的个数计算所述权重;其中,所述权重用于表示所述参与方组合在所述全部参与方组合中出现的概率;The method according to claim 1, wherein the constructing all participant combinations based on the participants and calculating the weight corresponding to each participant combination includes: according to all the participants in the joint learning According to the number of participants from the fewest to the most, the combination of all participants is constructed. The combination of all participants includes a plurality of combinations of participants. According to the number of participants in each combination of participants Calculating the weight; wherein, the weight is used to represent the probability that the participant combination appears in all the participant combinations;
    或者,所述利用预设的模型推演方式计算所述参与方组合的效用值,并依据计算出的所述参与方组合的效用值对所述查找表进行更新,包括:对所述参与方组合对应的模型参数进行聚合,并对所述参与方组合对应的模型进行模型推演,对所述参与方组合中每个所述参与方的权重进行聚合,得到所述参与方组合的权重,对所述参与方组合在标准验证集上进行模型推演,计算得到所述参与方组合的真实效用值,利用所述真实效用值对所述查找表进行更新;Alternatively, calculating the utility value of the participant combination by using a preset model derivation method, and updating the lookup table according to the calculated utility value of the participant combination includes: The corresponding model parameters are aggregated, and the model corresponding to the participant combination is modeled, and the weight of each participant in the participant combination is aggregated to obtain the weight of the participant combination. The combination of the participants performs model deduction on the standard verification set, calculates the real utility value of the combination of the participants, and uses the real utility value to update the look-up table;
    或者,所述基于所述最终更新后的查找表,计算每个所述参与方的贡献值,包括:根据所述最终更新后的查找表中的每个所述参与方组合的效用值,利用预设的沙普利值计算公式,计算每个所述参与方对应的贡献值,其中,所述贡献值用于表示所述参与方在所述联合学习中对所述聚合周期训练的联合学习模型的贡献度。Alternatively, the calculating the contribution value of each participant based on the final updated lookup table includes: according to the utility value of each participant combination in the final updated lookup table, using The preset Shapley value calculation formula calculates the contribution value corresponding to each of the participants, wherein the contribution value is used to represent the joint learning of the participants in the joint learning for the aggregation cycle training Contribution of the model.
  3. 根据权利要求1所述的方法,其特征在于,所述确定聚合周期前后联合学习模型对应的效用变化值并建立查找表,包括:针对每个所述聚合周期,确定所述聚合周期的初始效用值和最终效用值,将所述最终效用值与所述初始效用值之间的差值作为所述效用变化值,并建立所述聚合周期对应的包含所有所述参与方组合的查找表;对所述查找表执行初始化操作,以使所述查找表中除空集参与方组合和全集参与方组合之外的其他参与方组合的初始效用值为0;其中,所述查找表用于存储所有所述参与方组合对应的效用值;The method according to claim 1, wherein determining the utility change value corresponding to the joint learning model before and after the aggregation period and establishing a lookup table includes: for each of the aggregation periods, determining the initial utility of the aggregation period value and the final utility value, using the difference between the final utility value and the initial utility value as the utility change value, and establishing a lookup table corresponding to the aggregation period that contains all the combinations of the participants; The lookup table performs an initialization operation, so that the initial utility value of other participant combinations in the lookup table except the empty set participant combination and the full set participant combination is 0; wherein, the lookup table is used to store all The utility value corresponding to the combination of the participants;
    或者,所述根据所述效用变化值判断是否对所述聚合周期内参与方的贡献值进行计算,包括:将所述聚合周期的效用变化值与预设的第一截断阈值进行比较,当所述聚合周期的效用变化值小于所述第一截断阈值,且连续多轮所述聚合周期的效用变化值均小于所述第一截断阈值时,则判断所述聚合周期内各参与方的贡献值为0;否则,对所述聚合周期内各参与方的贡献值进行计算。Alternatively, the judging whether to calculate the contribution value of the participant in the aggregation period according to the utility change value includes: comparing the utility change value of the aggregation period with a preset first cut-off threshold, when the When the utility change value of the aggregation cycle is less than the first cut-off threshold, and the utility change values of the aggregation cycle for multiple consecutive rounds are all smaller than the first cut-off threshold, the contribution value of each participant in the aggregation cycle is judged is 0; otherwise, calculate the contribution value of each participant in the aggregation period.
  4. 根据权利要求1所述的方法,其特征在于,所述按照预定顺序从所述全部参与方组合中选取一个参与方组合,并对选取的所述参与方组合中的每一个参与方的边际贡献值进行估计,包括:The method according to claim 1, characterized in that, selecting a participant combination from all the participant combinations according to a predetermined order, and making a marginal contribution to each participant in the selected participant combination Values are estimated, including:
    按照所述全部参与方组合中所述参与方组合的排列顺序,依次对所述参与方组合进行选取,并对选取出的所述参与方组合内的参与方依次进行迭代,以便对所述参与方加入所述参与方组合时产生的边际贡献值进行估计,得到所述边际贡献值的估计值。According to the arrangement order of the participant combinations in all the participant combinations, the participant combinations are selected in turn, and the participants in the selected participant combinations are iterated in turn, so as to The marginal contribution value generated when the party joins the participant combination is estimated to obtain the estimated value of the marginal contribution value.
  5. 根据权利要求4所述的方法,其特征在于,所述根据估计结果以及所述参与方组合的权重,判断是否采用插值函数对所述参与方组合的效用值进行计算,包括:计算所述参与方对应的边际贡献值的估计值与所述参与方对应所述参与方组合的权重的乘积,并将所述乘积与预设的第二截断阈值进行比较;当所述参与方组合中每个所述参与方对应的所述乘积均小于或等于预设的第二截断阈值时,则判断采用插值函数对所述参与方组合的效用值进行计算;否则,利用预设的模型推演方式计算所述参与方组合的效用值;The method according to claim 4, wherein, according to the estimation result and the weight of the participant combination, judging whether to use an interpolation function to calculate the utility value of the participant combination includes: calculating the participation The product of the estimated value of the marginal contribution value corresponding to the party and the weight of the participant corresponding to the participant combination, and comparing the product with the preset second cut-off threshold; when each of the participant combination When the products corresponding to the participants are all less than or equal to the preset second cut-off threshold, it is judged that an interpolation function is used to calculate the utility value of the participant combination; otherwise, the preset model derivation method is used to calculate the The utility value of the combination of the above participants;
    所述利用插值函数计算所述参与方组合的效用值,包括:基于历史迭代过程中计算的所述参与方组合的效用值、以及所述参与方组合为全集参与方组合时对应的效用值,利用预设的插值函数对所述参与 方组合的效用值进行估计,得到所述参与方组合的效用值所对应的估计值,并根据所述估计值对所述查找表进行更新。The calculation of the utility value of the participant combination by using an interpolation function includes: based on the utility value of the participant combination calculated in the historical iteration process, and the corresponding utility value when the participant combination is a complete set of participant combinations, Estimate the utility value of the participant combination by using a preset interpolation function to obtain an estimated value corresponding to the utility value of the participant combination, and update the lookup table according to the estimated value.
  6. 一种联合学习中确定参与方贡献度的装置,其特征在于,包括:A device for determining the contribution degree of a participant in joint learning, characterized in that it includes:
    构造模块,被配置为确定联合学习的参与方,基于所述参与方构造全部参与方组合,并计算每个参与方组合对应的权重;The construction module is configured to determine the participants of the joint learning, construct all participant combinations based on the participants, and calculate the weight corresponding to each participant combination;
    第一判断模块,被配置为确定聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据所述效用变化值判断是否对所述聚合周期内参与方的贡献值进行计算;The first judging module is configured to determine the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of the participant in the aggregation period according to the utility change value;
    第二判断模块,被配置为当判断结果为是时,按照预定顺序从所述全部参与方组合中选取一个参与方组合,并对选取的所述参与方组合中的每一个参与方的边际贡献值进行估计,根据估计结果以及所述参与方组合的权重,判断是否采用插值函数对所述参与方组合的效用值进行计算;The second judging module is configured to, when the judging result is yes, select a participant combination from all the participant combinations in a predetermined order, and make a marginal contribution to each participant in the selected participant combination value, and judge whether to use an interpolation function to calculate the utility value of the participant combination according to the estimation result and the weight of the participant combination;
    更新模块,被配置为当判断结果为是时,利用插值函数计算所述参与方组合的效用值,当判断结果为否时,利用预设的模型推演方式计算所述参与方组合的效用值,并依据计算出的所述参与方组合的效用值对所述查找表进行更新;The update module is configured to use an interpolation function to calculate the utility value of the participant combination when the judgment result is yes, and to calculate the utility value of the participant combination by using a preset model derivation method when the judgment result is no, and updating the lookup table according to the calculated utility value of the participant combination;
    计算模块,被配置为依次选取每一个参与方组合,直至计算得到所有所述参与方组合的效用值,利用所有所述参与方组合的效用值对所述查找表进行更新,得到最终更新后的查找表,以便基于所述最终更新后的查找表,计算每个所述参与方的贡献值,根据所述贡献值确定所述参与方在所述联合学习中的贡献度。The calculation module is configured to sequentially select each combination of participants until the utility values of all the combinations of participants are calculated, and update the lookup table by using the utility values of all combinations of participants to obtain the final updated A lookup table, so as to calculate the contribution value of each participant based on the finally updated lookup table, and determine the contribution of the participant in the joint learning according to the contribution value.
  7. 一种联合学习中确定参与方贡献度的方法,其特征在于,包括:A method for determining the contribution of a participant in joint learning, characterized by comprising:
    基于联合学习中的参与方确定全部参与方组合,并计算所述全部参与方组合中每一个参与方组合的权重;determining all participant combinations based on the participants in the joint learning, and calculating the weight of each participant combination in the all participant combinations;
    确定当前聚合周期开始前的联合模型的第一效用值,以及当前聚合周期结束后的联合模型的第二效用值,基于所述第一效用值与所述第二效用值计算效用变化值,并建立查找表;其中,所述效用变化值用于判断是否计算所述当前聚合周期内各个参与方的贡献值;determining a first utility value of the joint model before the start of the current aggregation period, and a second utility value of the joint model after the end of the current aggregation period, calculating a utility change value based on the first utility value and the second utility value, and Establish a lookup table; wherein, the utility change value is used to determine whether to calculate the contribution value of each participant in the current aggregation period;
    当判断计算所述贡献值时,从所述全部参与方组合中选取一个参与方组合,并计算所述参与方组合中每一个参与方对应的边际贡献值,根据所述边际贡献值以及所述权重,判断利用第一估计方式或者第二估计方式对所述参与方组合的效用值进行估计;When judging and calculating the contribution value, select a participant combination from all the participant combinations, and calculate the marginal contribution value corresponding to each participant in the participant combination, according to the marginal contribution value and the Weight, judging whether to use the first estimation method or the second estimation method to estimate the utility value of the participant combination;
    确定所述第一估计方式或者第二估计方式对所述参与方组合的效用值的估计结果,利用所述估计结果对所述查找表进行更新,并依次迭代估计得到每一个所述参与方组合的效用值,获取依据所述效用值进行更新后得到的最终查找表,以便利用所述最终查找表对所述参与方的贡献值进行计算。determining the estimation result of the utility value of the participant combination by the first estimation method or the second estimation method, using the estimation result to update the lookup table, and iteratively estimating in turn to obtain each participant combination The utility value of , and obtain the final lookup table obtained after updating according to the utility value, so as to use the final lookup table to calculate the contribution value of the participant.
  8. 根据权利要求7所述的方法,其特征在于,所述确定当前聚合周期开始前的联合模型的第一效用值,以及当前聚合周期结束后的联合模型的第二效用值,基于所述第一效用值与所述第二效用值计算效用变化值,并建立查找表,包括:确定所述当前聚合周期开始前以及结束后,所述联合模型对应的第一效用值和第二效用值,计算所述第二效用值与所述第一效用值之间的差值,将所述差值作为所述效用变化值,并建立所述当前聚合周期对应的包含所有所述参与方组合的查找表;对所述查找表执行初始化操作,以使所述查找表中除空集参与方组合和全集参与方组合之外的其他参与方组合的初始效用值为0;其中,所述查找表用于存储所有所述参与方组合对应的效用值;The method according to claim 7, wherein said determining the first utility value of the joint model before the start of the current aggregation period and the second utility value of the joint model after the end of the current aggregation period is based on the first The utility value and the second utility value calculate the utility change value, and establish a lookup table, including: determining the first utility value and the second utility value corresponding to the joint model before and after the current aggregation period begins, and calculating The difference between the second utility value and the first utility value, using the difference as the utility change value, and establishing a lookup table corresponding to the current aggregation period that contains all the combinations of the participants ; Perform an initialization operation on the lookup table, so that the initial utility value of other participant combinations in the lookup table except the empty set participant combination and the full set participant combination is 0; wherein, the lookup table is used for storing utility values corresponding to all combinations of participants;
    或者,所述效用变化值用于判断是否计算所述当前聚合周期内各个参与方的贡献值,包括:将所述当前聚合周期对应联合模型的效用变化值与预设的第一截断阈值进行比较,当所述效用变化值小于所述第一截断阈值时,则判断所述当前聚合周期内各个参与方的贡献值为0;否则,对所述当前聚合周期内各个参与方的贡献值进行重新计算。Alternatively, the utility change value is used to judge whether to calculate the contribution value of each participant in the current aggregation period, including: comparing the utility change value of the joint model corresponding to the current aggregation period with a preset first cut-off threshold , when the utility change value is less than the first cut-off threshold, it is judged that the contribution value of each participant in the current aggregation period is 0; otherwise, the contribution value of each participant in the current aggregation period is re- calculate.
  9. 根据权利要求7所述的方法,其特征在于,所述从所述全部参与方组合中选取一个参与方组合,并计算所述参与方组合中每一个参与方对应的边际贡献值,包括:按照所述全部参与方组合中每个参与方组合的排列顺序,依次从所述全部参与方组合中选取一个参与方组合,并从所述参与方组合中随机选取一个参与方;根据所述参与方从所述参与方组合中划分出一个子组合,计算所述参与方加入所述子组合时产生的边际贡献值,对所述参与方组合内的参与方依次进行迭代,以便计算得到每一个所述参与方对应的边际贡献值;其中,所述子组合为所述参与方组合中除随机选取的所述参与方以外的参与方组成的集合;The method according to claim 7, wherein the selecting a participant combination from all the participant combinations, and calculating the corresponding marginal contribution value of each participant in the participant combination includes: The order of arrangement of each participant combination in the all participant combinations is to select a participant combination from the all participant combinations in turn, and randomly select a participant from the participant combination; according to the participant A sub-combination is divided from the combination of participants, the marginal contribution value generated when the participant joins the sub-combination is calculated, and the participants in the combination of participants are iterated sequentially, so as to calculate and obtain each The marginal contribution value corresponding to the participant; wherein, the sub-combination is a set of participants other than the randomly selected participant in the participant combination;
    所述根据所述边际贡献值以及所述权重,判断利用第一估计方式或者第二估计方式对所述参与方组合的效用值进行估计,包括:计算所述参与方的边际贡献值与所述参与方所属所述参与方组合的权重之间的乘积,并将所述乘积与预设的第二截断阈值进行比较;当所述参与方组合中每个所述参与方对应的所述乘积均小于或等于所述第二截断阈值时,则判断利用所述第一估计方式对所述参与方组合的效用值进行估计;否则,利用所述第二估计方式对所述参与方组合的效用值进行估计。According to the marginal contribution value and the weight, judging to use the first estimation method or the second estimation method to estimate the utility value of the participant combination includes: calculating the marginal contribution value of the participant and the The product between the weights of the participant combination to which the participant belongs, and compare the product with the preset second cut-off threshold; when the product corresponding to each participant in the participant combination is When it is less than or equal to the second cut-off threshold, it is judged to use the first estimation method to estimate the utility value of the participant combination; otherwise, use the second estimation method to estimate the utility value of the participant combination Make an estimate.
  10. 根据权利要求9所述的方法,其特征在于,所述利用所述第一估计方式对所述参与方组合的效用值进行估计,包括:从所述查找表中获取所述参与方组合中的子组合对应的效用值,对所述子组合对应的效用值进行平均值、最大值或者最小值的计算,将计算得到的平均值、最大值或者最小值作为所述参与方组合的效用值的估计值,并根据所述估计值对所述查找表进行更新;The method according to claim 9, characterized in that estimating the utility value of the participant combination by using the first estimation method comprises: obtaining the utility value of the participant combination from the lookup table The utility value corresponding to the sub-combination, calculate the average value, maximum value or minimum value of the utility value corresponding to the sub-combination, and use the calculated average value, maximum value or minimum value as the utility value of the participant combination an estimated value, and updating the lookup table according to the estimated value;
    或者,所述利用所述第二估计方式对所述参与方组合的效用值进行估计,包括:对所述参与方组合对应的模型参数进行聚合,并对所述参与方组合对应的模型进行模型推演,对所述参与方组合中每个所述参与方的权重进行聚合,得到所述参与方组合的权重,对所述参与方组合在标准验证集上进行模型推演,计算得到所述参与方组合的真实效用值,利用所述真实效用值对所述查找表进行更新。Alternatively, the estimating the utility value of the participant combination by using the second estimation method includes: aggregating model parameters corresponding to the participant combination, and modeling the model corresponding to the participant combination Deduction, the weight of each of the participants in the combination of participants is aggregated to obtain the weight of the combination of participants, model deduction is performed on the combination of participants on a standard verification set, and the calculation of the combination of the participants is obtained combined real utility value, using the real utility value to update the lookup table.
  11. 一种联合学习中确定参与方贡献度的装置,其特征在于,包括:A device for determining the contribution degree of a participant in joint learning, characterized in that it includes:
    确定模块,被配置为基于联合学习中的参与方确定全部参与方组合,并计算所述全部参与方组合中每一个参与方组合的权重;A determination module configured to determine all participant combinations based on the participants in the joint learning, and calculate the weight of each participant combination in the all participant combinations;
    建立模块,被配置为确定当前聚合周期开始前的联合模型的第一效用值,以及当前聚合周期结束后的联合模型的第二效用值,基于所述第一效用值与所述第二效用值计算效用变化值,并建立查找表;其中,所述效用变化值用于判断是否计算所述当前聚合周期内各个参与方的贡献值;A building module configured to determine a first utility value of the joint model before the start of the current aggregation period, and a second utility value of the joint model after the end of the current aggregation period, based on the first utility value and the second utility value Calculating the utility change value, and establishing a lookup table; wherein, the utility change value is used to judge whether to calculate the contribution value of each participant in the current aggregation period;
    判断模块,被配置为当判断计算所述贡献值时,从所述全部参与方组合中选取一个参与方组合,并计算所述参与方组合中每一个参与方对应的边际贡献值,根据所述边际贡献值以及所述权重,判断利用第一估计方式或者第二估计方式对所述参与方组合的效用值进行估计;The judging module is configured to, when judging and calculating the contribution value, select a participant combination from all the participant combinations, and calculate the marginal contribution value corresponding to each participant in the participant combination, according to the The marginal contribution value and the weight determine to use the first estimation method or the second estimation method to estimate the utility value of the participant combination;
    计算模块,被配置为确定所述第一估计方式或者第二估计方式对所述参与方组合的效用值的估计结果,利用所述估计结果对所述查找表进行更新,并依次迭代估计得到每一个所述参与方组合的效用值,获取依据所述效用值进行更新后得到的最终查找表,以便利用所述最终查找表对所述参与方的贡献值进行计算。The calculation module is configured to determine the estimation result of the utility value of the participant combination by the first estimation method or the second estimation method, use the estimation result to update the look-up table, and iteratively estimate in turn to obtain each A utility value of the participant combination, and a final lookup table obtained after updating according to the utility value is obtained, so as to use the final lookup table to calculate the contribution value of the participant.
  12. 一种联合学习中确定参与方贡献度的方法,其特征在于,包括:A method for determining the contribution of a participant in joint learning, characterized by comprising:
    基于联合学习的架构,生成多个参与方组,并确定由多个所述参与方组构成的参与方组集合,计算所述参与方组的权重,其中每个所述参与方组包含至少两个参与方;Based on the framework of joint learning, multiple participant groups are generated, and a set of participant groups composed of multiple participant groups is determined, and weights of the participant groups are calculated, wherein each of the participant groups includes at least two participants;
    确定所述联合学习中的聚合周期,获取所述聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据所述效用变化值判断是否计算所述聚合周期内各个参与方的贡献值;Determine the aggregation period in the joint learning, obtain the utility change value corresponding to the joint learning model before and after the aggregation period and establish a lookup table, and judge whether to calculate the contribution value of each participant in the aggregation period according to the utility change value;
    当判断结果为是时,利用所述参与方组集合中的参与方组随机生成一个全排列组合,并根据所述全排列组合中所述参与方组中的参与方顺序生成多个子组合,计算参与方加入所述子组合时的边际贡献值的估计值,根据所述边际贡献值的估计值以及所述参与方组的权重,判断是否采用插值函数对所述参与方加入所述子组合后形成的新参与方组的效用值进行计算;When the judgment result is yes, use the participant groups in the participant group set to randomly generate a full permutation combination, and generate multiple subcombinations according to the order of the participants in the participant group in the full permutation combination, calculate The estimated value of the marginal contribution value when the participant joins the sub-combination, according to the estimated value of the marginal contribution value and the weight of the participant group, it is judged whether to use an interpolation function to add the participant to the sub-combination Calculate the utility value of the new participant group formed;
    当判断结果为是时,利用插值函数计算所述新参与方组的效用值,当判断结果为否时,利用预设的模型推演方式计算所述新参与方组的效用值,并依据计算出的所述新参与方组的效用值对所述查找表进行更新;When the judgment result is yes, use the interpolation function to calculate the utility value of the new participant group, when the judgment result is no, use the preset model derivation method to calculate the utility value of the new participant group, and calculate updating the lookup table with the utility value of the new party group;
    基于更新后的查找表,计算所述参与方的边际贡献值,并判断所述参与方的边际贡献值是否收敛,当判断结果为是时,将收敛后的边际贡献值作为所述参与方的贡献值,当判断结果为否时,生成一个新的全排列组合,直至计算得到所有收敛后的所述参与方的贡献值,根据所述贡献值确定所述参与方在所述联合学习中的贡献度。Based on the updated lookup table, calculate the marginal contribution value of the participant, and judge whether the marginal contribution value of the participant is converged, and when the judgment result is yes, use the converged marginal contribution value as the participant's Contribution value, when the judgment result is no, generate a new full permutation combination until the calculation of the contribution value of all the participants after convergence, and determine the contribution of the participant in the joint learning according to the contribution value contribution.
  13. 根据权利要求12所述的方法,其特征在于,所述根据所述全排列组合中所述参与方组中参与方顺序生成多个子组合,计算参与方加入所述子组合时的边际贡献值的估计值,包括:The method according to claim 12, characterized in that, generating a plurality of sub-combinations according to the order of the participants in the participant group in the full arrangement combination, and calculating the marginal contribution value of the participants when they join the sub-combinations Estimates, including:
    按照所述参与方顺序将所述全排列组合划分成多个子组合,并确定所述全排列组合中的所述子组合的最后一个参与方所对应的下一个参与方,计算所述下一个参与方加入所述子组合时的边际贡献值的估计值。Divide the full permutation combination into multiple subcombinations according to the order of the participants, and determine the next participant corresponding to the last participant in the subcombination in the full permutation combination, and calculate the next participant Estimates of the contribution margins when a party joins the subportfolio.
  14. 根据权利要求12所述的方法,其特征在于,所述基于更新后的查找表,计算所述参与方的边际贡献值,并判断所述参与方的边际贡献值是否收敛,当判断结果为是时,将收敛后的边际贡献值作为所述参与方的贡献值,包括:The method according to claim 12, characterized in that, based on the updated lookup table, the contribution margin of the participant is calculated, and it is judged whether the contribution contribution of the participant converges, and when the judgment result is yes When , take the converged marginal contribution value as the contribution value of the participant, including:
    根据所述更新后的查找表中所述参与方加入所述子组合后的效用值,利用预设的沙普利值计算公式,计算所述参与方的边际贡献值;并根据所述参与方的边际贡献值是否收敛,当判断结果为收敛时,将收敛后的边际贡献值作为所述参与方的贡献值;According to the utility value of the participant in the updated lookup table after joining the sub-combination, the preset Shapley value calculation formula is used to calculate the marginal contribution value of the participant; and according to the participant Whether the marginal contribution value of the converged value is converged, and when the judgment result is converged, the converged marginal contribution value is used as the contribution value of the participant;
    其中,所述贡献值用于表示所述参与方在所述联合学习中对所述聚合周期训练的联合学习模型的贡献度。Wherein, the contribution value is used to represent the contribution of the participant to the joint learning model trained in the aggregation period in the joint learning.
  15. 一种联合学习中确定参与方贡献度的装置,其特征在于,包括:A device for determining the contribution degree of a participant in joint learning, characterized in that it includes:
    生成模块,被配置为基于联合学习的架构,生成多个参与方组,并确定由多个所述参与方组构成的 参与方组集合,计算所述参与方组的权重,其中每个所述参与方组包含至少两个参与方;The generation module is configured to generate a plurality of participant groups based on a joint learning architecture, and determine a participant group set composed of a plurality of the participant groups, and calculate the weights of the participant groups, wherein each of the participant groups The party group contains at least two parties;
    建立模块,被配置为确定所述联合学习中的聚合周期,获取所述聚合周期前后联合学习模型对应的效用变化值并建立查找表,根据所述效用变化值判断是否计算所述聚合周期内各个参与方的贡献值;The establishment module is configured to determine the aggregation period in the joint learning, obtain the utility change value corresponding to the joint learning model before and after the aggregation period, and establish a lookup table, and judge whether to calculate each in the aggregation period according to the utility change value. Contribution value of participants;
    判断模块,被配置为当判断结果为是时,利用所述参与方组集合中的参与方组随机生成一个全排列组合,并根据所述全排列组合中所述参与方组中的参与方顺序生成多个子组合,计算参与方加入所述子组合时的边际贡献值的估计值,根据所述边际贡献值的估计值以及所述参与方组的权重,判断是否采用插值函数对所述参与方加入所述子组合后形成的新参与方组的效用值进行计算;The judging module is configured to randomly generate a full permutation combination by using the participant groups in the participant group set when the judgment result is yes, and according to the order of the participants in the participant group in the full permutation combination Generate a plurality of sub-combinations, calculate the estimated value of the marginal contribution value when the participant joins the sub-combination, and judge whether to use an interpolation function to evaluate the participants according to the estimated value of the marginal contribution value and the weight of the participant group The utility value of the new participant group formed after adding the sub-combination is calculated;
    更新模块,被配置为当判断结果为是时,利用插值函数计算所述新参与方组的效用值,当判断结果为否时,利用预设的模型推演方式计算所述新参与方组的效用值,并依据计算出的所述新参与方组的效用值对所述查找表进行更新;The update module is configured to use an interpolation function to calculate the utility value of the new participant group when the judgment result is yes, and to calculate the utility value of the new participant group by using a preset model derivation method when the judgment result is no value, and update the lookup table according to the calculated utility value of the new participant group;
    计算模块,被配置为基于更新后的查找表,计算所述参与方的边际贡献值,并判断所述参与方的边际贡献值是否收敛,当判断结果为是时,将收敛后的边际贡献值作为所述参与方的贡献值,当判断结果为否时,生成一个新的全排列组合,直至计算得到所有收敛后的所述参与方的贡献值,根据所述贡献值确定所述参与方在所述联合学习中的贡献度。The calculation module is configured to calculate the marginal contribution value of the participant based on the updated lookup table, and judge whether the marginal contribution value of the participant is converged, and when the judgment result is yes, the converged marginal contribution value As the contribution value of the participant, when the judgment result is no, a new full permutation combination is generated until the contribution value of all converged participants is calculated, and the participant is determined according to the contribution value The degree of contribution in the joint learning.
  16. 一种联合学习训练方法,其特征在于,包括:A joint learning training method, characterized in that, comprising:
    在联合学习的本轮聚合周期内,获取联合学习的参与方根据本地数据进行初始模型训练得到的本地模型,对所述参与方的本地模型执行聚合操作,得到联合模型;In the current round of aggregation cycle of the joint learning, the local model obtained by the initial model training of the participants of the joint learning according to the local data is obtained, and the aggregation operation is performed on the local models of the participants to obtain the joint model;
    利用预设的联合学习贡献值算法,对所述本轮聚合周期内每个所述参与方对所述联合模型的贡献值进行计算,得到每个所述参与方对应的联合学习贡献值;Using a preset joint learning contribution value algorithm, calculate the contribution value of each of the participants to the joint model in the current round of aggregation period, and obtain the joint learning contribution value corresponding to each of the participants;
    获取每个所述参与方的初始指标,对所述联合学习贡献值以及初始指标执行融合操作,得到每个所述参与方的贡献度指标,其中所述初始指标用于表征所述参与方对联合学习的初始贡献度;Obtain the initial index of each of the participants, perform a fusion operation on the joint learning contribution value and the initial index, and obtain the contribution index of each of the participants, wherein the initial index is used to represent the contribution of the participant to The initial contribution of joint learning;
    根据所述贡献度指标计算所述参与方在下一轮聚合周期内的训练轮次,以使所述参与方在所述下一轮聚合周期内,基于所述训练轮次对本地模型进行训练,直至对所述联合模型的训练达到预设目标。calculating the training rounds of the participant in the next aggregation period according to the contribution index, so that the participant can train the local model based on the training rounds in the next aggregation period, Until the training of the joint model reaches the preset target.
  17. 根据权利要求16所述的方法,其特征在于,所述在联合学习的本轮聚合周期内,获取联合学习的参与方根据本地数据进行初始模型训练得到的本地模型,包括:在所述联合学习的本轮聚合周期开始时,各个所述参与方从预设的聚合服务器中下载初始模型,所述参与方利用本地数据对所述初始模型进行初始轮次的本地模型训练;其中,所述初始轮次为对所述本轮聚合周期的参数进行初始化得到的轮次数值;The method according to claim 16, characterized in that, in the current round of aggregation period of the joint learning, obtaining the local model obtained by the participants of the joint learning from the initial model training based on the local data comprises: When the current round of aggregation period starts, each of the participants downloads the initial model from the preset aggregation server, and the participant uses local data to perform an initial round of local model training on the initial model; wherein, the initial The round is the round value obtained by initializing the parameters of the current round of aggregation period;
    或者,所述利用预设的联合学习贡献值算法,对所述本轮聚合周期内每个所述参与方对所述联合模型的贡献值进行计算,得到每个所述参与方对应的联合学习贡献值,包括:根据所述联合学习中的参与方,构造全部的参与方组合,并计算每个所述参与方组合对应的权重;获取本轮聚合周期前后所述联合模型对应的效用变化值,根据所述效用变化值判断是否对各个所述参与方在所述本轮聚合周期的联合学习贡献值进行计算;当判断结果为是时,选取任意一个所述参与方组合,并计算所述参与方组合中的每一个所述参与方对应的边际贡献值;根据所述边际贡献值以及所述权重,对所述参与方组合的效用值的计算方式进行判断,以便选择利用插值函数或者模型推演的方式计算所述参与方组合的效用值;根据所述参与方组合的效用值对预定的查找表进行更新,并基于更新后的所述查找表,计算每个所述参与方对所述联合模型的联合学习贡献值。Alternatively, by using the preset joint learning contribution value algorithm, the contribution value of each of the participants to the joint model in the current round of aggregation period is calculated to obtain the joint learning corresponding to each of the participants. Contribution value, including: according to the participants in the joint learning, construct all the participant combinations, and calculate the weight corresponding to each of the participant combinations; obtain the utility change value corresponding to the joint model before and after the current round of aggregation period , judging whether to calculate the joint learning contribution value of each of the participants in the current aggregation cycle according to the utility change value; when the judgment result is yes, select any combination of the participants, and calculate the The marginal contribution value corresponding to each of the participants in the participant combination; according to the marginal contribution value and the weight, the calculation method of the utility value of the participant combination is judged, so as to choose to use an interpolation function or model Calculating the utility value of the combination of participants by means of deduction; updating the predetermined lookup table according to the utility value of the combination of participants, and based on the updated lookup table, calculating the contribution of each participant to the The joint learning contribution value of the joint model.
    或者,所述根据所述边际贡献值以及所述权重,对所述参与方组合的效用值的计算方式进行判断,以便选择利用插值函数或者模型推演的方式计算所述参与方组合的效用值,包括:根据所述参与方的边际贡献值与所述参与方组合的权重之间的乘积,将所述乘积与预设的截断阈值进行比较,当所述参与方组合中每个所述参与方对应的乘积均小于或等于所述截断阈值时,则选择利用插值函数的方式计算所述参与方组合的效用值,否则,选择利用模型推演的方式计算所述参与方组合的效用值;Or, according to the marginal contribution value and the weight, the calculation method of the utility value of the participant combination is judged, so as to choose to calculate the utility value of the participant combination by using an interpolation function or model derivation, Including: according to the product of the marginal contribution value of the participant and the weight of the participant combination, comparing the product with a preset cut-off threshold, when each participant in the participant combination When the corresponding products are all less than or equal to the cut-off threshold, choose to use an interpolation function to calculate the utility value of the participant combination, otherwise, choose to use model deduction to calculate the utility value of the participant combination;
    或者,在所述获取每个所述参与方的初始指标,对所述联合学习贡献值以及初始指标执行融合操作之前,所述方法还包括:针对所述联合学习中的每个所述参与方,根据每个所述参与方上报的本地数据质量、本地数据量和/或联合学习成本,计算每个所述参与方对应的初始指标,并对所述初始指标进行归一化处理,所述初始指标用于表示预估的所述参与方对所述本轮聚合周期的联合模型训练的贡献度;Alternatively, before acquiring the initial index of each of the participants and performing the fusion operation on the joint learning contribution value and the initial index, the method further includes: for each of the participants in the joint learning , according to the local data quality, local data volume and/or joint learning cost reported by each of the participants, calculate the initial index corresponding to each of the participants, and perform normalization processing on the initial index, the The initial indicator is used to represent the estimated contribution of the participant to the joint model training of the current aggregation cycle;
    或者,所述根据所述贡献度指标计算所述参与方在下一轮聚合周期内的训练轮次,包括:根据预先建立的贡献度指标与训练轮次之间的映射关系,生成映射函数,将计算得到的所述参与方对应的贡献度指标作为所述映射函数的输入,利用所述映射函数计算所述参与方对应的训练轮次,将所述训练轮次作为所述参与方在下一轮聚合周期内对本地模型进行训练时的聚合轮次。Alternatively, the calculating the training round of the participant in the next round of aggregation period according to the contribution index includes: generating a mapping function according to the pre-established mapping relationship between the contribution index and the training round, and The calculated contribution index corresponding to the participant is used as the input of the mapping function, and the training round corresponding to the participant is calculated by using the mapping function, and the training round is used as the participant's next round Aggregation rounds when training the local model within an aggregation cycle.
  18. 一种联合学习训练装置,其特征在于,包括:A joint learning training device, characterized in that it comprises:
    聚合模块,被配置为在联合学习的本轮聚合周期内,获取联合学习的参与方根据本地数据进行初始 模型训练得到的本地模型,对所述参与方的本地模型执行聚合操作,得到联合模型;The aggregation module is configured to obtain the local model obtained by the participants of the joint learning according to the local data for the initial model training in the current round of aggregation cycle of the joint learning, and perform an aggregation operation on the local models of the participants to obtain the joint model;
    计算模块,被配置为利用预设的联合学习贡献值算法,对所述本轮聚合周期内每个所述参与方对所述联合模型的贡献值进行计算,得到每个所述参与方对应的联合学习贡献值;The calculation module is configured to use a preset joint learning contribution value algorithm to calculate the contribution value of each of the participants to the joint model in the current round of aggregation period, and obtain the corresponding joint learning contribution value;
    融合模块,被配置为获取每个所述参与方的初始指标,对所述联合学习贡献值以及初始指标执行融合操作,得到每个所述参与方的贡献度指标,其中所述初始指标用于表征所述参与方对联合学习的初始贡献度;The fusion module is configured to obtain an initial index of each of the participants, perform a fusion operation on the joint learning contribution value and the initial index, and obtain a contribution index of each of the participants, wherein the initial index is used for Characterize the initial contribution of the participants to the joint learning;
    训练模块,被配置为根据所述贡献度指标计算所述参与方在下一轮聚合周期内的训练轮次,以使所述参与方在所述下一轮聚合周期内,基于所述训练轮次对本地模型进行训练,直至对所述联合模型的训练达到预设目标。A training module configured to calculate the training rounds of the participant in the next round of aggregation period according to the contribution index, so that the participant will, in the next round of aggregation period, based on the training rounds The local model is trained until the training of the joint model reaches a preset target.
  19. 一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如权利要求1所述的方法。An electronic device, comprising a memory, a processor, and a computer program stored in the memory and operable on the processor, the processor implements the method according to claim 1 when executing the program.
  20. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1所述的方法。A computer-readable storage medium storing a computer program, wherein the computer program implements the method according to claim 1 when executed by a processor.
PCT/CN2022/116570 2021-11-10 2022-09-01 Method and apparatus for determining contribution degree of participant in federated learning, and federated learning training method and apparatus WO2023082787A1 (en)

Applications Claiming Priority (8)

Application Number Priority Date Filing Date Title
CN202111337898.8 2021-11-10
CN202111326664.3A CN114116740A (en) 2021-11-10 2021-11-10 Method and device for determining contribution degree of participants in joint learning
CN202111337898.8A CN114116707A (en) 2021-11-10 2021-11-10 Method and device for determining contribution degree of participants in joint learning
CN202111326664.3 2021-11-10
CN202111326640.8 2021-11-10
CN202111326640.8A CN114116705A (en) 2021-11-10 2021-11-10 Method and device for determining contribution value of participants in joint learning
CN202111590175.9A CN116384500A (en) 2021-12-23 2021-12-23 Joint learning training method and device, electronic equipment and storage medium
CN202111590175.9 2021-12-23

Publications (1)

Publication Number Publication Date
WO2023082787A1 true WO2023082787A1 (en) 2023-05-19

Family

ID=86335060

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/116570 WO2023082787A1 (en) 2021-11-10 2022-09-01 Method and apparatus for determining contribution degree of participant in federated learning, and federated learning training method and apparatus

Country Status (1)

Country Link
WO (1) WO2023082787A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110443063A (en) * 2019-06-26 2019-11-12 电子科技大学 The method of the federal deep learning of self adaptive protection privacy
US20200285980A1 (en) * 2019-03-08 2020-09-10 NEC Laboratories Europe GmbH System for secure federated learning
CN112101528A (en) * 2020-09-17 2020-12-18 上海交通大学 Terminal contribution measurement method based on back propagation
CN112990478A (en) * 2021-02-22 2021-06-18 上海嗨普智能信息科技股份有限公司 Federal learning data processing system
CN114116740A (en) * 2021-11-10 2022-03-01 新智我来网络科技有限公司 Method and device for determining contribution degree of participants in joint learning
CN114116707A (en) * 2021-11-10 2022-03-01 新智我来网络科技有限公司 Method and device for determining contribution degree of participants in joint learning
CN114116705A (en) * 2021-11-10 2022-03-01 新智我来网络科技有限公司 Method and device for determining contribution value of participants in joint learning

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200285980A1 (en) * 2019-03-08 2020-09-10 NEC Laboratories Europe GmbH System for secure federated learning
CN110443063A (en) * 2019-06-26 2019-11-12 电子科技大学 The method of the federal deep learning of self adaptive protection privacy
CN112101528A (en) * 2020-09-17 2020-12-18 上海交通大学 Terminal contribution measurement method based on back propagation
CN112990478A (en) * 2021-02-22 2021-06-18 上海嗨普智能信息科技股份有限公司 Federal learning data processing system
CN114116740A (en) * 2021-11-10 2022-03-01 新智我来网络科技有限公司 Method and device for determining contribution degree of participants in joint learning
CN114116707A (en) * 2021-11-10 2022-03-01 新智我来网络科技有限公司 Method and device for determining contribution degree of participants in joint learning
CN114116705A (en) * 2021-11-10 2022-03-01 新智我来网络科技有限公司 Method and device for determining contribution value of participants in joint learning

Similar Documents

Publication Publication Date Title
WO2023124296A1 (en) Knowledge distillation-based joint learning training method and apparatus, device and medium
WO2021190638A1 (en) Federated modelling method based on non-uniformly distributed data, and related device
Heitsch et al. A note on scenario reduction for two-stage stochastic programs
CN111030861B (en) Edge calculation distributed model training method, terminal and network side equipment
US20180211166A1 (en) Distributed deep learning device and distributed deep learning system
CN113095512A (en) Federal learning modeling optimization method, apparatus, medium, and computer program product
US20240176906A1 (en) Methods, apparatuses, and systems for collaboratively updating model by multiple parties for implementing privacy protection
WO2021197223A1 (en) Model compression method, system, terminal, and storage medium
CN114116705A (en) Method and device for determining contribution value of participants in joint learning
CN114116707A (en) Method and device for determining contribution degree of participants in joint learning
CN109976901A (en) A kind of resource regulating method, device, server and readable storage medium storing program for executing
US11468330B2 (en) Artificial neural network growth
Yuan et al. Incentivizing federated learning under long-term energy constraint via online randomized auctions
CN113435534A (en) Data heterogeneous processing method and device based on similarity measurement, computer equipment and computer readable storage medium
Liang et al. Resource competition in blockchain networks under cloud and device enabled participation
WO2023082787A1 (en) Method and apparatus for determining contribution degree of participant in federated learning, and federated learning training method and apparatus
CN114116740A (en) Method and device for determining contribution degree of participants in joint learning
CN113095513A (en) Double-layer fair federal learning method, device and storage medium
WO2023109246A1 (en) Method and apparatus for breakpoint privacy protection, and device and medium
CN114298319A (en) Method and device for determining joint learning contribution value, electronic equipment and storage medium
CN113297310B (en) Method for selecting block chain fragmentation verifier in Internet of things
CN114553869A (en) Method and device for determining resource contribution degree based on joint learning and electronic equipment
CN116050557A (en) Power load prediction method, device, computer equipment and medium
WO2023093229A1 (en) Parameter aggregation method for federated learning, apparatus, and system
WO2023071529A1 (en) Device data cleaning method and apparatus, computer device and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22891592

Country of ref document: EP

Kind code of ref document: A1