Model training optimization method, electronic device and computer-readable storage medium

By randomly mapping the original data on the client, sending the mapped data and prediction class symbols to the server, calculating the model parameters for iterative optimization, the problem of low security in model training is solved, and the security improvement of model training is achieved.

CN117633536BActive Publication Date: 2025-04-11SUN YAT SEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311732811.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-14
Publication Date
2025-04-11
Estimated Expiration
2043-12-14

AI Technical Summary

Technical Problem

In the prior art, model training is relatively low in security, and the server or client can restore the original data through model parameters.

Method used

The original data is randomly mapped on the client to get the mapped data, and send the prediction class symbol and mapped data to the server. The server calculates the mapping feature matrix based on the mapping data, and calculates model parameters based on the matrix and predicted class standards, and performs iterative optimization.

Benefits of technology

Through random mapping and encryption, it ensures that the server cannot restore the original data, improving the security of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117633536B_ABST
    Figure CN117633536B_ABST
Patent Text Reader

Abstract

The present application discloses a model training optimization method, an electronic device, and a computer-readable storage medium, which are applied to the field of artificial intelligence technology, including: randomly mapping the original data to obtain the mapping data of the original data; sending the predicted class label corresponding to the original data and the mapping data to the server communicating with the client, wherein the predicted class label is a label for training the model to be trained, so that the server can calculate the mapping feature matrix based on the mapping data, and calculate the model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimize the model to be trained based on the model parameters. The present application solves the technical problem of low security of model training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a model training optimization method, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the rapid development of science and technology, communication technology has become more and more mature. At present, in order to improve the prediction accuracy of the trained model during model training, the federated learning method is usually used to realize model training. Specifically, multiple clients train their own models and send the model parameters to the server. The server performs weighted average calculation on the model parameters to obtain the global model parameters, and sends the global model parameters to each client so that each client can optimize its own trained model according to the global model parameters.

[0003] However, when this method is used, the server or client can restore the client's original data through model parameters (client's model parameters or global model parameters), resulting in lower security of model training. Summary of the invention

[0004] The main purpose of this application is to provide a model training optimization method, an electronic device and a computer-readable storage medium, aiming to solve the technical problem of low security of model training in the prior art.

[0005] To achieve the above objectives, the present application provides a model training optimization method, which is applied to a client, and the model training optimization method includes:

[0006] Randomly mapping the original data to obtain mapped data of the original data;

[0007] The predicted class label corresponding to the original data and the mapping data are sent to a server communicating with the client, wherein the predicted class label is a label used to train the model to be trained, so that the server can calculate a mapping feature matrix based on the mapping data, and calculate model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimize the model to be trained based on the model parameters.

[0008] To achieve the above objectives, the present application also provides a model training optimization method, which is applied to a server. The model training optimization method includes:

[0009] Receiving mapping data and predicted class labels sent by each client, wherein the mapping data sent by each client is obtained by each client performing random mapping on its own original data, the predicted class labels are labels used to train the training model, and the predicted class labels sent by each client correspond to the original data of each client;

[0010] Constructing a mapping feature matrix based on the mapping data sent by each of the clients;

[0011] The model parameters corresponding to the model to be trained are calculated according to the mapping feature matrix and the predicted class label, and the model to be trained is iteratively optimized based on the model parameters.

[0012] To achieve the above object, the present application also provides a client, the client comprising:

[0013] A mapping module, used for randomly mapping the original data to obtain mapping data of the original data;

[0014] A sending module is used to send the predicted class label corresponding to the original data and the mapping data to a server communicating with the client, wherein the predicted class label is a label used to train the model to be trained, so that the server can calculate a mapping feature matrix based on the mapping data, and calculate the model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimize the model to be trained based on the model parameters.

[0015] To achieve the above object, the present application also provides a server, the server comprising:

[0016] A receiving module, used to receive mapping data and predicted class labels sent by each client, wherein the mapping data sent by each client is obtained by each client performing random mapping on its own original data, the predicted class labels are labels used to train the training model, and the predicted class labels sent by each client correspond to the original data of each client;

[0017] A calculation module, used for constructing a mapping feature matrix based on the mapping data sent by each of the clients;

[0018] The optimization module is used to calculate the model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimize the model to be trained based on the model parameters.

[0019] The present application also provides an electronic device, which includes: a memory, a processor, and a program of the model training optimization method stored in the memory and executable on the processor. When the program of the model training optimization method is executed by the processor, the steps of the model training optimization method as described above can be implemented.

[0020] The present application also provides a computer-readable storage medium, on which is stored a program for implementing the model training optimization method. When the program of the model training optimization method is executed by a processor, the steps of the model training optimization method as described above are implemented.

[0021] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned model training optimization method when executed by a processor.

[0022] The present application provides a model training optimization method, an electronic device and a computer-readable storage medium, which are applied to a client, and randomly maps the original data to obtain the mapping data of the original data; the predicted class label corresponding to the original data and the mapping data are sent to a server communicating with the client, wherein the predicted class label is a label for training the model to be trained, so that the server calculates a mapping feature matrix based on the mapping data, and calculates the model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimizes the model to be trained based on the model parameters. The client randomly maps its original data, that is, the client encrypts the original data, and the client sends the predicted class label and mapping data (encrypted data of the original data) to the server, so it is guaranteed that the server cannot restore the original data according to the predicted class label and mapping data, and the server can perform model training according to the predicted class label and mapping data, so the security of model training is guaranteed.

[0023] The present application provides a model training optimization method, an electronic device and a computer-readable storage medium, which are applied to a server, by receiving mapping data and predicted class labels sent by each client, wherein the mapping data sent by each client is obtained by each client performing random mapping on its own original data, the predicted class label is a label for training a model to be trained, and the predicted class label sent by each client corresponds to the original data of each client; based on the mapping data sent by each client, a mapping feature matrix is ​​constructed; model parameters corresponding to the model to be trained are calculated according to the mapping feature matrix and the predicted class label, and the model to be trained is iteratively optimized based on the model parameters, and by receiving the mapping data and predicted class label of the client, iterative optimization of the model to be trained is achieved, that is, the model training process, and the server cannot restore the original data of the client based on the predicted class label and the mapping data alone, so the security of the model training is guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] 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.

[0025] 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.

[0026] Figure 1 This is a flow chart of the first embodiment of the model training optimization method of the present application;

[0027] Figure 2 This is a flow chart of the second embodiment of the model training optimization method of the present application;

[0028] Figure 3 A schematic diagram of a scenario of interaction between clients involved in the model training optimization method in an embodiment of the present application;

[0029] Figure 4 A schematic diagram of a scenario of interaction between a client and a server involved in the model training optimization method in an embodiment of the present application;

[0030] Figure 5 A schematic diagram of the structure of a client device involved in the model training optimization method in an embodiment of the present application;

[0031] Figure 6 This is an example diagram of a server device structure involved in the model training optimization method in an embodiment of the present application;

[0032] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the model training optimization method in the embodiment of the present application.

[0033] 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

[0034] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of this application.

[0035] Embodiment 1

[0036] The present application embodiment provides a model training optimization method. In the first embodiment of the model training optimization method of the present application, refer to Figure 1, applied to the client, the model training optimization method includes:

[0037] Step S10, randomly mapping the original data to obtain mapping data of the original data;

[0038] In this embodiment, it should be noted that the client is a terminal of a service industry, which may be a medical industry, a catering industry, or an application service industry, and the original data is user data collected by the client.

[0039] It can be understood that when the service industry is the medical industry, the original data is the user's medical behavior data, the medical behavior data includes at least one of medical data, physical examination data and vaccination data, the medical data includes at least one of medical frequency, review information, medical hospital, treatment information, diagnosis results and symptoms, and the treatment information includes at least one of treatment methods and treatment cycles.

[0040] It is understandable that when the service industry is the catering industry, the original data is the user's dining behavior data, and the dining behavior data includes at least one of the dining location, food type, dining amount and dining scene, and the dining scene includes but is not limited to event commemoration scenes, mourning scenes and daily social scenes.

[0041] It is understandable that when the service industry is the application service industry, the original data is the user's application usage data, and the application usage data includes at least one of the application usage type, application usage frequency, application usage duration and application usage time.

[0042] It should be noted that, in this embodiment, for the convenience of description, the explanation of each embodiment by the execution subject is omitted below.

[0043] In this embodiment, it should be noted that the number of clients can be multiple, and each client executes the model training optimization method applied to the client in this embodiment.

[0044] In a feasible embodiment, the original data stored in the client is pulled, and the original data is randomly mapped to obtain the mapping data of the original data.

[0045] Wherein, in step S10, the step of randomly mapping the original data to obtain the mapped data of the original data includes:

[0046] Step S11, receiving a first random matrix sent by the server;

[0047] In this embodiment, after the original data stored in the client is pulled, the first random matrix sent by the server is received.

[0048] Step S12, encrypting the original data based on the first random matrix to obtain encrypted data;

[0049] In a feasible embodiment, the sum of the first random matrix and the original data is used as the encrypted data.

[0050] Optionally, the step of using the sum of the first random matrix and the original data as the encrypted data may specifically include:

[0051]

[0052] in, is the encrypted data of client i, X i is the original data of client i, R i is the first random matrix of client i.

[0053] If the client is a non-hub client, executing step S13, calculating and obtaining first data based on the encrypted data of the non-hub client as mapping data of the original data;

[0054] In this embodiment, it should be noted that the non-hub client is a client that does not belong to the hub client.

[0055] In a feasible embodiment, before calculating the first data based on the encrypted data of the non-hub client, the encrypted data of the non-hub client is sent to the hub client, so that the hub client can calculate random data based on the encrypted data of the non-hub client, and send the random data to the non-hub client; the random data of the hub client is received, and the first data is calculated based on the random data as mapping data of the original data.

[0056] Wherein, in step S13, the random data includes first random data and second random data, and the step of calculating the first data based on the encrypted data of the non-hub client includes:

[0057] Step A10, sending the encrypted data of the non-hub client to the hub client, so that the hub client calculates the first random data and the second random data based on the encrypted data of the non-hub client, and sends the first random data and the second random data to the non-hub client;

[0058] In this embodiment, if the client is a non-hub client, the original data of the non-hub client is encrypted based on the first random matrix of the non-hub client, and after the encrypted data of the non-hub client is obtained, the encrypted data of the non-hub client is sent to the hub client.

[0059] Step A20: Receive the first random data and the second random data sent by the hub client, and calculate the first data based on the first random data and the second random data.

[0060] Exemplarily, the first data is calculated based on the first random data, the second random data and a first random matrix of the non-hub client.

[0061] Optionally, the step of calculating the first data based on the first random data, the second random data and the first random matrix of the non-hub client may specifically include:

[0062]

[0063] in, is the first data calculated by the non-hub client i based on the data sent by the hub client j, E i,j is the second random data sent by hub client j to non-hub client i, W j * The first random data sent by hub client j.

[0064] If the client is a hub client, step S14 is executed to calculate and obtain second data based on the original data of the hub client as mapping data of the original data.

[0065] In this embodiment, it should be noted that the number of the hub clients may be single or multiple, and the hub clients may be set by the user or randomly selected from the clients participating in the model training.

[0066] In this embodiment, if the client is a hub client, the original data of the hub client is encrypted based on the first random matrix of the hub client to obtain the encrypted data of the hub client, and then the second data is calculated based on the original data of the hub client as the mapping data of the original data.

[0067] Wherein, in step S14, the step of calculating the second data based on the original data of the hub client includes:

[0068] Step B10, generating a fourth random matrix;

[0069] In this embodiment, it should be noted that the fourth random matrix is ​​different from the first random matrix, the second random matrix and the third random matrix, and the fourth random matrices generated by the hub clients are different from each other.

[0070] Step B20: taking the product of the fourth random matrix and the original data of the hub client as the second data.

[0071] Optionally, the model training method also includes: receiving a second random matrix and a third random matrix sent by the server, and sending the encrypted data of the hub client to the remaining clients, wherein the remaining clients are hub clients other than the hub client; receiving the encrypted data of the non-hub client sent by the non-hub client, generating a fourth random matrix, calculating first random data based on the fourth random matrix and the second random matrix, and calculating second random data based on the encrypted data of the non-hub client, the fourth random matrix and the third random matrix.

[0072] In a feasible embodiment, the sum of the fourth random matrix and the second random matrix is ​​used as the first random data.

[0073] Optionally, the step of using the sum of the fourth random matrix and the second random matrix as the first random data may specifically include:

[0074] W j * =W j +R j,2

[0075] Among them, W j The fourth random matrix generated by hub client j, R j,2 is the second random matrix received by hub client j.

[0076] Optionally, the step of calculating the second random data based on the encrypted data of the non-hub client, the fourth random matrix and the third random matrix may specifically include:

[0077]

[0078] Among them, R i,j is the third random matrix received by hub client j.

[0079] Optionally, based on the calculation formula of the first random data, the second random data and the encrypted data, the calculation formula of the first data of the non-hub client i may be rewritten as follows:

[0080]

[0081]

[0082]

[0083] Step B30, sending the first random data and the second random data to the non-hub client, so that the non-hub client calculates the first data based on the first random data and the second random data;

[0084] Step B40: Calculate the mapping matrix value corresponding to the hub client based on the first data, the second random matrix, the third random matrix and the first random matrix of the hub client as the second data.

[0085] Exemplarily, a mapping matrix calculation method is obtained, and based on the first data, the second random matrix, the third random matrix and the first random matrix of the hub client, a mapping matrix value corresponding to the hub client is calculated by the mapping matrix calculation method.

[0086] Step S20, sending the predicted class label corresponding to the original data and the mapping data to a server communicating with the client, wherein the predicted class label is a label used to train the model to be trained, so that the server calculates a mapping feature matrix based on the mapping data, and calculates model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimizes the model to be trained based on the model parameters.

[0087] In this embodiment, it should be noted that the original data and the predicted class label can constitute a training sample, and the training sample can be used to train the model to be trained, so the predicted class label is the real label corresponding to the original data. The model to be trained is used to predict user behavior, or to predict the evaluation or analysis of the service behavior of the user.

[0088] It is understandable that, when the service industry is the medical industry, the model to be trained is used to predict the user's diagnosis result, or to predict the user's evaluation or analysis of the medical service.

[0089] It is understandable that, when the service industry is the catering industry, the model to be trained is used to predict the user's dining behavior, or to predict the user's evaluation or analysis of the catering service.

[0090] It is understandable that when the service industry is the application service industry, the model to be trained is used to predict the user's application usage behavior, or to predict the user's evaluation or analysis of the application service.

[0091] It is understandable that the client can exit model training at any time, and new clients can join model training. The client can also add new data at any time. At this time, the new data added by the client and / or the data of the new client can be used as the original update data for model training. That is, the data processed in this solution can be fixed data or streaming data (a steady stream of new data).

[0092] Optionally, if it is detected that the client exits model training, the data calculation process of the client is terminated.

[0093] Optionally, if the original update data is detected, based on various data corresponding to the client (wherein the various data include but are not limited to a first random matrix, a second random matrix, a third random matrix and a fourth random matrix), refer to the above method to calculate the encrypted update data of the original update data encrypted by the client, and send the encrypted update data corresponding to the original update data to the hub client, wherein, if the client is a non-hub client, the encrypted update data corresponding to the original update data is sent to each hub client; if the client is a hub client, the encrypted update data corresponding to the original update data is sent to each remaining client.

[0094] Optionally, after the step of sending the encrypted update data corresponding to the original update data to the hub client, if the client is a hub client, refer to the above method to calculate the second random data corresponding to the original update data, and send the second random data to the non-hub client; refer to the above method to calculate the second update data corresponding to the original update data, and send the second data corresponding to the original update data and the predicted update class label corresponding to the original update data to the server.

[0095] Optionally, after the step of sending the second random data to the non-hub client, if the client is a non-hub client, refer to the above method to calculate the first update data corresponding to the original update data, and send the first update data corresponding to the original update data to the server, so that the server can adjust the mapping feature matrix according to the mapping update data to obtain a mapping update matrix, and calculate the model update parameters corresponding to the model to be trained according to the mapping feature matrix and the update class label, and iteratively optimize the model to be trained based on the model update parameters.

[0096] Optionally, if a new client is detected, the new client and the clients participating in the model training all re-execute the above steps, which will not be repeated here.

[0097] An embodiment of the present application provides a model training optimization method, which is applied to a client, and randomly maps the original data to obtain mapping data of the original data; the predicted class label corresponding to the original data and the mapping data are sent to a server communicating with the client, wherein the predicted class label is a label for training the model to be trained, so that the server calculates a mapping feature matrix based on the mapping data, and calculates model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimizes the model to be trained based on the model parameters. The client randomly maps its original data, that is, the client encrypts the original data, and the client sends the predicted class label and mapping data (encrypted data of the original data) to the server, so it is guaranteed that the server cannot restore the original data according to the predicted class label and mapping data, and the server can perform model training according to the predicted class label and mapping data, so the security of model training is guaranteed.

[0098] Embodiment 2

[0099] Further, based on the first embodiment of the present application, in another embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be described in detail later. Figure 2 , applied to the client, the model training optimization method includes:

[0100] Step C10, receiving mapping data and predicted class labels sent by each client, wherein the mapping data sent by each client is obtained by each client performing random mapping on its own original data, the predicted class labels are labels used to train the training model, and the predicted class labels sent by each client correspond to the original data of each client;

[0101] Step C20, constructing a mapping feature matrix based on the mapping data sent by each of the clients;

[0102] In a feasible embodiment, based on the mapping data sent by each of the clients, a mapping matrix value corresponding to each of the clients is calculated, and based on the mapping matrix value corresponding to each of the clients, a mapping feature matrix is ​​constructed.

[0103] Wherein, in step C20, the mapping data sent by each of the clients includes first data sent by the non-hub client and second data sent by the hub client, and the step of constructing a mapping feature matrix based on the mapping data sent by each of the clients includes:

[0104] Step C21, calculating a mapping matrix value corresponding to the non-hub client based on the first data;

[0105] Exemplarily, a mapping matrix calculation method is obtained, based on the first data, the second random matrix, the third random matrix and the first random matrix value of the non-hub client, the mapping matrix value corresponding to the non-hub client is calculated by the mapping matrix calculation method.

[0106] Step C22: constructing the mapping feature matrix according to the mapping matrix value corresponding to the non-hub client and the second data.

[0107] Exemplarily, the mapping matrix value corresponding to the non-hub client and the second data are spliced ​​into the mapping matrix; a random feature mapping function and a fourth random matrix are obtained, and the mapping feature matrix is ​​constructed based on the random feature mapping function, the fourth random matrix and the mapping matrix, wherein the fourth random matrix, the first random matrix, the second random matrix and the third random matrix are different from each other.

[0108] Optionally, the step of constructing the mapping feature matrix based on the random feature mapping function, the fourth random matrix and the mapping matrix may specifically include:

[0109]

[0110] Among them, Z n is the mapping feature matrix, is the mapping matrix, N is the number of all clients participating in model training, M is the number of hub clients, is the random feature mapping function, W ser is the fourth random matrix.

[0111] Step C30, calculating the model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimizing the model to be trained based on the model parameters.

[0112] Wherein, in step C30, the step of calculating the model parameters corresponding to the to-be-trained model according to the mapping feature matrix and the predicted class label includes:

[0113] Step C31, performing enhanced mapping on the mapping feature matrix to obtain an enhanced mapping matrix;

[0114] Exemplarily, an activation function is obtained to generate a fifth random matrix and a sixth random matrix, wherein the fifth random matrix, the sixth random matrix, the fourth random matrix, the first random matrix, the second random matrix and the third random matrix are different from each other, and based on the activation function, the fifth random matrix and the sixth random matrix, the mapping feature matrix is ​​enhanced mapped to obtain enhanced mapping features, and each enhanced mapping feature is combined into the enhanced mapping matrix.

[0115] Optionally, the step of performing enhanced mapping on the mapping feature matrix based on the activation function, the fifth random matrix and the sixth random matrix to obtain enhanced mapping features may specifically include:

[0116] H k =ξ(Z n W hk +β hk ),k=1,2,…,m

[0117] Among them, H k is the kth enhanced mapping feature, m is the total number of enhanced mapping features, W hk is the fifth random matrix, ξ is the activation function, β hk is the sixth random matrix.

[0118] Optionally, the step of combining the enhanced mapping features into the enhanced mapping matrix may specifically include:

[0119] H m =[H1,H2,…,H m ,]

[0120] Among them, H m is the enhancement mapping matrix.

[0121] Step C32, constructing a total mapping matrix based on the enhanced mapping matrix and the mapping feature matrix;

[0122] Exemplarily, the enhanced mapping matrix and the mapping feature matrix are concatenated into the total mapping matrix.

[0123] Optionally, the step of splicing the enhanced mapping matrix and the mapping feature matrix into the total mapping matrix may specifically include:

[0124] A=[Z n ,H m ]

[0125] Among them, A is the total mapping matrix.

[0126] Step C33, calculating the model parameters corresponding to the model to be trained according to the total mapping matrix and the predicted class label.

[0127] Exemplarily, the pseudo-inverse of the total mapping matrix is ​​determined, and the model parameters corresponding to the model to be trained are calculated based on the pseudo-inverse of the total mapping matrix and the predicted class label.

[0128] In a feasible embodiment, an identity matrix is ​​obtained, and based on the identity matrix and the mapped total matrix, a pseudo-inverse of the mapped total matrix is ​​calculated.

[0129] Optionally, the step of calculating the pseudo-inverse of the total mapping matrix based on the identity matrix and the total mapping matrix may specifically include:

[0130]

[0131] Among them, A + is the pseudo-inverse of the total matrix of the mapping, and I is the identity matrix.

[0132] Optionally, the step of calculating the model parameters corresponding to the model to be trained according to the pseudo-inverse of the total mapping matrix and the predicted class label may specifically include:

[0133]

[0134] in, is the model parameter corresponding to the model to be trained, and Y is the predicted class label.

[0135] Wherein, in step C10, before the step of receiving mapping data and predicted class labels sent by each client, the method further includes:

[0136] The first random matrix is ​​sent to each of the clients respectively, and the second random matrix and the third random matrix are sent to the hub client respectively.

[0137] In this embodiment, it should be noted that the first random matrices of each client are different, the second random matrices of each hub client are different, and the third random matrices of each hub client are different. Each first random matrix, each second random matrix, and each third random matrix are also different.

[0138] In a feasible embodiment, a first random matrix is ​​generated for each of the clients, and a second random matrix and a third random matrix are generated for each of the hub clients; the first random matrix is ​​sent to each of the clients, and the second random matrix and the third random matrix are sent to the hub clients.

[0139] It is understandable that the client can exit model training at any time, and new clients can join model training. The client can also add new data at any time as the original data for model training. That is, the original data at this time is in a streaming data state (a dynamic data collection state that grows infinitely over time).

[0140] Optionally, if the detector receives first data, second data and predicted class labels corresponding to the newly added data, the mapping feature matrix is ​​updated based on the first data and second data corresponding to the newly added data; the model parameters are updated according to the updated mapping feature matrix and the predicted class labels corresponding to the newly added data, and the model to be trained is iteratively optimized based on the updated model parameters.

[0141] Optionally, refer to Figure 3 and Figure 4 , there may be new clients joining the model training. At this time, client 1...client n and the new clients may have new data. Client 1...client n and the new clients communicate with each other to calculate the mapping data, and send the mapping data and the predicted class label to the server. The server can calculate the mapping feature matrix according to the mapping data, calculate the enhanced data matrix according to the mapping feature matrix, and calculate the model parameters according to the predicted class label and the enhanced data matrix.

[0142] Optionally, in step C30, after the step of calculating the model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimizing the model to be trained based on the model parameters, the method further includes:

[0143] Step C40: if mapping update data and an update class label corresponding to the mapping update data are detected and received, adjusting the mapping feature matrix according to the mapping update data to obtain a mapping update matrix, wherein the mapping update data is calculated by each of the clients based on the original update data;

[0144] In a feasible embodiment, the mapping update data includes first update data sent by a non-hub client and second update data sent by a hub client. Based on the first update data, a mapping update matrix value corresponding to the non-hub client is calculated, and the mapping update matrix is ​​constructed according to the mapping update matrix value and the second update data.

[0145] Step C50, calculating the model update parameters corresponding to the model to be trained according to the mapping feature matrix and the updated class label, and iteratively optimizing the model to be trained based on the model update parameters.

[0146] In a feasible embodiment, the mapping update matrix is ​​enhanced mapped to obtain an enhanced update mapping matrix; based on the enhanced update mapping matrix and the mapping update matrix, a mapping update total matrix is ​​constructed, the mapping update total matrix and the mapping total matrix are spliced ​​to obtain a spliced ​​total matrix, and the model update parameters corresponding to the model to be trained are calculated according to the predicted update class labels corresponding to the spliced ​​total matrix and the mapping update data.

[0147] Optionally, the step of calculating the model update parameters corresponding to the to-be-trained model according to the predicted update class labels corresponding to the concatenated total matrix and the mapping update data comprises:

[0148]

[0149] in, Update the model parameters corresponding to the model to be trained, A new Update the total matrix, Y, for the mapping new The predicted update class label corresponding to the mapping update data.

[0150] It can be understood that the mapping update total matrix and the mapping total matrix are directly concatenated. Therefore, although the overall model training method adds original update data, it only needs to perform a series of calculations on the original update data. The mapping update total matrix obtained by the previous calculation is directly used for the original data. Therefore, the repeated calculation of the original data is reduced, thereby improving the model training efficiency.

[0151] The embodiment of the present application provides a model training optimization method, which is applied to a server, by receiving mapping data and predicted class labels sent by each client, wherein the mapping data sent by each client is obtained by randomly mapping each client to its own original data, and the predicted class label is a label used to train the model to be trained, and the predicted class label sent by each client corresponds to the original data of each client; based on the mapping data sent by each client, a mapping feature matrix is ​​constructed; model parameters corresponding to the model to be trained are calculated according to the mapping feature matrix and the predicted class label, and the model to be trained is iteratively optimized based on the model parameters, and by receiving the mapping data and predicted class label from the client, iterative optimization of the model to be trained is achieved, that is, the model training process, and the server cannot restore the original data of the client based on the predicted class label and the mapping data, so the security of the model training is guaranteed.

[0152] Embodiment 3

[0153] The present application also provides a client, referring to Figure 5 , the client comprises:

[0154] A mapping module, used for randomly mapping the original data to obtain mapping data of the original data;

[0155] A sending module is used to send the predicted class label corresponding to the original data and the mapping data to a server communicating with the client, wherein the predicted class label is a label used to train the model to be trained, so that the server can calculate a mapping feature matrix based on the mapping data, and calculate the model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimize the model to be trained based on the model parameters.

[0156] Optionally, the mapping module is further used for:

[0157] Receiving a first random matrix sent by the server;

[0158] Encrypting the original data based on the first random matrix to obtain encrypted data;

[0159] If the client is a non-hub client, first data is calculated based on the encrypted data of the non-hub client as mapping data of the original data;

[0160] If the client is a hub client, second data is calculated based on the original data of the hub client as mapping data of the original data.

[0161] Optionally, the mapping module is further used for:

[0162] Sending the encrypted data of the non-hub client to the hub client, so that the hub client calculates first random data and second random data based on the encrypted data of the non-hub client, and sending the first random data and the second random data to the non-hub client;

[0163] The first random data and the second random data sent by the hub client are received, and the first data is calculated based on the first random data and the second random data.

[0164] Optionally, the mapping module is further used for:

[0165] Generate a fourth random matrix;

[0166] The product of the fourth random matrix and the original data of the hub client is used as the second data.

[0167] The client provided by this application adopts the model training optimization method in the above embodiment to solve the technical problem of low security of model training. Compared with the prior art, the beneficial effects of the client provided by the embodiment of this application are the same as the beneficial effects of the model training optimization method provided by the above embodiment, and other technical features in the client are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0168] Embodiment 4

[0169] The present application also provides a server, referring to Figure 6 , the server comprises:

[0170] A receiving module, used to receive mapping data and predicted class labels sent by each client, wherein the mapping data sent by each client is obtained by each client performing random mapping on its own original data, the predicted class labels are labels used to train the training model, and the predicted class labels sent by each client correspond to the original data of each client;

[0171] A calculation module, used for constructing a mapping feature matrix based on the mapping data sent by each of the clients;

[0172] The optimization module is used to calculate the model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimize the model to be trained based on the model parameters.

[0173] Optionally, the mapping data sent by each of the clients includes first data sent by the non-hub client and second data sent by the hub client, and the calculation module is further used for:

[0174] Based on the first data, calculating a mapping matrix value corresponding to the non-hub client;

[0175] The mapping feature matrix is ​​constructed according to the mapping matrix value corresponding to the non-hub client and the second data.

[0176] Optionally, the optimization module is further used for:

[0177] Performing enhanced mapping on the mapping feature matrix to obtain an enhanced mapping matrix;

[0178] Based on the enhanced mapping matrix and the mapping feature matrix, constructing a total mapping matrix;

[0179] According to the total mapping matrix and the predicted class label, the model parameters corresponding to the model to be trained are calculated.

[0180] Optionally, after the step of calculating the model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimizing the model to be trained based on the model parameters, the server further includes:

[0181] If mapping update data and an update class label corresponding to the mapping update data are detected and received, adjusting the mapping feature matrix according to the mapping update data to obtain a mapping update matrix, wherein the mapping update data is calculated by each of the clients based on the original update data;

[0182] The model update parameters corresponding to the model to be trained are calculated according to the mapping feature matrix and the update class label, and the model to be trained is iteratively optimized based on the model update parameters.

[0183] The server provided by the present application adopts the model training optimization method in the above embodiment to solve the technical problem of low security of model training. Compared with the prior art, the beneficial effects of the server provided by the embodiment of the present application are the same as the beneficial effects of the model training optimization method provided by the above embodiment, and the other technical features in the server are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0184] Embodiment 5

[0185] An embodiment of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the model training optimization method in the above embodiment.

[0186] Reference below Figure 7 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers PDA (Personal Digital Assistant), PAD (tablet computer), PMP (Portable Media Player), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0187] like Figure 7As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a ROM (Read-Only Memory) or a program loaded from a storage device into a RAM (Random Access Memory). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM, and RAM are connected to each other via a bus. The input / output (I / O) port is also connected to the bus.

[0188] Typically, the following systems can be connected to the I / O port: input devices including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices including, for example, a magnetic tape, a hard disk, etc.; and communication devices. The communication device can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0189] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0190] The electronic device provided by the present application adopts the model training optimization method in the above embodiment to solve the technical problem of low security of model training. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the present application are the same as the beneficial effects of the model training optimization method provided by the above embodiment, and the other technical features in the electronic device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0191] It should be understood that the various parts of the present disclosure can be implemented with hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0192] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0193] Embodiment 6

[0194] This embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the model training optimization method in the above embodiment.

[0195] The computer-readable storage medium provided in the embodiment of the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, RAM, ROM, EPROM (Erasable Programmable Read Only Memory) or flash memory, optical fiber, CD-ROM (compact disc read-only memory), optical storage device, magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0196] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0197] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: randomly maps the original data to obtain the mapping data of the original data; sends the predicted class label corresponding to the original data and the mapping data to the server communicating with the client, wherein the predicted class label is a label for training the model to be trained, so that the server calculates a mapping feature matrix based on the mapping data, and calculates the model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimizes the model to be trained based on the model parameters; or, receives the mapping data and predicted class label sent by each client, wherein the mapping data sent by each client is obtained by each client randomly mapping its own original data, the predicted class label is a label for training the model to be trained, and the predicted class label sent by each client corresponds to the original data of each client; constructs a mapping feature matrix based on the mapping data sent by each client; calculates the model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimizes the model to be trained based on the model parameters.

[0198] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a LAN (Local Area Network) or a WAN (Wide Area Network), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet).

[0199] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0200] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.

[0201] The computer-readable storage medium provided by the present application stores computer-readable program instructions for executing the above-mentioned model training optimization method, which solves the technical problem of low security of model training. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the embodiment of the present application are the same as the beneficial effects of the model training optimization method provided by the above-mentioned implementation, and will not be repeated here.

[0202] Embodiment 7

[0203] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned model training optimization method when executed by a processor.

[0204] The computer program product provided in this application solves the technical problem of low security of model training. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiment of this application are the same as the beneficial effects of the model training optimization method provided in the above embodiment, which will not be repeated here.

[0205] 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 model training optimization method, characterized in that: Applied to the client, the model training optimization method includes: Receiving a first random matrix sent by a server; Encrypting the original data based on the first random matrix to obtain encrypted data; If the client is a non-hub client, first data is calculated based on the encrypted data of the non-hub client as mapping data of the original data; If the client is a hub client, calculating and obtaining second data based on the original data of the hub client as mapping data of the original data; The predicted class label corresponding to the original data and the mapping data are sent to a server communicating with the client, wherein the predicted class label is a label used to train the model to be trained, so that the server can calculate a mapping feature matrix based on the mapping data, and calculate model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label, and iteratively optimize the model to be trained based on the model parameters.

2. The model training optimization method according to claim 1, characterized in that: The step of calculating and obtaining the first data based on the encrypted data of the non-hub client comprises: Sending the encrypted data of the non-hub client to the hub client, so that the hub client calculates first random data and second random data based on the encrypted data of the non-hub client, and sending the first random data and the second random data to the non-hub client; The first random data and the second random data sent by the hub client are received, and the first data is calculated based on the first random data and the second random data.

3. The model training optimization method according to claim 1, characterized in that: The step of calculating the second data based on the original data of the hub client comprises: Generate a fourth random matrix; The product of the fourth random matrix and the original data of the hub client is used as the second data.

4. A model training optimization method, characterized in that: Applied to the server, the model training optimization method includes: Sending a first random matrix to each client, so that each client encrypts the original data based on the first random matrix to obtain encrypted data; if the client is a non-hub client, calculating first data based on the encrypted data of the non-hub client as mapping data of the original data; Receiving mapping data and predicted class labels sent by each client, wherein the mapping data sent by each client is obtained by each client performing random mapping on its own original data, the predicted class labels are labels used to train the training model, and the predicted class labels sent by each client correspond to the original data of each client; Constructing a mapping feature matrix based on the mapping data sent by each of the clients; The model parameters corresponding to the model to be trained are calculated according to the mapping feature matrix and the predicted class label, and the model to be trained is iteratively optimized based on the model parameters.

5. The model training optimization method according to claim 4, characterized in that: The mapping data sent by each of the clients includes first data sent by the non-hub client and second data sent by the hub client, The step of constructing a mapping feature matrix based on the mapping data sent by each of the clients includes: Based on the first data, calculating a mapping matrix value corresponding to the non-hub client; The mapping feature matrix is ​​constructed according to the mapping matrix value corresponding to the non-hub client and the second data.

6. The model training optimization method according to claim 4, characterized in that: The step of calculating the model parameters corresponding to the model to be trained according to the mapping feature matrix and the predicted class label comprises: Performing enhanced mapping on the mapping feature matrix to obtain an enhanced mapping matrix; Based on the enhanced mapping matrix and the mapping feature matrix, constructing a total mapping matrix; According to the total mapping matrix and the predicted class label, the model parameters corresponding to the model to be trained are calculated.

7. The model training optimization method according to claim 4, characterized in that: After the step of calculating the model parameters corresponding to the to-be-trained model according to the mapping feature matrix and the predicted class label, and iteratively optimizing the to-be-trained model based on the model parameters, the method further includes: If mapping update data and an update class label corresponding to the mapping update data are detected and received, adjusting the mapping feature matrix according to the mapping update data to obtain a mapping update matrix, wherein the mapping update data is calculated by each of the clients based on the original update data; The model update parameters corresponding to the model to be trained are calculated according to the mapping feature matrix and the update class label, and the model to be trained is iteratively optimized based on the model update parameters.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the steps of the model training optimization method described in any one of claims 1 to 3, or execute the steps of the model training optimization method described in any one of claims 4 to 7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for implementing the model training optimization method, and the program for implementing the model training optimization method is executed by a processor to implement the steps of the model training optimization method as described in any one of claims 1 to 3, or to execute the steps of the model training optimization method as described in any one of claims 4 to 7.

Citation Information

Patent Citations

  • Data encryption method and apparatus, machine learning model training method and apparatus, and electronic device

    CN109327421A