WO2022007651A1 - 数据保护方法、装置、服务器和介质 - Google Patents

数据保护方法、装置、服务器和介质 Download PDF

Info

Publication number
WO2022007651A1
WO2022007651A1 PCT/CN2021/102488 CN2021102488W WO2022007651A1 WO 2022007651 A1 WO2022007651 A1 WO 2022007651A1 CN 2021102488 W CN2021102488 W CN 2021102488W WO 2022007651 A1 WO2022007651 A1 WO 2022007651A1
Authority
WO
WIPO (PCT)
Prior art keywords
sample
gradient
target sample
target
label
Prior art date
Application number
PCT/CN2021/102488
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 北京字节跳动网络技术有限公司
Priority to JP2022555056A priority Critical patent/JP7354463B2/ja
Priority to EP21836952.8A priority patent/EP4083839A4/en
Publication of WO2022007651A1 publication Critical patent/WO2022007651A1/zh
Priority to US17/816,250 priority patent/US11755691B2/en

Links

Images

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/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
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/217Validation; Performance evaluation; Active pattern learning techniques
    • G06F18/2193Validation; Performance evaluation; Active pattern learning techniques based on specific statistical tests
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/09Supervised learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/091Active learning

Definitions

  • the embodiments of the present application relate to the field of computer technologies, and in particular, to a data protection method, apparatus, server, and medium.
  • the embodiments of the present application propose a data protection method, apparatus, server, and medium.
  • an embodiment of the present application provides a data protection method, the method includes: acquiring gradient correlation information corresponding to a target sample and a reference sample belonging to the same batch as the target sample, wherein the sample set to which the target sample belongs belongs to A two-class sample set with an uneven distribution; according to the comparison result of the gradient correlation information corresponding to the target sample and the gradient correlation information corresponding to the reference sample, the information of the data noise to be added is generated; according to the information of the data noise to be added, the target sample corresponds to The initial gradient transfer value is modified to generate revised gradient transfer information, so that the gradient transfer information corresponding to samples belonging to different categories in the sample set is consistent, where the initial gradient transfer value is used to indicate that the trained joint is adjusted according to the target sample.
  • Train the model send the gradient transfer information to the passive participants of the joint training model, so that the passive participants adjust the parameters of the joint training model according to the gradient transfer information.
  • the above-mentioned gradient correlation information includes a sample label and a sample prediction probability used to characterize the sample category, and the sample prediction probability is used to characterize the probability that the sample obtained by jointly training the model is predicted to be a preset category label, and the preset category
  • the label includes the sample label with a small proportion in the sample set, and the reference sample includes the sample whose predicted probability of the sample meets the preset probability condition and the sample label is consistent with the preset category label;
  • the comparison result of the correlation information generates the information of the data noise to be added, including: generating the standard deviation of the data noise to be added matching the target sample according to whether the sample label corresponding to the target sample is consistent with the preset category label.
  • generating the standard deviation of the data noise to be added that matches the target sample according to whether the sample label corresponding to the target sample is consistent with the preset category label includes: in response to determining that the sample label corresponding to the target sample is the same as the preset category label. Assuming that the class labels are consistent and the sample prediction probability corresponding to the target sample is greater than the sample prediction probability of the reference sample, the second standard deviation is generated as the standard deviation of the data noise to be added that matches the target sample, where the second standard deviation corresponds to the target sample.
  • the sample predicted probabilities of are positively correlated.
  • the above-mentioned reference sample includes a sample with the smallest sample prediction probability among the samples in the same batch as the target sample and consistent with the preset category label.
  • the above-mentioned gradient correlation information includes a gradient mode, and the gradient mode is used to indicate the mode of the gradient of the loss function corresponding to the sample to the parameter belonging to the model part of the passive participant; and the above-mentioned gradient correlation information corresponding to the target sample and With reference to the comparison result of the gradient correlation information corresponding to the sample, generating the information of the data noise to be added includes: in response to determining that the gradient mode corresponding to the target sample is smaller than the gradient mode of the reference sample, generating a third standard deviation as the target sample to be matched with the target sample. The standard deviation of the added data noise, where the third standard deviation is negatively correlated with the gradient modulus corresponding to the target sample.
  • the above-mentioned gradient correlation information includes a sample label used to characterize the sample category and a sample prediction probability
  • the above-mentioned sample prediction probability is used to characterize the probability that the sample obtained by jointly training the model is predicted as a preset category label, and the preset
  • the category label includes the sample label with a small proportion in the sample set
  • the reference sample includes the sample whose predicted probability of the sample satisfies the preset probability condition and the sample label is consistent with the preset category label
  • the above-mentioned generating unit is further configured to: according to the sample corresponding to the target sample Whether the label is consistent with the preset category label, the standard deviation of the data noise to be added that matches the target sample is generated.
  • the above-mentioned generating unit is further configured to: in response to determining that the sample label corresponding to the target sample is inconsistent with the preset category label, generate the first standard deviation as the standard deviation of the data noise to be added matching the target sample, The first standard deviation is negatively correlated with the sample prediction probability corresponding to the target sample.
  • the above-mentioned generating unit is further configured to: in response to determining that the sample label corresponding to the target sample is consistent with the preset category label and the sample predicted probability corresponding to the target sample is greater than the sample predicted probability of the reference sample, generate the second standard deviation As the standard deviation of the data noise to be added that matches the target sample, the second standard deviation is positively correlated with the sample prediction probability corresponding to the target sample.
  • the above-mentioned reference sample includes a sample with the smallest sample prediction probability among the samples in the same batch as the target sample and consistent with the preset category label.
  • the reference sample includes a sample with the largest gradient modulus among samples in the same batch as the target sample.
  • an embodiment of the present application provides a server, the server includes: one or more processors; a storage device on which one or more programs are stored; when one or more programs are processed by one or more The processor executes such that the one or more processors implement the method as described in any one of the implementations of the first aspect.
  • the data protection method, device, server, and medium provided by the embodiments of the present application obtain gradient correlation information corresponding to a target sample and a reference sample belonging to the same batch as the target sample, wherein the sample set to which the target sample belongs belongs to an uneven distribution According to the comparison result of the gradient correlation information corresponding to the target sample and the gradient correlation information corresponding to the reference sample, the information of the data noise to be added is generated; the initial gradient corresponding to the target sample is determined according to the information of the data noise to be added.
  • the transfer value is corrected, and the corrected gradient transfer information is generated, so that the gradient transfer information corresponding to the samples belonging to different categories in the sample set is consistent, wherein the initial gradient transfer value is used to indicate that the joint training model trained is adjusted according to the target sample;
  • the gradient transfer information is sent to the passive participants of the joint training model, so that the passive participants adjust the parameters of the joint training model according to the gradient transfer information.
  • FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present application may be applied;
  • FIG. 2 is a flowchart of an embodiment of a data protection method according to the present application.
  • FIG. 3 is a schematic diagram of an application scenario of a data protection method according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an embodiment of a data protection device according to the present application.
  • FIG. 6 is a schematic structural diagram of an electronic device suitable for implementing embodiments of the present application.
  • the servers 101 and 102 can interact through the network 103 to receive or send messages and the like.
  • Servers 101 and 102 may be servers belonging to different participants of the joint training model.
  • the server 101 described above as a passive participant may be used to train the subsection 1041 of the joint training model.
  • the sub-section 1041 of the above joint training model may be used to convert training samples input by the joint training model into feature representations (embedding) 1051 .
  • the output layer of the subsection 1041 of the joint training model described above may include K neurons.
  • the above-mentioned server 101 may send the above-mentioned characteristic representation 1051 to the server 102 as an active participant.
  • Server 102 may be used to train subsection 1042 of the jointly trained model.
  • the subsection 1042 of the above joint training model can be used to convert the feature representation obtained by combining the received feature representation 1051 and the feature representation generated by the active participant into a predicted probability of the input training sample corresponding to the preset label.
  • the above-mentioned active participant may generate the above-mentioned feature representation through feature engineering, or may use a model similar to the sub-part 1041 of the above-mentioned joint training model to generate the above-mentioned feature representation.
  • the server 102 determines gradient related information 1052 using the difference between the obtained probability and the sample label corresponding to the input sample.
  • the data protection method provided in the embodiment of the present application is generally executed by the server 102, and accordingly, the data protection device is generally set in the server 102.
  • the joint training model usually adopts a method of inputting a batch of samples into the initial model for training each time during the training process.
  • the above target samples and reference samples usually belong to the same batch of training samples.
  • the above-mentioned execution body may acquire a pre-stored sample set from a local or communicatively connected electronic device (eg, a database server). Then, the above-mentioned execution body may select a batch of samples from the above-mentioned sample set and input them into the joint training model to be trained, and obtain output results corresponding to each input sample through forward propagation. Then, the above-mentioned execution body determines the gradient correlation information corresponding to each input sample according to the obtained output result.
  • the above-mentioned target sample may be any sample specified in advance, or may be a sample different from the reference sample selected according to a preset rule.
  • the above-mentioned gradient correlation information may include a sample label and a sample prediction probability used to characterize the sample category.
  • the above-mentioned sample prediction probability may be used to represent the probability that the sample obtained by the joint training model is predicted to be a preset category label.
  • the above-mentioned preset category labels may include the sample labels with a small proportion in the above-mentioned unbalanced two-category sample set. As an example, when there are significantly more negative samples (eg, 70%) in the sample set than positive samples (eg, 30%), the above-mentioned preset category label may be information representing positive samples (eg, "+1").
  • the execution subject may generate the standard deviation of the data noise to be added that matches the target sample according to whether the sample label corresponding to the target sample is consistent with the preset category label.
  • the above-mentioned execution body may The standard deviation of the data noise to be added for the target sample match.
  • x can be used to characterize the samples input to the jointly trained model.
  • c is used to characterize the sample labels corresponding to the input samples.
  • y [y 1 , y 2 , . . . , y j ] can be used to characterize the output of the logit model.
  • y i can be used to characterize the label of the input sample is predicted as the logit score of the class label i.
  • the above-mentioned execution body may modify the initial gradient transfer value corresponding to the target sample according to a method consistent with the method of generating the information of the data noise to be added in step 202, and generate the modified gradient transfer information, so that the corresponding gradient transfer information is generated.
  • the gradient transfer information corresponding to samples with different sample labels is consistent.
  • the expectation of the modulo of the gradient transfer information corresponding to the corrected target sample is equal to the expectation of the modulo of the gradient transfer information corresponding to the above reference sample.
  • Step 204 Send the gradient transfer information to the passive participants of the joint training model.
  • FIG. 3 is a schematic diagram of an application scenario of the data protection method according to an embodiment of the present application.
  • the user browses the article presented by application A through a terminal device (eg 3011, 3012, 3013 in Fig. 3), and jumps to the commodity information presented by application B by clicking the link in the article .
  • Terminal devices (for example, 3011, 3012, and 3013 in FIG. 3 ) communicate with the background servers 303 and 304 of application programs A and B through the network 302 .
  • the background server 303 obtains the user information through the client of the application A, and obtains the feature 305 of the user a by using the joint training model part stored locally.
  • the information of the data noise to be added is determined by the gradient correlation information corresponding to the target sample and the reference sample, and the generated data noise is used to correct the initial gradient transfer value, ensuring the positive and negative
  • the corrected gradient corresponding to the sample transmits the consistency of information, thus effectively protecting data security.
  • the process 400 of the data protection method includes the following steps:
  • Step 401 Obtain the gradient correlation information corresponding to the target sample and the reference sample belonging to the same batch as the target sample respectively.
  • the execution body of the data protection method may acquire the above-mentioned gradient correlation information in a manner consistent with step 201 in the foregoing embodiment.
  • the sample set to which the above target sample belongs usually belongs to a two-category sample set with an uneven distribution.
  • the above-mentioned gradient-related information may include gradient modes.
  • the above-mentioned gradient modulus may be used to indicate the modulus of the gradient of the loss function corresponding to the sample to the parameter belonging to the model part of the above-mentioned passive participant.
  • the above-mentioned reference samples may include samples whose gradient modes satisfy preset gradient conditions.
  • the above-mentioned preset gradient conditions may include, for example, that the gradient modes belong to the top Q of the gradient modes corresponding to the samples in the sample set arranged from high to low.
  • the above-mentioned value of Q can be pre-specified according to the number of samples in each batch (batch size), such as 3, 5, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioethics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Information Transfer Between Computers (AREA)
  • Complex Calculations (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本申请实施例公开了数据保护方法、装置、服务器和介质。该方法的一具体实施方式包括:获取属于分布不均衡的二分类样本集的目标样本和与该目标样本属于同批次的参考样本分别对应的梯度关联信息;根据该目标样本对应的梯度关联信息与该参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息;根据该待添加的数据噪声的信息对该目标样本对应的初始梯度传递值进行修正,以使样本集中属于不同类别的样本所对应的修正后的梯度传递信息一致;将该梯度传递信息发送至联合训练模型的被动参与方。该实施方式使得正负样本对应的修正后的梯度传递信息没有明显差异,从而有力地保护了数据安全。

Description

数据保护方法、装置、服务器和介质
相关申请的交叉引用
本申请基于申请号为202010640985.X、申请日为2020年7月6日、名称为“数据保护方法、装置、服务器和介质”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本申请实施例涉及计算机技术领域,具体涉及数据保护方法、装置、服务器和介质。
背景技术
随着人工智能技术的发展,机器学习取得越来越广泛的应用。近年来,为了保护数据安全和解决数据孤岛的问题,相关的方式通常采用联合训练模型来实现在不暴露原始数据的前提下完成机器学习模型的共同训练。针对有监督机器学习模型,通常将拥有样本标签的一方称为主动参与方(active party),将未拥有样本标签的一方称为被动参与方(passive party)。主动参与方所拥有的样本标签是在联合训练模型中需要进行保护的重要数据之一。
发明内容
本申请实施例提出了数据保护方法、装置、服务器和介质。
第一方面,本申请实施例提供了一种数据保护方法,该方法包括:获取目标样本和与目标样本属于同批次的参考样本分别对应的梯度关联信息,其中,目标样本所属的样本集属于分布不均衡的二分类样本集;根据目标样本对应的梯度关联信息与参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息;根据待添加的数据噪 声的信息对目标样本对应的初始梯度传递值进行修正,生成修正后的梯度传递信息,以使样本集中属于不同类别的样本所对应的梯度传递信息一致,其中,初始梯度传递值用于指示根据目标样本调整所训练的联合训练模型;将梯度传递信息发送至联合训练模型的被动参与方,以使被动参与方根据梯度传递信息调整联合训练模型的参数。
在一些实施例中,上述梯度关联信息包括用于表征样本类别的样本标签和样本预测概率,样本预测概率用于表征样本经过联合训练模型所得到的预测为预设类别标签的概率,预设类别标签包括样本集中占比较小的样本标签,参考样本包括样本预测概率满足预设概率条件且样本标签与预设类别标签一致的样本;以及上述根据目标样本对应的梯度关联信息与参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息,包括:根据目标样本对应的样本标签是否与预设类别标签一致,生成与目标样本匹配的待添加的数据噪声的标准差。
在一些实施例中,上述根据目标样本对应的样本标签是否与预设类别标签一致,生成与目标样本匹配的待添加的数据噪声的标准差,包括:响应于确定目标样本对应的样本标签与预设类别标签不一致,生成第一标准差作为与目标样本匹配的待添加的数据噪声的标准差,其中,第一标准差与目标样本对应的样本预测概率负相关。
在一些实施例中,上述根据目标样本对应的样本标签是否与预设类别标签一致,生成与目标样本匹配的待添加的数据噪声的标准差,包括:响应于确定目标样本对应的样本标签与预设类别标签一致且目标样本对应的样本预测概率大于参考样本的样本预测概率,生成第二标准差作为与目标样本匹配的待添加的数据噪声的标准差,其中,第二标准差与目标样本对应的样本预测概率正相关。
在一些实施例中,上述参考样本包括与目标样本同批次、且与预设类别标签一致的样本中样本预测概率最小的样本。
在一些实施例中,上述梯度关联信息包括梯度模,梯度模用于指示样本对应的损失函数对属于被动参与方的模型部分的参数的梯度的模;以及上述根据目标样本对应的梯度关联信息与参考样本对应的梯 度关联信息的比较结果,生成待添加的数据噪声的信息,包括:响应于确定目标样本对应的梯度模小于参考样本的梯度模,生成第三标准差作为与目标样本匹配的待添加的数据噪声的标准差,其中,第三标准差与目标样本对应的梯度模负相关。
在一些实施例中,上述参考样本包括与目标样本同批次的样本中梯度模最大的样本。
第二方面,本申请实施例提供了一种数据保护装置,该装置包括:获取单元,被配置成获取目标样本和与目标样本属于同批次的参考样本分别对应的梯度关联信息,其中,目标样本所属的样本集属于分布不均衡的二分类样本集;生成单元,被配置成根据目标样本对应的梯度关联信息与参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息;修正单元,被配置成根据待添加的数据噪声的信息对目标样本对应的初始梯度传递值进行修正,生成修正后的梯度传递信息,以使样本集中属于不同类别的样本所对应的梯度传递信息一致,其中,初始梯度传递值用于指示根据目标样本调整所训练的联合训练模型;发送单元,被配置成将梯度传递信息发送至联合训练模型的被动参与方,以使被动参与方根据梯度传递信息调整联合训练模型的参数。
在一些实施例中,上述梯度关联信息包括用于表征样本类别的样本标签和样本预测概率,上述样本预测概率用于表征样本经过联合训练模型所得到的预测为预设类别标签的概率,预设类别标签包括样本集中占比较小的样本标签,参考样本包括样本预测概率满足预设概率条件且样本标签与预设类别标签一致的样本;以及上述生成单元进一步被配置成:根据目标样本对应的样本标签是否与预设类别标签一致,生成与目标样本匹配的待添加的数据噪声的标准差。
在一些实施例中,上述生成单元进一步被配置成:响应于确定目标样本对应的样本标签与预设类别标签不一致,生成第一标准差作为与目标样本匹配的待添加的数据噪声的标准差,其中,第一标准差与目标样本对应的样本预测概率负相关。
在一些实施例中,上述生成单元进一步被配置成:响应于确定目 标样本对应的样本标签与预设类别标签一致且目标样本对应的样本预测概率大于参考样本的样本预测概率,生成第二标准差作为与目标样本匹配的待添加的数据噪声的标准差,其中,第二标准差与目标样本对应的样本预测概率正相关。
在一些实施例中,上述参考样本包括与目标样本同批次、且与预设类别标签一致的样本中样本预测概率最小的样本。
在一些实施例中,上述梯度关联信息包括梯度模,上述梯度模用于指示样本对应的损失函数对属于被动参与方的模型部分的参数的梯度的模;以及上述生成单元进一步被配置成:响应于确定目标样本对应的梯度模小于参考样本的梯度模,生成第三标准差作为与目标样本匹配的待添加的数据噪声的标准差,其中,第三标准差与目标样本对应的梯度模负相关。
在一些实施例中,上述参考样本包括与目标样本同批次的样本中梯度模最大的样本。
第三方面,本申请实施例提供了一种服务器,该服务器包括:一个或多个处理器;存储装置,其上存储有一个或多个程序;当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面中任一实现方式描述的方法。
第四方面,本申请实施例提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时实现如第一方面中任一实现方式描述的方法。
本申请实施例提供的数据保护方法、装置、服务器和介质,通过获取目标样本和与目标样本属于同批次的参考样本分别对应的梯度关联信息,其中,目标样本所属的样本集属于分布不均衡的二分类样本集;根据目标样本对应的梯度关联信息与参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息;根据待添加的数据噪声的信息对目标样本对应的初始梯度传递值进行修正,生成修正后的梯度传递信息,以使样本集中属于不同类别的样本所对应的梯度传递信息一致,其中,初始梯度传递值用于指示根据目标样本调整所训练的联合训练模型;将梯度传递信息发送至联合训练模型的被动参与方, 以使被动参与方根据梯度传递信息调整联合训练模型的参数。从而保证了正负样本对应的修正后的梯度传递信息的一致性,有力地保护了数据安全。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:
图1是本申请的一个实施例可以应用于其中的示例性系统架构图;
图2是根据本申请的数据保护方法的一个实施例的流程图;
图3是根据本申请的实施例的数据保护方法的一个应用场景的示意图;
图4是根据本申请的数据保护方法的又一个实施例的流程图;
图5是根据本申请的数据保护装置的一个实施例的结构示意图;
图6是适于用来实现本申请的实施例的电子设备的结构示意图。
具体实施方式
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
图1示出了可以应用本申请的数据保护方法或数据保护装置的示例性架构100。
如图1所示,系统架构100可以包括终端设备101、102、103,网络104、106和服务器105、107。网络104、106用以分别在终端设备101、102、103和服务器105之间,服务器105和服务器107之间提供通信链路的介质。网络104、106可以包括各种连接类型,例如有 线、无线通信链路或者光纤电缆等等。
服务器101和102之间可以通过网络103交互,以接收或发送消息等。服务器101和102可以是分属于联合训练模型的不同参与方的服务器。作为示例,上述作为被动参与方的服务器101可以用于训练联合训练模型的子部分1041。其中,上述联合训练模型的子部分1041可以用于将联合训练模型输入的训练样本转换为特征表示(embedding)1051。上述联合训练模型的子部分1041的输出层可以包括K个神经元。上述服务器101可以将上述特征表示1051发送至作为主动参与方的服务器102。服务器102可以用于训练联合训练模型的子部分1042。上述联合训练模型的子部分1042可以用于将接收到的特征表示1051和主动参与方所生成的特征表示进行结合后的特征表示转换为预测输入的训练样本对应预设标签的概率。其中,上述主动参与方可以通过特征工程(feature engineering)生成上述特征表示,也可以采用与上述联合训练模型的子部分1041类似的模型来生成上述特征表示。之后,服务器102利用所得到的概率与输入的样本对应的样本标签之间的差异确定梯度相关信息1052。其中,上述梯度相关信息1052例如可以包括预设的损失函数对上述联合训练模型的子部分1041的输出层中各神经元对应的梯度。接下来,服务器102可以将所确定的梯度相关信息1052发送至上述服务器101,以使服务器101根据所得到的梯度相关信息1052调整上述联合训练模型的子部分1041的输出层中各神经元对应的参数。
需要说明的是,上述联合训练模型的子部分1042可以包括隐层(如图1所示的第(L-1)层)、logit模型(如图1所示的第L层)、softmax层。上述预设的损失函数可以包括交叉熵损失函数(Cross Entropy Loss)。
需要说明的是,服务器可以是硬件,也可以是软件。当服务器为硬件时,可以实现成多个服务器组成的分布式服务器集群,也可以实现成单个服务器。当服务器为软件时,可以实现成多个软件或软件模块(例如用来提供分布式服务的软件或软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。
需要说明的是,本申请实施例所提供的数据保护方法一般由服务 器102执行,相应地,数据保护装置一般设置于服务器102中。
应该理解,图1中的服务器和网络的数目仅仅是示意性的。根据实现需要,可以具有任意数目的服务器和网络。
继续参考图2,示出了根据本申请的数据保护方法的一个实施例的流程200。该数据保护方法包括以下步骤:
步骤201,获取目标样本和与目标样本属于同批次的参考样本分别对应的梯度关联信息。
在本实施例中,数据保护方法的执行主体(如图1所示的服务器102)可以通过有线连接方式或者无线连接方式获取目标样本和与目标样本属于同批次的参考样本分别对应的梯度关联信息。其中,上述目标样本所属的样本集通常属于分布不均衡的二分类样本集。上述分布不均衡通常用于表征正负样本的占比不同,尤其适用于占比差别较大的场景(例如正样本比例为25%、负样本比例为75%)。
需要说明的是,联合训练模型在训练过程中通常采用每次将一批(batch)样本输入初始模型进行训练的方式。上述目标样本和参考样本通常属于同一批次的训练样本。
在本实施例中,作为示例,上述执行主体可以从本地或通信连接的电子设备(例如数据库服务器)获取预先存储的样本集合。而后,上述执行主体可以从上述样本集合中选取一批样本输入至待训练的联合训练模型,通过前向传播(Forward Propagation)得到与输入的各样本对应的输出结果。而后,上述执行主体根据所得到的输出结果确定输入的各样本对应的梯度关联信息。其中,上述目标样本可以是预先指定的任意样本,也可以是按照预设规则所选取的与参考样本不同的样本。
在本实施例的一些可选的实现方式中,上述梯度关联信息可以包括用于表征样本类别的样本标签和样本预测概率。其中,上述样本预测概率可以用于表征样本经过上述联合训练模型所得到的预测为预设类别标签的概率。上述预设类别标签可以包括上述分布不均衡的二分类样本集中占比较小的样本标签。作为示例,当样本集中的负样本(例如占比70%)明显多于正样本(例如占比30%)时,上述预设类别标签可以为表征正样本的信息(例如“+1”)。上述参考样本可以包括样本预 测概率满足预设概率条件且样本标签与上述预设类别标签一致的样本。其中,上述预设概率条件例如可以包括样本预测概率属于样本集中样本对应的样本预测概率由低至高排列的前M个。上述M的值可以根据每一批次样本的数目(batch size)而预先指定,例如3、5等。
需要说明的是,由于上述样本集为二分类,因此,当预设类别标签为上述分布不均衡的二分类样本集中占比较大的样本标签时,参考样本可以包括样本预测概率满足预设概率条件且样本标签与上述预设类别标签不一致的样本。其中,上述预设概率条件例如可以包括样本预测概率属于样本集中样本对应的样本预测概率由高至低排列的前N个。上述N的值可以根据每一批次样本的数目(batch size)而预先指定,例如3、5等。两种情形是等价的,后续分析仅以前面第一种情形为例进行具体阐述。
在本实施例的一些可选的实现方式中,基于上述预设类别标签包括上述样本集中占比较小的样本标签,上述参考样本可以包括与上述目标样本同批次、且与上述预设类别标签一致的样本中样本预测概率最小的样本。
步骤202,根据目标样本对应的梯度关联信息与参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息。
在本实施例中,根据步骤201所获取的目标样本对应的梯度关联信息与参考样本对应的梯度关联信息的比较结果,上述执行主体可以通过各种方式生成待添加的数据噪声的信息。其中,上述待添加的数据噪声的信息可以包括统计值。上述统计值通常可以包括但不限于以下至少一项:平均值,方差,标准差。
在本实施例的一些可选的实现方式中,基于上述梯度关联信息包括的用于表征样本类别的样本标签和样本预测概率,以及样本预测概率满足预设概率条件且样本标签与上述预设类别标签一致的参考样本,上述执行主体可以根据目标样本对应的样本标签是否与上述预设类别标签一致,生成与上述目标样本匹配的待添加的数据噪声的标准差。
可选地,响应于确定目标样本对应的样本标签与上述预设类别标 签不一致,上述执行主体可以生成第一标准差作为与上述目标样本匹配的待添加的数据噪声的标准差。
在这些实现方式中,上述第一标准差通常与上述目标样本对应的样本预测概率负相关。作为示例,上述第一标准差可以为
Figure PCTCN2021102488-appb-000001
其中,上述p i可以用于表征上述参考样本对应的样本预测概率。上述p k可以用于表征上述目标样本对应的样本预测概率。
可选地,响应于确定目标样本对应的样本标签与上述预设类别标签一致且上述目标样本对应的样本预测概率大于上述参考样本的样本预测概率,上述执行主体可以生成第二标准差作为与上述目标样本匹配的待添加的数据噪声的标准差。
在这些实现方式中,上述第二标准差通常与上述目标样本对应的样本预测概率正相关。作为示例,上述第二标准差可以为
Figure PCTCN2021102488-appb-000002
其中,上述p i可以用于表征上述参考样本对应的样本预测概率。上述p k可以用于表征上述目标样本对应的样本预测概率。
基于上述可选的实现方式,当所选取的参考样本为与上述预设类别标签一致的样本中样本预测概率最小的样本,则可以对与上述目标样本同批次的、除参考样本之外的所有样本都进行如前述的噪声叠加,从而同批次的样本所对应的梯度传递信息均可以通过一致的方式进行修正,因此同批次的样本所对应的梯度传递信息因叠加噪声所带来的对模型参数调整的影响得以最大程度的抵消,从而实现对模型的训练效果的兼顾。
步骤203,根据待添加的数据噪声的信息对目标样本对应的初始梯度传递值进行修正,生成修正后的梯度传递信息。
在本实施例中,上述执行主体可以首先获取目标样本对应的初始梯度传递值。其中,上述初始梯度传递值可以用于指示根据上述目标样本调整所训练的联合训练模型。即,上述初始梯度传递值可以用于表征联合训练模型的主动参与方向被动参与方传递的、用于调整联合训练模型的参数的依据。作为示例,上述初始梯度传递值可以包括输入的样本对应的利用预设的损失函数对上述联合训练模型的被动参与方所训练的模型的输出层中各神经元对应的梯度(例如图1所示的梯度 相关信息1052)。具体地,上述初始梯度传递值可以通过以下步骤确定:
如图1所描述的联合训练模型的子部分1042,假设采用如公式(1)所示的损失函数:
Figure PCTCN2021102488-appb-000003
其中,x可以用于表征输入联合训练模型的样本。c用于表征与输入的样本对应的样本标签。y=[y 1,y 2,…,y j]可以用于表征logit模型的输出。y i可以用于表征输入的样本的标签被预测为类别标签i的分数(logit score)。
从而,上述损失函数对logit的梯度可以如公式(2)所示:
Figure PCTCN2021102488-appb-000004
则,输入的样本的标签被预测为类别标签i的概率可以如公式(3)所示:
Figure PCTCN2021102488-appb-000005
那么,上述损失函数对上述联合训练模型的被动参与方所训练的模型的子部分1041的输出层中各神经元对应的梯度可以如公式(4)所示:
Figure PCTCN2021102488-appb-000006
在logit模型为二分类的情况下,假设上述类别标签i用于表征正样本,当上述目标样本的样本标签与上述类别标签一致或不一致时,则上述目标样本对应的初始梯度传递值可以分别如公式(5)或公式(6)所示:
Figure PCTCN2021102488-appb-000007
Figure PCTCN2021102488-appb-000008
从而,发明人发现,在分布不均衡样本集中,通过(1-p 1) 2与p 1 2的大小往往可以区分出样本所对应的样本标签。即,正样本的梯度的模会明显大于负样本的梯度的模。
在本实施例中,上述执行主体可以根据与步骤202生成待添加的数据噪声的信息相一致的方法对目标样本对应的初始梯度传递值进行修正,生成修正后的梯度传递信息,以使对应于不同样本标签的样本所对应的梯度传递信息一致。
作为示例,基于待添加的数据噪声符合均值(Mean)为0、标准差(Standard Deviation)为σ的分布,即noise~N(0,σ 2)。其中,上述噪声可以包括但不限于以下至少一项:高斯噪声(Gaussian Noise),均匀分布(Uniform Distribution)噪声。则,上述执行主体可以将目标样本对应的初始梯度传递值g修正为g′=g·(1+noise)作为修正后的梯度传递信息。下面具体说明通过上述修正可以使对应于不同样本标签的样本所对应的梯度传递信息一致:
对于与上述预设类别标签i不一致的目标样本(即负样本)而言,添加符合N(0,σ 2)分布的噪声,其中,以σ的取值为前述第一标准差为例,即
Figure PCTCN2021102488-appb-000009
则:
E(p k 2·(1+σ) 2)=E(p k 2·(1+2σ+σ 2))=E(p k 2·(1+σ 2))=E((1-p i) 2)  (7)
可见,修正后的目标样本对应的梯度传递信息的模的期望与上述参考样本对应的梯度传递信息的模的期望相等。
相应地,对于与上述预设类别标签i一致(即正样本)且对应的样本预测概率大于上述参考样本的样本预测概率的目标样本而言,添加符合N(0,σ 2)分布的噪声,其中,以σ的取值为前述第二标准差为例,即
Figure PCTCN2021102488-appb-000010
则:
E((1-p k) 2·(1+σ) 2)=E((1-p k) 2·(1+2σ+σ 2))=E((1-p k) 2·(1+σ 2))=E((1-p i) 2)   (8)
可见,修正后的目标样本对应的梯度传递信息的模的期望与上述参考样本对应的梯度传递信息的模的期望相等。
步骤204,将梯度传递信息发送至联合训练模型的被动参与方。
在本实施例中,上述执行主体可以将步骤203所得到的梯度传递信息发送至联合训练模型的被动参与方,以使上述被动参与方根据上述梯度传递信息调整上述联合训练模型的参数。作为示例,被动参与 方可以根据上述梯度传递信息,按照链式法则(Chain rule)求导以更新上述被动参与方侧的联合训练模型(例如图1所示的联合训练模型的子部分1041)的参数。
继续参见图3,图3是根据本申请实施例的数据保护方法的应用场景的一个示意图。在图3的应用场景中,用户通过终端设备(例如图3中的3011、3012、3013)浏览应用程序A所呈现的文章,通过点击文章中的链接跳转至应用程序B所呈现的商品信息。终端设备(例如图3中的3011、3012、3013)通过网络302与应用程序A、B的后台服务器303、304通信连接。后台服务器303通过应用程序A的客户端获取用户信息,并利用存储于本地的联合训练模型部分得到用户a特征305。其中,上述用户a特征305通常根据应用程序A所获取的原始数据进行提取。后台服务器304可以根据是否接收到应用程序B的客户端发送的下单请求来生成用于表征正负样本的样本标签。用户b特征306通常根据应用程序B所获取的原始数据进行提取。后台服务器304可以利用存储于本地的联合训练模型部分得到预测为样本标签的概率,并根据各用户信息对应的样本标签和预设的损失函数生成各用户信息对应的初始梯度传递值307。后台服务器304可以根据前述实施例所描述的方式生成各用户信息对应的待添加噪声信息308。之后,后台服务器304可以根据待添加噪声信息308对所生成的初始梯度传递值307进行修正,生成修正后的梯度传递信息309。最后,后台服务器304可以将所生成的修正后的梯度传递信息309发送至后台服务器303,以使后台服务器303根据上述梯度传递信息调整其本地的联合训练模型部分的模型参数。
在实现本申请的过程中,发明人发现,在主动参与方和被动参与方的数据在用户维度上重叠较多而在特征维度上重叠较少的情况下,现有技术所通常使用的损失函数在应用于样本数据分布不均衡的二分类的任务时,通过正样本和负样本所得到的、用于调整联合训练模型的参数的梯度相关信息会产生分化。由于现有技术之一通常是将联合训练模型的主动参与方针对不同训练样本所得到的、用于指示被动参与方调整模型参数的梯度传递值直接发送给被动参与方,导致未加处 理的梯度传递值存在数据安全风险(例如根据所传递的梯度的模的大小来推断正负样本)。而本申请的上述实施例提供的方法,通过目标样本和参考样本对应的梯度关联信息确定待添加的数据噪声的信息,并利用所生成的数据噪声对初始梯度传递值进行修正,保证了正负样本对应的修正后的梯度传递信息的一致性,从而有力地保护了数据安全。
进一步参考图4,其示出了数据保护方法的又一个实施例的流程400。该数据保护方法的流程400,包括以下步骤:
步骤401,获取目标样本和与目标样本属于同批次的参考样本分别对应的梯度关联信息。
在本实施例中,数据保护方法的执行主体(例如图1所示的服务器102)可以按照与前述实施例中步骤201一致的方式获取上述梯度关联信息。其中,上述目标样本所属的样本集通常属于分布不均衡的二分类样本集。上述梯度关联信息可以包括梯度模。上述梯度模可以用于指示样本对应的损失函数对属于上述被动参与方的模型部分的参数的梯度的模。上述参考样本可以包括梯度模满足预设梯度条件的样本。其中,上述预设梯度条件例如可以包括梯度模属于样本集中样本对应的梯度模由高至低排列的前Q个。上述Q的值可以根据每一批次样本的数目(batch size)而预先指定,例如3、5等。
在本实施例的一些可选的实现方式中,上述参考样本可以包括与上述目标样本同批次的样本中梯度模最大的样本。
步骤402,响应于确定目标样本对应的梯度模小于参考样本的梯度模,生成第三标准差作为与目标样本匹配的待添加的数据噪声的标准差。
在本实施例中,响应于确定目标样本对应的梯度模小于上述参考样本的梯度模,上述执行主体可以生成第三标准差作为与目标样本匹配的待添加的数据噪声的标准差。其中,上述第三标准差通常与上述目标样本对应的梯度模负相关。作为示例,当所添加的数据噪声的均值为0时,上述第三标准差可以为
Figure PCTCN2021102488-appb-000011
其中,上述||g i||可以用于表征上述参考样本对应的梯度模。上述||g k||可以用于表征上述目标样本对应的梯度模。
上述第三标准差的具体推导过程可以如公式(9)所示:
Figure PCTCN2021102488-appb-000012
需要说明的是,与前述实施例中步骤402类似,利用上述所生成的数据噪声的标准差,上述执行主体可以使对应于不同样本标签的样本所对应的梯度传递信息一致,此处不再赘述。
基于上述可选的实现方式,当所选取的参考样本为与上述目标样本同批次的样本中梯度模最大的样本,则可以对与上述目标样本同批次的、除参考样本之外的所有样本都进行如前述的噪声叠加,从而同批次的样本所对应的梯度传递信息均可以通过一致的方式进行修正,因此同批次的样本所对应的梯度传递信息因叠加噪声所带来的对模型参数调整的影响得以最大程度的抵消,从而实现对模型的训练效果的兼顾。
步骤403,根据待添加的数据噪声的信息对目标样本的梯度关联信息包括的初始传递数值进行修正,生成包括待传递数值的梯度传递信息。
步骤404,将梯度传递信息发送至联合训练模型的被动参与方。
上述步骤403、步骤404分别与前述实施例中的步骤203、步骤204一致,上文针对步骤203、步骤204的描述也适用于步骤403、步骤404,此处不再赘述。
从图4中可以看出,本实施例中的数据保护方法的流程400体现了根据目标样本和参考样本对应的梯度模确定待添加的数据噪声的信息的步骤。由此,本实施例描述的方案可以无需额外获取样本对应的标签信息和预测概率信息,仅通过梯度模信息即可确定待添加的数据噪声的信息,从而减少了数据传输量,进而提升了模型训练的效率。
进一步参考图5,作为对上述各图所示方法的实现,本申请提供了数据保护装置的一个实施例,该装置实施例与图2或图4所示的方 法实施例相对应,该装置具体可以应用于各种电子设备中。
如图5所示,本实施例提供的数据保护装置500包括获取单元501、生成单元502、修正单元503和发送单元504。其中,获取单元501,被配置成获取目标样本和与目标样本属于同批次的参考样本分别对应的梯度关联信息,其中,目标样本所属的样本集属于分布不均衡的二分类样本集;生成单元502,被配置成根据目标样本对应的梯度关联信息与参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息;修正单元503,被配置成根据待添加的数据噪声的信息对目标样本对应的初始梯度传递值进行修正,生成修正后的梯度传递信息,以使样本集中属于不同类别的样本所对应的梯度传递信息一致,其中,初始梯度传递值用于指示根据目标样本调整所训练的联合训练模型;发送单元504,被配置成将梯度传递信息发送至联合训练模型的被动参与方,以使被动参与方根据梯度传递信息调整联合训练模型的参数。
在本实施例中,数据保护装置500中:获取单元501、生成单元502、修正单元503和发送单元504的具体处理及其所带来的技术效果可分别参考图2或图4对应实施例中的步骤201、步骤202、步骤203和步骤204的相关说明,在此不再赘述。
在本实施例的一些可选的实现方式中,上述梯度关联信息可以包括用于表征样本类别的样本标签和样本预测概率。上述样本预测概率可以用于表征样本经过联合训练模型所得到的预测为预设类别标签的概率。上述预设类别标签可以包括样本集中占比较小的样本标签。上述参考样本可以包括样本预测概率满足预设概率条件且样本标签与预设类别标签一致的样本。上述生成单元502可以进一步被配置成:根据目标样本对应的样本标签是否与预设类别标签一致,生成与目标样本匹配的待添加的数据噪声的标准差。
在本实施例的一些可选的实现方式中,上述生成单元502可以进一步被配置成:响应于确定目标样本对应的样本标签与预设类别标签不一致,生成第一标准差作为与目标样本匹配的待添加的数据噪声的标准差,其中,第一标准差与目标样本对应的样本预测概率负相关。
在本实施例的一些可选的实现方式中,上述生成单元502可以进一步被配置成:响应于确定目标样本对应的样本标签与预设类别标签一致且目标样本对应的样本预测概率大于参考样本的样本预测概率,生成第二标准差作为与目标样本匹配的待添加的数据噪声的标准差,其中,第二标准差与目标样本对应的样本预测概率正相关。
在本实施例的一些可选的实现方式中,上述参考样本可以包括与目标样本同批次、且与预设类别标签一致的样本中样本预测概率最小的样本。
在本实施例的一些可选的实现方式中,上述梯度关联信息可以包括梯度模。上述梯度模可以用于指示样本对应的损失函数对属于被动参与方的模型部分的参数的梯度的模。上述生成单元502可以进一步被配置成:响应于确定目标样本对应的梯度模小于参考样本的梯度模,生成第三标准差作为与目标样本匹配的待添加的数据噪声的标准差。其中,上述第三标准差可以与目标样本对应的梯度模负相关。
在本实施例的一些可选的实现方式中,上述参考样本可以包括与目标样本同批次的样本中梯度模最大的样本。
本申请的上述实施例提供的装置,通过获取单元501获取目标样本和与目标样本属于同批次的参考样本分别对应的梯度关联信息,其中,目标样本所属的样本集属于分布不均衡的二分类样本集;生成单元502根据目标样本对应的梯度关联信息与参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息;修正单元503根据待添加的数据噪声的信息对目标样本对应的初始梯度传递值进行修正,生成修正后的梯度传递信息,以使样本集中属于不同类别的样本所对应的梯度传递信息一致,其中,初始梯度传递值用于指示根据目标样本调整所训练的联合训练模型;发送单元504将梯度传递信息发送至联合训练模型的被动参与方,以使被动参与方根据梯度传递信息调整联合训练模型的参数。从而保证了正负样本对应的修正后的梯度传递信息的一致性,有力地保护了数据安全。
下面参考图6,其示出了适于用来实现本申请实施例的电子设备(例如图1中的服务器)600的结构示意图。图6示出的服务器仅仅是一 个示例,不应对本申请实施例的功能和使用范围带来任何限制。
如图6所示,电子设备600可以包括处理装置(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标等的输入装置606;包括例如液晶显示器(LCD,Liquid Crystal Display)、扬声器、振动器等的输出装置607;包括例如磁带、硬盘等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图6示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。图6中示出的每个方框可以代表一个装置,也可以根据需要代表多个装置。
特别地,根据本申请的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理装置601执行时,执行本申请的实施例的方法中限定的上述功能。
需要说明的是,本申请的实施例所述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、 便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请的实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请的实施例中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(Radio Frequency,射频)等等,或者上述的任意合适的组合。
上述计算机可读介质可以是上述服务器中所包含的;也可以是单独存在,而未装配入该服务器中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该服务器执行时,使得该服务器:获取目标样本和与目标样本属于同批次的参考样本分别对应的梯度关联信息,其中,目标样本所属的样本集属于分布不均衡的二分类样本集;根据目标样本对应的梯度关联信息与参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息;根据待添加的数据噪声的信息对目标样本对应的初始梯度传递值进行修正,生成修正后的梯度传递信息,以使样本集中属于不同类别的样本所对应的梯度传递信息一致,其中,初始梯度传递值用于指示根据目标样本调整所训练的联合训练模型;将梯度传递信息发送至联合训练模型的被动参与方,以使被动参与方根据梯度传递信息调整联合训练模型的参数。
可以以一种或多种程序设计语言或其组合来编写用于执行本申请实施例的操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个 独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本申请的各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器,包括获取单元、生成单元、修正单元和发送单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,获取单元还可以被描述为“获取目标样本和与目标样本属于同批次的参考样本分别对应的梯度关联信息的单元,其中,目标样本所属的样本集属于分布不均衡的二分类样本集”。
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请的实施例中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请实施例中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。

Claims (10)

  1. 一种数据保护方法,包括:
    获取目标样本和与所述目标样本属于同批次的参考样本分别对应的梯度关联信息,其中,所述目标样本所属的样本集属于分布不均衡的二分类样本集;
    根据所述目标样本对应的梯度关联信息与所述参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息;
    根据所述待添加的数据噪声的信息对所述目标样本对应的初始梯度传递值进行修正,生成修正后的梯度传递信息,以使所述样本集中属于不同类别的样本所对应的梯度传递信息一致,其中,所述初始梯度传递值用于指示根据所述目标样本调整所训练的联合训练模型;
    将所述梯度传递信息发送至所述联合训练模型的被动参与方,以使所述被动参与方根据所述梯度传递信息调整所述联合训练模型的参数。
  2. 根据权利要求1所述的方法,其中,所述梯度关联信息包括用于表征样本类别的样本标签和样本预测概率,所述样本预测概率用于表征样本经过所述联合训练模型所得到的预测为预设类别标签的概率,所述预设类别标签包括所述样本集中占比较小的样本标签,所述参考样本包括样本预测概率满足预设概率条件且样本标签与所述预设类别标签一致的样本;以及
    所述根据所述目标样本对应的梯度关联信息与所述参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息,包括:
    根据所述目标样本对应的样本标签是否与所述预设类别标签一致,生成与所述目标样本匹配的待添加的数据噪声的标准差。
  3. 根据权利要求2所述的方法,其中,所述根据所述目标样本对应的样本标签是否与所述预设类别标签一致,生成与所述目标样本匹配的待添加的数据噪声的标准差,包括:
    响应于确定所述目标样本对应的样本标签与所述预设类别标签不一致,生成第一标准差作为与所述目标样本匹配的待添加的数据噪声的标准差,其中,所述第一标准差与所述目标样本对应的样本预测概率负相关。
  4. 根据权利要求2所述的方法,其中,所述根据所述目标样本对应的样本标签是否与所述预设类别标签一致,生成与所述目标样本匹配的待添加的数据噪声的标准差,包括:
    响应于确定所述目标样本对应的样本标签与所述预设类别标签一致且所述目标样本对应的样本预测概率大于所述参考样本的样本预测概率,生成第二标准差作为与所述目标样本匹配的待添加的数据噪声的标准差,其中,所述第二标准差与所述目标样本对应的样本预测概率正相关。
  5. 根据权利要求2-4之一所述的方法,其中,所述参考样本包括与所述目标样本同批次、且与所述预设类别标签一致的样本中样本预测概率最小的样本。
  6. 根据权利要求1所述的方法,其中,所述梯度关联信息包括梯度模,所述梯度模用于指示样本对应的损失函数对属于所述被动参与方的模型部分的参数的梯度的模;以及
    所述根据所述目标样本对应的梯度关联信息与所述参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息,包括:
    响应于确定所述目标样本对应的梯度模小于所述参考样本的梯度模,生成第三标准差作为与所述目标样本匹配的待添加的数据噪声的标准差,其中,所述第三标准差与所述目标样本对应的梯度模负相关。
  7. 根据权利要求6所述的方法,其中,所述参考样本包括与所述目标样本同批次的样本中梯度模最大的样本。
  8. 一种数据保护装置,包括:
    获取单元,被配置成获取目标样本和与所述目标样本属于同批次的参考样本分别对应的梯度关联信息,其中,所述目标样本所属的样 本集属于分布不均衡的二分类样本集;
    生成单元,被配置成根据所述目标样本对应的梯度关联信息与所述参考样本对应的梯度关联信息的比较结果,生成待添加的数据噪声的信息;
    修正单元,被配置成根据所述待添加的数据噪声的信息对所述目标样本对应的初始梯度传递值进行修正,生成修正后的梯度传递信息,以使所述样本集中属于不同类别的样本所对应的梯度传递信息一致,其中,所述初始梯度传递值用于指示根据所述目标样本调整所训练的联合训练模型;
    发送单元,被配置成将所述梯度传递信息发送至所述联合训练模型的被动参与方,以使所述被动参与方根据所述梯度传递信息调整所述联合训练模型的参数。
  9. 一种服务器,包括:
    一个或多个处理器;
    存储装置,其上存储有一个或多个程序;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7中任一所述的方法。
  10. 一种计算机可读介质,其上存储有计算机程序,其中,该程序被处理器执行时实现如权利要求1-7中任一所述的方法。
PCT/CN2021/102488 2020-07-06 2021-06-25 数据保护方法、装置、服务器和介质 WO2022007651A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2022555056A JP7354463B2 (ja) 2020-07-06 2021-06-25 データ保護方法、装置、サーバ及び媒体
EP21836952.8A EP4083839A4 (en) 2020-07-06 2021-06-25 PRIVACY PROTECTION METHOD AND APPARATUS, SERVER AND MEDIUM
US17/816,250 US11755691B2 (en) 2020-07-06 2022-07-29 Data protection method and apparatus, and server and medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010640985.XA CN111783142B (zh) 2020-07-06 2020-07-06 数据保护方法、装置、服务器和介质
CN202010640985.X 2020-07-06

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/816,250 Continuation US11755691B2 (en) 2020-07-06 2022-07-29 Data protection method and apparatus, and server and medium

Publications (1)

Publication Number Publication Date
WO2022007651A1 true WO2022007651A1 (zh) 2022-01-13

Family

ID=72757996

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/102488 WO2022007651A1 (zh) 2020-07-06 2021-06-25 数据保护方法、装置、服务器和介质

Country Status (5)

Country Link
US (1) US11755691B2 (zh)
EP (1) EP4083839A4 (zh)
JP (1) JP7354463B2 (zh)
CN (1) CN111783142B (zh)
WO (1) WO2022007651A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11755691B2 (en) 2020-07-06 2023-09-12 Beijing Bytedance Network Technology Co., Ltd. Data protection method and apparatus, and server and medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112347476B (zh) * 2020-11-13 2024-02-02 脸萌有限公司 数据保护方法、装置、介质及设备
CN113190872A (zh) * 2021-05-28 2021-07-30 脸萌有限公司 数据保护方法、网络结构训练方法、装置、介质及设备
CN113722738B (zh) * 2021-09-02 2023-08-08 脸萌有限公司 数据保护方法、装置、介质及电子设备
CN114091065A (zh) * 2021-11-23 2022-02-25 脸萌有限公司 用于保护敏感数据的方法、设备、装置和介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6680735B1 (en) * 2000-10-04 2004-01-20 Terarecon, Inc. Method for correcting gradients of irregular spaced graphic data
CN108416370A (zh) * 2018-02-07 2018-08-17 深圳大学 基于半监督深度学习的图像分类方法、装置和存储介质
CN109165515A (zh) * 2018-08-10 2019-01-08 深圳前海微众银行股份有限公司 基于联邦学习的模型参数获取方法、系统及可读存储介质
CN109919299A (zh) * 2019-02-19 2019-06-21 西安交通大学 一种基于元学习器逐步梯度校正的元学习算法
CN111783142A (zh) * 2020-07-06 2020-10-16 北京字节跳动网络技术有限公司 数据保护方法、装置、服务器和介质

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10755172B2 (en) * 2016-06-22 2020-08-25 Massachusetts Institute Of Technology Secure training of multi-party deep neural network
US11062215B2 (en) 2017-03-17 2021-07-13 Microsoft Technology Licensing, Llc Using different data sources for a predictive model
CN109388661B (zh) * 2017-08-02 2020-04-21 创新先进技术有限公司 一种基于共享数据的模型训练方法及装置
US10743147B2 (en) 2017-10-30 2020-08-11 Apple Inc. Expanded implementation of enhanced broadcast multicast services for broadcast multicast content selection and service
US11475350B2 (en) * 2018-01-22 2022-10-18 Google Llc Training user-level differentially private machine-learned models
CN109684855B (zh) * 2018-12-17 2020-07-10 电子科技大学 一种基于隐私保护技术的联合深度学习训练方法
US10878298B2 (en) * 2019-03-06 2020-12-29 Adobe Inc. Tag-based font recognition by utilizing an implicit font classification attention neural network
CN110390206A (zh) * 2019-04-19 2019-10-29 江苏慧中数据科技有限公司 边云系统框架下具有隐私保护的梯度下降加速算法
CN110443063B (zh) * 2019-06-26 2023-03-28 电子科技大学 自适性保护隐私的联邦深度学习的方法
CN110728375B (zh) * 2019-10-16 2021-03-19 支付宝(杭州)信息技术有限公司 多个计算单元联合训练逻辑回归模型的方法和装置
CN110797124B (zh) * 2019-10-30 2024-04-12 腾讯科技(深圳)有限公司 一种模型多端协同训练方法、医疗风险预测方法和装置
CN111260061B (zh) * 2020-03-09 2022-07-19 厦门大学 联邦学习梯度交换中的差异化加噪方法及系统
CN111008709A (zh) * 2020-03-10 2020-04-14 支付宝(杭州)信息技术有限公司 联邦学习、资料风险评估方法、装置和系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6680735B1 (en) * 2000-10-04 2004-01-20 Terarecon, Inc. Method for correcting gradients of irregular spaced graphic data
CN108416370A (zh) * 2018-02-07 2018-08-17 深圳大学 基于半监督深度学习的图像分类方法、装置和存储介质
CN109165515A (zh) * 2018-08-10 2019-01-08 深圳前海微众银行股份有限公司 基于联邦学习的模型参数获取方法、系统及可读存储介质
CN109919299A (zh) * 2019-02-19 2019-06-21 西安交通大学 一种基于元学习器逐步梯度校正的元学习算法
CN111783142A (zh) * 2020-07-06 2020-10-16 北京字节跳动网络技术有限公司 数据保护方法、装置、服务器和介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11755691B2 (en) 2020-07-06 2023-09-12 Beijing Bytedance Network Technology Co., Ltd. Data protection method and apparatus, and server and medium

Also Published As

Publication number Publication date
EP4083839A4 (en) 2023-10-25
EP4083839A1 (en) 2022-11-02
JP7354463B2 (ja) 2023-10-02
US11755691B2 (en) 2023-09-12
CN111783142A (zh) 2020-10-16
US20220383054A1 (en) 2022-12-01
CN111783142B (zh) 2021-10-08
JP2023518015A (ja) 2023-04-27

Similar Documents

Publication Publication Date Title
WO2022007651A1 (zh) 数据保护方法、装置、服务器和介质
CN112347476B (zh) 数据保护方法、装置、介质及设备
EP3855365A1 (en) Distributed neural network model training
CN111401558A (zh) 数据处理模型训练方法、数据处理方法、装置、电子设备
CN113627085B (zh) 横向联邦学习建模优化方法、设备、介质
WO2020042884A1 (zh) 用于物联网设备间的数据传输方法、系统和电子设备
CN114186256B (zh) 神经网络模型的训练方法、装置、设备和存储介质
CN112434620B (zh) 场景文字识别方法、装置、设备和计算机可读介质
CN114462532A (zh) 模型训练方法、预测交易风险的方法、装置、设备及介质
CN114612688A (zh) 对抗样本生成方法、模型训练方法、处理方法及电子设备
CN110825589A (zh) 用于微服务系统的异常检测方法及其装置和电子设备
JP2022544827A (ja) プライバシー保護を備えた分散型機械学習
US11934581B2 (en) Terminal vibration evaluation method and apparatus in game scenario, medium, and device
WO2020006962A1 (zh) 用于处理图片的方法和装置
WO2020052120A1 (zh) 用于处理图像的特征点的方法和装置
CN111680754B (zh) 图像分类方法、装置、电子设备及计算机可读存储介质
CN114595474A (zh) 联邦学习建模优化方法、电子设备、介质及程序产品
WO2022206092A1 (zh) 基于量子核方法的图像分类方法、装置、服务器和系统
CN116910630B (zh) 用户识别信息存储方法、装置、电子设备和介质
CN113807530B (zh) 信息处理系统、方法和装置
CN117593263A (zh) 图像篡改检测方法、装置、存储介质以及电子设备
WO2023124312A1 (zh) 联合学习中的预测方法及装置
WO2023226064A1 (zh) 椭圆定位数据处理方法、装置、设备、介质和程序产品
CN116644346A (zh) 模型训练方法、分类信息生成方法、装置、设备和介质
CN114170479A (zh) 扰动生成模型的训练方法和装置

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: 21836952

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021836952

Country of ref document: EP

Effective date: 20220729

ENP Entry into the national phase

Ref document number: 2022555056

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE