Training method, device and electronic equipment for federated learning model
Through the federated learning model training method, the corporate portraits and feature information of multiple data providers are utilized to generate a target federated learning model, which solves the accuracy and speed problems of corporate credit status assessment, simplifies the loan process and improves the accuracy of assistance policies.
Patent Information
- Application Number
- CN202011596639.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-29
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2040-12-29
Smart Images

Figure CN113724059B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of deep learning technology, and in particular to a training method, device, electronic device and storage medium for a federated learning model. Background Art
[0002] Currently, when businesses seek loans, financial institutions or government agencies often need to assess their creditworthiness. If a business's creditworthiness is poor, the financial risk associated with granting the loan is higher. Conversely, if the business's creditworthiness is good, the financial risk associated with granting the loan is lower. However, this currently lacks the ability to accurately and quickly assess a business's creditworthiness, resulting in a cumbersome loan application process that hinders business operations and the precise implementation of policies supporting businesses. Summary of the Invention
[0003] The present application aims to solve one of the technical problems in the related art at least to a certain extent.
[0004] To this end, the first embodiment of the present application proposes a method for training a federated learning model, which performs federal training on the model through corporate portraits and feature information from multiple data providers. The resulting target federated learning model has better accuracy, and federated learning can be applied to the acquisition of corporate credit status. The target federated learning model can be used to accurately and quickly obtain the corporate credit status, which is conducive to simplifying the corporate loan process and the precise implementation of corporate assistance policies.
[0005] The second embodiment of the present application proposes a training device for a federated learning model.
[0006] A third embodiment of the present application provides an electronic device.
[0007] The fourth embodiment of the present application proposes a computer-readable storage medium.
[0008] The first aspect of the present application proposes a method for training a federated learning model, including: obtaining corporate portraits and feature information of multiple enterprises on a data provider; based on the corporate portraits and the feature information, cooperating with other data providers to perform federated training of the model to obtain the model intermediate results of each local learning model; sending the model intermediate results to a third-party platform for aggregation, and receiving the aggregated global model intermediate results sent by the third-party platform; based on the global model intermediate results, adjusting the model parameters of the local learning model itself to continue the federated training of the model to generate a target federated learning model, wherein the target federated learning model is used to predict the credit status of the enterprise.
[0009] According to the training method of the federated learning model of the embodiment of the present application, the model is federatedly trained through the corporate portraits and feature information of multiple data providers, and the obtained target federated learning model has better accuracy. Federated learning can be applied to the acquisition of the credit status of the enterprise, and the credit status of the enterprise can be accurately and quickly obtained through the target federated learning model, which is conducive to simplifying the corporate loan process and the precise implementation of corporate assistance policies.
[0010] In addition, the training method of the federated learning model according to the above embodiment of the present application may also have the following additional technical features:
[0011] In one embodiment of the present application, the federated training of the model based on the enterprise portrait and the feature information and in collaboration with other data providers includes: combining the enterprise portrait and the feature information to generate training samples for the data provider; and collaborating with the other data providers to perform federated training on their own local learning models based on their own training samples.
[0012] In one embodiment of the present application, the combining of the enterprise portrait and the feature information to generate a training sample for the data provider includes: generating a first matrix corresponding to the enterprise portrait; generating a second matrix corresponding to the feature information; and splicing the first matrix and the second matrix to generate the training sample.
[0013] In one embodiment of the present application, before the collaboration with the other data providers respectively performs federated training on their own local learning models based on their own training samples, it also includes: obtaining the corporate identification corresponding to the training samples of the other data providers; obtaining the corporate identification corresponding to the training samples of the data providers, and sending it to the other data providers; and aligning the training samples of the data providers with the training samples of the other data providers based on the obtained corporate identification.
[0014] In one embodiment of the present application, the training samples of the data provider end are aligned with the training samples of the other data provider end based on the acquired corporate identifier, including: obtaining a corporate identifier shared by the data provider end and the other data provider end; and based on the shared corporate identifier, filtering out training samples identified by non-shared corporate identifiers from the training samples of the data provider end.
[0015] In one embodiment of the present application, after filtering out the training samples identified by non-shared corporate identifiers, the method further includes: acquiring the shared corporate identifiers; and obtaining the respective training samples based on the shared corporate identifiers and the data provider.
[0016] In one embodiment of the present application, obtaining enterprise portraits and feature information of multiple enterprises on the data provider end includes: obtaining the original data of the multiple enterprises from the enterprise database on the data provider end according to the set screening rules; performing feature extraction and label extraction on the original data of each of the multiple enterprises; using the extracted features of each of the enterprises to generate the feature information of each of the enterprises; and using the extracted labels of each of the enterprises to generate the enterprise portrait of each of the enterprises.
[0017] In one embodiment of the present application, the feature extraction and label extraction of the original data of each of the multiple enterprises also includes: identifying abnormal data in the original data of each of the multiple enterprises; filtering the abnormal data to obtain cleaned data; preprocessing the cleaned data to generate data to be extracted; and performing feature extraction and label extraction on the data to be extracted.
[0018] In one embodiment of the present application, the preprocessing of the cleaned data to generate the data to be extracted includes: performing a missing value filling operation on the cleaned data; performing a data binning operation on the filled cleaned data; and encoding the binning results to generate the data to be extracted.
[0019] In one embodiment of the present application, the feature extraction of the data to be extracted includes: using a boosting tree model to perform feature splitting on the data to be extracted to generate leaf nodes of the boosting tree, and using position information of the leaf nodes as the feature information.
[0020] In one embodiment of the present application, after generating the target federated learning model, it also includes: obtaining the target enterprise portrait and target feature information of the target enterprise on the data provider end, wherein the target enterprise is an enterprise that needs to predict the credit status; in collaboration with the other data providers, using the target federated learning model to predict the target enterprise portrait and the target feature information to obtain the credit status information of the target enterprise.
[0021] The second aspect of the present application proposes a training device for a federated learning model, including: an acquisition module for acquiring corporate portraits and feature information of multiple companies on a data provider; a first training module for coordinating with other data providers to perform federal training of models based on the corporate portraits and the feature information to obtain the model intermediate results of their respective local learning models; an aggregation module for sending the model intermediate results to a third-party platform for aggregation, and receiving the aggregated global model intermediate results sent by the third-party platform; a second training module for adjusting the model parameters of its own local learning model based on the global model intermediate results to continue the federal training of the model to generate a target federated learning model, wherein the target federated learning model is used to predict the credit status of the enterprise.
[0022] The training device of the federated learning model in the embodiment of the present application performs federated training of the model through enterprise portraits and feature information of multiple data providers, and the obtained target federated learning model has better accuracy. Federated learning can be applied to the acquisition of the credit status of the enterprise, and the credit status of the enterprise can be accurately and quickly obtained through the target federated learning model, which is conducive to simplifying the enterprise loan process and the precise implementation of enterprise assistance policies.
[0023] In addition, the training device of the federated learning model according to the above embodiment of the present application may also have the following additional technical features:
[0024] In one embodiment of the present application, the first training module includes: a combination unit for combining the enterprise portrait and the feature information to generate a training sample for the data provider; a training unit for coordinating with the other data providers to perform federated training on their own local learning models based on their own training samples.
[0025] In one embodiment of the present application, the combination unit is specifically used to: generate a first matrix corresponding to the corporate portrait; generate a second matrix corresponding to the feature information; and splice the first matrix and the second matrix to generate the training sample.
[0026] In one embodiment of the present application, the first training module further includes: a first acquisition unit, which acquires the corporate identification corresponding to the training sample of the other data provider; a sending unit, which acquires the corporate identification corresponding to the training sample of the data provider and sends it to the other data provider; and an alignment unit, which aligns the training sample of the data provider with the training sample of the other data provider based on the acquired corporate identification.
[0027] In one embodiment of the present application, the alignment unit is specifically used to: obtain a corporate identifier shared by the data provider and the other data providers; and based on the shared corporate identifier, filter out training samples identified by non-shared corporate identifiers from the training samples of the data providers.
[0028] In one embodiment of the present application, the alignment unit is further configured to: obtain the shared corporate identifier; and obtain the respective training samples based on the shared corporate identifier and the data provider.
[0029] In one embodiment of the present application, the acquisition module includes: a second acquisition unit, used to obtain the original data of the multiple enterprises from the enterprise database on the data provider according to the set screening rules; an extraction unit, used to perform feature extraction and label extraction on the original data of each of the multiple enterprises; a feature generation unit, used to generate the feature information of each of the enterprises using the extracted features of each of the enterprises; and a portrait generation unit, used to generate the enterprise portrait of each of the enterprises using the extracted labels of each of the enterprises.
[0030] In one embodiment of the present application, the extraction unit is specifically used to: identify abnormal data in the original data of each of the multiple enterprises; filter the abnormal data to obtain cleaned data; preprocess the cleaned data to generate data to be extracted; and perform feature extraction and label extraction on the data to be extracted.
[0031] In one embodiment of the present application, the extraction unit is further configured to: perform a missing value filling operation on the cleaned data; perform a data binning operation on the filled cleaned data; and encode the binning result to generate the data to be extracted.
[0032] In one embodiment of the present application, the extraction unit is specifically used to: use a boosting tree model to perform feature splitting on the data to be extracted to generate leaf nodes of the boosting tree, and use position information of the leaf nodes as the feature information.
[0033] In one embodiment of the present application, the training device of the federated learning model also includes: a prediction module, which is used to: obtain the target enterprise portrait and target feature information of the target enterprise on the data provider end, wherein the target enterprise is an enterprise that needs to predict the credit status; cooperate with the other data providers to use the target federated learning model to predict the target enterprise portrait and the target feature information to obtain the credit status information of the target enterprise.
[0034] The third aspect embodiment of the present application proposes an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the training method of the federated learning model as described in the first aspect embodiment above.
[0035] The electronic device of the embodiment of the present application executes a computer program stored in the memory through a processor, and performs federal training of the model through the corporate portraits and feature information of multiple data providers. The obtained target federated learning model has better accuracy, and federated learning can be applied to the acquisition of the credit status of the enterprise. The credit status of the enterprise can be accurately and quickly obtained through the target federated learning model, which is conducive to simplifying the corporate loan process and the precise implementation of corporate assistance policies.
[0036] The fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the training method of the federated learning model described in the aforementioned method embodiment is implemented.
[0037] The computer-readable storage medium of the embodiment of the present application stores a computer program and is executed by a processor. The model is federated through corporate portraits and feature information of multiple data providers. The obtained target federated learning model has better accuracy. Federated learning can be applied to the acquisition of corporate credit status, and the credit status of the enterprise can be accurately and quickly obtained through the target federated learning model, which is conducive to simplifying the corporate loan process and the precise implementation of corporate assistance policies.
[0038] Additional aspects and advantages of the present application will be given in part in the following description and in part will become obvious from the following description or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0040] Figure 1 1 is a flow chart of a method for training a federated learning model according to one embodiment of the present application;
[0041] Figure 2 This is a flow chart of the process after a target federated learning model is generated in a training method for a federated learning model according to one embodiment of the present application;
[0042] Figure 3 A schematic diagram of a process for obtaining enterprise profiles and feature information in a training method for a federated learning model according to one embodiment of the present application;
[0043] Figure 4Schematic diagram of the process of extracting features and labels from raw data in a training method for a federated learning model according to one embodiment of the present application;
[0044] Figure 5 This is a flowchart of a federated learning model training method according to one embodiment of the present application, which is based on enterprise profiles and feature information and collaborates with other data providers to perform federated training of the model.
[0045] Figure 6 This is a flow chart of a method for training a federated learning model according to an embodiment of the present application before performing federated training on a local learning model.
[0046] Figure 7 Schematic diagram of a training system for a federated learning model according to one embodiment of the present application;
[0047] Figure 8 Schematic diagram of the structure of a training device for a federated learning model according to one embodiment of the present application;
[0048] Figure 9 Schematic diagram of the structure of a training device for a federated learning model according to another embodiment of the present application;
[0049] Figure 10 Schematic diagram of the structure of an electronic device according to one embodiment of the present application. DETAILED DESCRIPTION
[0050] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0051] The following describes the training method, device, electronic device and storage medium of the federated learning model of the embodiment of the present application with reference to the accompanying drawings.
[0052] Figure 1 The figure is a flowchart of a method for training a federated learning model according to an embodiment of the present application.
[0053] S101, obtaining enterprise portraits and characteristic information of multiple enterprises on the data provider side.
[0054] It should be noted that the execution subject of the training method of the federated learning model in the embodiment of the present application can be a training device for the federated learning model, and the training device for the federated learning model in the embodiment of the present application can be configured in any electronic device so that the electronic device can execute the training method of the federated learning model in the embodiment of the present application. Among them, the electronic device can be a personal computer (PC), a cloud device, a mobile device, etc. The mobile device can be, for example, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, an in-vehicle device, and other hardware devices with various operating systems, touch screens, and / or displays.
[0055] In the embodiment of the present application, the enterprise portraits and characteristic information of multiple enterprises can be obtained from the data provider, which includes but is not limited to databases, websites, etc. The number of data providers can be multiple and is not limited here.
[0056] It is understandable that different enterprises may correspond to different enterprise profiles and characteristic information. Optionally, a mapping relationship or mapping table between enterprises, enterprise profiles, and characteristic information may be pre-established. By querying the mapping relationship or mapping table, the enterprise profile and characteristic information corresponding to each enterprise can be obtained. It should be noted that the above-mentioned mapping relationship or mapping table can be configured based on actual circumstances and pre-set in the storage space of the data provider.
[0057] It is understandable that there may be multiple data providers, and the enterprise portraits and feature information stored on different data providers may also be different.
[0058] S102, based on the enterprise portrait and feature information, collaborate with other data providers to conduct federated model training to obtain the intermediate model results of their respective local learning models.
[0059] In the embodiment of the present application, the number of other data providers can be one or more, which is not limited here, and each data provider is provided with a local learning model. For example, the local learning model corresponding to the data provider A is M A , the local learning model corresponding to the data provider B is M B , the local learning model corresponding to the data provider C is M C The local learning model may be set according to actual conditions, for example, it may be a deep learning model.
[0060] In the embodiments of this application, federated learning can be used for model training. Data providers can collaborate with other data providers to perform federated model training based on enterprise profiles and feature information to obtain intermediate model results for their respective local learning models. These intermediate model results include, but are not limited to, gradients, losses, and the like.
[0061] It should be noted that when a data provider collaborates with other data providers to conduct federated training of a model, each data provider participating in the federated training only uses the corporate portraits and feature information of its own multiple companies to train its own local learning model. In other words, the training samples of each data provider participating in the federated training can be physically isolated, which can meet the data provider's requirements for data protection and data security.
[0062] S103: Send the model intermediate results to a third-party platform for aggregation, and receive the aggregated global model intermediate results sent by the third-party platform.
[0063] In an embodiment of the present application, the model intermediate results of the local learning model obtained by each data provider participating in the federated training can be sent to a third-party platform for aggregation, and the aggregated global model intermediate results sent by the third-party platform can be received.
[0064] It is understandable that the third-party platform can send the aggregated intermediate results of the global model to each data provider participating in the federated training.
[0065] It is understandable that third-party platforms do not provide data for federated training and can be selected based on actual circumstances.
[0066] Optionally, the third-party platform can calculate a global model intermediate result based on multiple model intermediate results. For example, when the model intermediate result is a gradient, the third-party platform can calculate the global gradient based on multiple gradients; when the model intermediate result is a loss, the third-party platform can calculate the global loss based on multiple losses.
[0067] S104, based on the intermediate results of the global model, adjust the model parameters of the local learning model to continue the federated training of the model to generate a target federated learning model, wherein the target federated learning model is used to predict the credit status of the enterprise.
[0068] In an embodiment of the present application, each data provider participating in the federated training can adjust the model parameters of its own local learning model based on the intermediate results of the global model to continue the federated training of the model to generate a target federated learning model.
[0069] Optionally, during the federated training of the model, if the number of model iterations reaches a preset threshold, or reaches a preset stop condition, or reaches a preset model evaluation indicator, the federated training of the model can be stopped, and the model obtained at the end of the last federated training is used as the target federated learning model.
[0070] In summary, according to the training method of the federated learning model in the embodiment of the present application, the model is federatedly trained through the corporate portraits and feature information of multiple data providers, and the obtained target federated learning model has better accuracy. Federated learning can be applied to the acquisition of the credit status of the enterprise, and the credit status of the enterprise can be accurately and quickly obtained through the target federated learning model, which is conducive to simplifying the corporate loan process and the precise implementation of corporate assistance policies.
[0071] Based on any of the above embodiments, Figure 2 As shown, after the target federated learning model is generated in step S104, the following steps are also included:
[0072] S201, obtaining a target enterprise portrait and target feature information of the target enterprise on the data providing end, wherein the target enterprise is an enterprise for which a credit status prediction is required.
[0073] In the embodiments of the present application, when it is necessary to predict the credit status of a target enterprise, the target enterprise portrait and target characteristic information of the target enterprise on the data provider can be obtained. It is understood that the number of data providers can be one or more, and the target enterprise portrait and target characteristic information of the target enterprise on one or more data providers can be obtained.
[0074] S202, collaborate with other data providers to use the target federated learning model to predict the target enterprise portrait and target feature information to obtain the credit status information of the target enterprise.
[0075] In the embodiments of the present application, the number of other data providers can be one or more, and this is not limited here. Federated learning can be used to obtain the credit status information of a target enterprise. The data provider can collaborate with other data providers to use a target federated learning model to predict the target enterprise's profile and target feature information to obtain the target enterprise's credit status information.
[0076] Optionally, the credit status information includes but is not limited to credit rating, credit score, etc., which are not further limited here.
[0077] This method can thus obtain the target enterprise's profile and target characteristic information from the data provider. It can then collaborate with other data providers to predict the target enterprise's profile and target characteristic information using a target federated learning model to obtain the target enterprise's credit status information. Federated learning can be applied to obtain the credit status of enterprises, and accurately and quickly using the target federated learning model will help streamline the enterprise loan process and accurately implement enterprise support policies.
[0078] Based on any of the above embodiments, Figure 3As shown, in step S101, enterprise portraits and characteristic information of multiple enterprises on the data provider are obtained, including:
[0079] S301, obtaining original data of multiple enterprises from the enterprise database on the data provider according to the set screening rules.
[0080] In an embodiment of the present application, the number of data providers may be one or more, and each data provider is provided with one or more enterprise databases. The original data of multiple enterprises can be obtained from the enterprise database on each data provider according to the set screening rules.
[0081] It is understandable that different enterprise databases may correspond to different screening rules. Optionally, the screening rules may be set according to actual conditions, including but not limited to classification algorithms, clustering algorithms, association algorithms, etc., which are not limited here.
[0082] S302: performing feature extraction and label extraction on the original data of each of the multiple enterprises.
[0083] Optionally, a feature extraction algorithm may be used to extract features from the raw data of each enterprise. The feature extraction algorithm may be set according to actual conditions, for example, an artificial intelligence (AI) algorithm.
[0084] Optionally, a label extraction algorithm may be used to extract labels from the raw data of each enterprise. The label extraction algorithm may be set according to actual conditions, for example, a deep learning algorithm.
[0085] S303: Generate feature information of each enterprise using the extracted features of each enterprise.
[0086] In the embodiment of the present application, the extracted features of each enterprise can be used to generate feature information of each enterprise. It is understandable that the features extracted from each enterprise may be different, and thus the feature information of each enterprise may also be different.
[0087] S304: Generate a corporate profile for each enterprise using the extracted labels of each enterprise.
[0088] In the embodiment of the present application, the extracted tags of each enterprise can be used to generate a corporate profile of each enterprise. It is understandable that the tags extracted from each enterprise may be different, and thus the corporate profile of each enterprise may also be different.
[0089] Therefore, this method can obtain the original data of multiple enterprises from the enterprise database on the data provider side according to the set screening rules, and perform feature extraction and label extraction on the original data of each of the multiple enterprises. After that, the extracted features of each enterprise can be used to generate the feature information of each enterprise, and the extracted labels of each enterprise can be used to generate the enterprise portrait of each enterprise to obtain the enterprise portrait and feature information of the enterprise.
[0090] Based on any of the above embodiments, Figure 4 As shown, step S302 of extracting features and labels from the raw data of each of the multiple enterprises may include:
[0091] S401 , identifying abnormal data in the original data of each of a plurality of enterprises.
[0092] It is understandable that there may be abnormal data in the original data of an enterprise.
[0093] Optionally, abnormal data may include data in the original data that differs significantly from other original data. In this case, identifying abnormal data in the original data may include obtaining an average of the differences between each original data and other original data. If the average of the differences is greater than a preset threshold, the original data corresponding to the difference is identified as abnormal data. The preset threshold can be set based on actual circumstances.
[0094] S402: Filter abnormal data to obtain cleaned data.
[0095] In an embodiment of the present application, in order to prevent abnormal data from affecting the accuracy of data processing, the abnormal data can be filtered out from the original data, and the remaining original data can be used as cleaned data.
[0096] S403: Preprocess the cleaned data to generate data to be extracted.
[0097] In an embodiment of the present application, in order to improve the accuracy of data processing, the cleaned data may be preprocessed to generate data to be extracted.
[0098] Optionally, preprocessing the cleaned data to generate the data to be extracted may include filling missing values in the cleaned data, binning the filled cleaned data, and encoding the binning results to generate the data to be extracted.
[0099] It is understandable that some values may be missing in the cleaned data. To effectively utilize the cleaned data, a missing value filling operation can be performed on the cleaned data to fill in the missing data. The filled cleaned data can then be binned, dividing the filled cleaned data into multiple data bins, each containing one or more filled cleaned data. The binning results can also be encoded to distinguish between different data bins, thereby generating the data to be extracted.
[0100] S404: Perform feature extraction and label extraction on the data to be extracted.
[0101] Optionally, feature extraction of the data to be extracted may include using a boosted tree model to perform feature splitting on the data to be extracted, thereby generating leaf nodes of the boosted tree, with the position information of the leaf nodes serving as feature information. The boosted tree model may be configured based on actual conditions, including, for example, but not limited to, a lightGBM model, a gradient boosting decision tree (GBDT) model, etc., which are not specifically limited here.
[0102] For example, assuming that a boosting tree model is used to perform feature splitting on the data to be extracted, the number of leaf nodes of the generated boosting tree is 5. The generated leaf nodes can be sorted. If the data A to be extracted is divided into the second leaf node, the feature information corresponding to the data A to be extracted can be (0, 1, 0, 0, 0). If the data B to be extracted is divided into the third leaf node, the feature information corresponding to the data B to be extracted can be (0, 0, 1, 0, 0).
[0103] It should be noted that, for the relevant content of label extraction of the data to be extracted, reference can be made to the above embodiments, which will not be described in detail here.
[0104] Therefore, this method can filter abnormal data from the enterprise's original data to obtain cleaned data, and preprocess the cleaned data to generate data to be extracted, and perform feature extraction and label extraction on the data to be extracted, which can improve the accuracy of feature extraction and label extraction.
[0105] Based on any of the above embodiments, Figure 5 As shown, in step S102, the federated training of the model based on the enterprise profile and feature information in collaboration with other data providers may include:
[0106] S501, combining the enterprise portrait and feature information to generate training samples for the data provider.
[0107] Optionally, the enterprise profile and feature information can be combined according to a set combination rule to generate training samples for the data provider. The combination rule can be set according to actual conditions and is not limited here.
[0108] Optionally, the enterprise portrait and feature information are combined to generate training samples for the data provider, which may include generating a first matrix corresponding to the enterprise portrait, generating a second matrix corresponding to the feature information, and splicing the first matrix and the second matrix to generate training samples.
[0109] For example, suppose the first matrix corresponding to the enterprise portrait of data provider A is The second matrix corresponding to the feature information is Then the first matrix can be and the second matrix Perform horizontal splicing to obtain the matrix The matrix As training samples of the data provider A. It is understandable that splicing can also be in other forms, which will not be described here.
[0110] S502, collaborate with other data providers to perform federated training on their own local learning models based on their own training samples.
[0111] In the embodiments of the present application, each data provider can combine the enterprise portraits and feature information of multiple enterprises to generate its own training samples. It can also collaborate with other data providers to perform federated training on its own local learning model based on its own training samples.
[0112] It should be noted that each data provider participating in federated training only uses the corporate portraits and feature information of its own multiple enterprises to generate its own training samples, and trains its own local learning model based on its own training samples. In other words, the training samples of each data provider participating in federated training can be physically isolated, which can meet the data provider's requirements for data protection and data security.
[0113] Therefore, this method combines enterprise portraits and feature information to generate training samples for the data provider, and collaborates with other data providers to perform federated training on their own local learning models based on their own training samples.
[0114] Based on any of the above embodiments, Figure 6 As shown, before cooperating with other data providers to perform federated training on their own local learning models based on their own training samples in step S502, the following steps are also included:
[0115] S601: Obtain the enterprise identification corresponding to the training samples of other data providers.
[0116] In the embodiments of the present application, corresponding enterprise identifiers can be set for training samples to distinguish training samples from different enterprises. For example, if there are four enterprises, namely Enterprise A, Enterprise B, Enterprise C, and Enterprise D, the enterprise identifier of the training sample corresponding to Enterprise A can be A. Correspondingly, the enterprise identifiers of the training samples corresponding to Enterprise B, Enterprise C, and Enterprise D can be B, C, and D, respectively.
[0117] S602: Obtain the enterprise identification corresponding to the training sample of the data provider and send it to other data providers.
[0118] In an embodiment of the present application, the enterprise identifiers corresponding to the training samples of the data provider and other data providers may be obtained respectively, and the enterprise identifiers corresponding to the training samples of the data provider may be sent to other data providers.
[0119] Optionally, the enterprise identification corresponding to the training sample of the data provider can be sent to a third-party platform, and the third-party platform can send the above enterprise identification to other data providers.
[0120] S603: Based on the acquired enterprise identifier, align the training samples of the data provider with the training samples of other data providers.
[0121] In an embodiment of the present application, the training samples of the data provider end can be aligned with the training samples of other data providers based on the enterprise identifiers corresponding to the training samples of the data provider end and other data providers, so that the data provider end can collaborate with other data providers to perform federated training of the model.
[0122] For example, if a data provider includes four training samples, arranged in the order of sample a, sample b, sample c, and sample d, and the corresponding corporate identifiers for sample a, sample b, sample c, and sample d are B, C, A, and D, respectively, and another data provider includes four training samples, arranged in the order of sample e, sample f, sample g, and sample h, and the corresponding corporate identifiers for sample e, sample f, sample g, and sample h are A, B, C, and D, respectively. It can be seen that according to the arrangement order of the training samples of the current data provider, the corporate identifiers corresponding to the training samples of the data provider are B, C, A, and D, respectively. According to the arrangement order of the training samples of the other data providers, the corporate identifiers corresponding to the training samples of the other data providers are A, B, C, and D, respectively. At this time, the training samples of the data provider are not aligned with the training samples of the other data providers.
[0123] The arrangement order of the training samples of the data provider can be adjusted to sample c, sample a, sample b, and sample d. At this time, the enterprise identifiers corresponding to the training samples of the data provider are A, B, C, and D, respectively, which are consistent with the order of the enterprise identifiers corresponding to the training samples of other data providers. At this time, the training samples of the data provider are aligned with the training samples of other data providers.
[0124] Optionally, based on the acquired corporate identifier, sample alignment is performed on the training samples of the data provider end and the training samples of other data providers, which may include obtaining the corporate identifier shared by the data provider end and the other data providers, and based on the shared corporate identifier, filtering out training samples identified by non-shared corporate identifiers from the training samples of the data provider end.
[0125] Furthermore, after filtering out the training samples identified by non-shared enterprise identifiers, shared enterprise identifiers may be obtained, and respective training samples may be obtained based on the shared enterprise identifiers and the data provider.
[0126] For example, if a data provider includes four training samples, arranged in the order of sample a, sample b, sample c, and sample d, and the corresponding enterprise identifiers for sample a, sample b, sample c, and sample d are B, C, A, and E, respectively, and another data provider includes three training samples, arranged in the order of sample e, sample f, and sample g, and the corresponding enterprise identifiers for sample e, sample f, and sample g are A, B, and C, respectively, then the enterprise identifiers shared by the data provider and the other data providers can be obtained as A, B, and C, and sample d, which is identified by the non-shared enterprise identifier E, can be deleted from the training samples of the data provider.
[0127] Based on the shared corporate identifiers A, B, and C, the order of the training samples on the data provider side can be adjusted to sample c, sample a, and sample b. The corporate identifiers corresponding to the training samples on the data provider side are now A, B, and C, which is consistent with the order of the corporate identifiers corresponding to the training samples on the other data providers. The training samples on the data provider side are now aligned with the training samples on the other data providers. At this point, the training samples on the data provider side include sample c, sample a, and sample b, while the training samples on the other data providers include sample e, sample f, and sample g.
[0128] Therefore, this method can respectively obtain the enterprise identifications corresponding to the training samples of the data provider and other data providers, and send the enterprise identifications corresponding to the training samples of the data provider to other data providers, and align the training samples of the data provider with the training samples of other data providers based on the obtained enterprise identifications, so that the data provider can collaborate with other data providers to perform federated training of the model.
[0129] like Figure 7As shown, the training system of the federated learning model may include a data provider, other data providers, a data processing module, a feature extraction module, an image extraction module, a feature combination module, an alignment module, a federated training module and a prediction module.
[0130] Among them, both the data provider and other data providers have enterprise databases. In specific implementations, the enterprise database on the data provider includes enterprise business information, enterprise affiliated institutions, public opinion information, enterprise annual reports, judicial proceedings and other information. The enterprise database on other data providers includes regulatory certification information (such as green production certification, organic production certification, pesticide residue compliance supervision, and related production enterprise regulatory certification information), pesticide residue detection information (such as pesticide residue quantity, pesticide warning information), and agricultural work information (such as agricultural fertilizer information, planting scale, and historical income information).
[0131] The data processing module is used to obtain raw data from the enterprise database and perform operations such as abnormal data filtering and preprocessing on the raw data to generate data to be extracted.
[0132] The feature extraction module is used to extract features from the data to be extracted, and to generate feature information of each enterprise using the extracted features of each enterprise.
[0133] Among them, the portrait extraction module is used to extract labels from the extracted data, and use the extracted labels of each enterprise to generate an enterprise portrait for each enterprise.
[0134] Among them, the feature combination module is used to combine enterprise portraits and feature information to generate training samples.
[0135] The alignment module is used to align the training samples of the data provider with the training samples of other data providers.
[0136] Among them, the federated training module is used to enable the data provider and other data providers to perform federated training on their own local learning models based on their own training samples to generate a target federated learning model.
[0137] Among them, the prediction module is used to use the target federated learning model to predict the credit status of the enterprise.
[0138] With the above Figures 1 to 7 Corresponding to the training method of the federated learning model provided in the embodiment, the present disclosure also provides a training device for the federated learning model. Figures 1 to 7 The training method of the federated learning model provided in the embodiment corresponds to the embodiment, so the implementation method of the training method of the federated learning model is also applicable to the training device of the federated learning model provided in the embodiment of the present disclosure, and will not be described in detail in the embodiment of the present disclosure.
[0139] Figure 8 Schematic diagram of the structure of a training device for a federated learning model according to an embodiment of the present application.
[0140] like Figure 8 As shown, the training device 100 of the federated learning model in the embodiment of the present application may include: an acquisition module 110, a first training module 120, a summary module 130 and a second training module 140.
[0141] An acquisition module 110 is used to acquire enterprise portraits and feature information of multiple enterprises on a data provider;
[0142] A first training module 120 is configured to perform federated model training in collaboration with other data providers based on the enterprise profile and the feature information to obtain intermediate model results of their respective local learning models;
[0143] A summarizing module 130 is configured to send the intermediate model results to a third-party platform for summarization, and receive the summarized global model intermediate results sent by the third-party platform;
[0144] The second training module 140 is used to adjust the model parameters of its own local learning model based on the intermediate result of the global model to continue the federated training of the model to generate a target federated learning model, wherein the target federated learning model is used to predict the credit status of the enterprise.
[0145] In one embodiment of the present application, Figure 9 As shown, the first training module 120 includes: a combination unit 1201, used to combine the enterprise portrait and the feature information to generate a training sample for the data provider; a training unit 1202, used to collaborate with the other data providers to perform federal training on their own local learning models based on their own training samples.
[0146] In one embodiment of the present application, the combination unit 1201 is specifically used to: generate a first matrix corresponding to the corporate portrait; generate a second matrix corresponding to the feature information; and splice the first matrix and the second matrix to generate the training sample.
[0147] In one embodiment of the present application, Figure 9As shown, the first training module 120 also includes: a first acquisition unit 1203, which acquires the corporate identification corresponding to the training sample of the other data provider; a sending unit 1204, which is used to acquire the corporate identification corresponding to the training sample of the data provider and send it to the other data provider; an alignment unit 1205, which is used to align the training sample of the data provider with the training sample of the other data provider based on the acquired corporate identification.
[0148] In one embodiment of the present application, the alignment unit 1205 is specifically used to: obtain the corporate identity shared by the data provider and the other data providers; and based on the shared corporate identity, filter out training samples identified by non-shared corporate identity from the training samples of the data provider.
[0149] In one embodiment of the present application, the alignment unit 1205 is further configured to: obtain the shared corporate identity; and obtain the respective training samples based on the shared corporate identity and the data provider.
[0150] In one embodiment of the present application, Figure 9 As shown, the acquisition module 110 includes: a second acquisition unit 1101, used to obtain the original data of the multiple enterprises from the enterprise database on the data provider according to the set screening rules; an extraction unit 1102, used to perform feature extraction and label extraction on the original data of each of the multiple enterprises; a feature generation unit 1103, used to generate the feature information of each of the enterprises by using the extracted features of each of the enterprises; a portrait generation unit 1104, used to generate the enterprise portrait of each of the enterprises by using the extracted labels of each of the enterprises.
[0151] In one embodiment of the present application, the extraction unit 1102 is specifically used to: identify abnormal data in the original data of each of the multiple enterprises; filter the abnormal data to obtain cleaned data; preprocess the cleaned data to generate data to be extracted; and perform feature extraction and label extraction on the data to be extracted.
[0152] In one embodiment of the present application, the extraction unit 1102 is further configured to: perform a missing value filling operation on the cleaned data; perform a data binning operation on the filled cleaned data; and encode the binning result to generate the data to be extracted.
[0153] In one embodiment of the present application, the extraction unit 1102 is specifically used to: use a boosting tree model to perform feature splitting on the data to be extracted to generate leaf nodes of the boosting tree, and use the position information of the leaf nodes as the feature information.
[0154] In one embodiment of the present application, Figure 9 As shown, the training device 100 of the federated learning model also includes: a prediction module 150, which is used to: obtain the target enterprise portrait and target feature information of the target enterprise on the data provider end, wherein the target enterprise is an enterprise that needs to predict the credit status; cooperate with the other data providers to use the target federated learning model to predict the target enterprise portrait and the target feature information to obtain the credit status information of the target enterprise.
[0155] The training device of the federated learning model in the embodiment of the present application performs federated training of the model through enterprise portraits and feature information of multiple data providers, and the obtained target federated learning model has better accuracy. Federated learning can be applied to the acquisition of the credit status of the enterprise, and the credit status of the enterprise can be accurately and quickly obtained through the target federated learning model, which is conducive to simplifying the enterprise loan process and the precise implementation of enterprise assistance policies.
[0156] In order to implement the above embodiment, Figure 10 As shown, the present application also proposes an electronic device 200, comprising: a memory 210, a processor 220, and a computer program stored on the memory 210 and executable on the processor 220. When the processor 220 executes the program, it implements the training method of the federated learning model proposed in the aforementioned embodiment of the present application.
[0157] The electronic device of the embodiment of the present application executes a computer program stored in the memory through a processor, and performs federal training of the model through the corporate portraits and feature information of multiple data providers. The obtained target federated learning model has better accuracy, and federated learning can be applied to the acquisition of the credit status of the enterprise. The credit status of the enterprise can be accurately and quickly obtained through the target federated learning model, which is conducive to simplifying the corporate loan process and the precise implementation of corporate assistance policies.
[0158] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the training method of the federated learning model proposed in the above embodiments of the present application.
[0159] The computer-readable storage medium of the embodiment of the present application stores a computer program and is executed by a processor. The model is federated through corporate portraits and feature information of multiple data providers. The obtained target federated learning model has better accuracy. Federated learning can be applied to the acquisition of corporate credit status, and the credit status of the enterprise can be accurately and quickly obtained through the target federated learning model, which is conducive to simplifying the corporate loan process and the precise implementation of corporate assistance policies.
[0160] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0161] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. Throughout the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0162] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0163] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and a portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.
[0164] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0165] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0166] In addition, the functional units in the various embodiments of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into a module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0167] The storage medium mentioned above may be a read-only memory, a magnetic disk, or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application. Persons skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.
Claims
1. A training method for a federated learning model, characterized in that: include: Obtain enterprise portraits and feature information of multiple enterprises on the data provider side; Based on the enterprise profile and the feature information, collaborate with other data providers to perform federated model training to obtain intermediate model results of their respective local learning models, including gradients and losses; Sending the model intermediate results to a third-party platform for aggregation, and receiving the aggregated global model intermediate results sent by the third-party platform; Based on the intermediate result of the global model, adjusting the model parameters of the local learning model to continue the federated training of the model to generate a target federated learning model, wherein the target federated learning model is used to predict the credit status of the enterprise; The federated training of the model based on the enterprise profile and the feature information in collaboration with other data providers includes: Combining the enterprise portrait and the feature information to generate a training sample for the data provider; Cooperating with the other data providers to perform federated training on their own local learning models based on their own training samples, wherein the training samples of each data provider participating in the federated training are physically isolated; The combining of the enterprise portrait and the feature information to generate a training sample for the data provider includes: Generate a first matrix corresponding to the enterprise portrait; generating a second matrix corresponding to the feature information; Concatenating the first matrix and the second matrix to generate the training sample; Before the collaboration with the other data providers to perform federated training on their own local learning models based on their own training samples, the method further includes: Obtaining the enterprise identification corresponding to the training sample from the other data provider; Obtaining the enterprise identifier corresponding to the training sample from the data provider and sending it to the other data provider; Performing sample alignment on the training sample of the data provider and the training sample of the other data provider according to the obtained enterprise identifier; The step of aligning the training sample of the data provider with the training sample of the other data provider based on the acquired enterprise identifier includes: Acquire a corporate identity shared by the data provider and the other data providers; According to the shared enterprise identifier, training samples identified by non-shared enterprise identifiers are filtered out from the training samples of the data provider.
2. The training method of the federated learning model according to claim 1, characterized in that: After filtering out the training samples identified by the non-shared enterprise identifiers, the method further includes: Obtaining the shared enterprise identity; The respective training samples are obtained based on the shared enterprise identifier and the data provider.
3. The training method of the federated learning model according to claim 1, characterized in that: The acquisition of enterprise portraits and characteristic information of multiple enterprises on the data provider includes: Obtaining the raw data of the plurality of enterprises from the enterprise database on the data provider according to the set screening rules; performing feature extraction and label extraction on the raw data of each of the multiple enterprises; generating the feature information of each enterprise by using the extracted features of each enterprise; The enterprise portrait of each enterprise is generated by utilizing the extracted labels of each enterprise.
4. The training method of the federated learning model according to claim 3, characterized in that: The extracting features and labels from the raw data of each of the multiple enterprises further includes: For the original data of each of the plurality of enterprises, identifying abnormal data in the original data; Filtering the abnormal data to obtain cleaned data; Preprocessing the cleaned data to generate data to be extracted; Feature extraction and label extraction are performed on the data to be extracted.
5. The training method of the federated learning model according to claim 4, characterized in that: The preprocessing of the cleaned data to generate data to be extracted includes: Performing a missing value filling operation on the cleaned data; Performing a data binning operation on the cleaned data after filling; The binning results are encoded to generate the data to be extracted.
6. The training method of the federated learning model according to claim 4, characterized in that: The feature extraction of the data to be extracted includes: A boosting tree model is used to perform feature splitting on the data to be extracted to generate leaf nodes of a boosting tree, and the position information of the leaf nodes is used as the feature information.
7. The training method of the federated learning model according to claim 1, characterized in that: After generating the target federated learning model, the following steps are also included: Obtaining a target enterprise portrait and target feature information of the target enterprise on the data provider, wherein the target enterprise is an enterprise for which credit status prediction is required; In collaboration with the other data providers, the target federated learning model is used to predict the target enterprise portrait and the target feature information to obtain the credit status information of the target enterprise.
8. A training device for a federated learning model, characterized in that: include: The acquisition module is used to obtain the enterprise portraits and feature information of multiple enterprises on the data provider; A first training module is configured to perform federated model training in collaboration with other data providers based on the enterprise profile and the feature information to obtain intermediate model results of their respective local learning models; A summary module is used to send the intermediate results of the model to a third-party platform for summary, and receive the summarized global model intermediate results sent by the third-party platform, wherein the intermediate results of the model include gradients and losses; A second training module is configured to adjust the model parameters of the local learning model based on the intermediate result of the global model to continue the federated training of the model to generate a target federated learning model, wherein the target federated learning model is used to predict the credit status of the enterprise; The first training module includes: a combining unit, configured to combine the enterprise portrait and the feature information to generate a training sample for the data provider; A training unit, configured to collaborate with the other data providers to perform federated training on their own local learning models based on their own training samples, wherein the training samples of each data provider participating in the federated training are physically isolated; The combination unit is specifically used for: Generate a first matrix corresponding to the enterprise portrait; generating a second matrix corresponding to the feature information; Concatenating the first matrix and the second matrix to generate the training sample; The first training module further includes: A first acquiring unit, acquiring an enterprise identifier corresponding to the training sample from the other data provider; a sending unit, configured to obtain the enterprise identifier corresponding to the training sample from the data provider, and send the identifier to the other data provider; an alignment unit, configured to align the training sample of the data provider with the training samples of the other data providers according to the acquired enterprise identifier; The alignment unit is specifically used to: Acquire a corporate identity shared by the data provider and the other data providers; According to the shared enterprise identifier, training samples identified by non-shared enterprise identifiers are filtered out from the training samples of the data provider.
9. The training device for the federated learning model according to claim 8, characterized in that: The alignment unit is further configured to: Obtaining the shared enterprise identity; The respective training samples are obtained based on the shared enterprise identifier and the data provider.
10. The training device for the federated learning model according to claim 8, characterized in that: The acquisition module includes: A second acquisition unit is configured to acquire the raw data of the plurality of enterprises from the enterprise database on the data providing end according to a set screening rule; an extraction unit, configured to perform feature extraction and label extraction on the raw data of each of the plurality of enterprises; a feature generating unit, configured to generate the feature information of each enterprise by using the extracted features of each enterprise; A portrait generating unit is used to generate the enterprise portrait of each enterprise by using the extracted label of each enterprise.
11. The training device for a federated learning model according to claim 10, characterized in that: The extraction unit is specifically used for: For the original data of each of the plurality of enterprises, identifying abnormal data in the original data; Filtering the abnormal data to obtain cleaned data; Preprocessing the cleaned data to generate data to be extracted; Feature extraction and label extraction are performed on the data to be extracted.
12. The training device for the federated learning model according to claim 11, characterized in that: The extraction unit is further used for: Performing a missing value filling operation on the cleaned data; Performing a data binning operation on the cleaned data after filling; The binning results are encoded to generate the data to be extracted.
13. The training device for a federated learning model according to claim 11, characterized in that: The extraction unit is specifically used for: A boosting tree model is used to perform feature splitting on the data to be extracted to generate leaf nodes of a boosting tree, and the position information of the leaf nodes is used as the feature information.
14. The training device for a federated learning model according to claim 8, wherein: Also includes: Prediction module, used to: Obtaining a target enterprise portrait and target feature information of the target enterprise on the data provider, wherein the target enterprise is an enterprise for which credit status prediction is required; In collaboration with the other data providers, the target federated learning model is used to predict the target enterprise portrait and the target feature information to obtain the credit status information of the target enterprise.
15. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method for training a federated learning model according to any one of claims 1 to 7 is implemented.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the training method of the federated learning model as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Sample prediction method and device based on federation training and storage medium
CN109165683A
Data processing method, device, computer, and storage medium
CN109409504A
Data processing method, device and equipment
CN111292168A
Credit risk control system and method based on federation mode
CN111461874A
User label data prediction system, method and device and electronic equipment
CN112085159A