WO2023174018A1 - 一种纵向联邦学习方法、装置、系统、设备及存储介质 - Google Patents

一种纵向联邦学习方法、装置、系统、设备及存储介质 Download PDF

Info

Publication number
WO2023174018A1
WO2023174018A1 PCT/CN2023/077525 CN2023077525W WO2023174018A1 WO 2023174018 A1 WO2023174018 A1 WO 2023174018A1 CN 2023077525 W CN2023077525 W CN 2023077525W WO 2023174018 A1 WO2023174018 A1 WO 2023174018A1
Authority
WO
WIPO (PCT)
Prior art keywords
sample set
sample
data
residual vector
matrix
Prior art date
Application number
PCT/CN2023/077525
Other languages
English (en)
French (fr)
Inventor
贺培轩
张尧
刘洋
吴烨
Original Assignee
北京字节跳动网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2023174018A1 publication Critical patent/WO2023174018A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/008Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols involving homomorphic encryption

Definitions

  • the present disclosure relates to the field of machine learning, and in particular to a vertical federated learning method, device, system, equipment and storage medium.
  • Federated learning is a distributed machine learning technology oriented towards privacy protection. It is used to solve the problem of how to jointly train a global model with the data of all parties while protecting the security of each data party when private data exists in multiple independent data parties.
  • federated learning includes horizontal federation, vertical federation and federated migration.
  • Vertical federated learning is to split the data sets of each data cube vertically (i.e., feature dimension), and take out the part of the data in each data set that has the same sample identifier but different features to jointly train a global model.
  • Vertical federated learning is especially suitable for scenarios where data from multiple parties such as finance, social networking, games, education, etc. serves the label of a certain business party.
  • financial lending company C can perform vertical federated learning based on the data of social media company A and online education company B, as well as its own data and default record labels, and jointly train a global model.
  • the trained global model can be used in financial lending company C. Predicting defaults facilitates financial lending company C to make subsequent decisions based on the prediction results, reduce bad debt rates, etc.
  • embodiments of the present disclosure provide a vertical federated learning method, which can improve the efficiency of vertical federated learning while ensuring the security of the privacy data of all parties.
  • the present disclosure provides a longitudinal federated learning method, which method includes:
  • the noise matrix corresponding to the third sample set Based on the mask matrix corresponding to the third sample set, calculate the noise matrix corresponding to the third sample set; wherein the noise matrix is composed of the noise amount corresponding to each training sample in the third sample set , the amount of noise is used for noise processing;
  • the second data party is used to calculate a gradient vector based on the noisy residual vector, and calculate a gradient vector based on the gradient
  • the vector updates the model parameters corresponding to the second data side to obtain the updated model parameters corresponding to the second data side.
  • calculating the noise matrix corresponding to the third sample set based on the mask matrix corresponding to the third sample set includes:
  • determining the residual vector corresponding to the third sample set includes:
  • the residual vector corresponding to the third sample set is determined from the residual vector corresponding to the first sample set.
  • the third sample set is obtained by splitting the second sample set of the second data party based on sample identifiers.
  • the present disclosure provides a vertical federated learning system.
  • the longitudinal federated learning system includes a first data party and at least one second data party.
  • the first data party has a labeled first sample set.
  • the training samples have a corresponding relationship with the training samples in the second sample set of the second data party;
  • a second calculation module used to calculate the mask matrix corresponding to the third sample set
  • a third calculation module configured to obtain the noisy residual vector from the first data side, and calculate a gradient vector based on the noisy residual vector
  • the present disclosure provides a device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor.
  • a device including: a memory, a processor, and a computer program stored on the memory and executable on the processor.
  • the processor executes the computer program, Implement the above method.
  • Figure 2 is a flow chart of a vertical federated learning method provided by an embodiment of the present disclosure
  • the second sample set can be processed directly, that is, the second sample set is divided into a third sample set corresponding to the second data side. .
  • the second data party can calculate the gradient vector based on the noisy residual vector. Calculate The obtained gradient vector is used to update the model parameters of the second data cube.
  • the model parameters include the weights corresponding to each dimensional feature in the second sample set local to the second data party, such as the weights corresponding to the features "login frequency”, "browsing duration” and "interesting topics” in Table 1 above.
  • the first data party updates the model parameters by calculating the residual vector and the gradient vector, and when it is determined that the preset training stop conditions are met, the model training is stopped and the first data party is obtained.
  • the updated model parameters of a data cube are used to form a model trained by the longitudinal federated learning system 100 .
  • S201 Receive the mask matrix corresponding to the third sample set sent by the second data party in the vertical federated learning system.
  • the first data party receives a mask matrix from at least one second data party, wherein the mask matrix is formed by The corresponding second data side is calculated based on the training samples in the third sample set split into the local second sample set.
  • the specific calculation method will be introduced in subsequent embodiments.
  • each training sample in the second sample set can be sorted according to a preset strategy, and the sorted training samples can be divided into different third sample sets. Specifically, the training samples in the second sample set can be sorted in ascending order of sample identifiers, and the sorted training samples can be divided into different third sample sets.
  • the first data party after receiving the mask matrix, constructs a noise matrix based on the mask matrix.
  • C i is used to represent the noise matrix of the i-th third sample set
  • Zi is used to represent the mask matrix corresponding to the third sample set
  • Z i T is used to represent the transpose matrix of the mask matrix Zi
  • I is used to represent the identity matrix, that is, a matrix in which the elements on the diagonal are 1 and the other elements are 0.
  • the mask matrix received by the first data party has a corresponding relationship with the third sample set of the second data party. Therefore, the noise matrix calculated based on the mask matrix is also the third sample set corresponding to the mask matrix.
  • the three sample sets have a corresponding relationship, which is the first Noise matrix for three-sample set.
  • S203 Determine the residual vector corresponding to the third sample set, and determine the product of the residual vector and the noise matrix corresponding to the third sample set as the noisy residual corresponding to the third sample set. vector.
  • the residual vector includes the difference between the label value of the training sample in the third sample set and the current predicted value.
  • the first data party needs to determine the current residual corresponding to each training sample to indicate the gap between the current predicted value and the true value of the label.
  • the first data party determines the first training sample from the first sample set that has a corresponding relationship with the second training sample in the second sample set, and then, based on the first The linear predictor corresponding to the training sample, the linear predictor corresponding to the second training sample, and the label value corresponding to the first training sample determine the current residual corresponding to the first training sample; wherein, the second training sample The corresponding linear predictor is determined by the second data party and sent to the first data party. Furthermore, based on the current residual corresponding to the first training sample, a residual vector corresponding to the first sample set is determined. Finally, the residual vector corresponding to the third sample set is determined from the residual vector corresponding to the first sample set.
  • the model parameters are first initialized, where the model parameters include weight values corresponding to the features of each dimension of the training sample. It is assumed that the weight values corresponding to the features of each dimension of the training samples in the first sample set local to the first data party constitute a weight vector. m 1 is used to represent the number of feature dimensions. For each training sample in the first sample set, assuming x, the first data party independently calculates the linear predictor corresponding to each training sample x in the first sample set
  • weight values corresponding to the features of each dimension of the training samples in the second sample set local to the second data side constitute a weight vector.
  • m 2 is used to represent the number of feature dimensions.
  • the linear predictor Sent to the first data party. Based on the sample identification, it can be determined that for the same training sample x, the linear predictor calculated by combining the local data of each data party is:
  • the vertical federated learning system includes multiple second data parties, for training samples with the same sample identification, it is necessary to combine the local data of the first data party and the multiple data parties to calculate the corresponding training sample. Linear predictor.
  • the first data side calculates the linear predictor of the training sample x
  • it combines the linear predictors independently calculated by each second data side to calculate the linear predictor of the entire training sample x.
  • the current predicted value of the training sample x is determined. Assuming that the currently trained model is a logistic regression model, the current predicted value of the training sample x is Then, the current predicted value of the training sample x The difference between the true value y x of the label of the training sample x correct Defined as the current residual of the training sample x.
  • the currently trained model can also be other types of models, such as linear regression models, then the current predicted value of the training sample x can be
  • the embodiments of this disclosure will not give examples one by one.
  • the embodiment of the present disclosure can use the noise vector to encrypt the residual and send it to the second data party to ensure the privacy of the data. Safety.
  • the strategy of dividing the second sample set into multiple third sample sets may be to sort the training samples in the second sample set in ascending order of sample identifiers, and sort the The final training samples are divided into different third sample sets.
  • the first data party also sorts the current residuals of each training sample in the residual vector in ascending order of sample identifiers, and constructs each third sample based on the current residuals of each sorted training sample.
  • Sets of corresponding residual vectors respectively, wherein each residual sub-vector has a corresponding third sample set, and the training samples in the third sample set have a corresponding relationship with the training sample corresponding to the current residual in the corresponding residual vector. Relationship, for example, sample identifiers have corresponding relationships, etc.
  • the corresponding noise matrix is used to encrypt the residual vector. Specifically, the first data party multiplies the residual vector corresponding to the same third sample set and the noise matrix, and the resulting product is used as the noisy residual vector corresponding to the third sample set.
  • the noise can be calculated using formula (2)
  • C i is used to represent the noise matrix of the i-th third sample set
  • Y i is used to represent the residual vector corresponding to the i-th third sample set
  • D i is used to represent the residual vector corresponding to the i-th third sample set. Noised residual vector.
  • the second data side is used to calculate a gradient vector based on the noisy residual vector, and update the model parameters corresponding to the second data side based on the gradient vector to obtain the update corresponding to the second data side.
  • Post model parameters Post model parameters.
  • the first data party after calculating the noise-added residual vector corresponding to each third sample set, the first data party sends each noise-added residual vector to the corresponding second data party.
  • the second data side calculates the gradient vector based on the noisy residual vector, and updates the model parameters corresponding to the second data side based on the gradient vector.
  • the first data side can determine the residual vector corresponding to the local first sample set, calculate the gradient vector based on the residual vector, and update the model parameters of the first data side based on the gradient vector. , after obtaining the update corresponding to the first data party model parameters.
  • x 1 is used to represent the training samples in the first sample set
  • l is used to represent the number of training samples in the first sample set
  • G 1 is used to represent the gradient vector corresponding to the first sample set.
  • the first data side calculates the gradient vector G 1 based on the residual vector, and based on The gradient vector updates the model parameters of the first data party, which is also based on the training samples of each data party, achieving the purpose of jointly training the model with data from multiple parties.
  • the first data side updates the model parameters corresponding to the first data side based on the gradient vector to obtain the updated model parameters corresponding to the first data side.
  • the updated model parameters corresponding to the first data side are w 1 - ⁇ G 1 , where w 1 is the model parameter before the update, G 1 represents the gradient vector calculated by the first data side in this round of model training, and eta is Default value.
  • the first data party can obtain the updated model parameters corresponding to the first data party; otherwise, continue to execute S203 and perform iterative training.
  • the preset training stop condition can be set based on the number of training times. For example, when the number of training times reaches n times, the training of the model will be stopped.
  • the preset training stop condition can also be set based on the difference between the updated model parameters obtained from two consecutive trainings. For example, when the difference between the updated model parameters obtained from two consecutive trainings is less than a preset threshold, the model will be stopped. train.
  • embodiments of the present disclosure can set training stop conditions based on requirements, which is not limited.
  • a new round of models is continued. Specifically, the residual vectors corresponding to each third sample set in the new round of model training are re-determined until it is determined that the conditions are met. until the preset training stop conditions are reached. At this time, the updated model parameters obtained from the latest model training of the first data party can be obtained, and the updated model parameters can be used to construct a model trained based on the longitudinal federated learning system.
  • the first data party calculates the noise matrix for the second data party and encrypts the residual vector based on the noise matrix to ensure that the residual vector calculated by the first data party will not Obtained by the second data party, the purpose of protecting the label privacy in the sample of the first data party is achieved.
  • the calculation overhead of encrypting the residual vector through the noise matrix is smaller. Therefore, the embodiments of the present disclosure can improve the efficiency of vertical federated learning on the basis of ensuring data privacy.
  • the present disclosure also provides a vertical federated learning method.
  • Figure 3 is another method provided by the embodiments of the present disclosure. Flowchart of a vertical federated learning approach.
  • S301 Determine a third sample set based on the local second sample set, and calculate the mask matrix corresponding to the third sample set.
  • the second data party may split the local second sample set based on the sample identifier to obtain a third sample set.
  • the second data party sorts each training sample in the second sample set in order from small to large sample identifiers, and divides the sorted training samples into different third sample sets. middle.
  • the second data side first performs QR decomposition on the matrix corresponding to the third sample set to obtain the Q matrix and the R matrix; wherein the product of the Q matrix and the R matrix is the third sample
  • the number of rows and columns of the Q matrix is the same and equal to the number of rows of the matrix corresponding to the third sample set.
  • the number of columns, g is a preset positive integer.
  • QR decomposition on the matrix can obtain the Q matrix used to construct the mask matrix.
  • the first data square is the matrix corresponding to each third sample set Compute the mask matrix.
  • QR decomposition is performed on the matrix of each third sample set, that is, Q i ⁇ R l ⁇ l and Q i ⁇ R l ⁇ l that satisfy the conditions are found.
  • Let x 2,i Q i Ri .
  • the g column in is used to construct the mask matrix Z i ⁇ R l′ ⁇ g .
  • m 2 is used to represent the number of feature dimensions of the training samples in the second sample set local to the second data party. As shown in Table 1 above, the number of corresponding feature dimensions is 3, which includes "login frequency" , "browsing duration" and "interesting topics" three feature dimensions, the value of m 2 is 3.
  • g (m 2 /(m 2 +1))*l'.
  • S302 Send the mask matrix corresponding to the third sample set to the first data party in the vertical federated learning system.
  • the first data cube is used to determine the corresponding noisy residual vector in the longitudinal federated learning system based on the mask matrix, and the first sample set stored in the first data cube includes Labeled training samples.
  • the training samples with labels in the first sample set have a corresponding relationship with the training samples in the second sample set.
  • the second data party after calculating the mask matrix Zi corresponding to each third sample set, the second data party sends Zi to the first data party.
  • the first data party determines the noisy residual vector corresponding to each third sample set based on the mask matrix Zi , and the process of the first data party training the local model parameters can be carried out with reference to the above embodiment. Understand, I won’t go into details here.
  • the second data party may calculate the gradient vector based on each noisy residual vector.
  • the second data side can use formula (4) to calculate the gradient vector, specifically:
  • the second data party since the residual vector received by the second data party is based on the noised residual matrix encrypted by the noise matrix, the second data party cannot obtain the plaintext of the residual vector calculated by the first data party.
  • the privacy data security of the first data party is ensured.
  • the noisy residual matrix can be used for the calculation of gradient vectors without affecting the training of model parameters by the second data party.
  • the embodiment of the present disclosure calculates the gradient vector based on the noisy residual matrix, which does not consume much system performance and can improve the efficiency of model training while ensuring the security of private data.
  • the second data side updates the model parameters corresponding to the second data side based on the gradient vector to obtain the updated model parameters corresponding to the second data side.
  • the updated model parameters corresponding to the second data side are w 2 - ⁇ G 2 , where w 2 is the model parameter before the update, G 2 represents the gradient vector calculated by the second data side in this round of model training, and eta is Default value.
  • the second data side After determining that the preset training stop condition is met, the second data side obtains the updated model parameters corresponding to the second data side; otherwise, continues to perform the acquisition of the noisy residual vector from the first data side. steps, iterative training.
  • the updated model parameters are used to form a model trained based on the longitudinal federated learning system.
  • the preset training stop condition in the embodiment of the present disclosure can be understood with reference to the above embodiment.
  • the preset training stop condition can be that the model training of the first data side reaches N rounds and at least one second The model training on the data side reaches N rounds.
  • the second data party calculates the gradient vector based on the residual vector after adding noise to the noise matrix, which consumes less system resources and can improve the longitudinal performance while ensuring data privacy.
  • the efficiency of federated learning is the efficiency of federated learning.
  • the first receiving module 401 is used to receive the mask matrix corresponding to the third sample set sent by the second data party in the vertical federated learning system; wherein the third sample set is based on the second data party It is obtained by splitting the second sample set that the training samples in the second sample set have a corresponding relationship with the training samples with labels in the local first sample set;
  • the first calculation module 402 is used to calculate the noise matrix corresponding to the third sample set based on the mask matrix corresponding to the third sample set; wherein the noise matrix is composed of the mask matrix corresponding to the third sample set. It consists of the noise amount corresponding to each training sample, and the noise amount is used for noise addition processing;
  • the first sending module 404 is used to send the noisy residual vector corresponding to the third sample set to the second data party; wherein the second data party is used to calculate the noise based on the noisy residual vector.
  • Gradient vector, and based on the gradient vector, the model parameters corresponding to the second data side are updated to obtain the updated model parameters corresponding to the second data side.
  • the first calculation module 402 includes:
  • a second determination sub-module configured to determine, from the first sample set, a first training sample that has a corresponding relationship with a second training sample in the second sample set;
  • the third sample set is obtained by splitting the second sample set of the second data party based on sample identifiers.
  • the vertical federated learning device provided by the embodiment of the present disclosure, by calculating a noise matrix for the second data party and encrypting the residual vector based on the noise matrix, it is ensured that the residual vector calculated by the first data party will not be used by the second data party. Obtained by the first data party, the purpose of protecting the label privacy in the sample of the first data party is achieved. In addition, compared with homomorphic encryption technology, the calculation overhead of encrypting the residual vector through the noise matrix is relatively low. Small, therefore, the embodiments of the present disclosure can improve the efficiency of vertical federated learning on the basis of ensuring data privacy.
  • the second determination module is specifically used to:
  • the second determination module includes:
  • the decomposition submodule is used to perform QR decomposition for the matrix corresponding to the third sample set to obtain the Q matrix and the R matrix; wherein the product of the Q matrix and the R matrix is the matrix corresponding to the third sample set, so The number of rows and columns of the Q matrix is the same and equal to the number of rows of the matrix corresponding to the third sample set;
  • embodiments of the present disclosure also provide a computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are run on a terminal device, the terminal device enables the terminal device to implement the present invention.
  • the longitudinal federated learning method described in the disclosed embodiments is disclosed.
  • An embodiment of the present disclosure also provides a computer program product.
  • the computer program product includes a computer program/instruction.
  • the computer program/instruction is executed by a processor, the vertical federated learning method described in the embodiment of the present disclosure is implemented.
  • embodiments of the present disclosure also provide a vertical federated learning device, as shown in Figure 6, which may include:
  • the number of processors 601 in the vertical federated learning device can be one or more. In Figure 6, one processor is taken as an example.
  • the processor 601, the memory 602, the input device 603 and the output device 604 may be connected through a bus or other means, wherein the connection through the bus is taken as an example in FIG. 6 .
  • the memory 602 can be used to store software programs and modules.
  • the processor 601 executes various functional applications and data processing of the vertical federated learning device by running the software programs and modules stored in the memory 602.
  • the memory 602 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system, at least one application program required for a function, and the like.
  • memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
  • the input device 603 may be used to receive input numeric or character information, and to generate signal input related to user settings and functional control of the vertical federated learning device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Filters That Use Time-Delay Elements (AREA)

Abstract

本公开提供了一种纵向联邦学习方法、装置、系统、设备及存储介质,该方法包括:第一数据方基于掩码矩阵计算噪声矩阵,将残差向量与噪声矩阵的乘积确定为加噪残差向量,并将该加噪残差向量发送至第二数据方。第二数据方基于加噪残差向量计算梯度向量,以更新模型参数。本公开中第一数据方通过为第二数据方计算噪声矩阵,并基于噪声矩阵为残差向量加密的方式,保证第一数据方计算得到的残差向量不会被第二数据方获取,达到了保护第一数据方的样本中标签隐私的目的。另外,通过噪声矩阵对残差向量加密的方式计算开销较小,因此,本公开能够在保证数据隐私的基础上,提高纵向联邦学习的效率。

Description

一种纵向联邦学习方法、装置、系统、设备及存储介质
相关申请的交叉引用
本申请要求于2022年03月15日提交的,申请号为202210253437.0、发明名称为“一种纵向联邦学习方法、装置、系统、设备及存储介质”的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本公开涉及机器学习领域,尤其涉及一种纵向联邦学习方法、装置、系统、设备及存储介质。
背景技术
联邦学习是一种面向隐私保护的分布式机器学习技术,用于解决当隐私数据存在于多个独立数据方时,如何在保护各数据方安全的前提下,联合各方数据共同训练一个全局模型的问题。其中,联邦学习包括横向联邦、纵向联邦和联邦迁移。
纵向联邦学习,是将各数据方的数据集按照纵向(即特征维度)切分,并取出各数据集中样本标识相同而特征不完全相同的那部分数据共同训练一个全局模型。纵向联邦学习尤其适用于来自于金融、社交、游戏、教育等多方数据服务于某一业务方标签的场景。例如,金融借贷公司C可以基于社交媒体公司A和网络教育公司B的数据,以及自身数据和违约记录标签进行纵向联邦学习,联合训练出全局模型,训练出的全局模型可以用于金融借贷公司C进行违约预测,便于金融借贷公司C基于预测结果做后续决策,降低坏账率等等。
参与纵向联邦学习的各数据方均是抱着共享数据、但不暴露己方数据的目的加入到联邦学习的,所以任何敏感数据都必须经过加密才能出己方信任域,因而纵向联邦学习引入了同态加密算法。虽然同态加密为密文计算提供了可行性,但是同态加密的计算开销较大,也同时影响了机器学习算法的性能,导致纵向联邦学习的效率较低。因此,如何在保证各方隐私数据安全的前提下,提高纵向联邦学习的效率,是目前亟需解决的技术问题。
发明内容
为了解决上述技术问题,本公开实施例提供了一种纵向联邦学习方法,能够在保证各方隐私数据安全的前提下,提高纵向联邦学习的效率。
第一方面,本公开提供了一种纵向联邦学习方法,所述方法包括:
接收纵向联邦学习系统中的第二数据方发送的与第三样本集合对应的掩码矩阵;其中,所述第三样本集合为基于对所述第二数据方的第二样本集合的拆分得到,所述第二样本集合中的训练样本与本地的 第一样本集合中具有标签的训练样本具有对应关系;
基于所述第三样本集合对应的掩码矩阵,计算所述第三样本集合对应的噪声矩阵;其中,所述噪声矩阵由与所述第三样本集合中的每个训练样本对应的噪音量构成,所述噪音量用于加噪处理;
确定所述第三样本集合对应的残差向量,并将所述残差向量与所述第三样本集合对应的噪声矩阵的乘积,确定为所述第三样本集合对应的加噪残差向量;其中,所述残差向量中包括所述第三样本集合中的训练样本的标签值与当前预测值之间的差值;
将所述第三样本集合对应的加噪残差向量发送至所述第二数据方;其中,所述第二数据方用于基于所述加噪残差向量计算梯度向量,并基于所述梯度向量更新所述第二数据方对应的模型参数,得到所述第二数据方对应的更新后模型参数。
一种可选的实施方式中,所述基于所述第三样本集合对应的掩码矩阵,计算所述第三样本集合对应的噪声矩阵,包括:
计算所述第三样本集合对应的掩码矩阵与所述掩码矩阵的转置矩阵的乘积;
将单位矩阵与所述乘积的差值,确定为所述第三样本集合对应的噪声矩阵。
一种可选的实施方式中,所述确定所述第三样本集合对应的残差向量,包括:
从所述第一样本集合中确定与所述第二样本集合中的第二训练样本具有对应关系的第一训练样本;
基于所述第一训练样本对应的线性预测器、所述第二训练样本对应的线性预测器以及所述第一训练样本对应的标签值,确定所述第一训练样本对应的当前残差;其中,所述第二训练样本对应的线性预测器由所述第二数据方确定并发送至所述第一数据方;
基于所述第一训练样本对应的当前残差,确定所述第一样本集合对应的残差向量;
从所述第一样本集合对应的残差向量中,确定所述第三样本集合对应的残差向量。
一种可选的实施方式中,所述第三样本集合为基于样本标识对所述第二数据方的第二样本集合进行拆分得到。
一种可选的实施方式中,所述第三样本集合中包括多媒体数据训练样本、音频数据训练样本、视频数据训练样本、图像数据训练样本、文本数据训练样本中的一种或者多种组合。
第二方面,本公开提供了一种纵向联邦学习方法,所述方法包括:
基于本地的第二样本集合确定第三样本集合,并计算所述第三样本集合对应的掩码矩阵;
将所述第三样本集合对应的掩码矩阵发送至纵向联邦学习系统中的第一数据方;其中,所述第一数据方用于基于所述掩码矩阵确定所述第三样本集合对应的加噪残差向量,所述第一数据方内存储的第一样本集合中包括具有标签的训练样本,所述第一样本集合中具有标签的训练样本与所述第二样本集合中的训练样本具有对应关系;
获取来自所述第一数据方的所述加噪残差向量,并基于所述加噪残差向量计算梯度向量;
基于所述梯度向量更新本地的模型参数,得到更新后模型参数。
一种可选的实施方式中,所述基于本地的第二样本集合确定第三样本集合,包括:
基于样本标识对本地的第二样本集合进行拆分,得到第三样本集合。
一种可选的实施方式中,所述基于样本标识对本地的第二样本集合进行拆分,得到第三样本集合,包括:
基于样本标识对本地的第二样本集合中的训练样本进行排序,得到排序后的第二样本集合;
对所述排序后的第二样本集合进行拆分,得到第三样本集合。
一种可选的实施方式中,所述计算所述第三样本集合对应的掩码矩阵,包括:
为所述第三样本集合对应的矩阵执行QR分解,得到Q矩阵和R矩阵;其中,所述Q矩阵和R矩阵的乘积为所述第三样本集合对应的矩阵,所述Q矩阵的行和列的数量相同,且等于所述第三样本集合对应的矩阵的行数量;
将所述Q矩阵的前m列去除后,从所述Q矩阵中获取g列构成所述第三样本集合对应的掩码矩阵;其中,m为所述第三样本集合对应的矩阵的列数量,所述g为预设正整数。
第三方面,本公开提供了一种纵向联邦学习系统,所述纵向联邦学习系统包括第一数据方和至少一个第二数据方,所述第一数据方的第一样本集合中具有标签的训练样本与所述第二数据方的第二样本集合中的训练样本具有对应关系;
所述第二数据方,用于基于所述第二样本集合确定第三样本集合,并计算所述第三样本集合对应的掩码矩阵,以及将所述第三样本集合对应的掩码矩阵发送至所述第一数据方;
所述第一数据方,用于基于所述第三样本集合对应的掩码矩阵,计算所述第三样本集合对应的噪声矩阵,确定所述第三样本集合对应的残差向量,并将所述残差向量与所述第三样本集合对应的噪声矩阵的乘积,确定为所述第三样本集合对应的加噪残差向量,以及将所述第三样本集合对应的加噪残差向量发送至所述第二数据方;其中,所述噪声矩阵由与所述第三样本集合中的每个训练样本对应的噪音量构成,所述噪音量用于加噪处理,所述残差向量中包括所述第三样本集合中的训练样本的标签值与当前预测值之间的差值;
所述第二数据方,还用于基于所述加噪残差向量计算梯度向量,并基于所述梯度向量更新本地的模型参数,得到所述第二数据方对应的更新后模型参数。
第四方面,本公开提供了一种纵向联邦学习装置,所述装置包括:
第一接收模块,用于接收纵向联邦学习系统中的第二数据方发送的与第三样本集合对应的掩码矩阵;其中,所述第三样本集合为基于对所述第二数据方的第二样本集合的拆分得到,所述第二样本集合中的训练样本与本地的第一样本集合中具有标签的训练样本具有对应关系;
第一计算模块,用于基于所述第三样本集合对应的掩码矩阵,计算所述第三样本集合对应的噪声矩阵;其中,所述噪声矩阵由与所述第三样本集合中的每个训练样本对应的噪音量构成,所述噪音量用于加噪处理;
第一确定模块,用于确定所述第三样本集合对应的残差向量,并将所述残差向量与所述第三样本集合对应的噪声矩阵的乘积,确定为所述第三样本集合对应的加噪残差向量;其中,所述残差向量中包括所述第三样本集合中的训练样本的标签值与当前预测值之间的差值;
第一发送模块,用于将所述第三样本集合对应的加噪残差向量发送至所述第二数据方;其中,所述第二数据方用于基于所述加噪残差向量计算梯度向量,并基于所述梯度向量更新所述第二数据方对应的模型参数,得到所述第二数据方对应的更新后模型参数。
第五方面,本公开提供了一种纵向联邦学习装置,所述装置包括:
第二确定模块,用于基于本地的第二样本集合确定第三样本集合;
第二计算模块,用于计算所述第三样本集合对应的掩码矩阵;
第二发送模块,用于将所述第三样本集合对应的掩码矩阵发送至纵向联邦学习系统中的第一数据方;其中,所述第一数据方用于基于所述掩码矩阵确定所述第三样本集合对应的加噪残差向量,所述第一数据方内存储的第一样本集合中包括具有标签的训练样本,所述第一样本集合中具有标签的训练样本与所述第二样本集合中的训练样本具有对应关系;
第三计算模块,用于获取来自所述第一数据方的所述加噪残差向量,并基于所述加噪残差向量计算梯度向量;
更新模块,用于基于所述梯度向量更新本地的模型参数,得到更新后模型参数。
第六方面,本公开提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现上述的方法。
第七方面,本公开提供了一种设备,包括:存储器,处理器,及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现上述的方法。
第八方面,本公开提供了一种计算机程序产品,所述计算机程序产品包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现上述的方法。
本公开实施例提供的技术方案与现有技术相比至少具有如下优点:
本公开实施例提供了一种纵向联邦学习方法,应用于纵向联邦学习系统,第一数据方在接收到第二数据方发送的与第三样本集合对应的掩码矩阵后,基于该掩码矩阵计算该第三样本集合对应的噪声矩阵,并在确定该第三样本集合对应的残差向量之后,将残差向量与对应的噪声矩阵的乘积确定为加噪残差向量。第一数据方将该第三样本集合对应的加噪残差向量发送至第二数据方之后,第二数据方基于该加噪残差向量计算梯度向量,用于更新模型参数。本公开实施例中第一数据方通过为第二数据方计算噪声矩阵,并基于噪声矩阵为残差向量加密的方式,保证第一数据方计算的残差向量不会被第二数据方获取,达到了保护第一数据方的样本中标签隐私的目的。另外,相比于同态加密技术,通过噪声矩阵对残差向量加密的方式计算开销较小,因此,本公开实施例能够在保证数据隐私的基础上,提高纵向联邦学习的效率。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的一种纵向联邦学习系统的结构示意图;
图2为本公开实施例提供的一种纵向联邦学习方法的流程图;
图3为本公开实施例提供的另一种纵向联邦学习方法的流程图;
图4为本公开实施例提供的一种纵向联邦学习装置的结构示意图;
图5为本公开实施例提供的另一种纵向联邦学习装置的结构示意图;
图6为本公开实施例提供的一种纵向联邦学习设备的结构示意图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。
联邦学习是指各方数据保留在本地,不泄露隐私的前提下,多个参与方联合数据建立虚拟的共有模型。具体的,联邦学习可以做到各方数据不出本地,通过加密机制下的参数交换方式,在不泄露隐私的情况下,建立一个虚拟的共用模型,联邦学习作为一种保障数据安全的建模方法,在各个领域都有巨大的应用前景。
纵向联邦学习属于联邦学习的多种类型中的一种,为便于对纵向联邦学习的理解,本公开以下面场景为例,对纵向联邦学习的应用场景进行描述。
假设纵向联邦学习的参与方A、B和C分别是三家公司,其中,A是社交媒体公司,B是网络教育公司,A拥有众多人群的大量社交相关特征,如下表1所示;而B拥有这部分人群的教育相关特征,如下表2所示;C是金融贷款公司,拥有这部分人群的信贷记录,以及少量相关特征,如表3所示。
表1
表2
表3
假设金融借贷公司C想要基于社交媒体公司A和网络教育公司B的数据,以及自身数据和违约记录标签进行纵向联邦学习,联合训练出共有模型,则需要在模型训练的过程中,保护各方数据(包括特征和标签)隐私不泄露给对方和第三方。在模型训练完成后,可以利用训练完成的模型进行违约预测,便于金融借贷公司C基于预测结果做后续决策,降低坏账率等等。
目前,上述纵向联邦学习的应用场景是基于同态加密的技术保证模型训练过程中各方数据隐私不泄露给对象和第三方的,然而同态加密的计算开销较大,而纵向联合学习往往需要很多轮训练才能得到效果较好的模型,这使得同态加密开销大的弊端更加显露,导致通过纵向联邦学习进行模型训练的效率较低。
为此,本公开实施例提供了一种纵向联邦学习系统,如图1所示,为本公开实施例提供的一种纵向联邦学习系统的结构示意图,其中,纵向联邦学习系统100包括第一数据方101和至少一个第二数据方102。
具体的,第一数据方101本地的第一样本集合中包括具有标签的训练样本,第二数据方102本地的第二样本集合中包括的训练样本与第一样本集合中的具有标签的训练样本具有对应关系,其中,第二样本集合中的训练样本不具有标签。
一种可选的实施方式中,在纵向联邦学习之前,首先确定第一数据方和各个第二数据方的样本集合的交集。其中,交集中可以包括各数据方样本集合中具有相同样本标识的训练样本。如上述表1、2、3所示,分别为各数据方的样本集合中具有相同用户ID的训练样本,即样本集合的交集,综合表1、2、3 可以从不同的特征维度描述同一用户ID训练样本的特征。
另外,用于确定各数据方样本集合的交集的方式,在本公开实施例中不做限定。
具体的,第二数据方102,用于基于所述第二样本集合确定第三样本集合,并计算所述第三样本集合对应的掩码矩阵,以及将所述第三样本集合对应的掩码矩阵发送至所述第一数据方。
由于直接对第二样本集合进行处理所需内存较大,容易导致运行报错,因此,本公开实施例中第二数据方可以基于第二样本集合中训练样本的数量,预先将第二样本集合中的训练样本划分为至少一个第三样本集合。
一种可选的实施方式中,可以按照样本标识对第二样本集合中的各个训练样本进行排序,并将排序后的训练样本划分为至少一个第三样本集合,每个第三样本集合中包括特定数量的训练样本。
需要说明的是,如果第二样本集合中的训练样本的量级较小,则可以直接对第二样本集合进行处理,即对应于第二数据方将第二样本集合划分为一个第三样本集合。
第一数据方101,用于基于所述第三样本集合对应的掩码矩阵,计算所述第三样本集合对应的噪声矩阵,确定所述第三样本集合对应的残差向量,并将所述残差向量与所述第三样本集合对应的噪声矩阵的乘积,确定为所述第三样本集合对应的加噪残差向量,以及将所述第三样本集合对应的加噪残差向量发送至所述第二数据方。其中,所述噪声矩阵由与所述第三样本集合中的每个训练样本对应的噪音量构成,所述噪音量用于加噪处理,所述残差向量中包括所述第三样本集合中的训练样本的标签值与当前预测值之间的差值。
一种可选的实施方式中,第二数据方计算得到第二样本集合中各个第三样本集合的掩码矩阵之后,将各个掩码矩阵发送至第一数据方,其中,各个掩码矩阵携带对应的第三样本集合中的各个训练样本的样本标识,以便第一数据方能够确定各个掩码矩阵对应的样本标识。其中,样本标识用于标识训练样本,例如上述表1、2、3中的用户ID。
第一数据方基于掩码矩阵计算各个第三样本集合的噪声矩阵,并在每轮的模型训练中,将各个第三样本集合的噪声矩阵与其对应的残差向量相乘得到的乘积,确定为对应的第三样本集合的加噪残差向量。然后,由第一数据方向对应的第二数据方发送各个加噪残差向量,由于加噪残差向量是基于噪声矩阵加密的,因此,每轮的模型训练中对加噪残差向量的传输,并不会泄露第一数据方计算的残差,保护了第一数据方的样本标签隐私安全。
第二数据方102,还用于基于所述加噪残差向量计算梯度向量,并基于所述梯度向量更新所述第二数据方对应的模型参数,得到所述第二数据方对应的更新后模型参数。
实际应用中,第二数据方在每轮的模型训练中得到更新后模型参数之后,需要判断当前是否满足预设训练停止条件,并在确定满足预设训练停止条件后,获取所述第二数据方对应的更新后模型参数,否则继续迭代训练。
实际应用中,第二数据方在接收到加噪残差向量之后,基于加噪残差向量计算梯度向量即可,计算 得到的梯度向量用于更新第二数据方的模型参数。其中,模型参数包括第二数据方本地的第二样本集合中各个维度特征分别对应的权重,例如上述表1中特征“登录频率”、“浏览时长”和“感兴趣话题”分别对应的权重。
在每轮的模型训练结束时,判断当前是否满足预设训练停止条件,如果未满足,则继续下一轮的模型训练,直到满足预设训练停止条件为止。如果当前满足预设训练停止条件,则可以获取第二数据方对应的更新后模型参数,用于构成纵向联邦学习系统100训练得到的模型。
第一数据方101,还用于确定所述第一样本集合对应的残差向量,基于所述残差向量计算梯度向量,并基于所述梯度向量更新所述第一数据方对应的模型参数,以及在确定满足预设训练停止条件后,获取所述第一数据方对应的更新后模型参数,否则迭代训练;其中,所述第一数据方和所述第二数据方分别对应的更新后模型参数用于构成基于所述纵向联邦学习系统训练得到的模型。
实际应用中,每轮的模型训练中,第一数据方通过计算残差向量以及计算梯度向量,实现对模型参数的更新,并在确定满足预设训练停止条件时,停止模型的训练,获取第一数据方的更新后模型参数,用于构成纵向联邦学习系统100训练得到的模型。
在利用纵向联邦学习系统训练模型的过程中,各数据方训练各自的模型参数,在训练结束后,联合各数据方分别对应的更新后模型参数,构成训练成功的模型,即全局模型,也称为共有模型。也就是说,通过纵向联邦学习得到的模型是联合多方数据训练得到。
本公开实施例提供的纵向联邦学习系统中,第一数据方通过为第二数据方计算噪声矩阵,并基于噪声矩阵为残差向量加密的方式,保证第一数据方计算的残差向量不会被第二数据方获取,达到了保护第一数据方的样本中标签隐私的目的。另外,相比于同态加密技术,通过噪声矩阵对残差向量加密的方式计算开销较小,因此,本公开实施例能够在保证数据隐私的基础上,提高纵向联邦学习的效率。
基于上述纵向联邦学习系统,本公开实施例提供了一种纵向联邦学习方法,参考图2,为本公开实施例提供的一种纵向联邦学习方法的流程图。
其中,该方法应用于纵向联邦学习系统中的第一数据方,该纵向联邦学习系统中还包括至少一个第二数据方,第一数据方的第一样本集合中具有标签的训练样本与第二数据方的第二样本集合中的训练样本具有对应关系,具体的,该方法包括:
S201:接收纵向联邦学习系统中的第二数据方发送的与第三样本集合对应的掩码矩阵。
其中,所述第三样本集合为基于对所述第二数据方的第二样本集合的拆分得到,所述第二样本集合中的训练样本与本地的第一样本集合中具有标签的训练样本具有对应关系。
第一样本集合、第二样本集合以及第三样本集合中可以包括各种数据类型的训练样本,例如,所述第三样本集合中可以包括多媒体数据训练样本、音频数据训练样本、视频数据训练样本、图像数据训练样本、文本数据训练样本中的一种或者多种组合。
本公开实施例中,第一数据方接收来自至少一个第二数据方的掩码矩阵,其中,该掩码矩阵是由对 应的第二数据方基于本地的第二样本合集拆分成的第三样本集合中的训练样本计算得到的,具体计算方式在后续实施例中进行介绍。
为了便于描述,本公开实施例中,假设第一数据方本地的第一样本集合中的训练样本包括其中,第一样本集合包括l个训练样本,每个训练样本具有m1个维度的特征值,y∈{0,1}l用于表示训练样本的标签所在列,每个训练样本的标签为0或1。第二数据方本地的第二样本集合中的训练样本包括第一样本集合和第二样本集合中的训练样本为第一数据方和第二数据方的本地数据进行交集计算之后得到的,第一样本集合和第二样本集合中的训练样本具有对应关系,例如,第一样本集合和第二样本集合中的训练样本具有对应的样本标识。如上述表1和表3所示,第一样本集合和第二样本集合中均包括用户ID分别为1、2、3的训练样本。
由于第二样本集合中的数据量较大,为了降低系统运行报错的概率,第二数据方可以预先将本地的第二样本集合中的训练样本划分到不同的第三样本集合中。例如,将拆分成多个其中,l′<<l。
一种可选的实施方式中,可以按照预设策略对第二样本集合中的各个训练样本进行排序,将排序后的训练样本划分到不同的第三样本集合中。具体的,可以按照样本标识由小到大的顺序,对第二样本集合中的各个训练样本进行排序,将排序后的训练样本划分到不同的第三样本集合中。
S202:基于所述第三样本集合对应的掩码矩阵,计算所述第三样本集合对应的噪声矩阵。
其中,所述噪声矩阵由与所述第三样本集合中的每个训练样本对应的噪音量构成,所述噪音量用于加噪处理。
本公开实施例中,第一数据方在接收到掩码矩阵之后,基于该掩码矩阵构造噪声矩阵。
一种可选的实施方式中,第一数据方在接收到掩码矩阵之后,确定该掩码矩阵的转置矩阵,并计算该转置矩阵和该掩码矩阵的矩阵乘积,然后,将单位矩阵与该矩阵乘积之间的差值,确定为该掩码矩阵对应的第三样本集合的噪声矩阵。
具体的,可以利用公式(1)计算噪声矩阵,如下:
Ci=I-ZiZi T          (1);
其中,Ci用于表示第i个第三样本集合的噪声矩阵,Zi用于表示该第三样本集合对应的掩码矩阵,Zi T用于表示掩码矩阵Zi的转置矩阵,I用于表示单位矩阵,即对角线上的元素为1,其他元素为0的矩阵。
需要说明的是,第一数据方接收到的掩码矩阵与第二数据方的第三样本集合具有对应关系,因此,基于掩码矩阵计算得到的噪声矩阵,也是与该掩码矩阵对应的第三样本集合具有对应关系的,即为该第 三样本集合的噪声矩阵。
S203:确定所述第三样本集合对应的残差向量,并将所述残差向量与所述第三样本集合对应的噪声矩阵的乘积,确定为所述第三样本集合对应的加噪残差向量。
其中,所述残差向量中包括所述第三样本集合中的训练样本的标签值与当前预测值之间的差值。
在基于纵向联邦学习的每轮模型训练中,第一数据方均需要确定每个训练样本对应的当前残差,以表明当前预测值与标签真实值之间的差距。
一种可选的实施方式中,首先,第一数据方从第一样本集合中确定与第二样本集合中的第二训练样本具有对应关系的第一训练样本,然后,基于所述第一训练样本对应的线性预测器、所述第二训练样本对应的线性预测器以及第一训练样本对应的标签值,确定所述第一训练样本对应的当前残差;其中,所述第二训练样本对应的线性预测器由所述第二数据方确定并发送至所述第一数据方。进而,基于所述第一训练样本对应的当前残差,确定所述第一样本集合对应的残差向量。最终,从所述第一样本集合对应的残差向量中,确定第三样本集合对应的残差向量。
实际应用中,在进行模型训练之前,首先初始化模型参数,其中,模型参数包括训练样本的各个维度的特征分别对应的权重值。假设第一数据方本地的第一样本集合中的训练样本的各个维度的特征分别对应的权重值构成权重向量m1用于表示特征维度的数量。对于第一样本集合中的每个训练样本,假设为x,第一数据方独立计算第一样本集合中的每个训练样本x对应的线性预测器
假设第二数据方本地的第二样本集合中的训练样本的各个维度的特征分别对应的权重值构成权重向量m2用于表示特征维度的数量。对于第二样本集合中的每个训练样本,假设为x,第二数据方独立计算第二样本集合中的每个训练样本x对应的线性预测器
第二数据方在独立计算得到每个训练样本的特征值之后,将线性预测器发送至第一数据方。基于样本标识可以确定针对同一训练样本x,联合各数据方的本地数据计算得到的线性预测器为:
值得注意的是,如果纵向联邦学习系统中包括多个第二数据方,则针对具有同一样本标识的训练样本,需要联合第一数据方和该多个数据方的本地数据计算该训练样本对应的线性预测器。
第一数据方在计算得到训练样本x的线性预测器之后,结合来自各个第二数据方独立计算的线性预测器,计算训练样本x整体的线性预测器并基于该线性预测器确定训练样本x的当前预测值,假设当前训练的模型为逻辑回归模型,则训练样本x的当前预测值为然后,将训练样本x的当前预测值与该训练样本x的标签真实值yx之间的差值确 定为训练样本x的当前残差。
另外,当前训练的模型还可以为其他类型的模型,例如线性回归模型,则训练样本x的当前预测值可以为对于其他类型的模型,本公开实施例不再一一举例。
第一数据方依照上述方式分别确定出每个训练样本的当前残差之后,将各个训练样本的当前残差组成残差向量Y=[r1,…,rn]T
为了保证隐私数据安全,第一数据方不能将明文的残差发送至第二数据方,因此,本公开实施例可以利用噪声向量对残差进行加密后发送至第二数据方,来保证隐私数据安全。
本公开实施例中,基于第二数据方将第二样本集合划分成多个第三样本集合的策略,第一数据方将残差向量Y=[r1,…,rn]T拆分成与各个第三样本集合对应的残差向量Yi∈Rl′×1,其中,l′即为第三样本集合中包含的训练样本的数量。
一种可选的实施方式中,将第二样本集合划分成多个第三样本集合的策略,可以为按照样本标识从小到大的顺序对第二样本集合中的各个训练样本进行排序,将排序后的训练样本划分到不同的第三样本集合中。相应的,第一数据方也按照样本标识从小到大的顺序,对残差向量中的各个训练样本的当前残差进行排序,并基于排序后的各个训练样本的当前残差构成各个第三样本集合分别对应的残差向量,其中,各个残差子向量具有对应的第三样本集合,且该第三样本集合中的训练样本与对应的残差向量中的当前残差对应的训练样本具有对应关系,例如样本标识具有对应关系等。
本公开实施例中,在确定各个第三样本集合对应的残差向量之后,利用其对应的噪声矩阵对残差向量进行加密。具体的,第一数据方将同一第三样本集合对应的残差向量和噪声矩阵相乘,得到的乘积作为该第三样本集合对应的加噪残差向量,可以利用公式(2)计算加噪残差向量,如下:
Di=CiYi       (2)
其中,Ci用于表示第i个第三样本集合的噪声矩阵,Yi用于表示第i个第三样本集合对应的残差向量,Di用于表示第i个第三样本集合对应的加噪残差向量。
S204:将所述第三样本集合对应的加噪残差向量发送至所述第二数据方。
其中,所述第二数据方用于基于所述加噪残差向量计算梯度向量,并基于所述梯度向量更新所述第二数据方对应的模型参数,得到所述第二数据方对应的更新后模型参数。
本公开实施例中,第一数据方在计算得到各个第三样本集合对应的加噪残差向量之后,将各个加噪残差向量发送至对应的第二数据方。第二数据方基于加噪残差向量计算梯度向量,并基于梯度向量更新第二数据方对应的模型参数,具体实现方式在后续实施例中进行介绍。
实际应用中,第一数据方可以确定本地的第一样本集合对应的残差向量,并基于所述残差向量计算梯度向量,以及基于所述梯度向量更新所述第一数据方的模型参数,得到所述第一数据方对应的更新后 模型参数。
第一数据方在确定第一样本集合对应的残差向量Y=[r1,…,rn]T之后,基于残差向量计算梯度向量。具体的,可以采用如下公式(3)计算梯度向量:
其中,x1用于表示第一样本集合中的训练样本,l用于表示第一样本集合中的训练样本的数量,G1用于表示第一样本集合对应的梯度向量。
由于残差向量由于残差向量Y=[r1,…,rn]T是基于各数据方的训练样本计算得到,因此,第一数据方基于该残差向量计算梯度向量G1,并基于该梯度向量更新第一数据方的模型参数,也是以各数据方的训练样本为基础的,实现了联合多方数据共同训练模型的目的。
本公开实施例中,第一数据方在计算得到梯度向量之后,基于梯度向量更新第一数据方对应的模型参数,得到第一数据方对应的更新后模型参数。假设第一数据方对应的更新后模型参数为w1-ηG1,其中,w1为更新前的模型参数,G1表示第一数据方在本轮模型训练中计算得到的梯度向量,η为预设数值。
第一数据方在确定满足预设训练停止条件后,可以获取所述第一数据方对应的更新后模型参数,否则,继续执行所述S203,迭代训练。
其中,所述更新后模型参数用于构成基于所述纵向联邦学习系统训练得到的模型。
本公开实施例中,预设训练停止条件可以基于训练次数设定,例如为训练次数达到n次,则停止模型的训练。预设训练停止条件也可以基于相邻两次训练得到的更新后模型参数之间的差值设定,例如为相邻两次训练得到的更新后模型参数相差小于预设阈值时,停止模型的训练。
需要说明的是,本公开实施例可以基于需求设置训练停止条件,对此不进行限制。
实际应用中,在确定当前未满足预设训练停止条件后,继续开启新一轮的模型,具体的,重新确定在新一轮模型训练中各个第三样本集合对应的残差向量,直到确定满足预设训练停止条件为止。此时,可以获取第一数据方的最近一次模型训练得到的更新后模型参数,并利用更新后模型参数构成基于所述纵向联邦学习系统训练得到的模型。
本公开实施例提供的纵向联邦学习方法中,第一数据方通过为第二数据方计算噪声矩阵,并基于噪声矩阵为残差向量加密的方式,保证第一数据方计算的残差向量不会被第二数据方获取,达到了保护第一数据方的样本中标签隐私的目的。另外,相比于同态加密技术,通过噪声矩阵对残差向量加密的方式计算开销较小,因此,本公开实施例能够在保证数据隐私的基础上,提高纵向联邦学习的效率。
基于上述实施例,本公开还提供了一种纵向联邦学习方法,参考图3,为本公开实施例提供的另一 种纵向联邦学习方法的流程图。
其中,该方法应用于纵向联邦学习系统中的第二数据方,第二数据方存储有第二样本集合,具体的,该方法包括:
S301:基于本地的第二样本集合确定第三样本集合,并计算所述第三样本集合对应的掩码矩阵。
一种可选的实施方式中,第二数据方可以基于样本标识对本地的第二样本集合进行拆分,得到第三样本集合。
一种可选的实施方式中,第二数据方按照样本标识由小到大的顺序,对第二样本集合中的各个训练样本进行排序,将排序后的训练样本划分到不同的第三样本集合中。
一种可选的实施方式中,第二数据方首先为第三样本集合对应的矩阵执行QR分解,得到Q矩阵和R矩阵;其中,所述Q矩阵和R矩阵的乘积为所述第三样本集合对应的矩阵,所述Q矩阵的行和列的数量相同,且等于所述第三样本集合对应的矩阵的行数量。然后,将所述Q矩阵的前m列去除后,从所述Q矩阵中获取g列构成所述第三样本集合对应的掩码矩阵;其中,m为所述第三样本集合对应的矩阵的列数量,所述g为预设正整数。
需要说明的是,本公开实施例针对QR分解的具体实现方式不做赘述,对矩阵执行QR分解能够得到用于构造掩码矩阵的Q矩阵。
以下以第二数据方将拆分成多个为例。第一数据方为各个第三样本集合对应的矩阵计算掩码矩阵。
实际应用中,针对每个第三样本集合的矩阵执行QR分解,即找到满足条件的Qi∈Rl×l使得x2,i=QiRi。然后,去掉Qi矩阵的前m2列得到选取中的g列,用于构造掩码矩阵Zi∈Rl′×g。其中,m2用于表示第二数据方本地的第二样本集合中的训练样本的特征维度的数量,如上述表1所示,其对应的特征维度的数量为3,即包含“登录频率”、“浏览时长”和“感兴趣话题”三个特征维度,m2的取值为3。另外,一种可选的实施方式中,g=(m2/(m2+1))*l'。
S302:将所述第三样本集合对应的掩码矩阵发送至纵向联邦学习系统中的第一数据方。
其中,所述第一数据方用于基于所述掩码矩阵确定所述纵向联邦学习系统中的对应的加噪残差向量,所述第一数据方内存储的第一样本集合中包括具有标签的训练样本,所述第一样本集合中具有标签的训练样本与所述第二样本集合中的训练样本具有对应关系。
本公开实施例中,第二数据方在计算得到各个第三样本集合对应的掩码矩阵Zi之后,将Zi发送至第一数据方。
需要说明的是,第一数据方基于掩码矩阵Zi确定各个第三样本集合对应的加噪残差向量,以及第一数据方对本地的模型参数进行训练的过程,可参照上述实施例进行理解,在此不再赘述。
S303:获取来自所述第一数据方的所述加噪残差向量,并基于所述加噪残差向量计算梯度向量。
本公开实施例中,第二数据方在接收到来自第一数据方的加噪残差向量之后,可以基于各个加噪残差向量计算梯度向量。
实际应用中,第二数据方可以利用公式(4)计算梯度向量,具体的:
其中,Di用于表示第i个第三样本集合对应的加噪残差向量,x2,i T用于表示第i个第三样本集合中的训练样本,l用于表示第二样本集合中的训练样本的数量,即所有第三样本集合中的训练样本的总数量;G2用于表示第二数据方在本轮模型训练中计算得到的梯度向量。
本公开实施例中,由于第二数据方接收到的残差向量是基于噪声矩阵加密后的加噪残差矩阵,因此第二数据方无法获知第一数据方计算得到的残差向量的明文,保证了第一数据方的隐私数据安全,另外,加噪残差矩阵能够用于梯度向量的计算,不影响第二数据方对模型参数的训练。
另外,本公开实施例基于加噪残差矩阵计算梯度向量,对系统性能消耗不大,能够在保证隐私数据安全的基础上,提升模型训练的效率。
S304:基于所述梯度向量更新本地的模型参数,得到更新后模型参数。
本公开实施例中,第二数据方在计算得到梯度向量之后,基于梯度向量更新第二数据方对应的模型参数,得到第二数据方对应的更新后模型参数。假设第二数据方对应的更新后模型参数为w2-ηG2,其中,w2为更新前的模型参数,G2表示第二数据方在本轮模型训练中计算得到的梯度向量,η为预设数值。
第二数据方在确定满足预设训练停止条件后,获取所述第二数据方对应的更新后模型参数,否则,继续执行所述获取来自所述第一数据方的所述加噪残差向量的步骤,迭代训练。
其中,所述更新后模型参数用于构成基于所述纵向联邦学习系统训练得到的模型。
本公开实施例中的预设训练停止条件可以参照上述实施例进行理解,一种可选的实施方式中,预设训练停止条件可以为第一数据方的模型训练达到N轮且至少一个第二数据方的模型训练达到N轮。
本公开实施例提供的纵向联邦学习方法中,第二数据方基于由噪声矩阵加噪后的残差向量计算梯度向量,对系统资源的消耗较低,能够在保证数据隐私的基础上,提高纵向联邦学习的效率。
基于上述方法实施例,本公开还提供了一种纵向联邦学习装置,参考图4,为本公开实施例提供的一种纵向联邦学习装置的结构示意图,所述装置包括:
第一接收模块401,用于接收纵向联邦学习系统中的第二数据方发送的与第三样本集合对应的掩码矩阵;其中,所述第三样本集合为基于对所述第二数据方的第二样本集合的拆分得到,所述第二样本集合中的训练样本与本地的第一样本集合中具有标签的训练样本具有对应关系;
第一计算模块402,用于基于所述第三样本集合对应的掩码矩阵,计算所述第三样本集合对应的噪声矩阵;其中,所述噪声矩阵由与所述第三样本集合中的每个训练样本对应的噪音量构成,所述噪音量用于加噪处理;
第一确定模块403,用于确定所述第三样本集合对应的残差向量,并将所述残差向量与所述第三样本集合对应的噪声矩阵的乘积,确定为所述第三样本集合对应的加噪残差向量;其中,所述残差向量中包括所述第三样本集合中的训练样本的标签值与当前预测值之间的差值;
第一发送模块404,用于将所述第三样本集合对应的加噪残差向量发送至所述第二数据方;其中,所述第二数据方用于基于所述加噪残差向量计算梯度向量,并基于所述梯度向量更新所述第二数据方对应的模型参数,得到所述第二数据方对应的更新后模型参数。一种可选的实施方式中,所述第一计算模块402,包括:
第一计算子模块,用于计算所述第三样本集合对应的掩码矩阵与所述掩码矩阵的转置矩阵的乘积;
第一确定子模块,用于将单位矩阵与所述乘积的差值,确定为所述第三样本集合对应的噪声矩阵。
一种可选的实施方式中,所述第一确定模块403,包括:
第二确定子模块,用于从所述第一样本集合中确定与所述第二样本集合中的第二训练样本具有对应关系的第一训练样本;
第三确定子模块,用于基于所述第一训练样本对应的线性预测器、所述第一训练样本对应的线性预测器以及所述第一训练样本对应的标签值,确定所述第一训练样本对应的当前残差;其中,所述第二训练样本对应的线性预测器是由所述第二数据方确定并发送至所述第一数据方;
第四确定子模块,用于基于所述第一训练样本对应的当前残差,确定所述第一样本集合对应的残差向量;
第五确定子模块,用于从所述第一样本集合对应的残差向量中,确定所述第三样本集合对应的残差向量。
一种可选的实施方式中,所述第三样本集合为基于样本标识对所述第二数据方的第二样本集合进行拆分得到。
一种可选的实施方式中,所述第三样本集合中包括多媒体数据训练样本、音频数据训练样本、视频数据训练样本、图像数据训练样本、文本数据训练样本中的一种或者多种组合。
本公开实施例提供的纵向联邦学习装置中,通过为第二数据方计算噪声矩阵,并基于噪声矩阵为残差向量加密的方式,保证第一数据方计算的残差向量不会被第二数据方获取,达到了保护第一数据方的样本中标签隐私的目的。另外,相比于同态加密技术,通过噪声矩阵对残差向量加密的方式计算开销较 小,因此,本公开实施例能够在保证数据隐私的基础上,提高纵向联邦学习的效率。
基于上述实施例,本公开还提供了一种纵向联邦学习装置,参考图5,为本公开实施例提供的另一种纵向联邦学习装置的结构示意图,所述装置包括:
第二确定模块501,用于基于本地的第二样本集合确定第三样本集合;
第二计算模块502,用于计算所述第三样本集合对应的掩码矩阵;
第二发送模块503,用于将所述第三样本集合对应的掩码矩阵发送至纵向联邦学习系统中的第一数据方;其中,所述第一数据方用于基于所述掩码矩阵确定所述第三样本集合对应的加噪残差向量,所述第一数据方内存储的第一样本集合中包括具有标签的训练样本,所述第一样本集合中具有标签的训练样本与所述第二样本集合中的训练样本具有对应关系;
第三计算模块504,用于获取来自所述第一数据方的所述加噪残差向量,并基于所述加噪残差向量计算梯度向量;
更新模块505,用于基于所述梯度向量更新本地的模型参数,得到更新后模型参数。
一种可选的实施方式中,所述第二确定模块,具体用于:
基于样本标识对本地的第二样本集合进行拆分,得到第三样本集合。
一种可选的实施方式中,所述第二确定模块,包括:
排序子模块,用于基于样本标识对本地的第二样本集合中的训练样本进行排序,得到排序后的第二样本集合;
拆分子模块,用于对所述排序后的第二样本集合进行拆分,得到第三样本集合。
一种可选的实施方式中,所述第二计算模块502,包括:
分解子模块,用于为所述第三样本集合对应的矩阵执行QR分解,得到Q矩阵和R矩阵;其中,所述Q矩阵和R矩阵的乘积为所述第三样本集合对应的矩阵,所述Q矩阵的行和列的数量相同,且等于所述第三样本集合对应的矩阵的行数量;
获取子模块,用于将所述Q矩阵的前m列去除后,从所述Q矩阵中获取g列构成所述第三样本集合对应的掩码矩阵;其中,m为所述第三样本集合对应的矩阵的列数量,所述g为预设正整数。
本公开实施例提供的纵向联邦学习装置中,基于由噪声矩阵加噪后的残差向量计算梯度向量,对系统资源的消耗较低,能够在保证数据隐私的基础上,提高纵向联邦学习的效率。
除了上述方法和装置以外,本公开实施例还提供了一种计算机可读存储介质,计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现本公开实施例所述的纵向联邦学习方法。
本公开实施例还提供了一种计算机程序产品,所述计算机程序产品包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现本公开实施例所述的纵向联邦学习方法。
另外,本公开实施例还提供了一种纵向联邦学习设备,参见图6所示,可以包括:
处理器601、存储器602、输入装置603和输出装置604。纵向联邦学习设备中的处理器601的数量可以一个或多个,图6中以一个处理器为例。在本公开的一些实施例中,处理器601、存储器602、输入装置603和输出装置604可通过总线或其它方式连接,其中,图6中以通过总线连接为例。
存储器602可用于存储软件程序以及模块,处理器601通过运行存储在存储器602的软件程序以及模块,从而执行纵向联邦学习设备的各种功能应用以及数据处理。存储器602可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等。此外,存储器602可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。输入装置603可用于接收输入的数字或字符信息,以及产生与纵向联邦学习设备的用户设置以及功能控制有关的信号输入。
具体在本实施例中,处理器601会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器602中,并由处理器601来运行存储在存储器602中的应用程序,从而实现上述纵向联邦学习设备的各种功能。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (15)

  1. 一种纵向联邦学习方法,其特征在于,所述方法包括:
    接收纵向联邦学习系统中的第二数据方发送的与第三样本集合对应的掩码矩阵;其中,所述第三样本集合为基于对所述第二数据方的第二样本集合的拆分得到,所述第二样本集合中的训练样本与本地的第一样本集合中具有标签的训练样本具有对应关系;
    基于所述第三样本集合对应的掩码矩阵,计算所述第三样本集合对应的噪声矩阵;其中,所述噪声矩阵由与所述第三样本集合中的每个训练样本对应的噪音量构成,所述噪音量用于加噪处理;
    确定所述第三样本集合对应的残差向量,并将所述残差向量与所述第三样本集合对应的噪声矩阵的乘积,确定为所述第三样本集合对应的加噪残差向量;其中,所述残差向量中包括所述第三样本集合中的训练样本的标签值与当前预测值之间的差值;
    将所述第三样本集合对应的加噪残差向量发送至所述第二数据方;其中,所述第二数据方用于基于所述加噪残差向量计算梯度向量,并基于所述梯度向量更新所述第二数据方对应的模型参数,得到所述第二数据方对应的更新后模型参数。
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述第三样本集合对应的掩码矩阵,计算所述第三样本集合对应的噪声矩阵,包括:
    计算所述第三样本集合对应的掩码矩阵与所述掩码矩阵的转置矩阵的乘积;
    将单位矩阵与所述乘积的差值,确定为所述第三样本集合对应的噪声矩阵。
  3. 根据权利要求1所述的方法,其特征在于,所述确定所述第三样本集合对应的残差向量,包括:
    从所述第一样本集合中确定与所述第二样本集合中的第二训练样本具有对应关系的第一训练样本;
    基于所述第一训练样本对应的线性预测器、所述第二训练样本对应的线性预测器以及所述第一训练样本对应的标签值,确定所述第一训练样本对应的当前残差;其中,所述第二训练样本对应的线性预测器由所述第二数据方确定并发送至第一数据方;
    基于所述第一训练样本对应的当前残差,确定所述第一样本集合对应的残差向量;
    从所述第一样本集合对应的残差向量中,确定所述第三样本集合对应的残差向量。
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述第三样本集合为基于样本标识对所述第二数据方的第二样本集合进行拆分得到。
  5. 根据权利要求1所述的方法,其特征在于,所述第三样本集合中包括多媒体数据训练样本、音频数据训练样本、视频数据训练样本、图像数据训练样本、文本数据训练样本中的一种或者多种组合。
  6. 一种纵向联邦学习方法,其特征在于,所述方法包括:
    基于本地的第二样本集合确定第三样本集合,并计算所述第三样本集合对应的掩码矩阵;
    将所述第三样本集合对应的掩码矩阵发送至纵向联邦学习系统中的第一数据方;其中,所述第一数据方用于基于所述掩码矩阵确定所述第三样本集合对应的加噪残差向量,所述第一数据方内存储的第一 样本集合中包括具有标签的训练样本,所述第一样本集合中具有标签的训练样本与所述第二样本集合中的训练样本具有对应关系;
    获取来自所述第一数据方的所述加噪残差向量,并基于所述加噪残差向量计算梯度向量;
    基于所述梯度向量更新本地的模型参数,得到更新后模型参数。
  7. 根据权利要求6所述的方法,其特征在于,所述基于本地的第二样本集合确定第三样本集合,包括:
    基于样本标识对本地的第二样本集合进行拆分,得到第三样本集合。
  8. 根据权利要求7所述的方法,其特征在于,所述基于样本标识对本地的第二样本集合进行拆分,得到第三样本集合,包括:
    基于样本标识对本地的第二样本集合中的训练样本进行排序,得到排序后的第二样本集合;
    对所述排序后的第二样本集合进行拆分,得到第三样本集合。
  9. 根据权利要求6-8中任一项所述的方法,其特征在于,所述计算所述第三样本集合对应的掩码矩阵,包括:
    为所述第三样本集合对应的矩阵执行QR分解,得到Q矩阵和R矩阵;其中,所述Q矩阵和R矩阵的乘积为所述第三样本集合对应的矩阵,所述Q矩阵的行和列的数量相同,且等于所述第三样本集合对应的矩阵的行数量;
    将所述Q矩阵的前m列去除后,从所述Q矩阵中获取g列构成所述第三样本集合对应的掩码矩阵;其中,m为所述第三样本集合对应的矩阵的列数量,g为预设正整数。
  10. 一种纵向联邦学习系统,其特征在于,所述纵向联邦学习系统包括第一数据方和至少一个第二数据方,所述第一数据方的第一样本集合中具有标签的训练样本与所述第二数据方的第二样本集合中的训练样本具有对应关系;
    所述第二数据方,用于基于所述第二样本集合确定第三样本集合,并计算所述第三样本集合对应的掩码矩阵,以及将所述第三样本集合对应的掩码矩阵发送至所述第一数据方;
    所述第一数据方,用于基于所述第三样本集合对应的掩码矩阵,计算所述第三样本集合对应的噪声矩阵,确定所述第三样本集合对应的残差向量,并将所述残差向量与所述第三样本集合对应的噪声矩阵的乘积,确定为所述第三样本集合对应的加噪残差向量,以及将所述第三样本集合对应的加噪残差向量发送至所述第二数据方;其中,所述噪声矩阵由与所述第三样本集合中的每个训练样本对应的噪音量构成,所述噪音量用于加噪处理,所述残差向量中包括所述第三样本集合中的训练样本的标签值与当前预测值之间的差值;
    所述第二数据方,还用于基于所述加噪残差向量计算梯度向量,并基于所述梯度向量更新本地的模型参数,得到所述第二数据方对应的更新后模型参数。
  11. 一种纵向联邦学习装置,其特征在于,所述装置包括:
    第一接收模块,用于接收纵向联邦学习系统中的第二数据方发送的与第三样本集合对应的掩码矩阵;其中,所述第三样本集合为基于对所述第二数据方的第二样本集合的拆分得到,所述第二样本集合中的训练样本与本地的第一样本集合中具有标签的训练样本具有对应关系;
    第一计算模块,用于基于所述第三样本集合对应的掩码矩阵,计算所述第三样本集合对应的噪声矩阵;其中,所述噪声矩阵由与所述第三样本集合中的每个训练样本对应的噪音量构成,所述噪音量用于加噪处理;
    第一确定模块,用于确定所述第三样本集合对应的残差向量,并将所述残差向量与所述第三样本集合对应的噪声矩阵的乘积,确定为所述第三样本集合对应的加噪残差向量;其中,所述残差向量中包括所述第三样本集合中的训练样本的标签值与当前预测值之间的差值;
    第一发送模块,用于将所述第三样本集合对应的加噪残差向量发送至所述第二数据方;其中,所述第二数据方用于基于所述加噪残差向量计算梯度向量,并基于所述梯度向量更新所述第二数据方对应的模型参数,得到所述第二数据方对应的更新后模型参数。
  12. 一种纵向联邦学习装置,其特征在于,所述装置包括:
    第二确定模块,用于基于本地的第二样本集合确定第三样本集合;
    第二计算模块,用于计算所述第三样本集合对应的掩码矩阵;
    第二发送模块,用于将所述第三样本集合对应的掩码矩阵发送至纵向联邦学习系统中的第一数据方;其中,所述第一数据方用于基于所述掩码矩阵确定所述第三样本集合对应的加噪残差向量,所述第一数据方内存储的第一样本集合中包括具有标签的训练样本,所述第一样本集合中具有标签的训练样本与所述第二样本集合中的训练样本具有对应关系;
    第三计算模块,用于获取来自所述第一数据方的所述加噪残差向量,并基于所述加噪残差向量计算梯度向量;
    更新模块,用于基于所述梯度向量更新本地的模型参数,得到更新后模型参数。
  13. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现如权利要求1-9任一项所述的方法。
  14. 一种纵向联邦学习设备,其特征在于,包括:存储器,处理器,及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如权利要求1-9任一项所述的方法。
  15. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现如权利要求1-9任一项所述的方法。
PCT/CN2023/077525 2022-03-15 2023-02-22 一种纵向联邦学习方法、装置、系统、设备及存储介质 WO2023174018A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210253437.0A CN114611128B (zh) 2022-03-15 2022-03-15 一种纵向联邦学习方法、装置、系统、设备及存储介质
CN202210253437.0 2022-03-15

Publications (1)

Publication Number Publication Date
WO2023174018A1 true WO2023174018A1 (zh) 2023-09-21

Family

ID=81862678

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/077525 WO2023174018A1 (zh) 2022-03-15 2023-02-22 一种纵向联邦学习方法、装置、系统、设备及存储介质

Country Status (2)

Country Link
CN (1) CN114611128B (zh)
WO (1) WO2023174018A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117077816A (zh) * 2023-10-13 2023-11-17 杭州金智塔科技有限公司 联邦模型的训练方法及系统

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114611128B (zh) * 2022-03-15 2023-06-06 抖音视界有限公司 一种纵向联邦学习方法、装置、系统、设备及存储介质
CN115422574A (zh) * 2022-08-15 2022-12-02 中国银联股份有限公司 一种数据处理方法、装置、电子设备及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112132293A (zh) * 2020-09-30 2020-12-25 腾讯科技(深圳)有限公司 纵向联邦学习中的计算方法、装置、设备及介质
CN112149171A (zh) * 2020-10-27 2020-12-29 腾讯科技(深圳)有限公司 联邦神经网络模型的训练方法、装置、设备及存储介质
CN112182594A (zh) * 2019-07-02 2021-01-05 北京百度网讯科技有限公司 一种数据加密方法及装置
CN112199702A (zh) * 2020-10-16 2021-01-08 鹏城实验室 一种基于联邦学习的隐私保护方法、存储介质及系统
CN112906912A (zh) * 2021-04-01 2021-06-04 深圳市洞见智慧科技有限公司 纵向联邦学习中无可信第三方的回归模型训练方法及系统
US20210374605A1 (en) * 2020-05-28 2021-12-02 Samsung Electronics Company, Ltd. System and Method for Federated Learning with Local Differential Privacy
CN114611128A (zh) * 2022-03-15 2022-06-10 北京字节跳动网络技术有限公司 一种纵向联邦学习方法、装置、系统、设备及存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10395180B2 (en) * 2015-03-24 2019-08-27 International Business Machines Corporation Privacy and modeling preserved data sharing
CN111260061B (zh) * 2020-03-09 2022-07-19 厦门大学 联邦学习梯度交换中的差异化加噪方法及系统
CN111178547B (zh) * 2020-04-10 2020-07-17 支付宝(杭州)信息技术有限公司 一种基于隐私数据进行模型训练的方法及系统
CN111241570B (zh) * 2020-04-24 2020-07-17 支付宝(杭州)信息技术有限公司 保护数据隐私的双方联合训练业务预测模型的方法和装置
CN112257876B (zh) * 2020-11-15 2021-07-30 腾讯科技(深圳)有限公司 联邦学习方法、装置、计算机设备及介质
CN113011587B (zh) * 2021-03-24 2022-05-10 支付宝(杭州)信息技术有限公司 一种隐私保护的模型训练方法和系统

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112182594A (zh) * 2019-07-02 2021-01-05 北京百度网讯科技有限公司 一种数据加密方法及装置
US20210374605A1 (en) * 2020-05-28 2021-12-02 Samsung Electronics Company, Ltd. System and Method for Federated Learning with Local Differential Privacy
CN112132293A (zh) * 2020-09-30 2020-12-25 腾讯科技(深圳)有限公司 纵向联邦学习中的计算方法、装置、设备及介质
CN112199702A (zh) * 2020-10-16 2021-01-08 鹏城实验室 一种基于联邦学习的隐私保护方法、存储介质及系统
CN112149171A (zh) * 2020-10-27 2020-12-29 腾讯科技(深圳)有限公司 联邦神经网络模型的训练方法、装置、设备及存储介质
CN112906912A (zh) * 2021-04-01 2021-06-04 深圳市洞见智慧科技有限公司 纵向联邦学习中无可信第三方的回归模型训练方法及系统
CN114611128A (zh) * 2022-03-15 2022-06-10 北京字节跳动网络技术有限公司 一种纵向联邦学习方法、装置、系统、设备及存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117077816A (zh) * 2023-10-13 2023-11-17 杭州金智塔科技有限公司 联邦模型的训练方法及系统
CN117077816B (zh) * 2023-10-13 2024-03-29 杭州金智塔科技有限公司 联邦模型的训练方法及系统

Also Published As

Publication number Publication date
CN114611128A (zh) 2022-06-10
CN114611128B (zh) 2023-06-06

Similar Documents

Publication Publication Date Title
WO2023174018A1 (zh) 一种纵向联邦学习方法、装置、系统、设备及存储介质
US20210004718A1 (en) Method and device for training a model based on federated learning
WO2022089256A1 (zh) 联邦神经网络模型的训练方法、装置、设备、计算机程序产品及计算机可读存储介质
CN112733967B (zh) 联邦学习的模型训练方法、装置、设备及存储介质
CN114401079B (zh) 多方联合信息价值计算方法、相关设备及存储介质
CN111475854B (zh) 保护两方数据隐私的协同计算方法及系统
WO2022257730A1 (zh) 实现隐私保护的多方协同更新模型的方法、装置及系统
Liu et al. Secure multi-label data classification in cloud by additionally homomorphic encryption
WO2022072415A1 (en) Privacy preserving machine learning using secure multi-party computation
CN116049909B (zh) 联邦特征工程中的特征筛选方法、装置、设备及存储介质
Li et al. Practical privacy-preserving federated learning in vehicular fog computing
CN112149706A (zh) 模型训练方法、装置、设备和介质
CN112948885A (zh) 实现隐私保护的多方协同更新模型的方法、装置及系统
CN114282692A (zh) 一种纵向联邦学习的模型训练方法及系统
CN114492850A (zh) 基于联邦学习的模型训练方法、设备、介质及程序产品
CN113792890A (zh) 一种基于联邦学习的模型训练方法及相关设备
CN116743376A (zh) 基于高效密文混淆技术的多方秘密分享数据隐私比较方法
CN112149141A (zh) 模型训练方法、装置、设备和介质
WO2022218033A1 (zh) 一种数据处理的方法和装置
CN114338017B (zh) 一种基于秘密分享的排序方法和系统
Xie et al. Efficient integer vector homomorphic encryption using deep learning for neural networks
CN111784078B (zh) 一种针对决策树的分布式预测方法和系统
Mishra et al. Efficient collusion resistant multi-secret image sharing
CN113657685A (zh) 联邦模型的训练方法、装置、设备、存储介质及程序
Pang et al. A gradient‐free distributed optimization method for convex sum of nonconvex cost functions

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23769526

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18566927

Country of ref document: US