WO2021022717A1 - 联邦学习中特征相关性分析方法、装置及可读存储介质 - Google Patents

联邦学习中特征相关性分析方法、装置及可读存储介质 Download PDF

Info

Publication number
WO2021022717A1
WO2021022717A1 PCT/CN2019/119231 CN2019119231W WO2021022717A1 WO 2021022717 A1 WO2021022717 A1 WO 2021022717A1 CN 2019119231 W CN2019119231 W CN 2019119231W WO 2021022717 A1 WO2021022717 A1 WO 2021022717A1
Authority
WO
WIPO (PCT)
Prior art keywords
column
feature
party
sample
target
Prior art date
Application number
PCT/CN2019/119231
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 WO2021022717A1 publication Critical patent/WO2021022717A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/10Machine learning using kernel methods, e.g. support vector machines [SVM]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the field of machine learning, in particular to a method, device and readable storage medium for analyzing feature correlation in federated learning.
  • Federated Learning is an emerging basic artificial intelligence technology. Its design goal is to ensure information security during big data exchange, protect terminal data and personal data privacy, and ensure legal compliance. Or develop high-efficiency machine learning among multiple computing nodes.
  • the main purpose of this application is to provide a feature correlation analysis method, device and readable storage medium in federated learning, aiming to realize feature correlation analysis in federated learning.
  • this application provides a feature correlation analysis method in federated learning.
  • the method includes the following steps:
  • the first party determines the correlation coefficient between each column of the first feature in the first party sample and each column of the second feature and a column of labels in the second party sample.
  • each column of second feature vectors and a column of label vectors in the second sample of the second party determine the value of each column of target second feature vector and its corresponding column of target label vector before the steps, include:
  • the first party normalize each column of the first feature in the first party sample to obtain the first sample composed of the first feature vector of each column, and encrypt the first feature vector of each column to obtain Send the first encrypted feature vector of each column to the second party;
  • normalization is performed on each column of second features and a column of labels in the second sample to obtain a second sample composed of each column of second feature vectors and a column of label vectors.
  • the second party of the federation determines each column of target second feature vectors and a corresponding column of target label vectors from each column of second feature vectors and a column of label vectors in the second sample of the second party.
  • the steps include:
  • the first encrypted feature vector of each column of the target is determined from the first encrypted feature vector of each column in the first sample of the first party based on the second feature vector of each column of targets, wherein the first sample and the The steps for the second sample to have the same user dimension include:
  • the first encrypted feature vector corresponding to the second feature vector of each column is searched from the first encrypted feature vector of each column after the arrangement order is shuffled to obtain the target first encrypted feature vector of each column.
  • each target second feature vector in each column of target second feature vectors and each target label vector in a column of target label vectors are respectively determined to correspond to each target in each column of target first encrypted feature vector
  • the first encrypting the target inner product of the feature vector to obtain the target inner product of each group, and the steps of sending the target inner product of each group to the first party include:
  • White noise is added to the inner product of each group to obtain the target inner product of each group.
  • the correlation between each column of the first feature in the first party sample and each column of the second feature and a column of labels in the second party sample is determined according to the inner product of each group of targets
  • the steps of the coefficient include:
  • the average value of each group of target inner products after decryption is obtained, and the correlation coefficient between each column of the first feature in the first sample and each column of the second feature and a column of labels in the second sample is obtained.
  • the correlation between each column of the first feature in the first party sample and each column of the second feature and a column of labels in the second party sample is determined according to the inner product of each group of targets After the coefficient steps, include:
  • the target column whose correlation coefficient between each column of the first feature in the first sample and each column of the second feature in the second sample and the correlation coefficient with a column of labels in the second sample is higher than the preset threshold
  • the feature is sent to the second party.
  • this application provides a feature correlation analysis method in federated learning, and the method includes:
  • the encrypted inner product of every two columns of the first feature vector in the first sample of the first party is calculated to obtain each group of encrypted inner products, and each group The encrypted inner product is sent to the second party;
  • the correlation coefficients between every two columns of the first feature in the first sample and every two columns of the second feature in the second sample are determined.
  • the step of determining the correlation coefficients of every two columns of the first feature in the first party sample and every two columns of the second feature in the same column of the second party sample according to the results of each set of calculations includes :
  • the average value of each group of operation results after decryption is obtained, and the correlation coefficients of the first feature in every two columns in the first sample and the second feature in the same column in every two samples in the second sample are obtained.
  • the present application also provides a feature correlation analysis device in federated learning.
  • the feature correlation analysis device in federated learning includes a processor, a memory, and stored in the memory and can be used by the The traffic data visualization program executed by the processor, wherein the computer-readable instructions are executed by the processor to realize the steps of the feature correlation analysis method in the federated learning as described above.
  • the present application also provides a readable storage medium having computer readable instructions stored on the readable storage medium, and when the computer readable instructions are executed by a processor, the federal Learning the steps of feature correlation analysis method.
  • This application provides a feature correlation analysis method, device, and readable storage medium in federated learning.
  • a feature correlation calculation instruction of a longitudinal scene is received, in the second party, from each of the second samples of the second party Determine the second feature vector of each column of target and its corresponding column of target label vector from the column of second feature vector and column of label vector; and, based on the column of target second feature vector, from each of the first sample In the column of the first encrypted feature vector, determine the first encrypted feature vector of each column target, wherein the first sample and the second sample have the same user dimension; and respectively determine the target second feature vector of each column
  • the target inner product of each target second feature vector and each target label vector in a list of target label vectors and each target first encrypted feature vector corresponding to each column of target first encrypted feature vector to obtain each set of target inner products Send each set of target inner product to the first party; in the first party, according to each set of target inner product, determine the first feature of each column in the first party sample, and the second feature of each column in the second party
  • FIG. 1 is a schematic diagram of the hardware structure of the feature correlation analysis device in the federated learning involved in the embodiment of the present application;
  • FIG. 2 is a schematic flowchart of the first embodiment of the feature correlation analysis method in the federated learning of the application
  • FIG. 3 is a schematic flowchart of a second embodiment of a method for analyzing feature correlation in federated learning under this application.
  • the main solution of the embodiment of the present application is: in the second party, from each column of second feature vectors and a column of label vectors in the second sample of the second party, determine each column of target second feature vector and its corresponding column Target label vector; and, based on the second feature vector of each column of targets, determine the first encrypted feature vector of each column of the target from the first encrypted feature vector in the first sample of the first party, wherein the first The sample and the second sample have the same user dimension; and each target second feature vector in each column of target second feature vectors and each target label vector in a column of target label vectors are determined to be the same as each column of target label vectors.
  • the target inner product of each target first encrypted eigenvector in an encrypted eigenvector is obtained, and each group of target inner product is obtained, and each group of target inner product is sent to the first party; in the first party, according to the target inner product of each group , Determine the correlation coefficients between each column of the first feature in the first sample and each column of the second feature and a column of labels in the second sample.
  • Figure 1 is a schematic diagram of the terminal structure of the hardware operating environment involved in the solution of the embodiment of the present application.
  • the feature correlation analysis method in federated learning involved in the embodiment of the present application can be implemented by a feature correlation analysis device in federated learning.
  • FIG. 1 is a schematic diagram of the hardware structure of the feature correlation analysis device in the federated learning involved in the embodiment of the application.
  • the feature correlation analysis device in federated learning may include a processor 1001 (for example, a central processing unit, a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005.
  • the communication bus 1002 is used to realize the connection and communication between these components;
  • the user interface 1003 may include a display (Display), an input unit such as a keyboard (Keyboard);
  • the network interface 1004 may optionally include a standard wired interface, a wireless interface (Such as WI-FI interface);
  • the memory 1005 can be a high-speed RAM memory or a non-volatile memory, such as a disk memory.
  • the memory 1005 can optionally be a storage device independent of the aforementioned processor 1001 .
  • the hardware structure shown in FIG. 1 does not constitute a limitation to the present application, and may include more or less components than those shown in the figure, or combine certain components, or different component arrangements.
  • the memory 1005 as a readable storage medium in FIG. 1 may include an operating system, a network communication module, and computer-readable instructions.
  • the processor 1001 can call the computer-readable instructions stored in the memory 1005, and execute the feature correlation analysis method in federated learning provided by the embodiment of the present application.
  • the embodiment of the present application provides a feature correlation analysis method in federated learning.
  • FIG. 2 is a schematic flowchart of the first embodiment of the feature correlation analysis method in the federated learning of this application.
  • the feature correlation analysis method in federated learning is implemented by the feature correlation analysis device in federated learning, and the feature correlation analysis method in federated learning includes the following steps:
  • Step S10 upon receiving the feature correlation calculation instruction of the vertical scene, at the second party, determine the second feature of each column of the target from each column of second feature vectors and a column of label vectors in the second sample of the second party.
  • Vector and its corresponding list of target label vectors
  • Step S20 Determine the first encrypted feature vector of each column of targets from the first encrypted feature vector of each column in the first sample of the first party based on the second feature vector of each column of targets, wherein the first sample and The second samples have the same user dimension; and,
  • Step S30 Determine each target second feature vector in each column of target second feature vectors and each target label vector in a column of target label vectors, respectively, and each target first encrypted feature vector corresponding to each column of target first encrypted feature vector The target inner product of the feature vector, the target inner product of each group is obtained, and the target inner product of each group is sent to the first party;
  • Step S40 In the first party, according to the inner product of each group of targets, the correlation coefficients between each column of the first feature in the first party sample and each column of the second feature and a column of labels in the second party sample are determined.
  • the correlation coefficient is used to measure the degree of linear correlation between two variables.
  • the more commonly used Pearson coefficient is the Pearson coefficient.
  • the formula for the Pearson coefficient is as follows:
  • the Pearson coefficient can be obtained from the normalized inner product of the two variables and then the average value. According to this, the present embodiment performs joint calculation on the correlation of the features used for modeling on the premise of ensuring the data security of both parties in the federation.
  • Step S10 upon receiving the feature correlation calculation instruction of the vertical scene, at the second party, determine the second feature of each column of the target from each column of second feature vectors and a column of label vectors in the second sample of the second party.
  • Vector and its corresponding list of target label vectors
  • Step S20 Determine the first encrypted feature vector of each column of targets from the first encrypted feature vector of each column in the first sample of the first party based on the second feature vector of each column of targets, wherein the first sample and The second samples have the same user dimension;
  • the feature correlation analysis device in federated learning may specifically be a joint computing device. Both parties in the federation are deployed with joint computing devices, and both parties in the federation may be a single server or a server cluster.
  • This embodiment is the feature correlation calculation of the vertical scene.
  • the samples of the first party and the second party of the federation have the same user dimension but different feature dimensions.
  • the sample of the first party of the federation contains multiple characteristics of each user, and the sample of the second party of the federation contains multiple different characteristics of the same user and the label of each user.
  • the second party determines each column of target second feature vectors and a corresponding column of target labels from each column of second feature vectors and a column of label vectors in the second sample of the second party.
  • the vector steps include:
  • the first party normalize the first feature of each column in the first party sample to obtain the first sample composed of the first feature vector of each column, and encrypt the first feature vector of each column , Obtain the first encrypted feature vector of each column, and send the first encrypted feature vector of each column to the second party; and,
  • the normalization process is performed on each first feature in each column of the first feature of the first party sample (if the first party is a cluster, the normalization process is performed in a distributed manner), Get the first feature vector from each column
  • the first sample composed, the first sample example is as follows (A represents the first party of the Federation):
  • Party A’s first sample contains Column and List the first feature vector.
  • the first feature vector of each column is encrypted using a preset encryption algorithm to obtain the first encrypted feature vector of each column.
  • each column of the first encrypted feature vector is sent to the second party, where the preset encryption algorithm can be selected as a homomorphic encryption algorithm, and the specific encryption process can refer to the prior art, which will not be repeated here.
  • a second sample composed of a second feature vector and a label vector.
  • An example of the second sample is as follows (B represents the first party of the federation):
  • Party B’s second sample contains Column and List the second feature vector and list the label vector Y.
  • the first encrypted feature vector of each column of targets in the first sample of the first party is determined.
  • step S10 includes:
  • Step S20 includes:
  • search for the first encrypted feature vector corresponding to the second feature vector of each column target from the first encrypted feature vector of each column after the arrangement order is shuffled to obtain the first encrypted feature vector of each column target.
  • the data of the second party is sampled, and the extracted data is used to calculate the correlation, that is, from each column of the second feature
  • the second feature vectors are extracted from the vector to obtain the second feature vector of each column of targets, and the label vector corresponding to the second feature vector of each column of the target is extracted from a column of label vectors to obtain a column of target label vectors, and then according to the correspondence established above, from In each column of the first encrypted feature vector after the arrangement order is shuffled, the first encrypted feature vector corresponding to the second feature vector of each column is searched to obtain the first encrypted feature vector of each column.
  • the first encrypted feature vector of each column of targets and the second feature vector of each column of targets, the first encrypted feature vector of each column of targets and a column of target label vectors can be correlated to calculate to obtain the first sample
  • Step S30 Determine each target second feature vector in each column of target second feature vectors and each target label vector in a column of target label vectors, respectively, and each target first encrypted feature vector corresponding to each column of target first encrypted feature vector The target inner product of the feature vector, the target inner product of each group is obtained, and the target inner product of each group is sent to the first party;
  • each target second feature vector in each column of target second feature vectors and each target label vector in each target label vector are respectively determined, and each target first feature vector corresponding to each column of target first encrypted feature vector is determined. Encrypt the target inner product of the feature vector to obtain the target inner product of each group.
  • step S30 includes:
  • each target second feature vector in each column of target second feature vectors and each target label vector in a column of target label vectors are calculated respectively, and each target first encrypted feature in each column of target first encrypted feature vector is calculated.
  • the inner product of the vector is the inner product of each group. For example, if the first encrypted feature vector of each column of targets, the second feature vector of each column of targets, and a column of target label vectors are as follows,
  • small white noise is added to each group of calculated inner products to obtain the target inner products of each group. After that, the target inner product of each group is sent to the first party.
  • Step 40 In the first party, the correlation coefficients between each column of the first feature in the first party sample and each column of the second feature and a column of labels in the second party sample are determined according to the inner product of each group of targets.
  • the first party determines the first feature vector of each column in the first sample of the first party, respectively, and each column of second feature vector and a column of label in the second sample of the second party
  • the correlation coefficient of the vector is used as the correlation coefficient between each column of the first feature in the first sample, and each column of the second feature and a column of labels in the second sample.
  • step S30 includes:
  • each target inner product is obtained based on the first encrypted feature vector of the target, in the first party, the corresponding decryption algorithm is used to decrypt each target inner product, and then the average value of each target inner product after decryption is calculated .
  • the correlation coefficients of each column of the first feature vector in the first sample of the first party and each column of the second feature vector and a column of label vector in the second sample of the second party can be obtained as the first sample
  • this embodiment realizes the correlation analysis between the two sides of the federation on the characteristics of both parties on the premise of ensuring the security of their respective data.
  • step S30 it further includes:
  • the target column whose correlation coefficient between each column of the first feature in the first sample and each column of the second feature in the second sample and the correlation coefficient with a column of labels in the second sample is higher than the preset threshold
  • the feature is sent to the second party.
  • the feature correlation analysis device in the federated learning of this embodiment is preset with a correlation coefficient threshold. For each column feature of the first party sample, the correlation coefficient with each column feature in the second party sample is compared with the second party. The correlation coefficient of the label of a column of features in the sample is higher than the preset threshold of the target column feature, indicating that it has a high correlation with the corresponding column feature of the second sample in the user dimension, due to the use of too high correlation feature combination Modeling will increase the noise of the model, and the modeling effect will be poor. Therefore, the target column feature is sent to the second party for the second party to delete the corresponding column feature in the second sample and the target column feature in the user dimension , Using only the remaining features in the second sample for joint modeling will greatly improve the modeling effect.
  • the second party determines the second feature of each column of the target from each column of second feature vectors and a column of label vectors in the second sample of the second party.
  • Vector and its corresponding list of target label vectors and, based on the second feature vector of each column of targets, determine the first encrypted feature vector of each column of targets from the first encrypted feature vector of each column in the first sample of the first party, wherein, the first sample and the second sample have the same user dimension; and each target second feature vector in each column of target second feature vectors and each target label vector in a column of target label vectors are determined respectively ,
  • the target inner product of each target first encrypted feature vector corresponding to each column of target first encrypted feature vector obtain each set of target inner product, and send each set of target inner product to the first party; in the first party, According to the inner product of each group of targets, the correlation coefficient between each column of the first feature in the first sample and each column of the second feature and a column of labels in the second sample is determined
  • a second embodiment of the feature correlation analysis method in the federated learning of the present application is proposed.
  • the difference from the first embodiment is that the method includes the following steps:
  • Step S50 When receiving the feature correlation calculation instruction of the horizontal scene, at the first party, calculate the encrypted inner product of every two columns of first feature vectors in the first sample of the first party to obtain each group of encrypted inner products, and Send each group of encrypted inner products to the second party;
  • Step S60 in the second party, calculate the inner product of every two second feature vectors of the same column in the second sample of the second party, wherein the first sample and the second sample have the same feature dimension;
  • Step S70 Add each group of encrypted inner product and the corresponding group inner product calculated by the second party to obtain the result of each group, and send the result of each group to the first party;
  • Step S80 In the first party, according to the results of each set of calculations, the correlation coefficients between every two columns of the first feature in the first sample and every two columns of the second feature in the second sample are determined.
  • This embodiment is the feature correlation calculation of the horizontal scene.
  • the samples of the first party and the second party of the federation have the same feature dimension but different user dimensions.
  • the sample of the first party of the federation contains multiple characteristics of each user, and the sample of the second party of the federation contains multiple identical characteristics of different users.
  • the first party in the federation calculates the encrypted inner product of every two columns of the first feature vector in the first sample of the first party to obtain each group of encrypted inner products, and sends each group of encrypted inner products Before the step to the second party, it is also necessary in the first party to normalize each first feature in each column of the first party’s sample (if the first party is a cluster, use distributed
  • the first sample is composed of the first feature vectors of each column.
  • the first sample is as follows (A represents the first party of the federation):
  • the second party normalize each column of the second feature in the second party's sample (if the second party is a cluster, the normalization is performed in a distributed manner), and the second feature of each column is obtained.
  • the second sample composed of feature vectors an example of the second sample is as follows (B represents the first party of the federation):
  • the first party of the federation when receiving the feature correlation calculation instruction of the horizontal scene, the first party of the federation first calculates the inner product of every two columns of the first feature vector in the first sample of the first party, taking into account the privacy of the first party data It uses a preset encryption algorithm to encrypt each group of calculated inner products to obtain each group of encrypted inner products, and send each group of encrypted inner products to the second party, where the preset encryption algorithm can be selected as homomorphic encryption
  • the algorithm and specific encryption process can refer to the prior art, which is not limited here. For example, taking the example of Party A above, calculate separately Column and Encrypted inner product of the column to get a set of encrypted inner products
  • each group of encrypted inner product and the corresponding group inner product calculated by the second party are added to obtain the result of each group, and the result of each group is sent to the first party.
  • the result of each group is sent to the first party.
  • the correlation coefficient between every two columns of the first feature in the first sample and every two columns of the second feature in the second sample is determined.
  • step S80 includes:
  • the average value of each group of operation results after decryption is obtained, and the correlation coefficients of the first feature in every two columns in the first sample and the second feature in the same column in every two samples in the second sample are obtained.
  • the corresponding decryption algorithm is used to decrypt each group of operation results, and then the decrypted operation results of each group after decryption are averaged to obtain every two of the first sample of the first party.
  • Columns of the first feature vector, and the correlation coefficients of the second feature vector of every two columns in the second sample of the second party, as the feature of every two columns in the first sample, and every two of the same column of features in the second sample The correlation coefficient.
  • this embodiment realizes the feature correlation analysis in the horizontal scenario of federated learning under the premise of ensuring the data security of the federated parties.
  • the embodiments of the present application also provide a computer-readable storage medium, and the computer-readable storage medium may be a non-volatile readable storage medium.
  • the computer-readable storage medium of the present application stores computer-readable instructions.
  • the steps of the above-mentioned feature correlation analysis method in federated learning are realized.
  • the method implemented when the computer-readable instruction is executed can refer to the various embodiments of the feature correlation analysis method in the federated learning of this application, which will not be repeated here.
  • the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. ⁇
  • the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, The optical disc) includes several instructions to enable a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the method described in each embodiment of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Complex Calculations (AREA)

Abstract

一种联邦学习中特征相关性分析方法、装置及可读存储介质,该方法包括:在接收到纵向场景的计算指令时,在第二方,从第二方第二样本的各列第二特征向量和一列标签向量中确定各列目标第二特征向量及一列目标标签向量,从第一方第一样本的各列第一加密特征向量中确定各列目标第一加密特征向量,确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积发送至第一方;在第一方根据各组目标内积确定第一方样本中每列特征,分别与第二方样本中每列特征和一列标签的相关性系数。

Description

联邦学习中特征相关性分析方法、装置及可读存储介质
本申请要求于2019年8月2日提交中国专利局、申请号为201910719769.1、发明名称为“联邦学习方法、系统、终端设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及机器学习领域,尤其涉及联邦学习中特征相关性分析方法、装置及可读存储介质。
背景技术
联邦学习(Federated Learning)是一种新兴的人工智能基础技术,其设计目标是在保障大数据交换时的信息安全、保护终端数据和个人数据隐私、保证合法合规的前提下,在多参与方或多计算结点之间开展高效率的机器学习。
若各参与方在联合建模前,未对各方用于建模的特征进行相关性筛选,将会增加模型的噪声,建模效果较差。然而,根据调研发现,目前工业界还没有相关的技术应用。因此,如何分析联邦学习中的特征相关性是目前亟待解决的问题。
发明内容
本申请的主要目的在于提供一种联邦学习中特征相关性分析方法、装置及可读存储介质,旨在实现联邦学习中的特征相关性分析。
为实现上述目的,本申请提供一种联邦学习中特征相关性分析方法,所述方法包括以下步骤:
在接收到纵向场景的特征相关性计算指令时,在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量;以及,
基于各列目标第二特征向量,从第一方第一样本中的各列第一加密特征向量中,确定各列目标第一加密特征向量,其中,所述第一样本和所述第二样本具有相同的用户维度;以及,
分别确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积,将各组目标内积发送至第一方;
在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分 别与第二方样本中每列第二特征和一列标签之间的相关性系数。
可选地,所述在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量的步骤之前,包括:
在第一方,对第一方样本中的每列第一特征进行归一化处理,得到由各列第一特征向量组成的第一样本,并对各列第一特征向量进行加密,得到各列第一加密特征向量,将各列第一加密特征向量发送至第二方;以及,
在第二方,对第二方样本中的每列第二特征和一列标签进行归一化处理,得到由各列第二特征向量和一列标签向量组成的第二样本。
可选地,所述在联邦第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量的步骤包括:
在第二方,打乱每列第一加密特征向量中各第一加密特征向量的排列顺序;以及,
建立打乱排列顺序前、后的每列第一加密特征向量,分别与每列第二特征向量和一列标签向量在列维度上的对应关系;以及,
从每列第二特征向量中抽取若干第二特征向量,得到各列目标第二特征向量,并从一列标签向量中抽取各列目标第二特征向量对应的标签向量得到一列目标标签向量;
所述基于各列目标第二特征向量,从第一方第一样本中的各列第一加密特征向量中,确定各列目标第一加密特征向量,其中,所述第一样本和所述第二样本具有相同的用户维度的步骤包括:
根据所述对应关系,从打乱排列顺序后的每列第一加密特征向量中,查找各列目标第二特征向量对应的第一加密特征向量,得到各列目标第一加密特征向量。
可选地,所述分别确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积,将各组目标内积发送至第一方的步骤包括:
分别计算每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的内积,得到各组内积;
对各组内积添加白噪声,得到各组目标内积。
可选地,所述在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数的步骤包括:
在第一方,对每组目标内积进行解密;
对解密后的每组目标内积求均值,得到第一方样本中每列第一特征, 分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
可选地,所述在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数的步骤之后,包括:
将第一方样本的各列第一特征中,与第二方样本中的每列第二特征的相关性系数、与第二方样本中一列标签的相关性系数高于预设阈值的目标列特征发送至第二方。
此外,为实现上述目的,本申请提供一种联邦学习中特征相关性分析方法,所述方法包括:
在接收到横向场景的特征相关性计算指令时,在第一方,计算第一方第一样本中每两列第一特征向量的加密内积,得到各组加密内积,并将各组加密内积发送至第二方;
在第二方,计算第二方第二样本中每两相同列第二特征向量的内积,其中,所述第一样本和所述第二样本具有相同的特征维度;以及,
对每组加密内积和第二方计算的对应组内积做加法运算,得到各组运算结果,将各组运算结果发送至第一方;
在第一方,根据各组运算结果,确定第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征之间的相关性系数。
可选地,所述在第一方,根据各组运算结果,确定第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征的相关性系数的步骤包括:
在第一方,对各组运算结果进行解密;
对解密后的每组运算结果求均值,得到第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征的相关性系数。
此外,为实现上述目的,本申请还提供一种联邦学习中特征相关性分析装置,所述联邦学习中特征相关性分析装置包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的交通数据的可视化程序,其中所述计算机可读指令被所述处理器执行时,实现如上所述的联邦学习中特征相关性分析方法的步骤。
此外,为实现上述目的,本申请还提供一种可读存储介质,所述可读存储介质上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如如上所述的联邦学习中特征相关性分析方法的步骤。
本申请提供一种联邦学习中特征相关性分析方法、装置及可读存储介质,在接收到纵向场景的特征相关性计算指令时,在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二 特征向量及其对应的一列目标标签向量;以及,基于各列目标第二特征向量,从第一方第一样本中的各列第一加密特征向量中,确定各列目标第一加密特征向量,其中,所述第一样本和所述第二样本具有相同的用户维度;以及,分别确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积,将各组目标内积发送至第一方;在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。本申请通过上述方式,在保障联邦双方各自数据安全的前提下,在联邦双方,对用于建模的特征相关性进行联合运算,实现了联邦学习纵向场景中的特征相关性分析。
附图说明
图1是本申请实施例方案涉及的联邦学习中特征相关性分析装置的硬件结构示意图;
图2为本申请联邦学习中特征相关性分析方法第一实施例的流程示意图;
图3为本申请联邦学习中特征相关性分析方法第二实施例的流程示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例的主要解决方案是:在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量;以及,基于各列目标第二特征向量,从第一方第一样本中的各列第一加密特征向量中,确定各列目标第一加密特征向量,其中,所述第一样本和所述第二样本具有相同的用户维度;以及,分别确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积,将各组目标内积发送至第一方;在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
如图1所示,图1是本申请实施例方案涉及的硬件运行环境的终端结 构示意图。
本申请实施例涉及的联邦学习中特征相关性分析方法可以由联邦学习中特征相关性分析装置实现。
参照图1,图1为本申请实施例方案中涉及的联邦学习中特征相关性分析装置的硬件结构示意图。本申请实施例中,联邦学习中特征相关性分析装置可以包括处理器1001(例如中央处理器Central Processing Unit、CPU),通信总线1002,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信;用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard);网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口);存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器,存储器1005可选的还可以是独立于前述处理器1001的存储装置。本领域技术人员可以理解,图1中示出的硬件结构并不构成对本申请的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
继续参照图1,图1中作为一种可读存储介质的存储器1005可以包括操作系统、网络通信模块以及计算机可读指令。在图1中,处理器1001可以调用存储器1005中存储的计算机可读指令,并执行本申请实施例提供的联邦学习中特征相关性分析方法。
本申请实施例提供了一种联邦学习中特征相关性分析方法。
参照图2,图2为本申请联邦学习中特征相关性分析方法第一实施例的流程示意图。
本实施例中,该联邦学习中特征相关性分析方法由联邦学习中特征相关性分析装置实现,该联邦学习中特征相关性分析方法包括以下步骤:
步骤S10,在接收到纵向场景的特征相关性计算指令时,在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量;以及,
步骤S20,基于各列目标第二特征向量,从第一方第一样本中的各列第一加密特征向量中,确定各列目标第一加密特征向量,其中,所述第一样本和所述第二样本具有相同的用户维度;以及,
步骤S30,分别确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积,将各组目标内积发送至第一方;
步骤S40,在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
本实施例首先介绍相关系数,相关系数是用来度量两个变量之间线性相关程度的量,比较常用的是皮尔森pearson系数,Pearson系数的公式如下:
Figure PCTCN2019119231-appb-000001
其中x和y分别是两个变量,cov(x,y)表示两个变量的协方差,σ x和σ y分别表示两个变量的标准差。
由上述式子可推知,Pearson系数可以由两个变量归一化后的内积再求均值得出。本实施例据此,在保障联邦双方各自数据安全的前提下,在联邦双方,对用于建模的特征的相关性进行联合计算。
以下详细介绍本实施例实现联邦学习中特征相关性分析的具体步骤:
步骤S10,在接收到纵向场景的特征相关性计算指令时,在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量;以及,
步骤S20,基于各列目标第二特征向量,从第一方第一样本中的各列第一加密特征向量中,确定各列目标第一加密特征向量,其中,所述第一样本和所述第二样本具有相同的用户维度;
在本实施中,联邦学习中特征相关性分析装置具体可以是联合计算装置,联邦双方均部署有联合计算装置,联邦双方均可以为单个服务器或服务器集群。
本实施例为纵向场景的特征相关性计算。在纵向场景中,联邦第一方的样本和第二方的样本具有相同的用户维度、不同的特征维度。联邦第一方的样本包含各个用户的多个特征,联邦第二方的样本包含相同用户的多个不同特征和每个用户的标签。
在本实施例中,所述在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量的步骤之前,包括:
a、在第一方,对第一方样本中的每列第一特征进行归一化处理,得到由各列第一特征向量组成的第一样本,并对各列第一特征向量进行加密,得到各列第一加密特征向量,将各列第一加密特征向量发送至第二方;以及,
b、在第二方,对第二方样本中的每列第二特征和一列标签进行归一化处理,得到由各列第二特征向量和一列标签向量组成的第二样本。
即,在第一方,对第一方样本的每列第一特征中的每个第一特征进行归一化处理(若第一方为集群,则采用分布式方式进行归一化处理),得到由各列第一特征向量
Figure PCTCN2019119231-appb-000002
组成的第一样本,第一样本示例如下(以 A表示联邦第一方):
Figure PCTCN2019119231-appb-000003
即,A方的第一样本中包含
Figure PCTCN2019119231-appb-000004
列和
Figure PCTCN2019119231-appb-000005
列第一特征向量。
进一步地,为防止第二方获得第一方的数据,采用预设加密算法对各列第一特征向量进行加密,得到各列第一加密特征向量
Figure PCTCN2019119231-appb-000006
然后将各列第一加密特征向量发送至第二方,其中,该预设加密算法可选为同态加密算法,具体加密过程可参照现有技术,此处不再赘述。
同时,在第二方,对第二方样本中的每列第二特征和一列标签进行归一化处理(若第二方为集群,则采用分布式方式进行归一化处理),得到由各列第二特征向量和一列标签向量组成的第二样本,第二样本示例如下(以B表示联邦第一方):
Figure PCTCN2019119231-appb-000007
即,B方的第二样本中包含
Figure PCTCN2019119231-appb-000008
列和
Figure PCTCN2019119231-appb-000009
列第二特征向量和一列标签向量Y。
那么,在接收到纵向场景的特征相关性计算指令时,在第二方,从第二样本中的各列第二特征向量一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量。
之后,基于各列目标第二特征向量,从第一方的第一样本中的各列第一加密特征向量中,确定各列目标第一加密特征向量。
作为一种实施方式,步骤S10包括:
c、在第二方,打乱每列第一加密特征向量中各第一加密特征向量的排列顺序;以及,
d、建立打乱排列顺序前、后的每列第一加密特征向量,分别与每列第二特征向量和一列标签向量在列维度上的对应关系;以及,
e、从每列第二特征向量中抽取若干第二特征向量,得到各列目标第二 特征向量,并从一列标签向量中抽取各列目标第二特征向量对应的标签向量得到一列目标标签向量;
步骤S20包括:
f、根据所述对应关系,从打乱排列顺序后的每列第一加密特征向量中,查找各列目标第二特征向量对应的第一加密特征向量,得到各列目标第一加密特征向量。
即,在第二方,在列维度上,对每列第一加密特征向量做shuffle处理,也就是打乱每列第一加密特征向量中各第一加密特征向量的排列顺序,如此,第一方也就无法通过
Figure PCTCN2019119231-appb-000010
获取各列第二特征向量
Figure PCTCN2019119231-appb-000011
然后建立shuffle处理前和shuffle处理后的每列第一加密特征向量,分别与每列第二特征向量和一列标签向量在列维度上(也就是用户维度上)的对应关系,例如,建立A方U1的
Figure PCTCN2019119231-appb-000012
Figure PCTCN2019119231-appb-000013
与B方U1的
Figure PCTCN2019119231-appb-000014
和Y1的对应关系。
为防止第一方通过构建特殊数据的方式获取第二方的数据值,在第二方,对第二方的数据进行抽样,抽取的数据用于计算相关性,即,从每列第二特征向量中抽取若干第二特征向量得到各列目标第二特征向量,并从一列标签向量中抽取各列目标第二特征向量对应的标签向量得到一列目标标签向量,然后根据前述建立的对应关系,从打乱排列顺序后的每列第一加密特征向量中,查找各列目标第二特征向量对应的第一加密特征向量,得到各列目标第一加密特征向量。之后,便可依据pearson系数,对各列目标第一加密特征向量与各列目标第二特征向量、对各列目标第一加密特征向量与一列目标标签向量进行相关性计算,得到第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
步骤S30,分别确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积,将各组目标内积发送至第一方;
具体地,分别确定每列目标第二特征向量中每一目标第二特征向量和每一目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积。
作为一种实施方式,步骤S30包括:
g,分别计算每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的内积,得到各组内积;
h,对各组内积添加白噪声,得到各组目标内积。
即,分别计算每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的内积,得到各组内积。比如,若各列目标 第一加密特征向量、各列目标第二特征向量和一列目标标签向量如下,
各列目标第一加密特征向量:
Figure PCTCN2019119231-appb-000015
各列目标第二特征向量和一列目标标签向量:
Figure PCTCN2019119231-appb-000016
则,分别计算
Figure PCTCN2019119231-appb-000017
列、
Figure PCTCN2019119231-appb-000018
列、Y列与
Figure PCTCN2019119231-appb-000019
列的内积,得到三组内积
Figure PCTCN2019119231-appb-000020
再分别计算
Figure PCTCN2019119231-appb-000021
列、Y列与
Figure PCTCN2019119231-appb-000022
列的内积,得到三组内积
Figure PCTCN2019119231-appb-000023
Figure PCTCN2019119231-appb-000024
为防止第一方通过构建特殊数据的方式获取第二方的数据值,在第二方,对计算得到的每组内积加上较小的白噪声,得到各组目标内积。之后,将各组目标内积发送至第一方。
步骤40,在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
之后,在第一方,根据各组目标内积,确定第一方第一样本中的各列第一特征向量,分别与第二方第二样本中的各列第二特征向量和一列标签向量的相关性系数,作为第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
作为一种实施方式,步骤S30包括:
i,在第一方,对每组目标内积进行解密;
j,对解密后的每组目标内积求均值,得到第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
由于每组目标内积是基于目标第一加密特征向量得到的,因此在第一方,先采用对应的解密算法对每组目标内积进行解密,再对解密后的每组目标内积求均值,即可得到第一方第一样本中的各列第一特征向量,分别与第二方第二样本中的各列第二特征向量和一列标签向量的相关性系数,作为第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
如此,本实施例在保障联邦双方各自数据安全的前提下,实现了联邦双方对双方特征的相关性分析。
进一步地,步骤S30之后,还包括:
将第一方样本的各列第一特征中,与第二方样本中的每列第二特征的相关性系数、与第二方样本中一列标签的相关性系数高于预设阈值的目标列特征发送至第二方。
即,本实施例联邦学习中特征相关性分析装置中预先设置有相关性系数阈值,对于第一方样本各列特征中,与第二方样本中每列特征的相关性系数、与第二方样本中一列特征的标签的相关性系数高于预设阈值的目标列特征,说明其与第二样本在用户维度上的对应列特征具有较高的相关性,由于利用相关性过高的特征联合建模将增加模型的噪声,建模效果较差,因此,将目标列特征发送至第二方,以供第二方将第二样本中与目标列特征在用户维度上的对应列特征进行删除,仅采用第二样本中的剩余特征联合建模,将大大提升建模的效果。
本实施例在接收到纵向场景的特征相关性计算指令时,在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量;以及,基于各列目标第二特征向量,从第一方第一样本中的各列第一加密特征向量中,确定各列目标第一加密特征向量,其中,所述第一样本和所述第二样本具有相同的用户维度;以及,分别确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积,将各组目标内积发送至第一方;在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。本实施例通过上述方式,在保障联邦双方各自数据安全的前提下,在联邦双方,对用于建模的特征相关性进行联合运算,实现了联邦学习纵向场景中的特征相关性分析。
进一步地,基于上述第一实施例,提出了本申请联邦学习中特征相关性分析方法的第二实施例,与第一实施例的区别在于,所述方法包括以下步骤:
步骤S50,在接收到横向场景的特征相关性计算指令时,在第一方,计算第一方第一样本中每两列第一特征向量的加密内积,得到各组加密内积,并将各组加密内积发送至第二方;
步骤S60,在第二方,计算第二方第二样本中每两相同列第二特征向量的内积,其中,所述第一样本和所述第二样本具有相同的特征维度;以及,
步骤S70,对每组加密内积和第二方计算的对应组内积做加法运算,得到各组运算结果,将各组运算结果发送至第一方;
步骤S80,在第一方,根据各组运算结果,确定第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征之间的相关性系数。
本实施例为横向场景的特征相关性计算。在横向场景中,联邦第一方的样本和第二方的样本具有相同的特征维度、不同的用户维度。联邦第一方的样本包含各个用户的多个特征,联邦第二方的样本包含不同用户的多个相同特征。
在本实施例中,所述在联邦第一方,计算第一方第一样本中每两列第一特征向量的加密内积,得到各组加密内积,并将各组加密内积发送至第二方的步骤之前,还需在第一方,对第一方样本的每列第一特征中的每个第一特征进行归一化处理(若第一方为集群,则采用分布式方式进行归一化处理),得到由各列第一特征向量组成的第一样本,第一样本示例如下(以A表示联邦第一方):
Figure PCTCN2019119231-appb-000025
同时,在第二方,对第二方样本中的每列第二特征进行归一化处理(若第二方为集群,则采用分布式方式进行归一化处理),得到由各列第二特征向量组成的第二样本,第二样本示例如下(以B表示联邦第一方):
Figure PCTCN2019119231-appb-000026
那么,在接收到横向场景的特征相关性计算指令时,首先在联邦第一方,计算第一方第一样本中每两列第一特征向量的内积,考虑到第一方数据的隐私性,采用预设加密算法对计算的各组内积进行加密,得到各组加密内积,并将各组加密内积发送至第二方,其中,该预设加密算法可选为同态加密算法,具体加密过程可参照现有技术,此处不作限定。例如,以上述A方示例为例,则分别计算
Figure PCTCN2019119231-appb-000027
列与
Figure PCTCN2019119231-appb-000028
列的加密内积,得到一组加密内积
Figure PCTCN2019119231-appb-000029
在第二方,计算第二方第二样本中每两相同列第二特征向量的内积, 对每组加密内积和第二方计算的对应组内积做加法运算,得到各组运算结果,将各组运算结果发送至第一方,以上述B方示例为例,则分别计算
Figure PCTCN2019119231-appb-000030
列与
Figure PCTCN2019119231-appb-000031
列的加密内积,得到一组加密内积
Figure PCTCN2019119231-appb-000032
Figure PCTCN2019119231-appb-000033
然后对每组加密内积和第二方计算的对应组内积做加法运算,得到各组运算结果,将各组运算结果发送至第一方。例如,继续以上述示例为例,分别对
Figure PCTCN2019119231-appb-000034
Figure PCTCN2019119231-appb-000035
Figure PCTCN2019119231-appb-000036
Figure PCTCN2019119231-appb-000037
做加法运算,得到一组运算结果
Figure PCTCN2019119231-appb-000038
Figure PCTCN2019119231-appb-000039
然后在第一方,根据各组运算结果,确定第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征之间的相关性系数。
作为一种实施方式,步骤S80包括:
在第一方,对各组运算结果进行解密;
对解密后的每组运算结果求均值,得到第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征的相关性系数。
即,在第一方,先采用对应的解密算法对各组运算结果进行解密,再对解密后的对解密后的每组运算结果求均值,即可得到第一方第一样本中每两列第一特征向量,分别与第二方第二样本中每两相同列第二特征向量的相关性系数,作为第一方样本中每两列特征,与第二方样本中每两相同列特征的相关性系数。
如此,本实施例在保障联邦双方各自数据安全的前提下,实现了联邦学习横向场景中的特征相关性分析。
此外,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质可以为非易失性可读存储介质。
本申请计算机可读存储介质上存储有计算机可读指令,其中所述计算机可读指令被处理器执行时,实现如上述的联邦学习中特征相关性分析方法的步骤。
其中,计算机可读指令被执行时所实现的方法可参照本申请联邦学习中特征相关性分析方法的各个实施例,此处不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上 述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种联邦学习中特征相关性分析方法,其中,所述方法包括以下步骤:
    在接收到纵向场景的特征相关性计算指令时,在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量;以及,
    基于各列目标第二特征向量,从第一方第一样本中的各列第一加密特征向量中,确定各列目标第一加密特征向量,其中,所述第一样本和所述第二样本具有相同的用户维度;以及,
    分别确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积,将各组目标内积发送至第一方;
    在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
  2. 如权利要求1所述的联邦学习中特征相关性分析方法,其中,所述在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量的步骤之前,包括:
    在第一方,对第一方样本中的每列第一特征进行归一化处理,得到由各列第一特征向量组成的第一样本,并对各列第一特征向量进行加密,得到各列第一加密特征向量,将各列第一加密特征向量发送至第二方;以及,
    在第二方,对第二方样本中的每列第二特征和一列标签进行归一化处理,得到由各列第二特征向量和一列标签向量组成的第二样本。
  3. 如权利要求2所述的联邦学习中特征相关性分析方法,其中,所述在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量的步骤包括:
    在第二方,打乱每列第一加密特征向量中各第一加密特征向量的排列顺序;以及,
    建立打乱排列顺序前、后的每列第一加密特征向量,分别与每列第二特征向量和一列标签向量在列维度上的对应关系;以及,
    从每列第二特征向量中抽取若干第二特征向量,得到各列目标第二特征向量,并从一列标签向量中抽取各列目标第二特征向量对应的标签向量得到一列目标标签向量;
    所述基于各列目标第二特征向量,从第一方第一样本中的各列第一加 密特征向量中,确定各列目标第一加密特征向量,其中,所述第一样本和所述第二样本具有相同的用户维度的步骤包括:
    根据所述对应关系,从打乱排列顺序后的每列第一加密特征向量中,查找各列目标第二特征向量对应的第一加密特征向量,得到各列目标第一加密特征向量。
  4. 如权利要求3所述的联邦学习中特征相关性分析方法,其中,所述分别确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积,将各组目标内积发送至第一方的步骤包括:
    分别计算每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的内积,得到各组内积;
    对各组内积添加白噪声,得到各组目标内积。
  5. 如权利要求4所述的联邦学习中特征相关性分析方法,其中,所述在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数的步骤包括:
    在第一方,对每组目标内积进行解密;
    对解密后的每组目标内积求均值,得到第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
  6. 如权利要求5所述的联邦学习中特征相关性分析方法,其中,所述在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数的步骤之后,包括:
    将第一方样本的各列第一特征中,与第二方样本中的每列第二特征的相关性系数、与第二方样本中一列标签的相关性系数高于预设阈值的目标列特征发送至第二方。
  7. 一种联邦学习中特征相关性分析方法,其中,所述方法包括:
    在接收到横向场景的特征相关性计算指令时,在第一方,计算第一方第一样本中每两列第一特征向量的加密内积,得到各组加密内积,并将各组加密内积发送至第二方;
    在第二方,计算第二方第二样本中每两相同列第二特征向量的内积,其中,所述第一样本和所述第二样本具有相同的特征维度;以及,
    对每组加密内积和第二方计算的对应组内积做加法运算,得到各组运算结果,将各组运算结果发送至第一方;
    在第一方,根据各组运算结果,确定第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征之间的相关性系数。
  8. 如权利要求7所述的联邦学习中特征相关性分析方法,其中,所述在第一方,根据各组运算结果,确定第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征的相关性系数的步骤包括:
    在第一方,对各组运算结果进行解密;
    对解密后的每组运算结果求均值,得到第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征的相关性系数。
  9. 一种联邦学习中特征相关性分析装置,其中,所述联邦学习中特征相关性分析装置包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的交通数据的可视化程序,其中所述计算机可读指令被所述处理器执行时,实现如下步骤:
    在接收到纵向场景的特征相关性计算指令时,在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量;以及,
    基于各列目标第二特征向量,从第一方第一样本中的各列第一加密特征向量中,确定各列目标第一加密特征向量,其中,所述第一样本和所述第二样本具有相同的用户维度;以及,
    分别确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积,将各组目标内积发送至第一方;
    在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
  10. 如权利要求9所述的联邦学习中特征相关性分析装置,其中,所述在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量的步骤之前,包括:
    在第一方,对第一方样本中的每列第一特征进行归一化处理,得到由各列第一特征向量组成的第一样本,并对各列第一特征向量进行加密,得到各列第一加密特征向量,将各列第一加密特征向量发送至第二方;以及,
    在第二方,对第二方样本中的每列第二特征和一列标签进行归一化处理,得到由各列第二特征向量和一列标签向量组成的第二样本。
  11. 如权利要求10所述的联邦学习中特征相关性分析装置,其中,所述在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向 量中,确定各列目标第二特征向量及其对应的一列目标标签向量的步骤包括:
    在第二方,打乱每列第一加密特征向量中各第一加密特征向量的排列顺序;以及,
    建立打乱排列顺序前、后的每列第一加密特征向量,分别与每列第二特征向量和一列标签向量在列维度上的对应关系;以及,
    从每列第二特征向量中抽取若干第二特征向量,得到各列目标第二特征向量,并从一列标签向量中抽取各列目标第二特征向量对应的标签向量得到一列目标标签向量;
    所述基于各列目标第二特征向量,从第一方第一样本中的各列第一加密特征向量中,确定各列目标第一加密特征向量,其中,所述第一样本和所述第二样本具有相同的用户维度的步骤包括:
    根据所述对应关系,从打乱排列顺序后的每列第一加密特征向量中,查找各列目标第二特征向量对应的第一加密特征向量,得到各列目标第一加密特征向量。
  12. 如权利要求11所述的联邦学习中特征相关性分析装置,其中,所述分别确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积,将各组目标内积发送至第一方的步骤包括:
    分别计算每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的内积,得到各组内积;
    对各组内积添加白噪声,得到各组目标内积。
  13. 如权利要求12所述的联邦学习中特征相关性分析装置,其中,所述在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数的步骤包括:
    在第一方,对每组目标内积进行解密;
    对解密后的每组目标内积求均值,得到第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
  14. 如权利要求13所述的联邦学习中特征相关性分析装置,其中,所述在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数的步骤之后,包括:
    将第一方样本的各列第一特征中,与第二方样本中的每列第二特征的 相关性系数、与第二方样本中一列标签的相关性系数高于预设阈值的目标列特征发送至第二方。
  15. 一种联邦学习中特征相关性分析装置,其中,所述联邦学习中特征相关性分析装置包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的交通数据的可视化程序,其中所述计算机可读指令被所述处理器执行时,实现如下步骤:
    在接收到横向场景的特征相关性计算指令时,在第一方,计算第一方第一样本中每两列第一特征向量的加密内积,得到各组加密内积,并将各组加密内积发送至第二方;
    在第二方,计算第二方第二样本中每两相同列第二特征向量的内积,其中,所述第一样本和所述第二样本具有相同的特征维度;以及,
    对每组加密内积和第二方计算的对应组内积做加法运算,得到各组运算结果,将各组运算结果发送至第一方;
    在第一方,根据各组运算结果,确定第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征之间的相关性系数。
  16. 如权利要求15所述的联邦学习中特征相关性分析装置,其中,所述在第一方,根据各组运算结果,确定第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征的相关性系数的步骤包括:
    在第一方,对各组运算结果进行解密;
    对解密后的每组运算结果求均值,得到第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征的相关性系数。
  17. 一种可读存储介质,其中,所述可读存储介质上存储有计算机可读指令,所述计算机可读指令被处理器执行时,实现如下步骤:
    在接收到纵向场景的特征相关性计算指令时,在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量;以及,
    基于各列目标第二特征向量,从第一方第一样本中的各列第一加密特征向量中,确定各列目标第一加密特征向量,其中,所述第一样本和所述第二样本具有相同的用户维度;以及,
    分别确定每列目标第二特征向量中每一目标第二特征向量和一列目标标签向量中每一目标标签向量,与每列目标第一加密特征向量中对应的每一目标第一加密特征向量的目标内积,得到各组目标内积,将各组目标内积发送至第一方;
    在第一方,根据各组目标内积,确定第一方样本中每列第一特征,分别与第二方样本中每列第二特征和一列标签之间的相关性系数。
  18. 如权利要求15所述的可读存储介质,其中,所述在第二方,分别从第二方第二样本中的各列第二特征向量和一列标签向量中,确定各列目标第二特征向量及其对应的一列目标标签向量的步骤之前,包括:
    在第一方,对第一方样本中的每列第一特征进行归一化处理,得到由各列第一特征向量组成的第一样本,并对各列第一特征向量进行加密,得到各列第一加密特征向量,将各列第一加密特征向量发送至第二方;以及,
    在第二方,对第二方样本中的每列第二特征和一列标签进行归一化处理,得到由各列第二特征向量和一列标签向量组成的第二样本。
  19. 一种可读存储介质,其中,所述可读存储介质上存储有计算机可读指令,所述计算机可读指令被处理器执行时,实现如下步骤:
    在接收到横向场景的特征相关性计算指令时,在第一方,计算第一方第一样本中每两列第一特征向量的加密内积,得到各组加密内积,并将各组加密内积发送至第二方;
    在第二方,计算第二方第二样本中每两相同列第二特征向量的内积,其中,所述第一样本和所述第二样本具有相同的特征维度;以及,
    对每组加密内积和第二方计算的对应组内积做加法运算,得到各组运算结果,将各组运算结果发送至第一方;
    在第一方,根据各组运算结果,确定第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征之间的相关性系数。
  20. 如权利要求19所述的可读存储介质,其中,所述在第一方,根据各组运算结果,确定第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征的相关性系数的步骤包括:
    在第一方,对各组运算结果进行解密;
    对解密后的每组运算结果求均值,得到第一方样本中每两列第一特征,与第二方样本中每两相同列第二特征的相关性系数。
PCT/CN2019/119231 2019-08-02 2019-11-18 联邦学习中特征相关性分析方法、装置及可读存储介质 WO2021022717A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910719769.1A CN110443378B (zh) 2019-08-02 2019-08-02 联邦学习中特征相关性分析方法、装置及可读存储介质
CN201910719769.1 2019-08-02

Publications (1)

Publication Number Publication Date
WO2021022717A1 true WO2021022717A1 (zh) 2021-02-11

Family

ID=68433323

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/119231 WO2021022717A1 (zh) 2019-08-02 2019-11-18 联邦学习中特征相关性分析方法、装置及可读存储介质

Country Status (2)

Country Link
CN (1) CN110443378B (zh)
WO (1) WO2021022717A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113239391A (zh) * 2021-07-13 2021-08-10 深圳市洞见智慧科技有限公司 一种无第三方的逻辑回归联邦学习模型训练系统及方法
CN113627086A (zh) * 2021-08-21 2021-11-09 深圳前海微众银行股份有限公司 横向联邦学习建模优化方法、设备、介质及程序产品
CN117034000A (zh) * 2023-03-22 2023-11-10 浙江明日数据智能有限公司 纵向联邦学习的建模方法、装置、存储介质以及电子设备

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110443378B (zh) * 2019-08-02 2023-11-03 深圳前海微众银行股份有限公司 联邦学习中特征相关性分析方法、装置及可读存储介质
CN111177249B (zh) * 2019-12-10 2022-05-17 浙江大学 一种基于联邦学习思想的多数据源数据可视化方法和装置
CN111079164B (zh) * 2019-12-18 2021-09-07 深圳前海微众银行股份有限公司 特征相关性计算方法、装置、设备及计算机可读存储介质
CN110968886B (zh) * 2019-12-20 2022-12-02 支付宝(杭州)信息技术有限公司 机器学习模型的训练样本的筛选方法及其系统
CN111723943B (zh) * 2020-04-01 2022-04-29 支付宝(杭州)信息技术有限公司 一种基于多标签的联邦学习方法、装置和系统
CN111753319B (zh) * 2020-06-22 2021-06-25 上海富数科技有限公司 基于联邦学习实现数据探索性分析处理的方法
CN112001452B (zh) * 2020-08-27 2021-08-27 深圳前海微众银行股份有限公司 特征选择方法、装置、设备及可读存储介质
CN112396189B (zh) * 2020-11-27 2023-09-01 中国银联股份有限公司 一种多方构建联邦学习模型的方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102694824A (zh) * 2011-03-22 2012-09-26 中国移动通信集团公司 一种用户数据存储系统及其数据访问方法
CN107256411A (zh) * 2017-05-27 2017-10-17 南京师范大学 特征选择和标记相关性联合学习的多标记数据分类方法
WO2018057302A1 (en) * 2016-09-26 2018-03-29 Google Llc Communication efficient federated learning
US20180373988A1 (en) * 2017-06-27 2018-12-27 Hcl Technologies Limited System and method for tuning and deploying an analytical model over a target eco-system
CN109657055A (zh) * 2018-11-09 2019-04-19 中山大学 基于层次混合网络的标题党文章检测方法及联邦学习策略
CN110443378A (zh) * 2019-08-02 2019-11-12 深圳前海微众银行股份有限公司 联邦学习中特征相关性分析方法、装置及可读存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009038788A1 (en) * 2007-09-21 2009-03-26 Noblis, Inc. Method and system for active learning screening process with dynamic information modeling
CN109299728B (zh) * 2018-08-10 2023-06-27 深圳前海微众银行股份有限公司 基于构建梯度树模型的样本联合预测方法、系统及介质
CN109165683B (zh) * 2018-08-10 2023-09-12 深圳前海微众银行股份有限公司 基于联邦训练的样本预测方法、装置及存储介质
CN110008696A (zh) * 2019-03-29 2019-07-12 武汉大学 一种面向深度联邦学习的用户数据重建攻击方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102694824A (zh) * 2011-03-22 2012-09-26 中国移动通信集团公司 一种用户数据存储系统及其数据访问方法
WO2018057302A1 (en) * 2016-09-26 2018-03-29 Google Llc Communication efficient federated learning
CN107256411A (zh) * 2017-05-27 2017-10-17 南京师范大学 特征选择和标记相关性联合学习的多标记数据分类方法
US20180373988A1 (en) * 2017-06-27 2018-12-27 Hcl Technologies Limited System and method for tuning and deploying an analytical model over a target eco-system
CN109657055A (zh) * 2018-11-09 2019-04-19 中山大学 基于层次混合网络的标题党文章检测方法及联邦学习策略
CN110443378A (zh) * 2019-08-02 2019-11-12 深圳前海微众银行股份有限公司 联邦学习中特征相关性分析方法、装置及可读存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113239391A (zh) * 2021-07-13 2021-08-10 深圳市洞见智慧科技有限公司 一种无第三方的逻辑回归联邦学习模型训练系统及方法
CN113627086A (zh) * 2021-08-21 2021-11-09 深圳前海微众银行股份有限公司 横向联邦学习建模优化方法、设备、介质及程序产品
CN113627086B (zh) * 2021-08-21 2024-03-26 深圳前海微众银行股份有限公司 横向联邦学习建模优化方法、设备、介质及程序产品
CN117034000A (zh) * 2023-03-22 2023-11-10 浙江明日数据智能有限公司 纵向联邦学习的建模方法、装置、存储介质以及电子设备

Also Published As

Publication number Publication date
CN110443378B (zh) 2023-11-03
CN110443378A (zh) 2019-11-12

Similar Documents

Publication Publication Date Title
WO2021022717A1 (zh) 联邦学习中特征相关性分析方法、装置及可读存储介质
WO2020177392A1 (zh) 基于联邦学习的模型参数训练方法、装置、设备及介质
CN109299728B (zh) 基于构建梯度树模型的样本联合预测方法、系统及介质
US10305889B2 (en) Identity authentication method and device and storage medium
CN110851869B (zh) 敏感信息处理方法、设备及可读存储介质
US20230224232A1 (en) System and method for extracting identifiers from traffic of an unknown protocol
US10095865B2 (en) Detecting unauthorized remote administration using dependency rules
WO2021197332A1 (zh) 保护数据隐私的图片分类方法及装置
CN106972927A (zh) 一种针对不同安全等级的加密方法及系统
CN106921493A (zh) 一种加密方法及系统
CN111401277A (zh) 人脸识别模型更新方法、装置、设备和介质
CN106911712A (zh) 一种应用于分布式系统的加密方法及系统
CN112231309A (zh) 纵向联邦数据统计的去重方法、装置、终端设备及介质
CN111490995A (zh) 保护隐私的模型训练方法和装置、数据处理方法、服务器
US10079933B2 (en) System and method for user-privacy-aware communication monitoring and analysis
CN112380404B (zh) 数据过滤方法、装置及系统
WO2020140616A1 (zh) 一种数据加密方法和相关装置
Xu et al. Towards efficient privacy-preserving truth discovery in crowd sensing systems
CN111414636A (zh) 识别模型的更新方法、装置、设备及存储介质
CN112468285B (zh) 基于隐私保护的数据处理方法、装置和服务器
Fazeen et al. Context-aware multimedia encryption in mobile platforms
CN113672954A (zh) 特征提取方法、装置和电子设备
Ramesh et al. Enhanced Authntication Mechanism in WLAN via MMBSPS
CN112597379A (zh) 数据识别方法、装置和存储介质及电子装置
US20150188947A1 (en) System and methods for automatic designation of encryption policies for user devices

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19940404

Country of ref document: EP

Kind code of ref document: A1