Feature completion method, device, equipment and storage medium based on federated learning
Through the feature completion method based on vertical federated learning, the features of multiple participants' devices are used for joint training, which solves the problem in the existing technology that feature value completion is difficult to improve the prediction accuracy of financial risk control models, and achieves a higher Forecast accuracy.
Patent Information
- Application Number
- CN202011643145.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-30
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-12-30
AI Technical Summary
In the existing technology, it is difficult to improve the prediction accuracy of financial risk control models by using methods such as average, median, and mode to fill in the missing feature values.
A feature completion method based on vertical federated learning is adopted. By obtaining the sample data to be completed and inputting it into the preset target feature completion model, the different features of multiple participants' devices are used for joint training to establish the preset target feature completion. model for feature completion.
It improves the prediction accuracy of the feature prediction model and avoids the problem of low model prediction accuracy when the number of samples is small or the features are homogeneous.
Smart Images

Figure CN112700010B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a feature completion method, apparatus, device and storage medium based on federated learning. Background Art
[0002] With the continuous development of financial technology, especially Internet technology finance, more and more technologies (such as distributed, blockchain, artificial intelligence, etc.) are applied in the financial field, but the financial industry also puts forward higher requirements on technology, such as higher requirements for the completion of missing features in the financial industry.
[0003] With the continuous development of computer software and artificial intelligence, neural network models are becoming more and more widely used. However, neural network models with superior performance are usually built based on training samples with high feature richness. In real application scenarios, the lack of feature values is the norm. For example, in the field of financial risk control, institutions engaged in financial risk control often cannot collect complete basic information of users. Specifically, there are a large number of missing values in user shopping information and web browsing information that are helpful for financial risk control. The missing feature values of important features will seriously affect the performance of the risk control model. Although the missing feature values are currently filled by using feature value completion methods such as mean, median, and mode, these feature completion methods do not fill the feature values from the perspective of improving the performance of the final model, and it is difficult to improve the prediction accuracy and other performance of the final model. Summary of the invention
[0004] The main purpose of this application is to provide a feature completion method, apparatus, device and storage medium based on federated learning, aiming to solve the technical problem in the prior art that it is difficult to obtain a prediction model with high prediction accuracy by using feature value completion methods such as average, median, and mode to fill in the missing feature values of the participating devices.
[0005] To achieve the above object, the present application provides a feature completion method based on vertical federated learning, which is applied to a first device. The feature completion method based on vertical federated learning includes:
[0006] Acquire sample data to be completed, and input the sample data to be completed into a preset target feature completion model;
[0007] The preset target feature completion model is obtained by iteratively training a preset initial completion model based on non-missing sample feature data with labels by executing a first preset longitudinal federated learning process;
[0008] The sample data to be completed is completed based on the feature completion model to obtain target completion data, so as to use the target completion data to train the machine learning model.
[0009] Optionally, before the step of completing the sample data to be completed based on the feature completion model to obtain target completion data and using the target completion data to train the machine learning model, the method includes:
[0010] Obtain non-missing sample feature data with labels;
[0011] Based on the non-missing sample feature data of the non-missing feature labels, executing a first preset longitudinal federated learning process, iteratively training a preset initial completion model, and obtaining a target model;
[0012] The target model is set as the preset target feature completion model.
[0013] Optionally, the first device is communicatively connected to the second device, and the step of acquiring non-missing sample feature data with labels includes:
[0014] Performing sample alignment with a second device to obtain non-missing sample data;
[0015] Based on a preset feature extraction model, feature extraction is performed on the non-missing sample data to map the non-missing sample data to a preset feature dimension to obtain non-missing sample feature data with a label.
[0016] Optionally, the step of executing a first preset longitudinal federated learning process based on the non-missing sample feature data of the non-missing feature labels, iteratively training a preset initial completion model, and obtaining a target model includes:
[0017] Based on the non-missing sample feature data, iteratively training the preset initial completion model to train and update the model calculation intermediate variables of the preset initial completion model;
[0018] Determine whether the preset initial completion model of iterative training meets the preset replacement and update conditions. If the preset initial completion model meets the preset replacement and update conditions, replace and update the intermediate variables of the model calculation updated by training by executing the first preset longitudinal federated learning process to obtain the replaced and updated preset initial completion model;
[0019] Continue to iteratively train and replace and update the replaced and updated preset initial completion model until the preset model to be trained meets the preset training completion condition, thereby obtaining the target model.
[0020] Optionally, the first device is in communication connection with a third party,
[0021] The step of replacing and updating the intermediate variables of the model calculation updated by training by executing the first preset longitudinal federated learning process to obtain the replaced and updated preset initial completion model includes:
[0022] The model calculation intermediate variables updated through training are encrypted and sent to a third party associated with the first device, so that the third party can perform splicing and aggregation processing on the corresponding model calculation intermediate variables of the first device and the second device to obtain spliced and aggregated intermediate variables, and feed the spliced and aggregated intermediate variables back to the first device;
[0023] The spliced aggregate intermediate variables fed back by the third party are received, and the model calculation intermediate variables updated through training are replaced and updated with the spliced aggregate intermediate variables to obtain the replaced and updated preset initial completion model.
[0024] Optionally, after the step of completing the sample data to be completed based on the feature completion model to obtain target completed data, the method includes:
[0025] Inputting the target completion data into a preset type prediction model;
[0026] The preset type prediction model is obtained by iteratively training the preset prediction model to be trained by executing the second preset longitudinal federated learning process based on the first device sample feature data with the preset type label;
[0027] The target completion data is predicted based on the preset type prediction model to obtain a target type.
[0028] Optionally, the sample data to be completed is loan sample data to be completed, and the step of completing the sample data to be completed based on the feature completion model to obtain target completed data includes:
[0029] The loan sample data to be completed is completed based on the feature completion model to obtain target completed data.
[0030] The present application also provides a feature completion device based on vertical federated learning, which is applied to a first device. The feature completion device based on vertical federated learning includes:
[0031] A first acquisition module is used to acquire sample data to be completed, and input the sample data to be completed into a preset target feature completion model;
[0032] The preset target feature completion model is obtained by iteratively training a preset initial completion model based on non-missing sample feature data with labels by executing a first preset longitudinal federated learning process;
[0033] The completion module is used to complete the sample data to be completed based on the feature completion model to obtain target completion data, so as to use the target completion data to train the machine learning model.
[0034] Optionally, the feature completion device based on vertical federated learning includes:
[0035] The second acquisition module is used to acquire non-missing sample feature data with labels;
[0036] An iterative training module, configured to execute a first preset longitudinal federated learning process based on the non-missing sample feature data of the non-missing feature labels, iteratively train a preset initial completion model, and obtain a target model;
[0037] A setting module is used to set the target model as the preset target feature completion model.
[0038] Optionally, the first device is communicatively connected to a second device, and the second acquisition module includes:
[0039] an alignment unit, configured to perform sample alignment with the second device to obtain non-missing sample data;
[0040] The feature extraction unit is used to perform feature extraction on the non-missing sample data based on a preset feature extraction model to map the non-missing sample data to a preset feature dimension to obtain non-missing sample feature data with a label.
[0041] Optionally, the iterative training module includes:
[0042] An iterative training unit, configured to iteratively train the preset initial completion model based on the non-missing sample feature data, so as to train and update the model calculation intermediate variables of the preset initial completion model;
[0043] A judging unit, used for judging whether the preset initial completion model of iterative training meets the preset replacement and update conditions, and if the preset initial completion model meets the preset replacement and update conditions, replacing and updating the intermediate variables of the model calculation of the training and update by executing the first preset longitudinal federated learning process to obtain the replaced and updated preset initial completion model;
[0044] The replacement and updating unit is used to continuously iteratively train and replace and update the preset initial completion model that is replaced and updated until the preset model to be trained meets the preset training completion condition, thereby obtaining the target model.
[0045] Optionally, the first device is in communication connection with a third party,
[0046] The judging unit comprises:
[0047] a sending subunit, configured to encrypt and send the model calculation intermediate variables updated through training to a third party associated with the first device, so that the third party can perform splicing and aggregation processing on the corresponding model calculation intermediate variables of the first device and the second device, obtain spliced and aggregated intermediate variables, and feed the spliced and aggregated intermediate variables back to the first device;
[0048] The receiving subunit is used to receive the spliced aggregate intermediate variables fed back by the third party, and replace and update the model calculation intermediate variables updated by training with the spliced aggregate intermediate variables to obtain the replaced and updated preset initial completion model.
[0049] Optionally, the device further comprises:
[0050] An input module, used for inputting the target completion data into a preset type prediction model;
[0051] The preset type prediction model is obtained by iteratively training the preset prediction model to be trained by executing the second preset longitudinal federated learning process based on the first device sample feature data with the preset type label;
[0052] The prediction module is used to perform prediction processing on the target completion data based on the preset type prediction model to obtain the target type.
[0053] Optionally, the completion module includes:
[0054] The completion unit is used to complete the loan sample data to be completed based on the feature completion model to obtain target completed data.
[0055] The present application also provides a feature completion device based on vertical federated learning, which is a physical device. The feature completion device based on vertical federated learning includes: a memory, a processor, and a program of the feature completion method based on vertical federated learning stored in the memory and executable on the processor. When the program of the feature completion method based on vertical federated learning is executed by the processor, the steps of the feature completion method based on vertical federated learning as described above can be implemented.
[0056] The present application also provides a readable storage medium, on which is stored a program for implementing a feature completion method based on vertical federated learning. When the program for the feature completion method based on vertical federated learning is executed by a processor, the steps of the feature completion method based on vertical federated learning as described above are implemented.
[0057] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned feature completion method based on vertical federated learning.
[0058] The present application provides a feature completion method, apparatus, device and storage medium based on federated learning. Compared with the prior art which uses feature value completion methods such as average, median and mode to fill in missing feature values of participating devices, making it difficult to obtain a prediction model with high prediction accuracy, the present application obtains sample data to be completed and inputs the sample data to be completed into a preset target feature completion model; wherein the preset target feature completion model is obtained by iteratively training a preset initial completion model based on non-missing sample feature data with labels by executing a first preset longitudinal federated learning process; the sample data to be completed is completed based on the feature completion model to obtain target completion data, so as to use the target completion data to train a machine learning model. In the present application, based on the non-missing sample feature data with labels, by executing the first preset longitudinal federated learning process, the preset initial completion model is iteratively trained to obtain the preset target feature completion model, and then the feature completion is performed on the sample data to be completed based on the preset target feature completion model, that is, the feature value completion method based on longitudinal federated learning utilizes the different features of multiple participating devices to jointly establish the preset target feature completion model, so as to avoid the low prediction accuracy of the trained model when the sample number is small or the sample features are relatively homogeneous, that is, to improve the prediction accuracy of the feature prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0060] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0061] Figure 1 This is a flowchart of the first embodiment of the feature completion method based on vertical federated learning in this application;
[0062] Figure 2 This is a flow chart of the second embodiment of the feature completion method based on vertical federated learning of the present application;
[0063] Figure 3 A schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application;
[0064] Figure 4 This is a flow chart of the third embodiment of the feature completion method based on vertical federated learning in the present application.
[0065] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0066] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0067] The present application embodiment provides a feature completion method based on vertical federated learning. In the first embodiment of the feature completion method based on vertical federated learning of the present application, it is applied to a first device, referring to Figure 1 , the feature completion method based on vertical federated learning includes:
[0068] Step S10, obtaining sample data to be completed, and inputting the sample data to be completed into a preset target feature completion model;
[0069] The preset target feature completion model is obtained by iteratively training a preset initial completion model based on non-missing sample feature data with labels by executing a first preset longitudinal federated learning process;
[0070] Step S20, completing the sample data to be completed based on the feature completion model to obtain target completion data, and using the target completion data to train the machine learning model.
[0071] The specific steps are as follows:
[0072] Step S10, obtaining sample data to be completed, and inputting the sample data to be completed into a preset target feature completion model;
[0073] The preset target feature completion model is obtained by iteratively training a preset initial completion model based on non-missing sample feature data with labels by executing a first preset longitudinal federated learning process;
[0074] In this embodiment, it should be noted that the feature completion method based on vertical federated learning is applied to the first device, wherein the first device and the other second device are connected in communication, specifically, the first device and the other second device are connected in vertical federated communication. In this embodiment, the sample data to be completed of the first device is obtained. After obtaining the sample data to be completed, the sample data to be completed is input into the preset target feature completion model, wherein the sample data to be completed refers to data with a missing feature. For example, the missing sample part of the first device A on feature F is recorded as Sample, the non-missing sample part of the first device A on feature F is recorded as Sample, then the sample data to be completed refers to Samples, specifically, for example, assuming that the sample of the first device A is loan data, and there are samples with missing age features in the loan data, then the samples with missing age features are Samples, or there are samples with missing educational background features in the loan data, then the samples with missing educational background features are Samples, wherein the sample data to be completed can be obtained through data cleaning and data integration. Specifically, for example, various sample IDs of the sample data in the first device are determined, and the sample data to be completed is determined based on whether the various sample IDs are missing values, etc., or various sample contents of the sample data in the first device are determined, and the sample data to be completed is determined based on whether the various sample contents are missing values, etc. The specific determination method is not specifically limited here.
[0075] After obtaining the sample data to be completed, the sample data to be completed is input into the preset target feature completion model to complete the missing features, specifically, to complete the missing feature values, wherein the preset target feature completion model is based on non-missing sample feature data with labels (non-missing feature labels), and is obtained by iteratively training the preset initial completion model by executing the first preset longitudinal federated learning process. The preset target feature completion model can be That is, the preset target feature completion model is (Features) and F n A (feature) mapping relationship, where there is a non-missing feature F n A All other features of the sample in the first device (Participant A) A are recorded as Has non-missing features All other features of the sample in the second device (participant B) B are recorded as feature and The splicing is recorded as For example, assuming that the first device A corresponds to feature X1 and feature X2 at the first device, the feature values corresponding to feature X1 and feature X2 are (x1, x2), where x1 is used to represent feature X1, x2 is used to represent feature X2, and the sample with missing feature X1 in the first device is F n A (y) Sample, the second device B corresponds to feature X3 and feature X4 at the second device, then feature X3 and feature X4, the corresponding feature value is (x3, x4), x3 is used to represent feature X3, x4 is used to represent feature X4, then Get features X1, X2, X3, X4 and y(F n A ), the mapping relationship between The completion feature of .
[0076] Among them, refer to Figure 2 Before the step of completing the sample data to be completed based on the feature completion model to obtain target completion data and using the target completion data to train the machine learning model, the method includes:
[0077] Step S01, obtaining non-missing sample feature data with labels;
[0078] Get non-missing sample feature data with labels such as
[0079] The first device is communicatively connected to the second device, and the step of obtaining non-missing sample feature data with labels includes:
[0080] Step A1, performing sample alignment with a second device to obtain non-missing sample data;
[0081] In this embodiment, it should be noted that the second device may be one or more than one. The following is a specific description using the second device as one as an example. The first device obtains non-missing sample data by performing sample alignment with the second device, that is, the first device A and the second device B match the identifiers of the samples owned by both parties. The samples whose identifiers match successfully are called overlapping samples, and the data corresponding to the overlapping samples are sample data. The sample data selected from the first device without feature missing is non-missing sample data, that is, F n A .
[0082] Specifically, refer to Figure 4 The identifier of the sample can specifically be a sample ID. The first device A and the second device B match the sample IDs owned by both parties to determine the overlapping samples based on the sample ID, wherein the sample ID is the identity identifier of the sample, and the sample ID includes an identity code, mobile phone number, ID card number, etc.
[0083] Step A3: Based on a preset feature extraction model, feature extraction is performed on the non-missing sample data to map the non-missing sample data to a preset feature dimension to obtain non-missing sample feature data with labels.
[0084] Obtain a preset feature extraction model, wherein the preset feature extraction model is a trained model capable of extracting features from sample data, and perform feature extraction on the non-missing sample data based on the preset feature extraction model to map the non-missing sample data to a preset feature dimension (converted into a feature vector), and obtain non-missing sample feature data with a label (non-missing feature label), that is, Has feature labels.
[0085] Step S02, based on the non-missing sample feature data of the non-missing feature labels, executing a first preset longitudinal federated learning process, iteratively training a preset initial completion model, and obtaining a target model;
[0086] Based on the non-missing sample feature data of the non-missing feature label and the non-missing sample feature data of the second device of the vertical federation, the preset initial completion model is iteratively trained to obtain the target model. In this embodiment, the method of iteratively training the preset initial completion model includes but is not limited to the gradient descent method.
[0087] Based on the non-missing sample feature data of the non-missing feature labels, a first preset longitudinal federated learning process is executed to iteratively train the preset initial completion model to obtain a target model, including:
[0088] Step B1, based on the non-missing sample feature data, iteratively training the preset initial completion model to train and update the model calculation intermediate variables of the preset initial completion model;
[0089] Step B2, determining whether the iteratively trained preset initial completion model meets the preset replacement and update conditions. If the preset initial completion model meets the preset replacement and update conditions, the first preset longitudinal federated learning process is executed to replace and update the intermediate variables of the model calculation updated by the training, so as to obtain the replaced and updated preset initial completion model;
[0090] Step B3, continuously iteratively training and replacing and updating the replaced and updated preset initial completion model until the preset model to be trained meets the preset training completion condition, thereby obtaining the target model.
[0091] In this embodiment, it should be noted that the non-missing sample feature data is input into the preset initial completion model to adjust the model calculation intermediate variables. During the adjustment process, the corresponding model calculation intermediate variables encrypted and fed back by the second device are also received, and the preset initial completion model is jointly iteratively trained to obtain a feature completion model. Specifically, the non-missing sample feature data is input into the preset initial completion model for iterative training to iteratively update each model calculation intermediate variable of the preset initial completion model, such as model variables, or gradients. During the iterative update process, it is determined whether the preset initial completion model meets the preset replacement update condition, wherein the preset replacement update condition includes reaching the iteration number threshold. , reaching the threshold of the number of training rounds, etc., and then if the preset initial completion model reaches the preset replacement and update conditions, the model calculation intermediate variables in the preset initial completion model are updated to the aggregated intermediate variables (obtained by aggregating the model calculation intermediate variables of the first device and the model calculation intermediate variables of the second device of the corresponding round), that is, specifically, if the basic model to be trained reaches the preset replacement and update conditions, the model calculation intermediate variables that are undergoing training and updating in the basic model to be trained are directly replaced with the aggregated intermediate variables; if the basic model to be trained does not reach the preset replacement and update conditions, the basic model to be trained is iteratively trained until the basic model to be trained reaches the preset replacement and update conditions. After replacement, the iterative training of the preset initial completion model and the judgment of whether the preset initial completion model meets the preset replacement update conditions are continuously performed, that is, if the preset initial completion model meets the preset replacement update conditions, and the second device is re-received to feedback the intermediate variables again to obtain new aggregated intermediate variables, the preset initial completion model is iteratively trained based on the new aggregated intermediate variables fed back again until the preset initial completion model meets the training completion conditions, then this iterative training is completed and the target model is obtained, wherein the training completion conditions include convergence of the loss function, reaching the upper limit of the number of iterations, etc.
[0092] In this embodiment, it should be noted that the loss function can be
[0093] Among them, there are non-missing features F n A All other features of the sample in the first device A are recorded as Has non-missing features All other features of the sample in the second device B are recorded as feature and The splicing is recorded as
[0094] Step S03: setting the target model as the preset target feature completion model
[0095] In this embodiment, after the target model is obtained, the target model is set as the preset target feature completion model.
[0096] In this embodiment, the first device is connected to a third party for communication.
[0097] The step of replacing and updating the intermediate variables of the model calculation updated by training by executing the first preset longitudinal federated learning process to obtain the replaced and updated preset initial completion model includes:
[0098] Step C1, encrypting and sending the updated model calculation intermediate variables to a third party associated with the first device, so that the third party can perform splicing and aggregation processing on the corresponding model calculation intermediate variables of the first device and the second device to obtain spliced and aggregated intermediate variables, and feed the spliced and aggregated intermediate variables back to the first device;
[0099] Step C2, receiving the spliced aggregate intermediate variables fed back by the third party, and replacing and updating the model calculation intermediate variables updated through training with the spliced aggregate intermediate variables, to obtain the replaced and updated preset initial completion model.
[0100] In this embodiment, it should be noted that the aggregated intermediate variable is specifically a spliced aggregated intermediate variable. Specifically, the splicing aggregation method includes summing, weighted averaging, direct splicing, etc. The model calculation intermediate variable updated by training is encrypted and sent to a third party associated with the first device, so that the third party can perform splicing and aggregation processing on the corresponding model calculation intermediate variables of the first device and the second device to obtain the spliced aggregated intermediate variable, and the spliced aggregated intermediate variable is fed back to the first device, the spliced aggregated intermediate variable fed back by the third party is received, and the model calculation intermediate variable updated by training is replaced and updated with the spliced aggregated intermediate variable to obtain the replaced and updated preset initial completion model. For example, assuming that the preset replacement and update condition is that the number of iterations reaches 500 times, the preset initial completion model. For every 500 iterations, the model calculation intermediate variable is sent to the third party once to receive the aggregated intermediate variable fed back by the third party based on the model calculation intermediate variable, and the model calculation intermediate variable in the preset initial completion model is replaced and updated with the corresponding aggregated intermediate variable.
[0101] Step S20, completing the sample data to be completed based on the feature completion model to obtain target completion data, and using the target completion data to train the machine learning model.
[0102] The sample data to be completed is completed based on the feature completion model to obtain target completion data, so as to use the target completion data to train the machine learning model. For example, the sample data to be completed is F m A , then the missing feature F is completed by the feature completion model m A To complete, specifically, F m A The completion feature is Right now
[0103] Among them, among them, has the missing feature F m A All other features of the sample in the first device A are recorded as Has missing feature F m A All other features of the sample in the second device B are recorded as feature and The splicing is recorded as
[0104] In this embodiment, after obtaining the target completion data, the target completion data is used to train the machine learning model, such as using the target completion data to train the subsequent corresponding machine learning model for financial risk control.
[0105] The present application provides a feature completion method, apparatus, device and storage medium based on federated learning. Compared with the prior art which uses feature value completion methods such as average, median and mode to fill in missing feature values of participating devices, making it difficult to obtain a prediction model with high prediction accuracy, the present application obtains sample data to be completed and inputs the sample data to be completed into a preset target feature completion model; wherein the preset target feature completion model is obtained by iteratively training a preset initial completion model based on non-missing sample feature data with labels by executing a first preset longitudinal federated learning process; the sample data to be completed is completed based on the feature completion model to obtain target completion data, so as to use the target completion data to train a machine learning model. In the present application, based on the non-missing sample feature data with labels, by executing the first preset longitudinal federated learning process, the preset initial completion model is iteratively trained to obtain the preset target feature completion model, and then the feature completion is performed on the sample data to be completed based on the preset target feature completion model, that is, the feature value completion method based on longitudinal federated learning utilizes the different features of multiple participating devices to jointly establish the preset target feature completion model, so as to avoid the low prediction accuracy of the trained model when the sample number is small or the sample features are relatively homogeneous, that is, to improve the prediction accuracy of the feature prediction model.
[0106] Further, based on the first embodiment of the present application, in another embodiment of the present application, after the step of completing the sample data to be completed based on the feature completion model to obtain the target completion data, the method includes:
[0107] Step S40, inputting the target completion data into a preset type prediction model;
[0108] The preset type prediction model is obtained by iteratively training the preset prediction model to be trained by executing the second preset longitudinal federated learning process based on the first device sample feature data with the preset type label;
[0109] Step S50: performing prediction processing on the target completion data based on the preset type prediction model to obtain a target type.
[0110] In this embodiment, after obtaining the target completion data, the target completion data is input into a preset type prediction model, and the target completion data is predictively processed based on the preset type prediction model to obtain the target type, wherein before the step of predictively processing the target completion data based on the preset type prediction model to obtain the target type, first device sample feature data with a preset type label is also obtained, and based on the first device sample feature data with the preset type label, a preset prediction model to be trained is iteratively trained by executing a second preset longitudinal federated learning process to obtain a preset type prediction model, wherein the second preset longitudinal federated learning process can be: based on the target completion data, the preset prediction model to be trained is iteratively trained to train and update the model of the preset prediction model to be trained Calculate intermediate variables; determine whether the preset prediction model to be trained through iterative training meets the preset update conditions. If the preset initial completion model meets the preset update conditions, encrypt the model calculation intermediate variables of the preset prediction model to be trained through training and update and send them to a third party, so that the third party can perform splicing and aggregation processing on the model calculation intermediate variables of the corresponding preset prediction models to be trained of the first device and the second device to obtain the target intermediate variables, and feed the target intermediate variables back to the first device to continuously perform iterative training on the preset prediction model to be trained until the training is completed (model loss converges) to obtain a preset type prediction model. If the model loss does not converge, optimize the preset prediction model to be trained based on the model loss until the model loss converges to obtain the preset label prediction model. Perform prediction processing on the target completion data based on the preset type prediction model to obtain the target type.
[0111] In this embodiment, the target completion data is input into a preset type prediction model; wherein the preset type prediction model is obtained by iteratively training a preset prediction model to be trained based on the first device sample feature data with a preset type label by executing a second preset longitudinal federated learning process; the target completion data is predicted based on the preset type prediction model to obtain the target type. In this embodiment, the user type is accurately determined based on the target completion data.
[0112] Further, based on the first and second embodiments of the present application, in another embodiment of the present application, the sample data to be completed is loan sample data to be completed, and the step of completing the sample data to be completed based on the feature completion model to obtain target completion data includes:
[0113] Step D1, completing the loan sample data to be completed based on the feature completion model to obtain target completed data.
[0114] In this embodiment, the feature completion method based on vertical federated learning is applied to loan scenarios, such as micro loans or credit loans. In micro loans or credit loans, the sample data to be completed is the loan sample data to be completed, and then the loan sample data to be completed is obtained, and the loan sample data to be completed is input into a preset target feature completion model; wherein, the preset target feature completion model is based on non-missing loan sample feature data with labels, and is obtained by iteratively training a preset initial completion model by executing a first preset vertical federated learning process; based on the feature completion model, the loan sample data to be completed is completed to obtain the target completion data.
[0115] This embodiment completes the loan sample data to be completed based on the feature completion model to obtain target completed data, thereby achieving accurate completion of loan data.
[0116] Reference Figure 3 , Figure 3 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.
[0117] like Figure 3 As shown, the feature completion device based on vertical federated learning may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. The memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0118] Optionally, the feature completion device based on vertical federated learning may also include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The rectangular user interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0119] Those skilled in the art will understand that Figure 3 The structure of the feature completion device based on vertical federated learning shown in the figure does not constitute a limitation of the feature completion device based on vertical federated learning, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0120] like Figure 3As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, and a feature completion method program based on vertical federated learning. The operating system is a program that manages and controls the hardware and software resources of the feature completion device based on vertical federated learning, and supports the operation of the feature completion method program based on vertical federated learning and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and to communicate with other hardware and software in the feature completion method system based on vertical federated learning.
[0121] exist Figure 3 In the feature completion device based on vertical federated learning shown, the processor 1001 is used to execute the feature completion method program based on vertical federated learning stored in the memory 1005 to implement the steps of the feature completion method based on vertical federated learning described in any one of the above items.
[0122] The specific implementation methods of the feature completion device based on vertical federated learning in the present application are basically the same as the above-mentioned embodiments of the feature completion method based on vertical federated learning, and will not be repeated here.
[0123] The embodiment of the present application further provides a feature completion device based on vertical federated learning, which is applied to a first device. The feature completion device based on vertical federated learning includes:
[0124] A first acquisition module is used to acquire sample data to be completed, and input the sample data to be completed into a preset target feature completion model;
[0125] The preset target feature completion model is obtained by iteratively training a preset initial completion model based on non-missing sample feature data with labels by executing a first preset longitudinal federated learning process;
[0126] The completion module is used to complete the sample data to be completed based on the feature completion model to obtain target completion data, so as to use the target completion data to train the machine learning model.
[0127] Optionally, the feature completion device based on vertical federated learning includes:
[0128] The second acquisition module is used to acquire non-missing sample feature data with labels;
[0129] An iterative training module, configured to execute a first preset longitudinal federated learning process based on the non-missing sample feature data of the non-missing feature labels, iteratively train a preset initial completion model, and obtain a target model;
[0130] A setting module is used to set the target model as the preset target feature completion model.
[0131] Optionally, the first device is communicatively connected to a second device, and the second acquisition module includes:
[0132] an alignment unit, configured to perform sample alignment with the second device to obtain non-missing sample data;
[0133] The feature extraction unit is used to perform feature extraction on the non-missing sample data based on a preset feature extraction model to map the non-missing sample data to a preset feature dimension to obtain non-missing sample feature data with a label.
[0134] Optionally, the iterative training module includes:
[0135] An iterative training unit, configured to iteratively train the preset initial completion model based on the non-missing sample feature data, so as to train and update the model calculation intermediate variables of the preset initial completion model;
[0136] A judging unit, used for judging whether the preset initial completion model of iterative training meets the preset replacement and update conditions, and if the preset initial completion model meets the preset replacement and update conditions, replacing and updating the intermediate variables of the model calculation of the training and update by executing the first preset longitudinal federated learning process to obtain the replaced and updated preset initial completion model;
[0137] The replacement and updating unit is used to continuously iteratively train and replace and update the preset initial completion model that is replaced and updated until the preset model to be trained meets the preset training completion condition, thereby obtaining the target model.
[0138] Optionally, the first device is in communication connection with a third party,
[0139] The judging unit comprises:
[0140] a sending subunit, configured to encrypt and send the model calculation intermediate variables updated through training to a third party associated with the first device, so that the third party can perform splicing and aggregation processing on the corresponding model calculation intermediate variables of the first device and the second device, obtain spliced and aggregated intermediate variables, and feed the spliced and aggregated intermediate variables back to the first device;
[0141] The receiving subunit is used to receive the spliced aggregate intermediate variables fed back by the third party, and replace and update the model calculation intermediate variables updated by training with the spliced aggregate intermediate variables to obtain the replaced and updated preset initial completion model.
[0142] Optionally, the device further comprises:
[0143] An input module, used for inputting the target completion data into a preset type prediction model;
[0144] The preset type prediction model is obtained by iteratively training the preset prediction model to be trained by executing the second preset longitudinal federated learning process based on the first device sample feature data with the preset type label;
[0145] The prediction module is used to perform prediction processing on the target completion data based on the preset type prediction model to obtain the target type.
[0146] Optionally, the completion module includes:
[0147] The completion unit is used to complete the loan sample data to be completed based on the feature completion model to obtain target completed data.
[0148] The specific implementation of the feature completion device based on vertical federated learning in the present application is basically the same as the above-mentioned embodiments of the feature completion method based on vertical federated learning, and will not be repeated here.
[0149] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned feature completion method based on vertical federated learning.
[0150] The specific implementation methods of the computer program product of the present application are basically the same as the above-mentioned embodiments of the feature completion method based on vertical federated learning, and will not be repeated here.
[0151] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A feature completion method based on vertical federated learning, characterized in that: Applied to the first device, the feature completion method based on vertical federated learning includes: Obtaining sample data to be completed, and inputting the sample data to be completed into a preset target feature completion model, wherein the sample data to be completed is loan sample data to be completed that lacks age features or educational background features; Wherein, the preset target feature completion model is obtained by iteratively training a preset initial completion model based on non-missing sample feature data with labels by executing a first preset longitudinal federated learning process, and the step of iteratively training the preset initial completion model by executing the first preset longitudinal federated learning process includes: when the preset initial completion model reaches a preset replacement update condition, updating the model calculation intermediate variables in the preset initial completion model to aggregated intermediate variables, and iteratively training the updated preset initial completion model, wherein the aggregated intermediate variables are obtained by aggregating the model calculation intermediate variables of the first device and the model calculation intermediate variables of the second device in the corresponding iteration round; The sample data to be completed is completed based on the preset target feature completion model to obtain target completion data, so as to use the target completion data to train the machine learning model.
2. The feature completion method based on vertical federated learning as claimed in claim 1, characterized in that: Before the step of completing the sample data to be completed based on the preset target feature completion model to obtain target completion data and using the target completion data to train the machine learning model, the method includes: Obtain non-missing sample feature data with labels; Based on the non-missing sample feature data with labels, executing a first preset longitudinal federated learning process, iteratively training the preset initial completion model, and obtaining a target model; The target model is set as the preset target feature completion model.
3. The feature completion method based on vertical federated learning as claimed in claim 2, characterized in that: The first device is communicatively connected to the second device, and the step of obtaining non-missing sample feature data with labels includes: Performing sample alignment with a second device to obtain non-missing sample data; Based on a preset feature extraction model, feature extraction is performed on the non-missing sample data to map the non-missing sample data to a preset feature dimension to obtain non-missing sample feature data with a label.
4. The feature completion method based on vertical federated learning as claimed in claim 2, characterized in that: The step of executing a first preset longitudinal federated learning process based on the non-missing sample feature data with labels, iteratively training the preset initial completion model, and obtaining a target model includes: Based on the non-missing sample feature data, iteratively training the preset initial completion model to train and update the model calculation intermediate variables of the preset initial completion model; Determine whether the preset initial completion model of iterative training meets the preset replacement and update conditions. If the preset initial completion model meets the preset replacement and update conditions, replace and update the intermediate variables of the model calculation updated by training by executing the first preset longitudinal federated learning process to obtain the replaced and updated preset initial completion model; Continue to iteratively train and replace and update the replaced and updated preset initial completion model until the preset initial completion model meets the preset training completion condition, thereby obtaining the target model.
5. The feature completion method based on vertical federated learning as claimed in claim 4, characterized in that: The step of replacing and updating the intermediate variables of the model calculation updated by training by executing the first preset longitudinal federated learning process to obtain the replaced and updated preset initial completion model includes: The model calculation intermediate variables updated through training are encrypted and sent to a third party associated with the first device, so that the third party can perform splicing and aggregation processing on the corresponding model calculation intermediate variables of the first device and the second device to obtain spliced and aggregated intermediate variables, and feed the spliced and aggregated intermediate variables back to the first device; The spliced aggregate intermediate variables fed back by the third party are received, and the model calculation intermediate variables updated through training are replaced and updated with the spliced aggregate intermediate variables to obtain the replaced and updated preset initial completion model.
6. The feature completion method based on vertical federated learning as claimed in claim 1, characterized in that: After the step of completing the sample data to be completed based on the preset target feature completion model to obtain target completion data, the method includes: Inputting the target completion data into a preset type prediction model; The preset type prediction model is obtained by iteratively training the preset prediction model to be trained by executing the second preset longitudinal federated learning process based on the first device sample feature data with the preset type label; The target completion data is predicted based on the preset type prediction model to obtain a target type.
7. The feature completion method based on vertical federated learning as claimed in claim 1, characterized in that: The step of performing completion processing on the sample data to be completed based on the preset target feature completion model to obtain target completion data includes: The loan sample data to be completed is completed based on the preset target feature completion model to obtain target completion data.
8. A feature completion device based on vertical federated learning, characterized in that: Applied to the first device, the feature completion device based on vertical federated learning includes: The first acquisition module is used to acquire sample data to be completed and input the sample data to be completed into a preset target feature completion model, wherein the sample data to be completed is loan sample data to be completed that lacks age features or educational background features; Wherein, the preset target feature completion model is obtained by iteratively training a preset initial completion model based on non-missing sample feature data with labels by executing a first preset longitudinal federated learning process, and the step of iteratively training the preset initial completion model by executing the first preset longitudinal federated learning process includes: when the preset initial completion model reaches a preset replacement update condition, updating the model calculation intermediate variables in the preset initial completion model to aggregated intermediate variables, and iteratively training the updated preset initial completion model, wherein the aggregated intermediate variables are obtained by aggregating the model calculation intermediate variables of the first device and the model calculation intermediate variables of the second device in the corresponding iteration round; The completion module is used to complete the sample data to be completed based on the preset target feature completion model to obtain target completion data, so as to use the target completion data to train the machine learning model.
9. A feature completion device based on vertical federated learning, characterized in that: The feature completion device based on vertical federated learning includes: a memory, a processor, and a program stored in the memory for implementing the feature completion method based on vertical federated learning. The memory is used to store a program for implementing a feature completion method based on vertical federated learning; The processor is used to execute a program for implementing the feature completion method based on vertical federated learning, so as to implement the steps of the feature completion method based on vertical federated learning as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores a program for implementing a feature completion method based on vertical federated learning, and the program for implementing a feature completion method based on vertical federated learning is executed by a processor to implement the steps of the feature completion method based on vertical federated learning as described in any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
