Federated learning data processing method and apparatus, storage medium, and electronic device

By calculating the model metrics and training contributions of federated learning members, and selecting high-contribution participants for joint training, the problem of ensuring data quality and training contribution in federated learning is solved, thereby improving model training effectiveness and ensuring data security.

CN116205307BActive Publication Date: 2026-05-12NEUSOFT CORP
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NEUSOFT CORP
Filing Date
2022-11-11
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Federated learning suffers from challenges in ensuring data quality and training contribution, leading to poor model training results.

Method used

By acquiring model metrics from each participant, calculating training contribution, and selecting participants with high training contributions for joint training, we avoid using low-quality data in model training. At the same time, we store training contribution information on the blockchain to ensure data security and traceability.

Benefits of technology

It improved the model training effect, ensured data security and traceability, avoided the misleading effects of low-quality data, and optimized the feature dimensions of the dataset to improve model performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116205307B_ABST
    Figure CN116205307B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a federated learning data processing method, device, storage medium and electronic equipment. The method is applied to a first participant, and the first participant is any one of federated learning members. The method comprises: training a target model to be trained based on a first data set of the first participant to obtain a first model; training the target model in conjunction with a second participant in the federated learning members to obtain a second model; obtaining model indicators of the first model and the second model respectively to obtain a first indicator of the first model and a second indicator of the second model; determining a training contribution degree of a second data set of the second participant to the target model according to the first indicator and the second indicator; and training the target model in conjunction with a target participant in the second participant, and the training contribution degree of the target participant is greater than a contribution degree threshold. In this way, the training effect of the model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of federated learning technology, and more specifically, to a federated learning data processing method, apparatus, storage medium, and electronic device. Background Technology

[0002] Federated learning is a distributed machine learning technique that trains models across multiple data sources with local data, enabling the construction of a global model based on virtual fused data without exchanging local sample data, thus achieving data-sharing computation. Blockchain technology provides the implementation foundation for distributed model training in federated learning, significantly improving its usability. However, in some scenarios, the effectiveness of federated learning may be poor. Summary of the Invention

[0003] The purpose of this disclosure is to provide a federated learning data processing method, apparatus, storage medium, and electronic device to solve the aforementioned related technical problems.

[0004] To achieve the above objectives, according to a first aspect of the present disclosure, a federated learning data processing method is provided, applied to a first participant, which is any party among the members of the federated learning process, the method comprising:

[0005] The first model is obtained by training the target model to be trained based on the first dataset of the first participant.

[0006] The second participant in the federated learning group trains the target model to obtain a second model;

[0007] The model metrics of the first model and the second model are obtained respectively, resulting in the first metric of the first model and the second metric of the second model;

[0008] Based on the first indicator and the second indicator, determine the contribution of the second participant's second dataset to the training of the target model;

[0009] The target model is trained by the target participant in the second participant group, and the training contribution of the target participant is greater than the contribution threshold.

[0010] Optionally, it also includes:

[0011] Obtain the training contribution of the first dataset generated by the second participant;

[0012] If the training contribution of the first dataset is less than a first threshold and the training contribution of the second dataset is greater than a second threshold, the difference in feature dimensions between the first dataset and the second dataset is determined, where the second threshold is greater than the first threshold.

[0013] Based on the differences in feature dimensions, the feature dimensions in the first dataset can be increased or decreased.

[0014] Optionally, obtaining the model metrics of the first model and the second model respectively, to obtain the first metric of the first model and the second metric of the second model, includes:

[0015] Obtain the feature dimensions of the datasets of the federated learning members to obtain a dimension set;

[0016] Calculate the weight value of each feature dimension based on the set of dimensions;

[0017] Obtain the model metrics of the first model in each of the aforementioned feature dimensions to obtain the third metric;

[0018] Based on the third index of the first model in each of the feature dimensions, and the weight values ​​of the feature dimensions, the first index of the first model is calculated.

[0019] Obtain the model metrics of the second model in each of the aforementioned feature dimensions to obtain the fourth metric;

[0020] The second index of the second model is calculated based on the fourth index of each of the feature dimensions of the second model and the weight values ​​of the feature dimensions.

[0021] Optionally, determining the contribution of the second participant's second dataset to the training of the target model based on the first and second metrics includes:

[0022] Calculate the difference between the second indicator and the first indicator;

[0023] The difference is used as the contribution of the second dataset to the training of the target model.

[0024] Optionally, the model metrics include one or more of precision, recall, recall-precision RP curve, and RPC curve.

[0025] Optionally, before training the target model to be trained based on the first dataset of the first participant, the method further includes:

[0026] Send an authentication request to the authentication end of the federated learning, the authentication request including the identity information of the first participant, the authentication request being used by the authentication end to authenticate the identity of the first participant;

[0027] Receive the authentication response sent by the authentication terminal, the authentication response including the digital identity credential issued by the authentication terminal to the first participant if the authentication is successful;

[0028] The second participant in the federated learning group trains the target model to obtain a second model, including:

[0029] A federated learning request is sent to the second participant, the federated learning request including the digital identity credential, the federated learning request being used by the second participant to verify the identity of the target participant;

[0030] If the authentication is successful, the second participant in the federated learning group trains the target model to obtain the second model.

[0031] Optionally, the federated learning members are nodes in a blockchain network, and the method further includes:

[0032] The training contribution is saved to the blockchain of the blockchain network.

[0033] According to a second aspect of the present disclosure, a federated learning data processing apparatus is provided, applied to a first participant, the first participant being any party among the members of the federated learning process, the apparatus comprising:

[0034] The first training module is used to train the target model to be trained based on the first dataset of the first participant, so as to obtain the first model.

[0035] The second training module is used to train the target model in conjunction with the second participant in the federated learning members to obtain the second model;

[0036] The first acquisition module is used to acquire the model metrics of the first model and the second model respectively, and obtain the first metric of the first model and the second metric of the second model.

[0037] The first determining module is used to determine the contribution of the second participant's second dataset to the training of the target model based on the first indicator and the second indicator.

[0038] The model training module is used to train the target model in conjunction with the target participants in the second participant group, wherein the training contribution of the target participants is greater than the contribution threshold.

[0039] Optionally, it also includes:

[0040] The second acquisition module is used to acquire the training contribution of the first dataset generated by the second participant;

[0041] The second determining module is used to determine the difference in feature dimensions between the first dataset and the second dataset when the training contribution of the first dataset is less than a first threshold and the training contribution of the second dataset is greater than a second threshold, wherein the second threshold is greater than the first threshold.

[0042] The second execution module is used to increase or decrease the feature dimensions in the first dataset based on the difference in feature dimensions.

[0043] Optionally, the first acquisition module includes:

[0044] The first acquisition submodule is used to acquire the feature dimensions of the dataset of the federated learning members, and obtain a dimension set;

[0045] The first calculation submodule is used to calculate the weight value of each feature dimension based on the set of dimensions.

[0046] The second acquisition submodule is used to acquire the model index of the first model in each of the feature dimensions to obtain the third index;

[0047] The second calculation submodule is used to calculate the first index of the first model based on the third index of the first model in each of the feature dimensions and the weight value of the feature dimensions.

[0048] The third acquisition submodule is used to acquire the model index of the second model in each of the feature dimensions to obtain the fourth index;

[0049] The third calculation submodule is used to calculate the second index of the second model based on the fourth index of the second model in each of the feature dimensions and the weight value of the feature dimensions.

[0050] Optionally, the first determining module includes:

[0051] The fourth calculation submodule is used to calculate the difference between the second indicator and the first indicator;

[0052] The first execution submodule is used to use the difference as the contribution of the second dataset to the training of the target model.

[0053] Optionally, the model metrics include one or more of the following: accuracy, recall, RP curve, and RPC curve.

[0054] Optionally, it also includes:

[0055] The first sending module is configured to send an authentication request to the authentication end of the federated learning before the first training module trains the target model to be trained based on the first dataset of the first participant. The authentication request includes the identity information of the first participant and is used by the authentication end to authenticate the identity of the first participant.

[0056] The first receiving module is used to receive the authentication response sent by the authentication terminal, the authentication response including the digital identity credential issued by the authentication terminal to the first participant when the authentication is successful;

[0057] The second training module includes:

[0058] The first sending submodule is used to send a federated learning request to the second participant. The federated learning request includes the digital identity credential. The federated learning request is used by the second participant to verify the identity of the target participant.

[0059] The first training submodule is used to train the target model in conjunction with the second participant in the federated learning members, in the case that the authentication is successful, to obtain the second model.

[0060] Optionally, the federated learning members are nodes in a blockchain network, and the device further includes:

[0061] A storage module is used to save the training contribution to the blockchain of the blockchain network.

[0062] According to a third aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in any of the first aspects above.

[0063] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising:

[0064] A memory on which computer programs are stored;

[0065] A processor for executing the computer program in the memory to implement the steps of the method described in any of the first aspects above.

[0066] In the above technical solution, the first participant can train the target model based on its own first dataset to obtain a first model. The first participant can also collaborate with a second participant to train the target model, obtaining a second model. This allows for the acquisition of a first metric for the first model and a second metric for the second model. Based on these metrics, the contribution of the second participant's second dataset to the training of the target model can be determined. For example, by comparing the first and second metrics, the impact of the newly added second dataset on the model metrics can be determined, thereby determining the training contribution. In this way, the first participant can collaborate with a target participant with a higher training contribution to train the target model, thus avoiding the use of low-quality training data in the model training process and improving the model's training performance.

[0067] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0068] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:

[0069] Figure 1 This is a flowchart illustrating a federated learning data processing method as shown in an exemplary embodiment of this disclosure.

[0070] Figure 2 This is a flowchart illustrating the acquisition of a first indicator and a second indicator as shown in an exemplary embodiment of this disclosure.

[0071] Figure 3 This is a flowchart illustrating a federated learning data processing method as shown in an exemplary embodiment of this disclosure.

[0072] Figure 4 This is a flowchart illustrating a federated learning data processing method as shown in an exemplary embodiment of this disclosure.

[0073] Figure 5 This is a flowchart illustrating a federated learning data processing method as shown in an exemplary embodiment of this disclosure.

[0074] Figure 6 This is a schematic diagram of a federated learning system shown in an exemplary embodiment of this disclosure.

[0075] Figure 7 This is a block diagram of a federated learning data processing apparatus shown in an exemplary embodiment of the present disclosure.

[0076] Figure 8 This is a block diagram of an electronic device 800 as shown in an exemplary embodiment of this disclosure. Detailed Implementation

[0077] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.

[0078] Before introducing the federated learning data processing method, apparatus, storage medium and electronic device disclosed herein, the application scenarios of this disclosure will be introduced first.

[0079] Based on its distributed and immutable characteristics, blockchain can solve the trust issues encountered in the upgrading of traditional industries. Currently, blockchain technology is being explored and applied in fields such as finance, product traceability, government services and public welfare, and electronic evidence storage.

[0080] Federated learning enables the development and utilization of data without it leaving the domain or being decrypted. Because the data does not leave the domain, federated learning can improve data security.

[0081] In some scenarios, blockchain technology and federated learning can be combined for model training. For example, participants in federated learning can store the plaintext of data off-chain and save the digest hash of the data on the blockchain to ensure data security and auditability. During model training, participants select authorized data for training. The plaintext data remains within the domain during training, and detailed information about the plaintext data is not exposed, ensuring data security. Furthermore, to perform joint training without exposing the plaintext data, participants can share model training gradients or jointly maintain and update the training model on the blockchain.

[0082] By combining blockchain technology and federated learning technology, we can ensure data security during data sharing and provide feasible solutions for issues such as data authenticity, data ownership confirmation, and compliant data transfer.

[0083] It is worth noting that because the training data is not exposed in plaintext during model training, it is difficult to guarantee the quality of the data provided by the participants and its contribution to the model training. For example, in some scenarios, the training data provided by the participants may be of poor quality or even fabricated. In such cases, it may mislead the model, thereby affecting the model's training performance.

[0084] Therefore, this disclosure provides a federated learning data processing method applied to a first participant, which is any one of the federated learning members. The federated learning members can act as nodes in a blockchain network. In specific implementations, federated learning members can be any stationary or mobile computing device, such as a laptop, tablet, desktop computer, etc.

[0085] Figure 1 This is a flowchart illustrating a federated learning data processing method as shown in this disclosure, with reference to... Figure 1 The method includes:

[0086] In step S11, the target model to be trained is trained based on the first dataset of the first participant to obtain the first model.

[0087] In step S12, the second participant in the federated learning group trains the target model to obtain the second model.

[0088] Here, the target model can be a model specified by the initiator of federated learning. In specific implementations, the target model can be set according to application requirements; it can be a deep learning model or a machine learning model. For example, the target model can be a support vector machine model, a Bayesian model, a clustering model, a long short-term memory network, etc.

[0089] When the first participant trains the model in conjunction with the second participant, it can obtain the training parameters of the second participant and perform joint training based on the training parameters. The training parameters of the second participant can be obtained by the second participant training the target model based on its own second training set. These training parameters can be, for example, the model's training gradient or any parameters that can be used for federated learning.

[0090] In step S13, the model indices of the first model and the second model are obtained respectively, resulting in the first index of the first model and the second index of the second model.

[0091] Figure 2 This disclosure presents a flowchart illustrating the acquisition of a first indicator and a second indicator, as shown below. Figure 2 As shown, the step of obtaining the model metrics of the first model and the second model respectively, to obtain the first metric of the first model and the second metric of the second model (step S13), includes:

[0092] In step S131, the feature dimensions of the datasets of the federated learning members are obtained to obtain a set of dimensions.

[0093] Here, federated learning members can establish communication to obtain the feature dimensions of each other's datasets. As an example, federated learning members can broadcast the feature dimensions of their own datasets to other federated learning members.

[0094] The feature dimensions of the dataset can be set based on application requirements. For example, in some implementation scenarios, the dataset can be animal data, and the feature dimensions of the dataset can include animal age, animal weight, animal species, etc.

[0095] It should be noted that, in order to protect data security, the feature dimensions may not include detailed data under these feature dimensions, such as the animal's specific age and weight.

[0096] For example, there can be three federated learning participants. The feature dimensions of participant X1's dataset are X1 = [x1, x2, x3], the feature dimensions of participant X2's dataset are X2 = [x2, x3, x5], and the feature dimensions of participant X3's dataset are X3 = [x2, x4]. Thus, by aggregating the feature dimensions corresponding to X1, X2, and X3, a dimension set can be obtained.

[0097] In step S132, the weight values ​​of each feature dimension are calculated based on the dimension set.

[0098] Following the example above, when calculating the weight values ​​of a feature dimension, we can first calculate the frequency of that feature dimension. As an example, the frequency of a feature dimension can be calculated using the following formula:

[0099]

[0100] Among them, f i n represents the frequency of feature dimension i. i Let f1 be the total number of feature dimensions i in the dimension set, and n be the number of federated learning members. Continuing with the example above, f1 = 1 / 3, f2 = 3 / 3, f3 = 2 / 3, f4 = 1 / 3, and f5 = 1 / 3.

[0101] After obtaining the frequencies of each feature dimension, the frequencies of each feature dimension can be normalized to obtain the weight values ​​of the feature dimensions. For example, normalization can be performed using the softmax function, i.e., the weight values ​​of the feature dimensions are obtained through the following calculation formula:

[0102]

[0103] Among them, w i Let be the weight value of the i-th feature dimension, and j be the total number of feature dimensions.

[0104] In step S133, the model indices of the first model in each feature dimension are obtained to obtain the third index.

[0105] In step S134, the first index of the first model is calculated based on the third index of the first model in each feature dimension and the weight value of the feature dimension.

[0106] In step S135, the model indices of the second model in each feature dimension are obtained to obtain the fourth index.

[0107] In step S136, the second index of the second model is calculated based on the fourth index of the second model in each feature dimension and the weight value of the feature dimension.

[0108] The model metrics include one or more of the following: accuracy, recall, RP curve, and RPC curve.

[0109] As an example, model metrics can include precision and recall, from which the F1 score can be calculated. The F1 score is a statistical metric used to measure the accuracy of a binary classification model. It takes into account both the precision and recall of the classification model and can be viewed as a harmonic average of the model's precision and recall.

[0110] Thus, the F1 score can be calculated using the following formula:

[0111]

[0112]

[0113]

[0114] Where F represents the F1 score, P i P represents the accuracy of the trained model on the i-th feature dimension. m R represents the accuracy of the trained model. i R represents the recall rate of the trained model on the i-th feature dimension. m Let be the recall of the trained model. Here, the trained model can be either the first model or the second model. That is, the F1 score of the first model and the second model can be calculated using the above formula.

[0115] Furthermore, in some implementation scenarios, model metrics can refer to accuracy, recall, etc. Taking accuracy as an example, the model's accuracy in each feature dimension can be multiplied by the weight value of that feature dimension, and the sum of the products under each feature dimension can be used as the third metric of the first model. In other words, P... m As the primary indicator of the first model: Similarly, a second index can be calculated for the second model.

[0116] Reference Figure 1 After obtaining the first and second indicators, in step S14, the contribution of the second dataset of the second participant to the training of the target model is determined based on the first and second indicators.

[0117] For example, in one possible implementation, the difference between the second metric and the first metric can be calculated, and the difference can be used as the contribution of the second dataset to the training of the target model.

[0118] Continuing with the above example, if the F1 score of the first model trained by participant X1 itself is denoted as F1, and the F1 score of the second model jointly trained by participant X1 and participant X2 is denoted as F... 12 Then we can calculate

[0119] ΔF 12 =F 12 -F1

[0120] Where, ΔF 12 This contributes to the training of the second dataset. It should be understood that when ΔF... 12 When ΔF is greater than 0, it indicates that the newly added second dataset has a positive gain on the training of the target model. 12 A value less than 0 indicates that the newly added second dataset has a negative impact on the training of the target model. Therefore, this can be analyzed using ΔF. 12 This is used to measure the contribution of the second dataset to the model training.

[0121] Furthermore, in some implementation scenarios, the training contribution of the second dataset can be determined by combining the computational results of other federated learning members. For example, the F1 score of the first model trained by participant X3 itself is denoted as F3, and the F1 score of the second model jointly trained by participant X3 and participant X2 is denoted as F... 32 Then we can calculate:

[0122] ΔF 32 =F 32 -F3

[0123] Similarly, ΔF can be calculated. 42 =F 42 -F4, ΔF 52 =F 52 -F5,…,ΔF n2 =F n2 -F n In this way, the average of the calculation results of multiple federated learning members can be used as the training contribution to the second dataset. That is, the training contribution can be calculated using the following formula.

[0124]

[0125] Among them, S m Let n be the training contribution of the m-th federated learning member to dataset m, where n is the number of federated learning members.

[0126] Of course, the description of training contribution can take many forms, and this disclosure does not limit this. For example, in some implementation scenarios, the first participant can use S... m As an objective training contribution to dataset m, ΔF 1m This represents the subjective training contribution of the first participant to dataset m. Thus, the first participant can use the sum of the objective training contribution and the subjective training contribution as the final training contribution to dataset m.

[0127] After calculating the training contribution, the first participant can also select federated learning members to participate in joint training based on the training contribution.

[0128] For example, in step S15, the target model is trained jointly by the target participant in the second participant group, and the training contribution of the target participant is greater than the contribution threshold.

[0129] The contribution threshold can be set based on application requirements. As an example, the first participant can set a contribution threshold to designate a predetermined number of second participants with high training contributions as target participants. In this way, the first participant can collaborate with the target participants to train the model. For instance, the first participant can obtain the model gradients of the multiple target participants and then train the target model.

[0130] In the above technical solution, the first participant can train the target model based on its own first dataset to obtain a first model. The first participant can also collaborate with a second participant to train the target model to obtain a second model. In this way, a first metric of the first model and a second metric of the second model can be obtained, and the contribution of the second participant's second dataset to the training of the target model can be determined based on the first and second metrics. Thus, the first participant can collaborate with a target participant with a higher training contribution to train the target model, thereby avoiding the use of low-quality training data in the model training process and improving the model's training performance.

[0131] Furthermore, after calculating the training contribution, the training contribution can be saved. For example, in one possible implementation, the federated learning members are nodes in a blockchain network. (See also...) Figure 3 The flowchart shown is a method for processing data in federated learning. Figure 1 Based on this, the method further includes:

[0132] Step S16: Save the training contribution to the blockchain of the blockchain network.

[0133] Here, for example, training contribution information can be maintained in a blockchain, which can include the training contribution of each dataset. This training contribution information can be presented in the form of tables, matrices, etc. As an example, the training contribution information can be matrix A:

[0134]

[0135] In this matrix, each row represents the training contribution of the dataset of the m-th participant calculated by the i-th participant.

[0136] In the above technical solution, training contributions can be stored in the blockchain for verification. This allows other participants to query and trace the training contributions within the blockchain.

[0137] In some implementation scenarios, the first participant can also optimize its own first dataset based on the aforementioned training contribution. (See reference...) Figure 4 The flowchart shown is a method for processing federated learning data. Figure 1 In addition to this, it also includes:

[0138] In step S18, the training contribution of the first dataset generated by the second participant is obtained.

[0139] For example, federated learning members can maintain training contribution information in the blockchain, which can include the training contribution of each dataset. In this way, the first participant can obtain the training contribution of the first dataset through this training contribution information.

[0140] In step S19, if the training contribution of the first dataset is less than a first threshold and the training contribution of the second dataset is greater than a second threshold, the difference in feature dimensions between the first dataset and the second dataset is determined. The second threshold is greater than the first threshold.

[0141] In step S110, the feature dimensions in the first dataset are increased or decreased based on the difference in feature dimensions.

[0142] It should be noted that when the training contribution of the first dataset is less than the first threshold, it indicates that the first dataset provides a relatively small positive gain during the model training of other federated learning members. When the training contribution of the second dataset is greater than the second threshold, it indicates that the second dataset of other federated learning members provides a relatively large positive gain during the model training of the first participant.

[0143] At this point, the first dataset can be optimized based on the differences in feature dimensions. For example, in one possible implementation, the first dataset has fewer feature dimensions than the second dataset and lacks features in the first dimension. In this case, features in the first dimension can be added to the first dataset. As an example, if the first dataset lacks animal age dimension features relative to the second dataset, the first participant can adjust the first dataset by adding animal age data to it.

[0144] In one possible implementation, the first dataset has more feature dimensions than the second dataset, and includes more features in the second dimension. In this case, the number of features in the second dimension of the first dataset can be reduced.

[0145] By employing the above technical solution, federated learning members can optimize their own datasets based on their training contributions, thereby obtaining datasets that are more conducive to model training. This approach helps improve the model's training performance.

[0146] Figure 5 This is a flowchart of a federated learning data processing method shown in this disclosure, such as... Figure 5 As shown, the method includes:

[0147] In step S51, an authentication request is sent to the authentication end of the federated learning. The authentication request includes the identity information of the first participant and is used by the authentication end to authenticate the identity of the first participant.

[0148] Here, refer to Figure 6 The diagram illustrates a federated learning system, which may include a committee. The committee can be composed of authoritative organizations among the federated learning members. The committee can act as an administrator within the consortium blockchain or as a subset of authoritative bodies elected by all members. Due to the decentralized nature of blockchain, committee members cannot act maliciously on their own. In a federated learning system, the committee may have the authority to select authentication endpoints, revoke the digital identities of system members, and review and modify the identity permissions of system members (such as publishers / subscribers). The committee's digital identities can be distributed and stored within the consortium blockchain.

[0149] The committee can also select an certifying entity. This entity can be an authoritative body with the power to issue certificates, such as a government agency or a certification body. The certifying entity has the authority to issue trusted credentials to members of the federated learning community.

[0150] For example, in step S51, the first participant can send an authentication request to the authentication terminal, which includes the first participant's identity information. The authentication terminal can then verify and authenticate the first participant's identity information. If authentication is successful, a digital identity credential can be issued to the first participant. Identity authentication through the authentication terminal ensures the legitimacy and traceability of the identities of federated learning members, thus initially guaranteeing the quality and security of the dataset. Furthermore, the issued digital identity credential and the digital identity of the authentication terminal can be distributed and stored on the consortium blockchain.

[0151] Reference Figure 6 A federated learning system can also include federated learning member nodes, which can be divided into publishers and subscribers. Publishers have the authority to publish federated learning training tasks and can also possess all the permissions of subscribers. The publisher's digital identity is stored in a distributed manner on the consortium blockchain. The subscriber's digital identity is stored in the consortium blockchain and can subscribe to federated learning training tasks published by publishers. Subscribers have the necessary permissions for federated learning, such as the permission to provide federated learning training datasets and use the datasets to train models, the permission to upload training models to the blockchain, and the permission to upload the hash value of the training set to the blockchain as proof, etc. However, subscribers cannot publish training tasks.

[0152] In step S52, an authentication response sent by the authentication terminal is received. The authentication response includes a digital identity credential issued by the authentication terminal to the first participant if the authentication is successful.

[0153] After obtaining digital identity credentials, the first participant can engage in federated learning tasks. For example, a member with publishing privileges can initiate a federated learning task. As an example, a federated learning task is described as follows:

[0154] Publisher: Organization 1;

[0155] Task Description: Cardiovascular disease risk prediction;

[0156] Dataset labels: 0 - no risk, 1 - risky;

[0157] Training model: AdaBoost;

[0158] Data characteristics requirements: Patients must be between 30 and 60 years old; male; ...

[0159] Subscribers who have already joined the learning task: [];

[0160] Training contribution: [];

[0161] Release date: 2022.XY;

[0162] Deadline: 2022.XZ.

[0163] The training model and data features can be specified by the publisher. This allows federated learning members to process the data according to the description in the federated learning task to obtain the dataset.

[0164] It should be noted that the first participant in this embodiment can have publisher permissions (i.e., act as a publisher) or subscriber permissions (i.e., act as a subscriber); this disclosure does not impose any restrictions. When the first participant acts as a subscriber, it can send a join request to the publisher, the join request including the first participant's digital identity credentials. After receiving the join request, the publisher can verify the digital identity credentials. If the verification is successful, the publisher can allow the first participant to join the federated learning task and add the first participant's information to the list of subscribers who have joined the learning task.

[0165] In step S53, the target model to be trained is trained based on the first dataset of the first participant to obtain the first model.

[0166] In step S54, a federated learning request is sent to the second participant. The federated learning request includes digital identity credentials and is used by the second participant to verify the identity of the target participant.

[0167] Upon receiving the joint learning request, the second participant can verify the digital identity credential. For example, the second participant can query a list of subscribers who have joined the learning task to determine if the first participant is on that list. The second participant can also verify the digital identity credential; if the verification is successful, the second participant can allow the first participant to perform joint training.

[0168] In step S55, if authentication is successful, the second participant in the federated learning group trains the target model to obtain the second model.

[0169] In step S56, the model indices of the first model and the second model are obtained respectively, resulting in the first index of the first model and the second index of the second model.

[0170] In step S57, the contribution of the second dataset of the second participant to the training of the target model is determined based on the first indicator and the second indicator.

[0171] In step S58, the target model is trained jointly by the target participants in the second participant group, and the training contribution of the target participants is greater than the contribution threshold.

[0172] In the above technical solution, the first participant can train the target model based on its own first dataset to obtain the first model. The first participant can also collaborate with the second participant to train the target model to obtain the second model. In this way, the first metric of the first model and the second metric of the second model can be obtained, and the contribution of the second participant's second dataset to the training of the target model can be determined based on the first and second metrics. For example, the impact of the newly added second dataset on the model metrics can be determined by comparing the first and second metrics.

[0173] In this way, the first participant can work with the target participants who have made higher contributions to the training to train the target model, thereby avoiding the use of poor-quality training data in the model training process and thus improving the training effect of the model.

[0174] Based on the same inventive concept, this disclosure also provides a federated learning data processing apparatus, applied to a first participant, which is any one of the federated learning members. Figure 7 This is a block diagram of a federated learning data processing apparatus shown in this disclosure, with reference to... Figure 7 The device includes:

[0175] The first training module 701 is used to train the target model to be trained based on the first dataset of the first participant, so as to obtain the first model.

[0176] The second training module 702 is used to train the target model in conjunction with the second participant in the federated learning members to obtain the second model;

[0177] The first acquisition module 703 is used to acquire the model metrics of the first model and the second model respectively, and obtain the first metric of the first model and the second metric of the second model.

[0178] The first determining module 704 is used to determine the contribution of the second participant's second dataset to the training of the target model based on the first indicator and the second indicator.

[0179] The model training module 705 is used to train the target model in conjunction with the target participant in the second participant, wherein the training contribution of the target participant is greater than the contribution threshold.

[0180] In the above technical solution, the first participant can train the target model based on its own first dataset to obtain the first model. The first participant can also collaborate with the second participant to train the target model to obtain the second model. In this way, the first metric of the first model and the second metric of the second model can be obtained, and the contribution of the second participant's second dataset to the training of the target model can be determined based on the first and second metrics. For example, the impact of the newly added second dataset on the model metrics can be determined by comparing the first and second metrics.

[0181] In this way, the first participant can work with the target participants who have made higher contributions to the training to train the target model, thereby avoiding the use of poor-quality training data in the model training process and thus improving the training effect of the model.

[0182] Optionally, it also includes:

[0183] The second acquisition module is used to acquire the training contribution of the first dataset generated by the second participant;

[0184] The second determining module is used to determine the difference in feature dimensions between the first dataset and the second dataset when the training contribution of the first dataset is less than a first threshold and the training contribution of the second dataset is greater than a second threshold, wherein the second threshold is greater than the first threshold.

[0185] The second execution module is used to increase or decrease the feature dimensions in the first dataset based on the difference in feature dimensions.

[0186] Optionally, the first acquisition module includes:

[0187] The first acquisition submodule is used to acquire the feature dimensions of the dataset of the federated learning members, and obtain a dimension set;

[0188] The first calculation submodule is used to calculate the weight value of each feature dimension based on the set of dimensions.

[0189] The second acquisition submodule is used to acquire the model index of the first model in each of the feature dimensions to obtain the third index;

[0190] The second calculation submodule is used to calculate the first index of the first model based on the third index of the first model in each of the feature dimensions and the weight value of the feature dimensions.

[0191] The third acquisition submodule is used to acquire the model index of the second model in each of the feature dimensions to obtain the fourth index;

[0192] The third calculation submodule is used to calculate the second index of the second model based on the fourth index of the second model in each of the feature dimensions and the weight value of the feature dimensions.

[0193] Optionally, the first determining module includes:

[0194] The fourth calculation submodule is used to calculate the difference between the second indicator and the first indicator;

[0195] The first execution submodule is used to use the difference as the contribution of the second dataset to the training of the target model.

[0196] Optionally, the model metrics include one or more of the following: accuracy, recall, RP curve, and RPC curve.

[0197] Optionally, it also includes:

[0198] The first sending module is configured to send an authentication request to the authentication end of the federated learning before the first training module trains the target model to be trained based on the first dataset of the first participant. The authentication request includes the identity information of the first participant and is used by the authentication end to authenticate the identity of the first participant.

[0199] The first receiving module is used to receive the authentication response sent by the authentication terminal, the authentication response including the digital identity credential issued by the authentication terminal to the first participant when the authentication is successful;

[0200] The second training module includes:

[0201] The first sending submodule is used to send a federated learning request to the second participant. The federated learning request includes the digital identity credential. The federated learning request is used by the second participant to verify the identity of the target participant.

[0202] The first training submodule is used to train the target model in conjunction with the second participant in the federated learning members, in the case that the authentication is successful, to obtain the second model.

[0203] Optionally, the federated learning members are nodes in a blockchain network, and the device further includes:

[0204] A storage module is used to save the training contribution to the blockchain of the blockchain network.

[0205] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0206] This disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the federated learning data processing method provided in this disclosure.

[0207] This disclosure also provides an electronic device, including:

[0208] A memory on which computer programs are stored;

[0209] A processor is configured to execute the computer program in the memory to implement the steps of the federated learning data processing method provided in this disclosure.

[0210] Figure 8 This is a block diagram illustrating an electronic device 800 according to an exemplary embodiment. For example... Figure 8 As shown, the electronic device 800 may include a processor 801 and a memory 802. The electronic device 800 may also include one or more of a multimedia component 803, an input / output (I / O) interface 804, and a communication component 805.

[0211] The processor 801 controls the overall operation of the electronic device 800 to complete all or part of the steps in the federated learning data processing method described above. The memory 802 stores various types of data to support the operation of the electronic device 800. This data may include, for example, instructions for any application or method operating on the electronic device 800, and application-related data such as contact data, sent and received messages, pictures, audio, video, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. Multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 802 or transmitted via communication component 805. The audio component also includes at least one speaker for outputting audio signals. I / O interface 804 provides an interface between processor 801 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 805 is used for wired or wireless communication between the electronic device 800 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IoT, eMTC, or other 5G technologies, or combinations thereof, is not limited here. Therefore, the corresponding communication component 805 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.

[0212] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the federated learning data processing method described above.

[0213] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the federated learning data processing method described above. For example, the computer-readable storage medium may be the memory 802 including the program instructions described above, which may be executed by the processor 801 of the electronic device 800 to complete the federated learning data processing method described above.

[0214] In another exemplary embodiment, a computer program product is also provided, comprising a computer program executable by a programmable device, the computer program having a code portion for performing the above-described federated learning data processing method when executed by the programmable device.

[0215] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.

[0216] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.

[0217] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.

Claims

1. A federated learning data processing method, characterized in that, Applied to a first participant, which is any one of the federated learning members, wherein the federated learning members are nodes in a blockchain network, the method includes: The first model is obtained by training the target model to be trained based on the first dataset of the first participant. The second participant in the federated learning group trains the target model to obtain a second model; The model metrics of the first model and the second model are obtained respectively to obtain the first metric of the first model and the second metric of the second model. The model metrics include one or more of the following: accuracy, recall, RP curve, and RPC curve. Based on the first indicator and the second indicator, the contribution of the second dataset of the second participant to the training of the target model is determined; wherein, the difference between the second indicator and the first indicator is calculated, and the difference is used as the contribution of the second dataset to the training of the target model; The target model is trained by the target participant in the second participant group, and the training contribution of the target participant is greater than the contribution threshold. The training contribution is saved to the blockchain of the blockchain network; Obtain the training contribution of the first dataset generated by the second participant; If the training contribution of the first dataset is less than a first threshold and the training contribution of the second dataset is greater than a second threshold, the difference in feature dimensions between the first dataset and the second dataset is determined, where the second threshold is greater than the first threshold. Based on the differences in feature dimensions, the feature dimensions in the first dataset can be increased or decreased.

2. The method according to claim 1, characterized in that, The step of obtaining the model metrics of the first model and the second model respectively, to obtain the first metric of the first model and the second metric of the second model, includes: Obtain the feature dimensions of the datasets of the federated learning members to obtain a dimension set; Calculate the weight value of each feature dimension based on the set of dimensions; Obtain the model metrics of the first model in each of the aforementioned feature dimensions to obtain the third metric; Based on the third index of the first model in each of the feature dimensions, and the weight value of the feature dimensions, the first index of the first model is calculated. Obtain the model metrics of the second model in each of the aforementioned feature dimensions to obtain the fourth metric; Based on the fourth index of the second model in each of the feature dimensions, and the weight values ​​of the feature dimensions, the second index of the second model is calculated.

3. The method according to claim 1, characterized in that, Before training the target model based on the first dataset of the first participant, the process further includes: Send an authentication request to the authentication end of the federated learning, the authentication request including the identity information of the first participant, the authentication request being used by the authentication end to authenticate the identity of the first participant; Receive the authentication response sent by the authentication terminal, the authentication response including the digital identity credential issued by the authentication terminal to the first participant if the authentication is successful; The second participant in the federated learning group trains the target model to obtain a second model, including: A federated learning request is sent to the second participant, the federated learning request including the digital identity credential, the federated learning request being used by the second participant to verify the identity of the target participant; If authentication is successful, the second participant in the federated learning group trains the target model to obtain a second model.

4. A federated learning data processing device, characterized in that, Applied to a first participant, which is any one of the federated learning members, wherein the federated learning members are nodes in a blockchain network, the device includes: The first training module is used to train the target model to be trained based on the first dataset of the first participant, so as to obtain the first model. The second training module is used to train the target model in conjunction with the second participant in the federated learning members to obtain the second model; The first acquisition module is used to acquire model metrics of the first model and the second model respectively, to obtain a first metric of the first model and a second metric of the second model. The model metrics include one or more of accuracy, recall, RP curve, and RPC curve. The first determining module is used to determine the contribution of the second dataset of the second participant to the training of the target model based on the first indicator and the second indicator; wherein, the difference between the second indicator and the first indicator is calculated, and the difference is used as the contribution of the second dataset to the training of the target model; The model training module is used to train the target model in conjunction with the target participants in the second participant group, wherein the training contribution of the target participants is greater than the contribution threshold. A storage module is used to save the training contribution to the blockchain of the blockchain network; The second acquisition module is used to acquire the training contribution of the first dataset generated by the second participant; The second determining module is used to determine the difference in feature dimensions between the first dataset and the second dataset when the training contribution of the first dataset is less than a first threshold and the training contribution of the second dataset is greater than a second threshold, wherein the second threshold is greater than the first threshold. The second execution module is used to increase or decrease the feature dimensions in the first dataset based on the difference in feature dimensions.

5. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 1 to 3.

6. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1 to 3.