A method for implementing a machine learning model that supports dynamic addition and deletion of user data

By dividing user data into independent subsets and training sub-models in the online machine learning service, the problem of low efficiency of dynamic data update and deletion in the existing technology is solved, efficient model update and user data security are achieved, and the computational cost is reduced. Overhead and response time.

CN114692894BActive Publication Date: 2024-08-23NANJING UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210353332.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-02
Publication Date
2024-08-23
Estimated Expiration
2042-04-02

AI Technical Summary

Technical Problem

The existing online machine learning service model structure does not support the dynamic addition and deletion of user data, resulting in data deletion requiring a large amount of computing overhead and long-term retraining, which increases the risk of user privacy data leakage.

Method used

By collecting user data on the server side and dividing it into independent data subsets, training sub-models separately and combining them into an integrated model, it supports dynamic data update and deletion requests, achieving incremental learning and machine forgetting.

Benefits of technology

It reduces the computational overhead of model update and data forgetting, improves processing efficiency, and ensures the security of user data and the real-time response capability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114692894B
    Figure CN114692894B
Patent Text Reader

Abstract

The present invention discloses a method for implementing a machine learning model that supports dynamic addition and deletion of user data, including step 1, data collection on the server side; step 2, dividing the user data set to obtain a series of mutually independent data subsets, and each user data is only stored in one data subset; step 3, training the data subsets obtained by the division through sub-models, and combining and reasoning the trained sub-models using an integrated model; step 4, responding to the user's data update request to achieve incremental learning of the newly added user data; step 5, responding to the user's data deletion request to achieve forgetting of the user data. The present invention can perform machine learning on any amount of user data and can achieve accurate model reasoning results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for implementing model training and updating in an online machine learning service, and in particular to a method for implementing a machine learning model that supports dynamic addition and deletion of user data. Background Art

[0002] With the rapid development of machine learning, especially deep learning, many companies have begun to train deep neural network models and use them as a type of user service, that is, machine learning as a service. Online machine learning such as image classification, face recognition, and voice translation has provided many conveniences for people's lives. But at the same time, in order to improve the quality of services, service providers need to use real data as the training set of the model to improve the availability of the model. Therefore, some machine learning services require users to upload some private data, and on this basis, train an accurate and efficient machine learning model, so as to further improve the satisfaction of users' model inference requests.

[0003] However, this approach also causes the user's data to be stored on the server side. Even if the user no longer uses the service, the data information previously uploaded by the user still exists in the model of the online service, which increases the risk of user privacy data leakage. In order to solve this problem, the server not only needs to respond to the user's data update request, but also needs to meet the user's data deletion request, so as to permanently delete the relevant user data from the server. In the scenario of machine learning, the user's data information not only exists in the training set of the model, but also because the machine learning model can remember the data that has been trained, the machine learning model will also contain the user's information, and the machine forgetting operation needs to be performed.

[0004] However, the inventors of the present application have discovered that the above technology has at least the following technical problems: the model structure of existing online machine learning services often does not support machine forgetting of partial data, and can only be achieved by completely retraining the model. This results in a large amount of computing overhead for data deletion and a long retraining time.

[0005] Therefore, for the scenario of online machine learning services, it is necessary to build a flexible machine learning model to support the dynamic addition and deletion of user data and maintain the availability and update efficiency of the model. Summary of the invention

[0006] The technical problem to be solved by the present invention is to provide an implementation method of a machine learning model that supports dynamic addition and deletion of user data in view of the deficiencies in the prior art.

[0007] The present application provides a method for implementing a machine learning model that supports dynamic addition and deletion of user data, which is characterized by comprising the following steps:

[0008] Step 1, data collection on the server side; the data collection includes an auxiliary data set consisting of relevant public data sets and data pre-collected by the server and user data uploaded by the user;

[0009] Step 2: The server divides the user data set into a series of independent data subsets, and each user data is stored in only one data subset;

[0010] Step 3: The server trains the data subset obtained by the division through the sub-model, and combines and infers the trained sub-models through the integrated model;

[0011] Step 4: The server responds to the user's data update request to achieve incremental learning of the newly added user data; the user's data update request includes the user interacting with the server and uploading his own private data, requesting the server to learn the newly uploaded data;

[0012] In step 5, the server responds to the user's data deletion request to achieve machine forgetting of existing user data; the user's data deletion request includes the user interacting with the server and uploading his or her own identity, requesting the server to delete all data under the identity, and removing the training parameters of this part of the data in the machine learning model.

[0013] The technical solution of the present invention further defines that: in step 1, the user data includes the user's original data sample, the sample's data label, the sample's user identity, and the sample's available time;

[0014] The original data samples of the users, each user has multiple data samples, and x represents a single data sample;

[0015] The data labels of the samples, for each sample, have a corresponding data label for indicating a specific data category, and y is used to represent the relevant category;

[0016] The user's identity tag, data from the same user has the same identity tag, denoted as u;

[0017] The availability time of the data is specified by the user and is denoted by t.

[0018] Preferably, in step 2, the user data set is composed of multiple pieces of user data. For a user data set containing n pieces of data, it is represented as D u ={(x i ,y i ,u i ,t i )|1≤i≤n}.

[0019] Preferably, the data partitioning process of step 2 includes splitting the user data set according to user identity attributes and calculating the average available time; then sorting the user data, and dividing the sorted data into a series of independent data subsets in order; the data subsets contain data from multiple users, and different data subsets are independent of each other.

[0020] Preferably, the step 2 specifically comprises:

[0021] Step 201: the user data set D u , split into multiple single-user datasets according to the identity attributes of the data, where each single-user dataset uniquely contains data from a specific user. The dataset of the jth user can be expressed as

[0022] Step 202: For each single-user data set, calculate the average available time of the data therein.

[0023] Step 203, sorting the average available time of the single-user data set by a sorting algorithm to obtain a set of ordered single-user data sets, namely And for any two sets, they both satisfy

[0024] Step 204: Divide the above user data set into m subsets in the same order, each subset contains The data of each user is recorded as Where 1≤j≤m, the division of the user data set is completed.

[0025] Preferably, the model training process of step 3 includes training of sub-models and training of integrated models, wherein the training process of sub-models includes training a data subset and an auxiliary data set using a machine learning algorithm, and executing the training algorithm on each data subset to obtain a corresponding sub-model; the training process of the integrated model includes using a machine learning algorithm, using all sub-models and all data sets to train to obtain an integrated model.

[0026] Preferably, the specific steps of step 3 include: step 301, initializing a list of sub-models for storing parameters of each sub-model;

[0027] Step 302, setting the basic structure and corresponding hyperparameters of sub-model training, including model training rounds N, model learning rate lr, and model loss function L;

[0028] Step 303: for the jth model, initialize a single model parameter, denoted as W j ;

[0029] Step 304: Use the jth data subset obtained by partitioning And the auxiliary data set D saved by the server o , as the training set of the current model;

[0030] Step 305: According to the hyperparameters of the model, the model is trained N times using the corresponding learning rate lr. The loss function is used to update the parameters of the model in each round of training, that is,

[0031]

[0032] Step 306, using j=1 to j=m, repeat steps 303 to 305, and save the corresponding W j Go to the list of sub-models and get the sub-models corresponding to all subsets;

[0033] Step 307, setting the basic structure of the integrated model training and the corresponding hyper parameters, including the model training round N, the model learning rate lr, and the model loss function L;

[0034] Step 308, initializing the parameters of the integrated model, denoted as E;

[0035] Step 309, using all user data sets D u With auxiliary dataset D o , as the original training set of the integrated model;

[0036] Step 310: According to the hyperparameters of the integrated model, the integrated model is trained N times using the corresponding learning rate lr. The loss function is used to update the parameters of the model in each round of training, that is, where W1(x),…,W m (x) represents the calculation result of the sub-model for the input data x;

[0037] Step 311, saving the parameters of the integrated model and ending the model training process;

[0038] Step 312, use the above sub-models and integrated model to realize the reasoning of unknown data; the reasoning process of the model can be expressed as E(W1(x),…,W m (x)), that is, first use all sub-models to calculate the input data, then input all the calculation results into the integrated model for aggregation, and the integrated model outputs the final inference result.

[0039] Preferably, the model update process of step 4 includes the server responding to the user's data update request and receiving the data sample uploaded by the user; then the server uses the machine learning algorithm to update the parameters of the sub-model and the integrated model to complete the learning of the newly added data; the user's data update request includes the user interacting with the server and uploading k pieces of his own private data, and the uploaded data set is D update ={(x i ,y i ,u i ,t i )|1≤i≤k}; the specific processing steps are as follows:

[0040] Step 401: After receiving the data set, the server merges it into the existing user data set. And calculate the average available time of the newly added data

[0041] Step 402: Based on the average available time T calculated above update , add the new data to the jth data subset, that is, And make T j-1 <T update ≤T j , that is, the average available time of the added data subset is as close as possible to the newly added data;

[0042] Step 403, repeat step 305, using the updated data subset Train the sub-model so that it can learn the newly added data, and then save the parameters of the newly trained sub-model;

[0043] Step 404, repeat step 310, using the updated data set and the updated subset model, train the integrated model so that the integrated model can learn the newly added data, and then save the parameters of the newly trained integrated model;

[0044] Step 405, ends the data updating process, and the reasoning process of the model is consistent with the aforementioned step 312.

[0045] Preferably, the model updating process of step 5 includes the server responding to the user's data deletion request and receiving the identity identifier uploaded by the user; then the server uses the machine forgetting algorithm to retrain the parameters of the sub-model and the integrated model to complete the forgetting of the existing data; the specific steps include:

[0046] Step 501: After receiving the identity, the server selects all user data with the same identity from the user data set, which is recorded as D remove ={(x i ,yi ,u i ,t i )|1≤i≤k,u i =u}; u is the user's identity;

[0047] Step 502: The server searches for the D remove Related data is used in the process of model segmentation. Data with the same user identity will be segmented into the same data subset. The server determines the unique data subset containing the user data, which is recorded as

[0048] Step 503, the server Remove this part of data, that is, Then discard the original sub-model;

[0049] Step 504, repeat step 305, using the removed data subset Retrain the sub-model so that it no longer contains information about the removed data, and then save the parameters of the newly trained sub-model;

[0050] Step 505: The server removes D from all user data. remove ,Right now Then discard the original integrated model;

[0051] Step 506, repeat step 310, using the removed user data Retraining the integrated model to remove information related to the user data in the integrated model, and then saving parameters of the integrated model;

[0052] Step 507, ending the data deletion process, and the model reasoning process is consistent with the aforementioned step 312.

[0053] The technical solution provided in the embodiments of the present application has at least the following technical effects or advantages: 1) The present invention proposes an implementation method of a machine learning model for online service scenarios that supports dynamic addition and deletion of user data. The machine learning model can perform machine learning on any amount of user data and can achieve accurate model inference results.

[0054] 2) The present invention also supports processing of user data update requests and data deletion requests. By adjusting and updating some network parameters in the model, efficient processing efficiency can be achieved and complete data forgetting can be realized.

[0055] 3) Compared with the completely retrained machine learning model solution, the present invention can significantly reduce the computational overhead required for model data update and data forgetting while maintaining the model accuracy, thereby being able to adapt to frequent data changes and respond to user requests more quickly.

[0056] 4) The present invention can be applied to most online machine learning services, especially some fields closely related to user privacy, and has a wide range of application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 Schematic diagram of the network structure of a server and multiple users in an embodiment of the present invention.

[0058] Figure 2 It is a schematic diagram of the server data set and machine learning model structure in an embodiment of the present invention.

[0059] Figure 3 It is a schematic diagram of a process of dividing a user data set into data subsets in an embodiment of the present invention.

[0060] Figure 4 It is a schematic diagram of the training process of the machine learning model in an embodiment of the present invention.

[0061] Figure 5 It is a schematic diagram of the data update process of the online machine learning service according to an embodiment of the present invention.

[0062] Figure 6 A schematic diagram of updating the model structure of the online machine learning service according to an embodiment of the present invention.

[0063] Figure 7 Schematic diagram of the data deletion process of the online machine learning service in an embodiment of the present invention.

[0064] Figure 8 Schematic diagram of model structure update of online machine learning service in an embodiment of the present invention. DETAILED DESCRIPTION

[0065] The present invention provides a method for implementing a machine learning model that supports continuous data update and deletion in an online service scenario. In the method, the online machine learning service uses a centralized machine learning model, the server collects and organizes data, and trains a machine learning model for users to use; the user uploads part of their own data and uses the model to perform reasoning tasks. According to the user's changes in wishes, the user can dynamically upload new data to the server during the service operation, or request the server to delete the data that he has uploaded.

[0066] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific embodiments of the specification.

[0067] Example

[0068] Figure 1 It is a schematic diagram of the network structure of the user-server model described in the present invention. In the online machine learning service described in the present invention, there is a central node as a server. The server saves the data uploaded by the user and trains it to obtain a machine learning model. The remaining multiple user nodes only interact with the server for data. Taking the image classification task as an example, the data interaction mainly includes three types of requests. The first is the user's model inference request, in which the user uploads some unlabeled image samples to the server and requests the server to use the machine learning model for inference. After that, the server returns the classification inference result to the user and immediately deletes the image previously uploaded by the user. The second is the user's data update request, in which the user uploads the original image data x, image category y, user identity u, and data availability time t as a quadruple of data to the server together. A single request can contain multiple data tuples at the same time, that is, D update ={(x i ,y i ,u i ,t i )|1≤i≤k}; after receiving this request, the server saves it to the local image dataset of the server and updates the machine learning model to achieve classification reasoning capabilities for newly uploaded images. The third category is the user's data deletion request, in which the user uploads his or her identity u to the server and requests the server to delete all data related to this identity; after receiving this request, the server needs to delete the image data with the same identity in the locally saved dataset and update the machine learning model to remove the relevant information in the model to achieve complete machine forgetting.

[0069] Figure 2 It is a schematic diagram of the server data set and machine learning model structure of the present invention. The data set on the server side mainly includes an auxiliary data set and a user data set, wherein the auxiliary data set mainly includes public data and a portion of data owned by the server, so the data therein only contains data samples and data labels, and there is no need to consider issues related to user data updates and deletions. The user data set is mainly composed of data uploaded by multiple users, and each piece of user data contains data samples, data labels, user identities, and data availability time. The machine learning model shown in the figure also consists of two parts. One part is multiple sub-models, which have the same parameter structure but are trained separately using different user data, such as Figure 2In the example, there are 6 users, divided into 3 data subsets, and 3 sub-models are used for training respectively. In order to improve the effect of model training, auxiliary data sets are also used for sub-model training in this process. After the sub-model training is completed, the present invention uses a separate integrated model to aggregate the output of the sub-model to obtain the final inference result.

[0070] Figure 3 It is a flow chart of dividing the user data set into data subsets according to the present invention. For example, the server provides an image classification service for the CIFAR series, in which CIFAR100 is used as an auxiliary data set, and CIFAR10 is the data uploaded by 100 users. Each user randomly owns a part of CIFAR10 data, and the user's identity and available time are added to each data. CIFAR10 contains a total of 50,000 data samples. The data division method used by the server is as follows:

[0071] Step 201: The server divides the data set into a series of single-user data sets according to the user's identity. In this example, each single-user data set represents the data owned by a user, so 100 single-user data sets will be obtained at this time, each user contains 500 data samples, and the data set of the jth user is Where 1≤j≤100;

[0072] Step 202: for each single-user data set, calculate the average available time in the data set In this example, by counting the available time in 100 single-user data sets, we can get the average available time of each data set, which is denoted as T j , where 1≤j≤100;

[0073] Step 203, sorting the average available time of the single-user data set by a sorting algorithm to obtain a set of ordered single-user data sets, namely And for any two sets, they both satisfy

[0074] Step 204: divide the above single-user data set into m subsets in order. In this example, there are 10 data subsets in total, and each subset contains data of 10 users. The jth data subset can be expressed as Where 1≤j≤10, k is the number of data in each subset. Use this group of data subsets as the result of the division to complete the data set division step;

[0075] Figure 4This is a schematic diagram of the training process of the machine learning model of the present invention. In this example, the server trains a sub-model for each of the 10 data subsets obtained by division, and then aggregates the results of the sub-models through the integrated model to obtain the prediction output of the overall model. The specific execution steps are as follows:

[0076] Step 301: The server initializes an empty sub-model list for storing the training parameters of each sub-model.

[0077] Step 302: For each data subset, the server selects a suitable model structure and sets the corresponding training hyperparameters. In this example, the server can use the ResNet network as the network structure of the sub-model for training the CIFAR10 dataset. The related model hyperparameters can be set to training rounds N = 30, the model learning rate lr = 0.1, and the model loss function uses the cross entropy function, that is, where y c is a unit vector that is 1 only in the cth dimension, p c is the prediction result of the model;

[0078] Step 303: for each data subset, initialize a separate sub-model W j In this example, the server randomly initializes a new ResNet model;

[0079] Step 304: The server sends the jth data subset and auxiliary dataset D o Combined as the training data set for the current model. In this example, each data subset The data sample size included is the original data set That is, it contains 5,000 user data samples and all auxiliary data sets;

[0080] Step 305: Use the machine learning algorithm and the model's hyperparameters to train the model N times using the corresponding learning rate lr. In each round of training, the loss function is used to update the model's parameters, i.e. In this example, the server trains the initialized ResNet model for 30 times. After the training is completed, the parameters of the sub-model are saved in a list.

[0081] Step 306: Use different data subsets, set j=1 to j=m, repeat steps 303 to 305, and complete the training process of the sub-model. In this example, after the training process is completed, the server obtains 10 different ResNet models, each of which is independent of each other and has different learned user information, and can perform data inference process separately;

[0082] Step 307, the server selects a suitable ensemble model and sets relevant hyperparameters. In this example, the server can use a fully connected network as the structure of the ensemble model. Since the fully connected network contains fewer parameters, the training time of the model is relatively short. Here, the training round N = 10, the learning rate lr = 0.01, and the loss function also uses the cross entropy function;

[0083] Step 308, the server uses a parameter E of the random initialization integration model;

[0084] Step 309: The server uses all user data sets to train the integrated model. In this example, the server uses a learning rate of 0.01 to train the integrated model 10 times, and each training involves 50,000 user data. The model update process is where W1(x),…,W m (x) represents the calculation result of the aforementioned sub-model for the input data x;

[0085] Step 310, saving the parameters of the trained integrated model and ending the model training process.

[0086] Step 311, using the above sub-models and integrated model, the reasoning of unknown data can be realized. The reasoning process of the model can be expressed as E(W1(x),…,W m (x)), that is, first use all sub-models to calculate the input data, then input all the calculation results into the integrated model for aggregation, and the integrated model outputs the final inference result.

[0087] Figure 5 , Figure 6 Schematic diagram of the data update process and model structure update of the online machine learning service of the present invention. The user data update request includes the user interacting with the server and uploading k pieces of his own private data. At this time, the uploaded data set is D update ={(x i ,y i ,u i ,t i )|1≤i≤k}. After receiving this request, the server processes it as follows:

[0088] Step 401: The server first saves this part of data to the local user data set, that is, by Figure 6 For example, in Figure 2 Based on this, the server receives the updated data from user 7;

[0089] Step 402: The server calculates the average available time of the newly added data.

[0090] Step 403: In all data subsets, the server searches for the data subset closest to the average available time and adds the newly added data to the subset. And T j-1 <T update ≤T j .like Figure 6 The server finds that the available time of subset 3 is closest to the newly added data, and adds it to subset 3;

[0091] Step 404: The server updates the sub-model corresponding to the data subset. Figure 6 In the example, since the data of subset 3 is updated, the server updates the sub-model corresponding to subset 3. For data updates, the server can use incremental learning to use the updated data subset on the previously trained sub-model parameters. Continue the machine learning training process so that the sub-model can learn the distribution of updated data. After the training is completed, the server saves the trained sub-model parameters and replaces the original sub-model;

[0092] Step 405: The server updates the final integrated model. Since the sub-models have updated their parameters, the corresponding output results have also changed accordingly. Therefore, the server needs to further update the parameters of the integrated model. Here, the updated data set can be used. and the updated subset model, train the integrated model so that the integrated model can learn the newly added data, then save the parameters of the newly trained integrated model and replace the original sub-model;

[0093] Step 406, end the data update process. Figure 6 In the above example, the part of the model that needs to be changed includes a sub-model and an integrated model. Compared with the update of the entire model, the data update overhead required by the machine learning solution of the present invention is approximately one-third of the update overhead of the entire model. Where m represents the number of sub-models.

[0094] Figure 7 , Figure 8 Schematic diagram of the data deletion process and model structure update of the online machine learning service of the present invention. The data deletion request mainly involves the user interacting with the server and uploading his own identity u, requesting the server to delete all data under the identity and remove the training parameters of this part of the data in the machine learning model. After receiving this request, the server specifically processes as follows:

[0095] Step 501: After receiving the identity, the server selects all user data with the same identity from the user data set, which is recorded as Dremove ={(x i ,y i ,u i ,t i )|1≤i≤k,u i =u}. like Figure 8 , User 4 requests to delete the relevant data, and then the server searches for all data related to User 4;

[0096] Step 502: The server searches for the data subset where the data is located. Since data with the same user identity will be divided into the same data subset during the model division process, the server can determine the unique data subset containing the user data, which is recorded as In the figure, subset 2 is related to this part of the data;

[0097] Step 503, the server Remove this part of data, that is, Then discard the original sub-models and integrated models. Figure 8 In the example, the relevant data of user 4 is removed from subset 2 and also from the overall user dataset, so that the training data of the model no longer contains relevant data;

[0098] Step 504: The server uses the removed data subset Retrain the sub-model, and then save and update the parameters of the sub-model. For data deletion requests, the server completely retrains the relevant model to ensure that the retrained model does not contain any information related to the deleted data, so as to achieve complete machine forgetting;

[0099] Step 505: The server uses the removed user data Retrain the integrated model, then save and update the parameters of the integrated model;

[0100] Step 506, end the data deletion process. Figure 8 In the above example, the model structure that needs to be retrained mainly includes a sub-model and an integrated model. Compared with the retraining of all models, the data deletion overhead required by the machine learning scheme of the present invention is approximately one-third of the update overhead of all models. Where m represents the number of sub-models.

[0101] Furthermore, since the present invention uses the average available time of the data to sort when dividing the data, thereby clustering together user data that is more likely to be forgotten, when deleting data, the deletion of data at adjacent times can be performed together, thereby reducing the number of times the model needs to be retrained, further reducing the model retraining overhead.

[0102] The above description is only a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements without departing from the principle of the present invention. These improvements should also be regarded as within the scope of protection of the present invention.

Claims

1. A method for implementing a machine learning model that supports dynamic addition and deletion of user data, characterized in that The steps include: Step 1, data collection on the server side; the data collection includes an auxiliary data set consisting of relevant public data sets and data pre-collected by the server and user data uploaded by the user; Step 2: The server divides the user data set into a series of independent data subsets, and each user data is stored in only one data subset; Step 3: The server trains the data subset obtained by the division through the sub-model, and combines and infers the trained sub-models through the integrated model; Step 4: The server responds to the user's data update request and implements incremental learning of the newly added user data; The user's data update request includes the user interacting with the server and uploading his own private data, requesting the server to learn the newly uploaded data; Step 5: The server responds to the user's data deletion request to achieve machine forgetting of existing user data; the user's data deletion request includes the user interacting with the server and uploading his or her own identity, requesting the server to delete all data under the identity, and removing the training parameters of this part of the data in the machine learning model; The model training process of step 3 includes training of sub-models and training of integrated models, wherein the training process of sub-models includes training a data subset and an auxiliary data set using a machine learning algorithm, and executing the training algorithm on each data subset to obtain a corresponding sub-model; the training process of the integrated model includes using a machine learning algorithm, using all sub-models and all data sets, to train an integrated model; the specific steps of step 3 include: step 301, initializing a list of sub-models for storing parameters of each sub-model; Step 302, setting the basic structure and corresponding hyperparameters of sub-model training, including model training rounds N, model learning rate lr, and model loss function L; Step 303: for the jth model, initialize a single model parameter, denoted as W j ; Step 304: Use the jth data subset obtained by partitioning And the auxiliary data set D saved by the server o , as the training set of the current model; Step 305: According to the hyperparameters of the model, the model is trained N times using the corresponding learning rate lr. The loss function is used to update the parameters of the model in each round of training, that is, Step 306, using j=1 to j=m, repeat steps 303 to 305, and save the corresponding W j Go to the list of sub-models and get the sub-models corresponding to all subsets; Step 307, setting the basic structure of the integrated model training and the corresponding hyper parameters, including the model training round N, the model learning rate lr, and the model loss function L; Step 308, initializing the parameters of the integrated model, denoted as E; Step 309, using all user data sets D u With auxiliary dataset D o , as the original training set of the integrated model; Step 310: According to the hyperparameters of the integrated model, the integrated model is trained N times using the corresponding learning rate lr. The loss function is used to update the parameters of the model in each round of training, that is, where W1(x),…,W m (x) represents the calculation result of the sub-model for the input data x; Step 311, saving the parameters of the integrated model and ending the model training process; Step 312, use the above sub-models and integrated model to realize the reasoning of unknown data; the reasoning process of the model can be expressed as E(W1(x),…,W m (x)), that is, first use all sub-models to calculate the input data, then input all the calculation results into the integrated model for aggregation, and the integrated model outputs the final inference result.

2. The method for implementing a machine learning model that supports dynamic addition and deletion of user data according to claim 1, characterized in that: In step 1, the user data includes the user's original data sample, the sample's data label, the sample's user identity, and the sample's available time; The original data samples of the users, each user has multiple data samples, and x represents a single data sample; The data labels of the samples, for each sample, have a corresponding data label for indicating a specific data category, and y is used to represent the relevant category; The user's identity tag, data from the same user has the same identity tag, denoted as u; The availability time of the data is specified by the user and is denoted by t.

3. The method for implementing a machine learning model that supports dynamic addition and deletion of user data according to claim 1, characterized in that: In step 2, the user data set is composed of multiple pieces of user data. For a user data set containing n pieces of data, it is represented as D u ={(x i ,y i ,u i ,t i )|1≤i≤n}.

4. The method for implementing a machine learning model that supports dynamic addition and deletion of user data according to claim 3, characterized in that: The data partitioning process of step 2 includes splitting the user data set according to user identity attributes and calculating the average available time; then sorting the user data and dividing the sorted data into a series of independent data subsets in order; the data subsets contain data from multiple users, and different data subsets are independent of each other.

5. The method for implementing a machine learning model that supports dynamic addition and deletion of user data according to claim 4, characterized in that: The specific steps of step 2 include: Step 201: the user data set D u , split into multiple single-user datasets according to the identity attributes of the data, where each single-user dataset uniquely contains data from a specific user. The dataset of the jth user can be expressed as Step 202: For each single-user data set, calculate the average available time of the data therein. Step 203, sorting the average available time of the single-user data set by a sorting algorithm to obtain a set of ordered single-user data sets, namely And for any two sets, they both satisfy Step 204: Divide the above user data set into m subsets in the same order, each subset contains The data of each user is recorded as Where 1≤j≤m, the division of the user data set is completed.

6. The method for implementing a machine learning model that supports dynamic addition and deletion of user data according to claim 1, characterized in that: The model update process of step 4 includes the server responding to the user's data update request and receiving the data sample uploaded by the user; then the server uses the machine learning algorithm to update the parameters of the sub-model and the integrated model to complete the learning of the newly added data; the user's data update request includes the user interacting with the server and uploading k pieces of his own private data, and the uploaded data set is D update ={(x i ,y i ,u i ,t i )|1≤i≤k}; the specific processing steps are as follows: Step 401: After receiving the data set, the server merges it into the existing user data set. And calculate the average available time of the newly added data Step 402: Based on the average available time T calculated above update , add the new data to the jth data subset, that is, And make T j-1 <T update ≤T j , that is, the average available time of the added data subset is as close as possible to the newly added data; Step 403, repeat step 305, using the updated data subset Train the sub-model so that it can learn the newly added data, and then save the parameters of the newly trained sub-model; Step 404, repeat step 310, using the updated data set and the updated subset model, train the integrated model so that the integrated model can learn the newly added data, and then save the parameters of the newly trained integrated model; Step 405, ends the data updating process, and the reasoning process of the model is consistent with the aforementioned step 312.

7. The method for implementing a machine learning model that supports dynamic addition and deletion of user data according to claim 1, characterized in that: The model update process of step 5 includes the server responding to the user's data deletion request and receiving the identity identifier uploaded by the user; then the server uses the machine forgetting algorithm to retrain the parameters of the sub-model and the integrated model to complete the forgetting of the existing data; The specific steps include: Step 501: After receiving the identity, the server selects all user data with the same identity from the user data set, which is recorded as D remove ={(x i ,y i ,u i ,t i )|1≤i≤k,u i =u}; u is the user's identity; Step 502: The server searches for the D remove Related data is used in the process of model segmentation. Data with the same user identity will be segmented into the same data subset. The server determines the unique data subset containing the user data, which is recorded as Step 503, the server Remove this part of data, that is, Then discard the original sub-model; Step 504, repeat step 305, using the removed data subset Retrain the sub-model so that it no longer contains information about the removed data, and then save the parameters of the newly trained sub-model; Step 505: The server removes D from all user data. remove ,Right now Then discard the original integrated model; Step 506, repeat step 310, using the removed user data Retraining the integrated model to remove information related to the user data in the integrated model, and then saving parameters of the integrated model; Step 507, ending the data deletion process, and the model reasoning process is consistent with the aforementioned step 312.

Citation Information

Patent Citations

  • Incremental learning distributed computing method, system and node based on block chain

    CN111639368A

  • Data memory elimination method and device for deep learning model

    CN113177630A

  • Continuous learning method for federated learning

    CN113657607A

  • Systems and method for automatically configuring machine learning models

    US10296848B1

  • Method, apparatus and system for secure vertical federated learning

    US20210073678A1