WO2021179839A1 - 保护用户隐私的用户分类系统的构建方法及装置 - Google Patents

保护用户隐私的用户分类系统的构建方法及装置 Download PDF

Info

Publication number
WO2021179839A1
WO2021179839A1 PCT/CN2021/074481 CN2021074481W WO2021179839A1 WO 2021179839 A1 WO2021179839 A1 WO 2021179839A1 CN 2021074481 W CN2021074481 W CN 2021074481W WO 2021179839 A1 WO2021179839 A1 WO 2021179839A1
Authority
WO
WIPO (PCT)
Prior art keywords
loss
user
original
data
gradient
Prior art date
Application number
PCT/CN2021/074481
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 WO2021179839A1 publication Critical patent/WO2021179839A1/zh

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
    • 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/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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/30Noise filtering

Definitions

  • the embodiments of this specification relate to the field of computer technology, and in particular, to a method and device for constructing a user classification system that protects user privacy.
  • One or more embodiments in this specification provide a method and device for constructing a user classification system that protects user privacy, which can protect user privacy and ensure the fairness of machine learning.
  • a method for constructing a user classification system that protects user privacy.
  • the method includes: inputting original user data into a feature encoder based on differential privacy to obtain a corresponding feature representation, and the original user data includes corresponding Preset the original sensitive data of the sensitive item; input the characteristic representation into the user classifier to obtain the user classification prediction result; determine the first loss based on the user classification prediction result and the classification label corresponding to the original user data; With the goal of minimizing the first loss, train the user classifier; input the feature representation into the first decoder to obtain restored sensitive data that simulates the original sensitive data; based on the restored sensitive data and the restored sensitive data The original sensitive data, determine the second loss; to minimize the first loss and maximize the second loss as the goal, train the feature encoder; to minimize the second loss as the goal, train the The first decoder; the trained feature encoder and the user classifier are constructed as the user classification system.
  • the method further includes: inputting the feature representation into a second decoder to obtain a simulation of the original user Restore user data of data; determine a third loss based on the restored user data and the original user data; train the second decoder with the goal of minimizing the third loss; wherein, to minimize the The first loss and maximizing the second loss are the objectives, and training the feature encoder includes: aiming at minimizing the first loss, minimizing the third loss, and maximizing the second loss , Training the feature encoder.
  • determining the second loss based on the restored sensitive data and the original sensitive data includes: determining the mutual information between the restored sensitive data and the original sensitive data as the second loss.
  • training the feature encoder includes: determining the original gradient corresponding to the comprehensive loss, and the comprehensive loss is the same as the first loss.
  • One loss is positively correlated and negatively correlated with the second loss; adding noise for realizing the differential privacy to the original gradient to obtain the added gradient; using the added gradient to adjust the characteristic encoder Model parameters.
  • the method further includes: performing gradient clipping on the original gradient based on a preset clipping threshold to obtain the clipped gradient; wherein Performing noise addition processing to obtain the processed gradient includes: determining the Gaussian noise for realizing the differential privacy based on the cropping threshold and a predetermined noise scaling factor; calculating the sum of the cropped gradient and the Gaussian noise , As the added gradient.
  • the classification label indicates the risk level of the corresponding user, or the group to which the user belongs, or the credit level of the user.
  • a device for constructing a user classification system that protects user privacy
  • a feature encoding unit configured to input original user data into a feature encoder based on differential privacy to obtain a corresponding feature representation, the original user The data includes the original sensitive data corresponding to the preset sensitive items
  • the classification prediction unit is configured to input the characteristic representation into the user classifier to obtain the user classification prediction result
  • the first loss determination unit is configured to be based on the user classification The prediction result and the classification label corresponding to the original user data determine the first loss
  • the classifier training unit is configured to train the user classifier with the goal of minimizing the first loss
  • the first decoding unit is configured to Inputting the characteristic representation into a first decoder to obtain restored sensitive data that simulates the original sensitive data; a second loss determining unit configured to determine a second loss based on the restored sensitive data and the original sensitive data;
  • An encoder training unit configured to train the feature encoder with the goal of minimizing the first loss and maximizing the second loss; a first decoder training
  • a method for constructing a machine learning system for protecting data privacy and security includes: inputting original sample data into a feature encoder based on differential privacy to obtain a corresponding feature representation, and the original sample data includes data corresponding to Preset the original sensitive data of the sensitive item; input the characteristic representation into the prediction model used to perform the target task to obtain the prediction result; determine the first loss based on the prediction result and the sample label corresponding to the original sample data; With the goal of minimizing the first loss, train the prediction model; input the characteristic representation into the first decoder to obtain restored sensitive data that simulates the original sensitive data; based on the restored sensitive data and the Original sensitive data, determine the second loss; to minimize the first loss and maximize the second loss, train the feature encoder; to minimize the second loss, train the first loss A decoder; constructing the trained feature encoder and the prediction model as the machine learning system for executing the target task.
  • the target task includes classification or scoring of a target object, and the target object includes a user or a commodity.
  • a device for constructing a machine learning system for protecting data privacy and security including: a feature encoding unit configured to input original sample data into a feature encoder based on differential privacy to obtain a corresponding feature representation.
  • the sample data includes the original sensitive data corresponding to the preset sensitive items;
  • the prediction unit is configured to input the characteristic representation into the prediction model used to perform the target task to obtain the prediction result;
  • the first loss determination unit is configured to be based on all The prediction result and the sample label corresponding to the original sample data determine a first loss;
  • a prediction model training unit configured to train the prediction model with the goal of minimizing the first loss;
  • a first decoding unit configured to Inputting the characteristic representation into a first decoder to obtain restored sensitive data that simulates the original sensitive data;
  • a second loss determining unit configured to determine a second loss based on the restored sensitive data and the original sensitive data;
  • An encoder training unit configured to train the feature encoder with the goal of minimizing the first loss and maximizing the second loss;
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed in a computer, the computer is caused to execute the method provided in the first aspect or the third aspect.
  • a computing device including a memory and a processor, the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect or the third aspect is implemented .
  • the feature encoder that introduces differential privacy is used to obtain a feature representation with differential privacy characteristics, so that the user classifier that takes the feature representation as input can also maintain the differential privacy characteristics.
  • the privacy and security of user data are protected; at the same time, the first decoder and feature encoder are introduced for adversarial learning, so that the impact of sensitive data contained in user data can be removed to the greatest extent in the feature representation, thereby ensuring the prediction and classification results Fairness. Therefore, using the user classification system constructed by the method can simultaneously protect the privacy and security of user data and ensure the fairness of user classification prediction results.
  • Figure 1 shows a schematic structural diagram of an algorithm framework disclosed in an embodiment of this specification
  • Figure 2 shows the schematic flow diagram of the method for constructing a user classification system for protecting user privacy disclosed in an embodiment of this specification
  • Figure 3 shows a schematic structural diagram of another algorithm framework disclosed in an embodiment of this specification.
  • Fig. 4 shows a schematic structural diagram of a user classification system according to an embodiment
  • Figure 5 shows a structural diagram of a device for constructing a user classification system for protecting user privacy disclosed in an embodiment of this specification
  • FIG. 6 shows a schematic flowchart of a method for constructing a machine learning system for protecting data privacy and security disclosed in an embodiment of this specification
  • Fig. 7 shows a structure diagram of a device for constructing a machine learning system for protecting data privacy and security disclosed in an embodiment of this specification.
  • differential privacy technology has been increasingly used. Differential privacy is a formal definition of data privacy security, which guarantees that the information of a single piece of data is not leaked while modeling and analyzing all data. The realization of differential privacy is an extremely reasonable guarantee for individual privacy security under the requirements of big data modeling and analysis.
  • the inventor proposes to design an algorithm framework by introducing the idea of differential privacy and adversarial learning to protect user privacy and ensure the fairness of machine learning.
  • FIG. 1 shows a schematic structural diagram of an algorithm framework disclosed in an embodiment of this specification.
  • a feature encoder is used to perform feature encoding on original user data x to obtain a feature representation z.
  • the obtained feature representation z has the characteristics of differential privacy, so any machine learning model that uses feature representation z (including the user classifier in Figure 1) will remain Differential privacy features to ensure that the original user data x will not be leaked, thereby realizing the protection of user privacy.
  • the feature representation z is obtained, on the one hand, it is input into the user classifier to obtain the predicted classification result y; on the other hand, it is input into the first decoder used to restore the original sensitive data s in the user data , Get the recovered sensitive data s'. It should be noted that, in order to weaken the influence of the original sensitive data s on the predicted classification result y, the first decoder and the feature encoder are allowed to fight against each other.
  • the target task of the first decoder is to restore the sensitive data s
  • the feature encoder includes making it difficult for the first decoder to recover the sensitive data s, so that the influence of the sensitive data s is removed to the greatest extent in the feature representation z, and the fairness of the predicted classification result y is ensured.
  • the trained feature encoder and user classifier can be used to construct a user classification system.
  • the user classification system thus obtained can be implemented at the same time Protect the privacy and security of user data, and ensure the fairness of user classification prediction results.
  • the embodiment of this specification discloses a construction method of a user classification system that protects user privacy.
  • the following describes the implementation steps of the construction method in conjunction with specific embodiments.
  • FIG. 2 shows a schematic flow chart of a method for constructing a user classification system for protecting user privacy disclosed in an embodiment of this specification.
  • the execution subject of the constructing method may be any device or device or system or platform with computing and processing capabilities. As shown in Figure 2, the method may include steps S202 to S218.
  • Step S202 Input the original user data into a feature encoder based on differential privacy to obtain a corresponding feature representation.
  • the original user data includes original sensitive data corresponding to preset sensitive items;
  • Step S204 input the feature representation In the user classifier, the user classification prediction result is obtained;
  • step S206 the first loss is determined based on the user classification prediction result and the classification label corresponding to the original user data;
  • step S208 the goal is to minimize the first loss ,
  • Train the user classifier step S210, input the characteristic representation into the first decoder to obtain restored sensitive data that simulates the original sensitive data;
  • step S212 based on the restored sensitive data and the original sensitive data , Determine the second loss;
  • step S214 train the feature encoder with the goal of minimizing the first loss and maximizing the second loss;
  • step S216 train the feature encoder with the goal of minimizing the second loss
  • the first decoder; Step S218, the trained feature encoder and the user classifier are constructed as the user classification system.
  • step S202 the original user data is input into a feature encoder based on differential privacy to obtain a corresponding feature representation, and the original user data includes original sensitive data corresponding to preset sensitive items.
  • the data generated by the user can be regarded as the user's private data, and the user hopes that his private data will not be leaked during use, that is, the security of the user's privacy is guaranteed. Accordingly, in the process of using the above-mentioned original user data, it is also hoped to ensure the security of this part of the data.
  • the above-mentioned original user data may be collected by the staff through multiple channels according to the target task of the machine learning.
  • the target task may be to identify fraudulent users, divide users into groups, or evaluate the credit rating of users, and so on.
  • multiple channels may include collecting from the system backend or system database, using web crawlers to crawl from the website, issuing questionnaires, collecting points in the application APP, and so on.
  • the number of data items corresponding to the aforementioned original user data depends on the number of samples selected for one training set (such as 1 or 10, etc.).
  • the original user data may include the user's basic attribute characteristics and the user's business characteristics.
  • the basic attribute characteristics may include the user's gender, age, occupation, income, political appearance, ethnicity, skin color, health status, and education level, etc.
  • the business features may include operating behavior features, such as the type of the most recent operation, the page of the operation, and the stay time, and so on.
  • the business characteristics may also include characteristics of financial assets, such as the balance of Yu'ebao, the number of recent purchases, and the amount of consumption, and so on.
  • the business characteristics may also include credit record characteristics, such as the number of borrowings, the amount of borrowing, and the amount of repayment, and so on.
  • the business characteristics may also include social characteristics, such as the number of friends, the frequency of communication with friends, the communication time period, the type of communication platform, and so on.
  • the aforementioned original user data includes original sensitive data corresponding to preset sensitive items.
  • the preset sensitive items are determined by analyzing a large amount of original user data collected by the staff in combination with the above-mentioned target tasks of machine learning.
  • the target task is to determine whether a user will buy a skirt. Given that in the collected transaction samples, most users are of female gender, and the proportion of women who buy skirts is relatively high, which makes the machine learning model very good. Gender may be given too high weight, so gender can be set as a sensitive item in user data.
  • the target task is to determine whether the user’s skin is cancerous. Given that most of the collected skin data samples are light-colored skin, this is likely to cause the trained model to be applied to dark skin. When performing cancer classification, the classification effect is not good, so skin color can be determined as a sensitive item. In another embodiment, it is assumed that the target task is to determine whether to provide users with deposit-free rights.
  • regions can be set as sensitive items in user data.
  • the preset sensitive items in the collected original user data can be completed, and the preset sensitive items can be one or more items.
  • the collected original user data can be input into a feature encoder based on differential privacy.
  • the feature encoder may use DNN (Deep Neural Networks, deep neural network), or CNN (Convolutional Neural Networks, convolutional neural network), or RNN (Recurrent Neural Network, recurrent neural network) and other neural networks. Network structure.
  • Differential privacy aims to protect the potential user privacy information in the published data (for example, statistical information determined based on multiple pieces of user data) by adding interference noise to the data (for example, multiple pieces of user data), so as to achieve even if the attack
  • the attacker has mastered information other than a certain piece of information (for example, a certain piece of user data) (for example, other user data in a plurality of pieces of user data), and the attacker still cannot infer the certain piece of information.
  • interference noise can be added in the input stage of the original user data, thereby achieving differential privacy.
  • interference noise may be added to the model parameters used for calculation processing in the feature encoder during the calculation process of the original user data by the feature encoder, thereby achieving differential privacy.
  • it may be Laplace noise.
  • it may also be Gaussian noise.
  • the aforementioned feature encoder can be directly implemented by using the existing differential privacy algorithm PATE (Private Aggregation of Teacher Ensembles, private aggregation of teacher ensemble).
  • the feature representation corresponding to the original user data can be determined.
  • the mathematical form of the feature representation can be a vector or an array.
  • the characteristic representation is input into the user classifier to obtain the user classification prediction result.
  • the user classifier may adopt a multi-classification model.
  • the user classifier may use multiple binary classification models.
  • the algorithm on which the user classification model is based may be a decision tree classification method, a Bayesian classification algorithm, a support vector machine or a neural network algorithm, and so on.
  • a first loss is determined based on the user classification prediction result and the classification label corresponding to the original user data.
  • the classification label corresponds to the above-mentioned target task, and a piece of original user data and the corresponding classification label constitute a training sample.
  • the classification label may be a risk level label indicating the user's risk level, such as high risk, medium risk, and low risk.
  • the classification label may be a risk classification label indicating the user's risk category, such as a normal user or a high-risk user (such as a user account suspected of fraud or account theft).
  • the classification label may be a group classification label indicating the group to which the user belongs, such as an impulsive consumer group and a conservative consumer group.
  • the classification label may be a credit level label indicating the user's credit level, such as excellent credit, good credit, neutral credit, and poor credit.
  • the loss function used to determine the above-mentioned first loss may be a cross-entropy loss function, a hinge loss function, an exponential loss function, and so on.
  • the cross entropy loss function shown in formula (1) can be specifically used:
  • L cls represents the loss of the user classifier
  • N represents the number of samples in a batch of training samples
  • i represents the i-th sample among N samples
  • M represents the total number of label categories corresponding to the above classification labels
  • J represents the j-th classification label in the M classification labels
  • y ij represents the indicator variable (the value is 0 or 1), if the classification label in the i-th sample is the same as the j-th classification label, then 1, Otherwise, take 0
  • p ij represents the predicted probability that the i-th sample belongs to the category indicated by the j-th classification label.
  • the user classification prediction result and classification label are input into the preset loss function, and the first loss can be obtained.
  • the user classifier is trained with the goal of minimizing the first loss. Specifically, the loss gradient corresponding to the first loss can be determined, and then the determined loss gradient can be used to adjust the model parameters in the user classifier in the direction of gradient descent, so that the user classifier can be trained.
  • the feature representation is input into the first decoder to obtain restored sensitive data that simulates the original sensitive data.
  • the first decoder may be implemented using a DNN network, a CNN network, or an RNN network. Based on this, the characteristic representation can be input into the first decoder to obtain recovered sensitive data.
  • a second loss is determined based on the restored sensitive data and the original sensitive data.
  • the mutual information between the two can be determined as the second loss.
  • the KL divergence between the two can be determined as the second loss.
  • the MSE Mel Squared Loss, Euclidean distance
  • N represents the number of samples in a batch of training samples, i represents the i-th sample among N samples; K represents the number of discrete values corresponding to the original sensitive data, and k represents the k-th type Discrete value; y ik represents the indicator variable (the value is 0 or 1), if the original sensitive data in the i-th sample is the same as the k-th discrete value, then 1 is used, otherwise 0; p(s′) ik means Predict the probability that the restored sensitive data corresponding to the i-th sample is the same as the k-th discrete value, p(s) k indicates that in the batch of N training samples, the corresponding discrete value of the original sensitive data contained is the k-th discrete value The probability of the value.
  • the first loss that measures the classification performance of the user classification prediction model can be determined, and the second loss that measures the restoration performance of the first decoder for restoring the original sensitive data can be determined.
  • the feature encoder is trained with the goal of minimizing the first loss and maximizing the second loss; and, in step S216, the goal is to minimize the second loss, Training the first decoder.
  • the feature encoder aims at optimizing the classification performance of the user classification prediction model and reducing the restoration performance of the first decoder, while the first decoder aims at optimizing its restoration performance, thus realizing the characteristic encoder Adversarial learning with the first decoder, so that the feature representation output from the feature encoder, while ensuring that the classifier has a good classification effect, it is difficult to recover sensitive data, which means that it is possible to weaken or remove the original Sensitive data in user data affects the learned feature representation, thereby weakening the impact of sensitive data on user prediction classification results, thereby ensuring the accuracy of classification results while achieving the fairness of machine learning.
  • the integrated loss of the feature encoder may be determined based on the first loss and the second loss. Specifically, the integrated loss is positively correlated with the first loss and negatively correlated with the second loss.
  • formula (3) can be used to show the loss function to determine the comprehensive loss:
  • L en represents the comprehensive loss of the feature encoder
  • L cls represents the above-mentioned first loss
  • represents the super parameter, and takes a positive value, such as 0.8, 1 or 1.2.
  • the gradient descent method can be used to adjust the parameters in the feature encoder to realize the training of the feature encoder.
  • training the feature encoder may include: firstly, determining the original gradient corresponding to the comprehensive loss; then, adding noise for realizing the differential privacy to the original gradient to obtain the added gradient; then, using all the original gradients. The added gradient is used to adjust the model parameters of the feature encoder.
  • adding noise for realizing the differential privacy to the original gradient to obtain the added gradient may include: first performing gradient clipping on the original gradient based on a preset clipping threshold. , Obtain the cropped gradient, and then determine the Gaussian noise used to achieve differential privacy based on the cropped threshold and the predetermined noise scaling coefficient (as a hyperparameter); then calculate the sum of the cropped gradient and the Gaussian noise as the After adding the gradient.
  • t represents the current iterative training of the t-th round
  • x i represents the i-th sample in a batch of training samples.
  • g t (x i ) represents the loss of the i-th sample in the t-th round Gradient
  • ⁇ t represents the initial model parameters of the feature encoder in the t-th round
  • L en () represents the loss function of the feature encoder.
  • N represents the number of samples in a batch of training samples, Indicates the added gradient corresponding to the N samples in the t-th round;
  • represents the above-mentioned noise scaling factor, which is a super parameter and can be set as required;
  • C is the above-mentioned clipping threshold;
  • I represents an indication
  • the function can be 0 or 1. For example, it can be set to 1 for even-numbered rounds in multiple rounds of training, and 0 for odd-numbered rounds.
  • ⁇ t represents the learning step length of the t-th round, or the learning rate, which is a super parameter, which can be set to 0.5 or 0.3, etc.; ⁇ t+1 represents the adjustment obtained after the t-th round of training Model parameters.
  • the first decoder is trained.
  • the loss gradient corresponding to the second loss can be determined, and then the determined loss gradient can be used to adjust the model parameters in the first decoder in the direction of gradient descent, so that the training of the first decoder can be realized.
  • the trained user classifier, feature encoder and first decoder can be obtained. Accordingly, after multiple rounds of iterative training, the trained user classifier and feature encoder can be constructed as a user classification system for user classification.
  • FIG. 3 shows a schematic structural diagram of another algorithm framework disclosed in the embodiment of this specification.
  • the second decoder shown therein is used to restore the original user data x according to the characteristic representation z, and the characteristic encoder needs to cooperate with this The task is to make the restored user data x'as close as possible to the original user data x.
  • the method may further include: first, input the characteristic representation into a second decoder to obtain restored user data that simulates the original user data; then, based on the restored user data And the original user data to determine a third loss; then, with the goal of minimizing the third loss, the second decoder is trained.
  • the above step S214 may include: training the feature encoder with the objective of minimizing the first loss, minimizing the third loss, and maximizing the second loss.
  • the second decoder may be implemented using a DNN network, a CNN network, or an RNN network.
  • the mutual information between the original user data and the restored user data may be determined as the third loss.
  • the KL divergence between the two can be determined as the second loss.
  • the MSE between the two can also be determined as the second loss.
  • the comprehensive loss of the feature encoder can be determined based on the first loss, the second loss, and the third loss. Specifically, the comprehensive loss is positively correlated with the first loss and the third loss, and is positively correlated with the second loss. The loss is negatively correlated.
  • formula (8) can be used to show the loss function to determine the comprehensive loss:
  • L en represents the comprehensive loss of the feature encoder
  • L cls represents the above-mentioned first loss
  • both ⁇ 1 and ⁇ 2 are hyperparameters, and take positive values, for example, ⁇ 1 is 0.4, ⁇ 2 is 0.6, and so on.
  • the parameters in the feature encoder are adjusted to realize the training of the feature encoder.
  • the supervised feature encoder can learn as much as possible useful features for the classification task, thereby improving the accuracy of the classification result.
  • the trained feature encoder, user classifier, first decoder and second decoder can be obtained.
  • the trained feature encoder and user The classifier is constructed as a user classification system. For example, refer to the schematic structural diagram of the user classification system according to an embodiment shown in FIG. 4.
  • the feature encoder that introduces differential privacy is used to obtain a feature representation with differential privacy characteristics, so that the user classifier that takes the feature representation as input can also maintain the differential privacy characteristics.
  • the privacy and security of user data are protected; at the same time, the first decoder and feature encoder are introduced for adversarial learning, so that the impact of sensitive data contained in user data can be removed to the greatest extent in the feature representation, thereby ensuring the prediction and classification results Fairness. Therefore, using the user classification system constructed by the method can simultaneously protect the privacy and security of user data and ensure the fairness of user classification prediction results.
  • FIG. 5 shows a structure diagram of a device for constructing a user classification system for protecting user privacy disclosed in an embodiment of this specification.
  • the device 500 includes the following units.
  • the feature encoding unit 501 is configured to input original user data into a feature encoder based on differential privacy to obtain a corresponding feature representation.
  • the original user data includes original sensitive data corresponding to preset sensitive items; a classification prediction unit 503, It is configured to input the characteristic representation into a user classifier to obtain a user classification prediction result;
  • the first loss determination unit 505 is configured to determine the first loss based on the user classification prediction result and the classification label corresponding to the original user data
  • the classifier training unit 507 is configured to train the user classifier with the goal of minimizing the first loss;
  • the first decoding unit 509 is configured to input the characteristic representation into the first decoder to obtain the simulation
  • the second loss determination unit 511 is configured to determine the second loss based on the restored sensitive data and the original sensitive data;
  • the encoder training unit 513 is configured to minimize the first loss A loss and maximizing the second loss as a goal, train the feature encoder;
  • the device 500 further includes: a second decoding unit 519, configured to input the characteristic representation into a second decoder to obtain restored user data that simulates the original user data; and a third loss determination unit 521, configured to determine a third loss based on the restored user data and the original user data; a second decoder training unit 523, configured to train the second decoder with the goal of minimizing the third loss
  • the encoder training unit 513 is specifically configured to train the feature encoder with the goal of minimizing the first loss, minimizing the third loss, and maximizing the second loss.
  • the second loss determining unit 511 is specifically configured to determine the mutual information between the restored sensitive data and the original sensitive data as the second loss.
  • the encoder training unit 513 specifically includes: a comprehensive loss determination module 5131 configured to determine an original gradient corresponding to a comprehensive loss, where the comprehensive loss is positively correlated with the first loss and is correlated with the second loss Negative correlation; interference noise adding module 5132, configured to add noise for realizing the differential privacy to the original gradient, to obtain the added gradient; encoder tuning module 5133, configured to use the added gradient to adjust the The model parameters of the feature encoder are described.
  • the encoder training unit 513 further includes: a gradient cropping module 5134 configured to perform gradient cropping on the original gradient based on a preset cropping threshold to obtain the cropped gradient; wherein, an interference noise adding module 5132 is specifically configured to: determine the Gaussian noise for realizing the differential privacy based on the cropping threshold and a predetermined noise scaling factor; calculate the sum of the cropped gradient and the Gaussian noise as the added gradient .
  • a gradient cropping module 5134 configured to perform gradient cropping on the original gradient based on a preset cropping threshold to obtain the cropped gradient
  • an interference noise adding module 5132 is specifically configured to: determine the Gaussian noise for realizing the differential privacy based on the cropping threshold and a predetermined noise scaling factor; calculate the sum of the cropped gradient and the Gaussian noise as the added gradient .
  • the classification label indicates the risk level of the corresponding user, or the group to which the user belongs, or the credit level of the user.
  • the feature encoder that introduces differential privacy is used to obtain a feature representation with differential privacy characteristics, so that the user classifier that takes the feature representation as input can also maintain the differential privacy characteristics.
  • the privacy and security of user data are protected; at the same time, the first decoder and feature encoder are introduced for adversarial learning, so that the impact of sensitive data contained in user data can be removed to the greatest extent in the feature representation, thereby ensuring the prediction and classification results Fairness. Therefore, using the user classification system constructed by the method can simultaneously protect the privacy and security of user data and ensure the fairness of user classification prediction results.
  • FIG. 6 shows a schematic flowchart of a method for constructing a machine learning system for protecting data privacy and security disclosed in an embodiment of this specification.
  • the execution subject of the constructing method may be any device or device or system or platform with computing and processing capabilities. Wait.
  • the method may include steps S602 to S618.
  • Step S602 Input the original sample data into the feature encoder based on differential privacy to obtain the corresponding feature representation.
  • the original sample data includes the original sensitive data corresponding to the preset sensitive items;
  • Step S604 input the feature representation In the prediction model used to execute the target task, the prediction result is obtained;
  • step S606 the first loss is determined based on the prediction result and the sample label corresponding to the original sample data;
  • step S610 input the characteristic representation into the first decoder to obtain restored sensitive data that simulates the original sensitive data;
  • step S612, based on the restored sensitive data and the original sensitive data Determine the second loss;
  • step S614 train the feature encoder with the goal of minimizing the first loss and maximizing the second loss;
  • step S616, train the feature encoder with the goal of minimizing the second loss
  • the first decoder; step S618, the trained feature encoder and the prediction model are constructed as the machine learning system that performs
  • the target task may be classification or scoring for the target object.
  • the original sample data may be original user data
  • the corresponding sample label may be a classification label for the user.
  • the prediction model may be a user classification model or a user scoring model
  • the machine learning system constructed therefrom may be a user classification system or a user scoring system.
  • the target object may be a commodity.
  • the original sample data may be the original commodity picture, and the corresponding sample label may be the target selected in the picture. Area;
  • the original sample data is original product data, and the corresponding sample label may be a classification label for the product.
  • the original product data may include the origin of the product, raw materials, cost, selling price, sales volume, and so on.
  • the classification label may be a popular grade label, such as super popular, ordinary people, and not popular.
  • the classification label may be a target group label, such as students, professionals, health-care professionals, and so on.
  • the preset sensitive item may be the place of production or price of the commodity.
  • the prediction model may be a product classification model or a product scoring model, and the machine learning system constructed therefrom may be a product classification system or a product scoring system.
  • the method further includes: inputting the feature representation into the second decoder to obtain the simulated original sample Data restoration sample data; based on the restoration sample data and the original sample data, determine a third loss; to minimize the third loss as the goal, train the second decoder; wherein, to minimize the The first loss and maximizing the second loss are the objectives, and training the feature encoder includes: aiming at minimizing the first loss, minimizing the third loss, and maximizing the second loss , Training the feature encoder.
  • determining the second loss based on the restored sensitive data and the original sensitive data includes: determining the mutual information between the restored sensitive data and the original sensitive data as the second loss.
  • training the feature encoder includes: determining the original gradient corresponding to the comprehensive loss, and the comprehensive loss is compared with the total loss.
  • the first loss is positively correlated and negatively correlated with the second loss; adding noise for realizing the differential privacy to the original gradient to obtain the added gradient; using the added gradient to adjust the feature encoding The model parameters of the device.
  • the method further includes: performing gradient clipping on the original gradient based on a preset clipping threshold to obtain the clipped gradient; wherein Performing noise addition processing to obtain the processed gradient includes: determining the Gaussian noise for realizing the differential privacy based on the cropping threshold and a predetermined noise scaling factor; calculating the sum of the cropped gradient and the Gaussian noise , As the added gradient.
  • the feature encoder that introduces differential privacy is used to obtain a feature representation with differential privacy characteristics, so that the user classifier that takes the feature representation as input can also maintain the differential privacy characteristics.
  • the privacy and security of the sample data are protected; at the same time, the first decoder and the feature encoder are introduced for adversarial learning, so that the impact of the sensitive data contained in the sample data can be removed to the greatest extent in the feature representation, thereby ensuring the predicted classification results Fairness. Therefore, the use of the machine learning system constructed by the method can simultaneously protect the privacy and safety of sample data and ensure the fairness of the prediction results for the target task.
  • FIG. 7 shows a structure diagram of a device for constructing a machine learning system for protecting data privacy and security disclosed in an embodiment of this specification.
  • the device 700 includes the following units.
  • the feature encoding unit 701 is configured to input original sample data into a feature encoder based on differential privacy to obtain a corresponding feature representation.
  • the original sample data includes original sensitive data corresponding to preset sensitive items;
  • the prediction unit 703 is configured to In order to input the characteristic representation into the prediction model used to perform the target task to obtain the prediction result;
  • the first loss determination unit 705 is configured to determine the first loss based on the prediction result and the sample label corresponding to the original sample data
  • the prediction model training unit 707 is configured to train the sample classifier with the goal of minimizing the first loss;
  • the first decoding unit 709 is configured to input the characteristic representation into the first decoder to obtain the simulation
  • the second loss determination unit 711 is configured to determine the second loss based on the restored sensitive data and the original sensitive data;
  • the encoder training unit 713 is configured to minimize the first loss A loss and maximizing the second loss as the goal, train the feature encoder;
  • the device 700 further includes: a second decoding unit 719, configured to input the characteristic representation into a second decoder to obtain restored sample data that simulates the original sample data; and a third loss determination unit 721, configured to determine a third loss based on the restored sample data and the original sample data; a second decoder training unit 723, configured to train the second decoder with the goal of minimizing the third loss
  • the encoder training unit 713 is specifically configured to train the feature encoder with the goal of minimizing the first loss, minimizing the third loss, and maximizing the second loss.
  • the second loss determining unit 711 is specifically configured to determine the mutual information between the restored sensitive data and the original sensitive data as the second loss.
  • the encoder training unit 713 specifically includes: a comprehensive loss determination module 7131 configured to determine the original gradient corresponding to the comprehensive loss, where the comprehensive loss is positively correlated with the first loss and is correlated with the second loss Negative correlation; interference noise adding module 7132, configured to add noise for realizing the differential privacy to the original gradient, to obtain the added gradient; encoder tuning module 7133, configured to use the added gradient to adjust the The model parameters of the feature encoder are described.
  • the encoder training unit 713 further includes: a gradient cropping module 7134 configured to perform gradient cropping on the original gradient based on a preset cropping threshold to obtain the cropped gradient; wherein, an interference noise adding module The 7132 is specifically configured to: determine the Gaussian noise for realizing the differential privacy based on the cropping threshold and a predetermined noise scaling factor; calculate the sum of the cropped gradient and the Gaussian noise as the added gradient .
  • the feature encoder that introduces differential privacy is used to obtain a feature representation with differential privacy characteristics, so that the user classifier that takes the feature representation as input can also maintain the differential privacy characteristics.
  • the privacy and security of the sample data are protected; at the same time, the first decoder and the feature encoder are introduced for adversarial learning, so that the impact of the sensitive data contained in the sample data can be removed to the greatest extent in the feature representation, thereby ensuring the predicted classification results Fairness. Therefore, the use of the machine learning system constructed by the method can simultaneously protect the privacy and safety of sample data and ensure the fairness of the prediction results for the target task.
  • a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the description described in conjunction with FIG. 2 or FIG. 6 method.
  • a computing device including a memory and a processor, the memory is stored with executable code, and when the processor executes the executable code, a combination of FIG. 2 or FIG. 6 is implemented. The described method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioethics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Probability & Statistics with Applications (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本说明书实施例提供一种保护用户隐私的用户分类系统的构建方法。该方法包括:先将包括原始敏感数据的原始用户数据输入基于差分隐私的特征编码器中,得到对应的特征表示;然后,一方面,将该特征表示输入用户分类器中,得到分类结果,并结合该原始用户数据对应的分类标签,确定第一损失,用于训练该用户分类器,另一方面,将该特征表示输入第一解码器中,得到模拟该原始敏感数据的复原敏感数据,并基于该复原敏感数据和该原始敏感数据,确定第二损失,以及以最小化该第二损失为目标,训练该第一解码器;接着,以最小化该第一损失以及最大化该第二损失为目标,训练该特征编码器;最后将训练后的该特征编码器和该用户分类器,构建为该用户分类系统。

Description

保护用户隐私的用户分类系统的构建方法及装置 技术领域
本说明书实施例涉及计算机技术领域,具体地,涉及一种保护用户隐私的用户分类系统的构建方法及装置。
背景技术
随着机器学习技术的兴起,该领域中出现的保护用户隐私安全的问题和机器学习的公平性问题,已成为研究热点。具体地,在互联网大数据时代,利用大数据建立机器学习模型,已成为各行各业的需求常态,而建模过程中存在泄漏用户隐私的风险,因此,如何保护用户隐私数据的安全成为亟待解决的问题。另外,因机器学习需要依靠大量数据,而这些数据中通常是存在偏差的,因此会导致机器学习会出现不公平的情况,比如说,从网站上爬取的多张穿裙子的人像图片,其中的人物可能绝大多数是女性,而在仅需对图片中的服饰是否为裙子进行分类的场景下,即使图片中人物所穿的是裙子,但因该人物是男性,而会被分类为不是裙子。
然而,目前尚未发现有方案,可以同时兼顾上述两个问题。因此,迫切需要一种方案,可以同时实现保护用户隐私安全和保证机器学习的公平性。
发明内容
本说明书中的一个或多个实施例提供一种保护用户隐私的用户分类系统的构建方法及装置,可实现既保护用户隐私安全又保证机器学习的公平性。
第一方面,提供一种保护用户隐私的用户分类系统的构建方法,该方法包括:将原始用户数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始用户数据中包括对应于预设敏感项的原始敏感数据;将所述特征表示输入用户分类器中,得到用户分类预测结果;基于所述用户分类预测结果和所述原始用户数据对应的分类标签,确定第一损失;以最小化所述第一损失为目标,训练所述用户分类器;将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据;基于所述复原敏感数据和所述原始敏感数据,确定第二损失;以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;以最小化所述第二损失为目标,训练所述第一解码器;将训练后的所述特征编码器和所述用户分类器,构建为所述用户分类系统。
在一个实施例中,在将原始用户数据输入基于差分隐私的特征编码器中,得到特征表示之后,所述方法还包括:将所述特征表示输入第二解码器中,得到模拟所述原始用户数据的复原用户数据;基于所述复原用户数据和所述原始用户数据,确定第三损失;以最小化所述第三损失为目标,训练所述第二解码器;其中,以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器,包括:以最小化所述第一损失,最小化所述第三损失,以及最大化所述第二损失为目标,训练所述特征编码器。
在一个实施例中,基于所述复原敏感数据和所述原始敏感数据,确定第二损失,包括:确定所述复原敏感数据和原始敏感数据之间的互信息,作为所述第二损失。
在一个实施例中,以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器,包括:确定综合损失对应的原始梯度,所述综合损失与所述第一损失正相关,且与所述第二损失负相关;对所述原始梯度添加用于实现所述差分隐私的噪声,得到添加后梯度;利用所述添加后梯度,调整所述特征编码器的模型参数。
在一个实施例中,在确定综合损失对应的原始梯度之后,所述方法还包括:基于预设的裁剪阈值,对所述原始梯度进行梯度裁剪,得到裁剪后梯度;其中,对所述原始梯度进行噪声添加处理,得到处理后梯度,包括:基于所述裁剪阈值和预定的噪声缩放系数,确定用于实现所述差分隐私的高斯噪声;计算所述裁剪后梯度与所述高斯噪声的和值,作为所述添加后梯度。
在一个实施例中,所述分类标签指示对应用户的风险等级,或用户所属的人群,或用户的信用等级。
第二方面,提供一种保护用户隐私的用户分类系统的构建装置,包括:特征编码单元,配置为将原始用户数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始用户数据中包括对应于预设敏感项的原始敏感数据;分类预测单元,配置为将所述特征表示输入用户分类器中,得到用户分类预测结果;第一损失确定单元,配置为基于所述用户分类预测结果和所述原始用户数据对应的分类标签,确定第一损失;分类器训练单元,配置为以最小化所述第一损失为目标,训练所述用户分类器;第一解码单元,配置为将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据;第二损失确定单元,配置为基于所述复原敏感数据和所述原始敏感数据,确定第二损失;编码器训练单元,配置为以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;第一解码器训练单元,配置为以最小化所述第二损失为目标,训练所述第一解码器;分类系统构建单元,配置为将训练后的所述特征编码器和所述用户分类器,构建为所述用户分类系统。
第三方面,提供一种保护数据隐私安全的机器学习系统的构建方法,包括:将原始样本数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始样本数据中包括对应于预设敏感项的原始敏感数据;将所述特征表示输入用于执行目标任务的预测模型中,得到预测结果;基于所述预测结果和所述原始样本数据对应的样本标签,确定第一损失;以最小化所述第一损失为目标,训练所述预测模型;将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据;基于所述复原敏感数据和所述原始敏感数据,确定第二损失;以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;以最小化所述第二损失为目标,训练所述第一解码器; 将训练后的所述特征编码器和所述预测模型,构建为执行所述目标任务的所述机器学习系统。
在一个实施例中,所述目标任务包括针对目标对象的分类或评分,所述目标对象包括用户或商品。
第四方面,提供一种保护数据隐私安全的机器学习系统的构建装置,包括:特征编码单元,配置为将原始样本数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始样本数据中包括对应于预设敏感项的原始敏感数据;预测单元,配置为将所述特征表示输入用于执行目标任务的预测模型中,得到预测结果;第一损失确定单元,配置为基于所述预测结果和所述原始样本数据对应的样本标签,确定第一损失;预测模型训练单元,配置为以最小化所述第一损失为目标,训练所述预测模型;第一解码单元,配置为将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据;第二损失确定单元,配置为基于所述复原敏感数据和所述原始敏感数据,确定第二损失;编码器训练单元,配置为以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;系统构建单元,配置为以最小化所述第二损失为目标,训练所述第一解码器;系统构建单元,配置为将训练后的所述特征编码器和所述预测模型,构建为执行所述目标任务的所述机器学习系统。
第五方面,提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行第一方面或第三方面中提供的方法。
第六方面,提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现第一方面或第三方面中提供的方法。
综上,在本说明是实施例披露的构建方法中,利用引入差分隐私的特征编码器,得到具有差分隐私特性的特征表示,使得以特征表示作为输入的用户分类器同样可以保持差分隐私特性,从而实现对用户数据的隐私安全的保护;同时,引入第一解码器与特征编码器进行对抗学习,使得特征表示中可以最大程度上去除用户数据中包含的敏感数据的影响,进而保障预测分类结果的公平性。由此,使用通过所述方法构建的用户分类系统,可以同时实现保护用户数据的隐私安全,以及保障用户分类预测结果的公平性。
附图说明
为了更清楚地说明本说明书披露的多个实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书披露的多个实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1示出本说明书实施例披露的一种算法框架的结构示意图;
图2示出本说明书实施例披露的保护用户隐私的用户分类系统的构建方法流程示 意图;
图3示出本说明书实施例披露的另一种算法框架的结构示意图;
图4示出的根据一个实施例的用户分类系统的结构示意图;
图5示出本说明书实施例披露的保护用户隐私的用户分类系统的构建装置结构图;
图6示出本说明书实施例披露的保护数据隐私安全的机器学习系统的构建方法流程示意图;
图7示出本说明书实施例披露的保护数据隐私安全的机器学习系统的构建装置结构图。
具体实施方式
下面结合附图,对本说明书披露的多个实施例进行描述。
如前所述,一方面,在互联网大数据建模分析需求下,如何保护用户的隐私是非常重要的问题。在该背景下,差分隐私技术得到越来越多的应用。差分隐私是一种对数据隐私安全性的形式化定义,其保证在对全部数据进行建模分析的同时并不泄露个体单条数据的信息。差分隐私的实现,是大数据建模分析需求之下,对于个体隐私安全性的极为合理的保证。
另一方面,机器学习中存在不公平的问题。在许多场景下,是因为模型的训练样本(例如,前述中穿裙子的图片)的样本分布存在偏差,导致样本中的一些敏感属性(如,前述中的男女性别)使得预测结果存在不公平的情况。进一步地,想要获得具有理想样本分布(如不存在偏差或偏差很小)的样本集,往往是十分困难的,因此,希望通过削弱其中敏感属性对预测结果的影响,从而提高机器学习中的公平性。
基于以上观察和分析,为兼顾上述两个十分重要的问题,发明人提出通过引入差分隐私和对抗学习的思想,设计一种算法框架,同时实现保护用户隐私和保证机器学习的公平性。
在一个实施例中,图1示出本说明书实施例披露的一种算法框架的结构示意图,如图1所示,其中特征编码器用于对原始用户数据x进行特征编码,得到特征表示z。需要理解,因为特征编码器是基于差分隐私技术实现的,所以得到的特征表示z具有差分隐私的特性,由此任何使用特征表示z的机器学习模型(包括图1中的用户分类器)都会保持差分隐私特性,从而保证原始用户数据x不会被泄漏,从而实现对用户隐私安全的保护。进一步地,在得到特征表示z以后,一方面,将其输入用户分类器中,得到预测分类结果y,另一方面,将其输入用于复原用户数据中原始敏感数据s的第一解码器中,得到复原敏感数据s’。需要说明,为了削弱原始敏感数据s对预测分类结果y的影响,让第一解码器和特征编码器进行对抗,具体地,第一解码器的目标任务为恢复敏感数据s,而特征编码器的目标任务包括使得第一解码器难以恢复敏感数据s,如此实现 特征表示z中最大程度上去除敏感数据s的影响,进而保障预测分类结果y的公平性。基于以上算法框架,对特征编码器、用户分类器和第一解码器进行训练后,可以利用其中训练后的特征编码器和用户分类器构建用户分类系统,如此得到的用户分类系统,可以同时实现保护用户数据的隐私安全,以及保障用户分类预测结果的公平性。
基于发明人设计的上述算法框架,本说明书实施例披露一种保护用户隐私的用户分类系统的构建方法,下面结合具体的实施例,描述所述构建方法的实施步骤。
图2示出本说明书实施例披露的保护用户隐私的用户分类系统的构建方法流程示意图,所述构建方法的执行主体可以为任何具有计算、处理能力的装置或设备或系统或平台等。如图2所示,所述方法可以包括步骤S202~S218。
步骤S202,将原始用户数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始用户数据中包括对应于预设敏感项的原始敏感数据;步骤S204,将所述特征表示输入用户分类器中,得到用户分类预测结果;步骤S206,基于所述用户分类预测结果和所述原始用户数据对应的分类标签,确定第一损失;步骤S208,以最小化所述第一损失为目标,训练所述用户分类器;步骤S210,将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据;步骤S212,基于所述复原敏感数据和所述原始敏感数据,确定第二损失;步骤S214,以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;步骤S216,以最小化所述第二损失为目标,训练所述第一解码器;步骤S218,将训练后的所述特征编码器和所述用户分类器,构建为所述用户分类系统。
需要说明的是,上述步骤中提及的第一损失和第一解码器中的“第一”,以及后续提到的“第一”、“第二”等类似用语,仅用于区分同类事物,不具有其他限定作用。
以上步骤具体如下:首先,在步骤S202,将原始用户数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始用户数据中包括对应于预设敏感项的原始敏感数据。
需要说明,由用户产生的数据,都可以看作是用户的隐私数据,用户希望其隐私数据在使用过程中不被泄漏,也就是用户隐私的安全得到保障。据此,在使用上述原始用户数据的过程中,同样希望保障这部分数据的安全。
具体地,上述原始用户数据可以由工作人员根据机器学习的目标任务,通过多种渠道采集而得到。在一个实施例中,其中目标任务可以为识别欺诈用户、用户进行所属群组的划分、或评估用户的信用等级,等等。在一个实施例中,其中多种渠道可以包括,从系统后台或系统数据库中采集、利用网络爬虫从网站中爬取、发放调查问卷、在应用程序APP中埋点采集,等等。
在一个实施例中,上述原始用户数据对应的数据条数,取决于设定的一次训练所 选取的样本数(如1或10等等)。在一个实施例中,原始用户数据中可以包括用户的基础属性特征和用户的业务特征。在一个具体的实施例中,其中基础属性特征可以包括用户的性别、年龄、职业、收入、政治面貌、民族、肤色、健康状况和教育程度等。在一个具体的实施例中,其中业务特征可以包括操作行为方面的特征,例如最近一次操作的类型、操作的页面和停留的时间等等。在另一个具体的实施例中,其中业务特征还可以包括金融资产方面的特征,例如余额宝余额、近期消费次数和消费金额等等。在又一个具体的实施例中,其中业务特征还可以包括信用记录方面的特征,例如借款次数、借款金额和还款金额等等。在还一个具体的实施例中,其中业务特征还可以包括社交方面的特征,例如好友数目、与好友的沟通频次、沟通时间段、沟通平台类别等等。
进一步地,上述原始用户数据中包括对应于预设敏感项的原始敏感数据。其中预设敏感项,是由工作人员结合上述机器学习的目标任务,对采集的大量原始用户数据进行分析而确定的。
在一个实施例中,假定目标任务是确定用户是否会买裙子,鉴于收集到的交易样本中,大部分用户的性别是女性,而女性群体中购买裙子的比例较高,这使得机器学习模型很可能会给予性别过高的权重,由此可以将性别设定为用户数据中的敏感项。在另一个实施例中,假定目标任务是确定用户皮肤是否发生癌变,鉴于收集到的皮肤数据样本中,大部分是浅色皮肤,这就很可能导致训练出的模型在应用于对深色皮肤进行癌变分类时,分类效果不佳,由此可以将肤色确定为敏感项。在还一个实施例中,假定目标任务是确定是否提供给用户免押金的权益,鉴于收集到的负样本(标签为不提供)中,用户大部分是来自南部地区的,这使得训练出的模型可能会给予地区过高的权重,而使得后续模型的使用过程中,南部地区的用户难以享受到免押金的权益,由此可以将地区设定为用户数据中的敏感项。如此,可以完成针对采集的原始用户数据中敏感项的预先设定,并且,预先设定的敏感项可以为一项或多项。
另一方面,可以将采集到的原始用户数据输入基于差分隐私的特征编码器中。在一个实施例中,特征编码器可以采用DNN(Deep Neural Networks,深度神经网络)、或CNN(Convolutional Neural Networks,卷积神经网络)、或RNN(Recurrent Neural Network,循环神经网络)等神经网络的网络结构。
差分隐私旨在通过对数据(例如,多条用户数据)添加干扰噪声的方式,保护所发布数据(例如,基于多条用户数据确定出的统计信息)中潜在的用户隐私信息,从而达到即便攻击者已经掌握了除某条信息(例如,某条用户数据)以外的其他信息(例如,多条用户数据中的其他用户数据),该攻击者仍然无法推测出该某条信息。
对于将差分隐私引入特征编码器,在一种实施方式中,可以在原始用户数据的输入阶段,添加干扰噪声,从而实现差分隐私。在另一种实施方式中,可以在特征编码器 对原始用户数据进行计算处理的阶段,对特征编码器中用于计算处理的模型参数添加干扰噪声,从而实现差分隐私。在又一种实施方式中,还可以在特征编码器的输出阶段,对初始输出添加干扰噪声后,得到上述特征表示,从而实现差分隐私。对于其中添加的干扰噪声,在一个实施例中,可以是拉普拉斯噪声(laplace noise)。另一个实施例中,还可以是高斯噪声(gaussian noise)。
根据一个具体的实施例,上述特征编码器可以直接采用已有的差分隐私算法PATE(Private Aggregation of Teacher Ensembles,教师系综的私有聚合)实现。
利用上述特征编码器,可以确定与原始用户数据对应的特征表示。具体地,其中特征表示的数学形式可以为向量或数组。
接着,在步骤S204,将所述特征表示输入用户分类器中,得到用户分类预测结果。在一个实施例中,用户分类器可以采用多分类模型。在另一个实施例中,用户分类器可以采用多个二分类模型。另一方面,在一个实施例中,用户分类模型所基于的算法可以为决策树分类法、贝叶斯分类算法、支持向量机或神经网络算法,等等。由此,将特征表示输入用户分类器中,可以得到用户分类预测结果。
然后,在步骤S206,基于所述用户分类预测结果和所述原始用户数据对应的分类标签,确定第一损失。具体地,其中分类标签与上述目标任务相对应,并且,一条原始用户数据和对应的分类标签,构成一个训练样本。
在一个实施例中,分类标签可以为指示用户风险等级的风险等级标签,如高风险、中等风险和低风险等。在另一个实施例中,分类标签可以为指示用户风险类别的风险类别标签,如普通用户或高风险用户(如涉嫌欺诈、盗号的用户账户)等。在又一个实施例中,分类标签可以为指示用户所属人群的人群类别标签,如冲动型消费人群和保守型消费人群等。在还一个实施例中,分类标签可以为指示用户信用等级的信用等级标签,如信用优、信用良、信用中和信用差等。
在一个实施例中,确定上述第一损失所采用的损失函数,可以为交叉熵损失函数、铰链损失函数、指数损失函数,等等。在一个例子中,具体可以采用公式(1)示出的交叉熵损失函数:
Figure PCTCN2021074481-appb-000001
在公式(1)中,L cls表示用户分类器的损失;N表示一批次训练样本中的样本数量,i表示N个样本中的第i个样本;M表示上述分类标签对应的标签类别总数,j表示M种分类标签中的第j种分类标签;y ij表示指示变量(取值为0或1),若第i个样本中的分类标签和第j种分类标签相同,则取1,否则取0;p ij表示预测出的第i个样本属于第j种分类标签所指示类别的概率。
由此,将用户分类预测结果和分类标签输入预先设定的损失函数中,可以得到第 一损失。接着,在步骤S208,以最小化所述第一损失为目标,训练所述用户分类器。具体地,可以确定第一损失对应的损失梯度,再利用确定出的损失梯度,往梯度下降的方向调整用户分类器中的模型参数,如此可以实现对用户分类器的训练。
另一方面,在以上得到与原始用户数据对应的特征表示以后,接着还在步骤S210,将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据。在一个实施例中,第一解码器可以采用DNN网络、CNN网络或RNN网络实现。基于此,可以将特征表示输入第一解码器中,得到复原敏感数据。
然后在步骤S212,基于所述复原敏感数据和所述原始敏感数据,确定第二损失。在一个实施例中,可以确定两者之间的互信息,作为所述第二损失。在另一个实施例中,可以确定两者之间的KL散度,作为所述第二损失。在又一个实施例中,还可以确定两者之间的MSE(Mean Squared Loss,欧氏距离),作为所述第二损失。
在一个例子中,假定上述预设敏感项的数量为1,原始敏感数据的取值为多种离散值,此时,可以采用公式(2)示出的互信息损失函数确定第二损失:
Figure PCTCN2021074481-appb-000002
上式(2)中,
Figure PCTCN2021074481-appb-000003
表示第一解码器的损失;N表示一批次训练样本中的样本数量,i表示N个样本中的第i个样本;K表示原始敏感数据所对应离散值的种数,k表示第k种离散值;y ik表示指示变量(取值为0或1),若第i个样本中的原始敏感数据和第k种离散值相同,则取1,否则取0;p(s′) ik表示预测出第i个样本对应的复原敏感数据与第k种离散值相同的概率,p(s) k表示该批次N个训练样本中,所包含原始敏感数据所对应离散值为第k种离散值的概率。
以上,可以确定出衡量用户分类预测模型的分类性能的第一损失,以及衡量第一解码器针对原始敏感数据进行复原的复原性能的第二损失。基于此,在步骤S214,以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;并且,在步骤S216,以最小化所述第二损失为目标,训练所述第一解码器。由此,特征编码器以优化用户分类预测模型的分类性能,以及降低第一解码器的复原性能为目标任务,而第一解码器以优化其复原性能为目标任务,这样就实现了特征编码器与第一解码器之间的对抗学习,从而使得从特征编码器输出的特征表示,在保证分类器具有良好分类效果的同时,难以复原出敏感数据,也就意味着,尽可能削弱或去除原始用户数据中的敏感数据,对学习到的特征表示的影响,进而削弱敏感数据对用户预测分类结果的影响,从而在保证分类结果准确度的同时,实现机器学习的公平性。
在一个实施例中,可以基于第一损失和第二损失,确定特征编码器的综合损失,具体地,综合损失与第一损失正相关,且与第二损失负相关。在一个例子中,可以采用公式(3)示出损失函数确定综合损失:
Figure PCTCN2021074481-appb-000004
式(3)中,L en表示特征编码器的综合损失,L cls表示上述第一损失,
Figure PCTCN2021074481-appb-000005
表示上述第二损失,α表示超参,取正值,如0.8、1或1.2等。
进一步地,在确定出特征编码器的损失后,可以利用梯度下降法,调整特征编码器中的参数,以实现对特征编码器的训练。
需要说明,上述已介绍多种在特征编码器中引入差分隐私的实施方式,如对特征编码器的初始输入、模型参数或初始输出直接添加干扰噪声,此外,还可以通过在损失梯度中添加干扰噪声的方式,引入差分隐私,并且,这种方式可以更加有效的保护用户隐私安全。在一个实施例中,训练特征编码器可以包括:首先,确定综合损失对应的原始梯度;接着,对所述原始梯度添加用于实现所述差分隐私的噪声,得到添加后梯度;然后,利用所述添加后梯度,调整所述特征编码器的模型参数。在一个具体的实施例中,其中,对所述原始梯度添加用于实现所述差分隐私的噪声,得到添加后梯度,可以包括:先基于预设的裁剪阈值,对所述原始梯度进行梯度裁剪,得到裁剪后梯度,再基于该裁剪阈值和预定的噪声缩放系数(为超参),确定用于实现差分隐私的高斯噪声;然后计算裁剪后梯度与所述高斯噪声的和值,作为所述添加后梯度。
根据一个具体的例子,先利用公式(4)确定综合损失对应的原始梯度:
Figure PCTCN2021074481-appb-000006
上式(4)中,t表示当前为第t轮次的迭代训练,x i表示一批次训练样本中的第i个样本g t(x i)表示第t轮中第i个样本的损失梯度,θ t表示第t轮中特征编码器的起始模型参数,L en()表示特征编码器的损失函数。
在利用式(5)对原始梯度进行梯度裁剪:
Figure PCTCN2021074481-appb-000007
上式(5)中,
Figure PCTCN2021074481-appb-000008
表示第t轮中第i个样本的裁剪后梯度,C表示裁剪阈值,‖g(x i)‖ 2表示对g t(x i)求取二阶范数。
然后利用公式(6)添加高斯噪声:
Figure PCTCN2021074481-appb-000009
上式(6)中,N表示一批次训练样本的样本数量,
Figure PCTCN2021074481-appb-000010
表示第t轮中N个样本对应的添加后梯度;
Figure PCTCN2021074481-appb-000011
表示高斯噪声,并且其符合以均值0和方差σ 2C 2I作为分布参数的高斯分布;σ表示上述噪声缩放系数,为超参,可以按需设定;C为上述裁剪阈值;I表示指示函数,可以取0或1,比如,可以设定在多轮训练中的偶数轮次取1,而奇数轮次取0。
再接着,利用公式(7)计算调整后的模型参数:
Figure PCTCN2021074481-appb-000012
上式(7)中,η t表示第t轮的学习步长,或者说学习率,为超参,可以设定为0.5或0.3等;θ t+1表示经过第t轮训练得到的调整后模型参数。
以上可以实现对特征编码器的训练。另一方面,以最小化上述第二损失为目标,训练所述第一解码器。在一个实施例中,可以确定第二损失对应的损失梯度,再利用确定出的损失梯度,往梯度下降的方向调整第一解码器中的模型参数,如此可以实现对第一解码器的训练。
由上,可以得到训练后的用户分类器、特征编码器和第一解码器。据此,可以将经过多轮迭代训练后,训练好的用户分类器和特征编码器,构建为用户分类系统,用于用户分类。此外需要说明,对于上述训练过程,可以使用端到端的训练方法,每次训练中对算法框架中的各个模型均进行调参;或者,也可以先固定其中某个模型(如特征编码器)的参数,训练其他模型(如分类器和第一解码器),再固定其他模型的参数,训练该某个模型,如此循环,完成多轮迭代训练,具体不作限定。
以上主要基于图1中示出的算法框架,对本说明书实施例披露的用户分类系统的构建方法进行说明。另外,在一个实施例中,还可以在图1示出的算法框架的基础上,添加第二解码器,以监督特征编码器尽可能学习到有用的特征。具体地,图3示出本说明书实施例披露的另一种算法框架的结构示意图,其中示出的第二解码器,用于根据特征表示z复原原始用户数据x,特征编码器需要配合这一任务,使得复原出的复原用户数据x’与原始用户数据x尽可能的相近。基于此,在上述步骤S202之后,所述方法还可以包括:首先,将所述特征表示输入第二解码器中,得到模拟所述原始用户数据的复原用户数据;接着,基于所述复原用户数据和所述原始用户数据,确定第三损失;然后,以最小化所述第三损失为目标,训练所述第二解码器。相应地,上述步骤S214中可以包括:以最小化所述第一损失,最小化所述第三损失,以及最大化所述第二损失为目标,训练所述特征编码器。
在一个具体的实施例中,第二解码器可以采用DNN网络、CNN网络或RNN网络实现。在一个具体的实施例中,可以确定所述原始用户数据和复原用户数据之间的互信息,作为所述第三损失。在另一个具体的实施例中,可以确定两者之间的KL散度,作为所述第二损失。在又一个具体的实施例中,还可以确定两者之间的MSE,作为所述第二损失。
在一个具体的实施例中,可以基于第一损失、第二损失和第三损失,确定特征编码器的综合损失,具体地,综合损失与第一损失和第三损失正相关,且与第二损失负相关。在一个例子中,可以采用公式(8)示出损失函数确定综合损失:
Figure PCTCN2021074481-appb-000013
式(8)中,L en表示特征编码器的综合损失,L cls表示上述第一损失,
Figure PCTCN2021074481-appb-000014
表示上 述第二损失,
Figure PCTCN2021074481-appb-000015
表示上述第三损失;α 1和α 2均为超参,取正值,例如,α 1取0.4,α 2取0.6等。
进一步地,基于如此确定的综合损失,调整特征编码器中的参数,以实现对特征编码器的训练。如此,通过在算法框架中加入第二解码器,可以监督特征编码器尽可能学习到对于分类任务而言,有用的特征,从而提高分类结果的准确性。需要说明的,基于图3示出的算法框架,可以得到训练后的特征编码器、用户分类器、第一解码器和第二解码器,同样地,还是将其中训练好的特征编码器和用户分类器,构建为用户分类系统,例如,可以参见图4示出的根据一个实施例的用户分类系统的结构示意图。
综上,在本说明是实施例披露的构建方法中,利用引入差分隐私的特征编码器,得到具有差分隐私特性的特征表示,使得以特征表示作为输入的用户分类器同样可以保持差分隐私特性,从而实现对用户数据的隐私安全的保护;同时,引入第一解码器与特征编码器进行对抗学习,使得特征表示中可以最大程度上去除用户数据中包含的敏感数据的影响,进而保障预测分类结果的公平性。由此,使用通过所述方法构建的用户分类系统,可以同时实现保护用户数据的隐私安全,以及保障用户分类预测结果的公平性。
与前述实施例中披露的构建方法相对应的,本说明书实施例还披露一种构建装置。具体地,图5示出本说明书实施例披露的保护用户隐私的用户分类系统的构建装置结构图,如图5所示,所述装置500包括以下单元。
特征编码单元501,配置为将原始用户数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始用户数据中包括对应于预设敏感项的原始敏感数据;分类预测单元503,配置为将所述特征表示输入用户分类器中,得到用户分类预测结果;第一损失确定单元505,配置为基于所述用户分类预测结果和所述原始用户数据对应的分类标签,确定第一损失;分类器训练单元507,配置为以最小化所述第一损失为目标,训练所述用户分类器;第一解码单元509,配置为将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据;第二损失确定单元511,配置为基于所述复原敏感数据和所述原始敏感数据,确定第二损失;编码器训练单元513,配置为以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;第一解码器训练单元515,配置为以最小化所述第二损失为目标,训练所述第一解码器;分类系统构建单元517,配置为将训练后的所述特征编码器和所述用户分类器,构建为所述用户分类系统。
在一个实施例中,所述装置500还包括:第二解码单元519,配置为将所述特征表示输入第二解码器中,得到模拟所述原始用户数据的复原用户数据;第三损失确定单元521,配置为基于所述复原用户数据和所述原始用户数据,确定第三损失;第二解码器训练单元523,配置为以最小化所述第三损失为目标,训练所述第二解码器;其中编码 器训练单元513,具体配置为:以最小化所述第一损失,最小化所述第三损失,以及最大化所述第二损失为目标,训练所述特征编码器。
在一个实施例中,第二损失确定单元511具体配置为:确定所述复原敏感数据和原始敏感数据之间的互信息,作为所述第二损失。
在一个实施例中,编码器训练单元513具体包括:综合损失确定模块5131,配置为确定综合损失对应的原始梯度,所述综合损失与所述第一损失正相关,且与所述第二损失负相关;干扰噪声添加模块5132,配置为对所述原始梯度添加用于实现所述差分隐私的噪声,得到添加后梯度;编码器调参模块5133,配置为利用所述添加后梯度,调整所述特征编码器的模型参数。
在一个实施例中,所述编码器训练单元513还包括:梯度裁剪模块5134,配置为基于预设的裁剪阈值,对所述原始梯度进行梯度裁剪,得到裁剪后梯度;其中,干扰噪声添加模块5132具体配置为:基于所述裁剪阈值和预定的噪声缩放系数,确定用于实现所述差分隐私的高斯噪声;计算所述裁剪后梯度与所述高斯噪声的和值,作为所述添加后梯度。
在一个实施例中,所述分类标签指示对应用户的风险等级,或用户所属的人群,或用户的信用等级。
综上,在本说明是实施例披露的构建装置中,利用引入差分隐私的特征编码器,得到具有差分隐私特性的特征表示,使得以特征表示作为输入的用户分类器同样可以保持差分隐私特性,从而实现对用户数据的隐私安全的保护;同时,引入第一解码器与特征编码器进行对抗学习,使得特征表示中可以最大程度上去除用户数据中包含的敏感数据的影响,进而保障预测分类结果的公平性。由此,使用通过所述方法构建的用户分类系统,可以同时实现保护用户数据的隐私安全,以及保障用户分类预测结果的公平性。
以上主要对用于用户分类的算法框架进行介绍。实际上,上述算法框架还可以用于执行其他方面的任务,如用分打分,商品分类,等等。具体地,图6示出本说明书实施例披露的保护数据隐私安全的机器学习系统的构建方法流程示意图,所述构建方法的执行主体可以为任何具有计算、处理能力的装置或设备或系统或平台等。如图6所示,所述方法可以包括步骤S602~S618。
步骤S602,将原始样本数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始样本数据中包括对应于预设敏感项的原始敏感数据;步骤S604,将所述特征表示输入用于执行目标任务的预测模型中,得到预测结果;步骤S606,基于所述预测结果和所述原始样本数据对应的样本标签,确定第一损失;步骤S608,以最小化所述第一损失为目标,训练所述预测模型;步骤S610,将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据;步骤S612,基于所述复原敏感 数据和所述原始敏感数据,确定第二损失;步骤S614,以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;步骤S616,以最小化所述第二损失为目标,训练所述第一解码器;步骤S618,将训练后的所述特征编码器和所述预测模型,构建为执行所述目标任务的所述机器学习系统。
针对以上步骤,在一个实施例中,其中目标任务可以为针对目标对象的分类或评分。在一个具体的实施例中,其中目标对象为用户,相应地,原始样本数据可以为原始用户数据,对应的样本标签可以为针对用户的分类标签。进一步地,上述预测模型可以为用户分类模型或用户打分模型,由此构建的上述机器学习系统可以为用户分类系统或用户打分系统。
在另一个具体的实施例中,其中目标对象可以为商品,相应地,在一个更具体地实施例中,原始样本数据可以为原始商品图片,对应的样本标签可以为在图片中框选的目标区域;在另一个更具体的实施例中,原始样本数据为原始商品数据,对应的样本标签可以为针对商品的分类标签。在一个例子中,其中原始商品数据可以包括商品产地、原料、成本、售价、销量等等。在一个例子中,其中分类标签可以为热门等级标签,如超级热门、一般人们、不热门。在另一个例子中,其中分类标签可以为目标人群标签,如学生、职场人士、养生人士,等等。在一个例子中,其中预设敏感项可以为商品的产地或价格。进一步地,上述预测模型可以为商品分类模型或商品打分模型,由此构建的上述机器学习系统可以为商品分类系统或商品打分系统。
在一个实施例中,在将原始样本数据输入基于差分隐私的特征编码器中,得到特征表示之后,所述方法还包括:将所述特征表示输入第二解码器中,得到模拟所述原始样本数据的复原样本数据;基于所述复原样本数据和所述原始样本数据,确定第三损失;以最小化所述第三损失为目标,训练所述第二解码器;其中,以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器,包括:以最小化所述第一损失,最小化所述第三损失,以及最大化所述第二损失为目标,训练所述特征编码器。
在一个实施例中,基于所述复原敏感数据和所述原始敏感数据,确定第二损失,包括:确定所述复原敏感数据和原始敏感数据之间的互信息,作为所述第二损失。
在一个实施例中,其中,以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器,包括:确定综合损失对应的原始梯度,所述综合损失与所述第一损失正相关,且与所述第二损失负相关;对所述原始梯度添加用于实现所述差分隐私的噪声,得到添加后梯度;利用所述添加后梯度,调整所述特征编码器的模型参数。
在一个实施例中,在确定综合损失对应的原始梯度之后,所述方法还包括:基于预设的裁剪阈值,对所述原始梯度进行梯度裁剪,得到裁剪后梯度;其中,对所述原始梯度进行噪声添加处理,得到处理后梯度,包括:基于所述裁剪阈值和预定的噪声缩放 系数,确定用于实现所述差分隐私的高斯噪声;计算所述裁剪后梯度与所述高斯噪声的和值,作为所述添加后梯度。
需要说明,对以上步骤的描述,还可以参见前述实施例中的相关描述。
综上,在本说明是实施例披露的构建方法中,利用引入差分隐私的特征编码器,得到具有差分隐私特性的特征表示,使得以特征表示作为输入的用户分类器同样可以保持差分隐私特性,从而实现对样本数据的隐私安全的保护;同时,引入第一解码器与特征编码器进行对抗学习,使得特征表示中可以最大程度上去除样本数据中包含的敏感数据的影响,进而保障预测分类结果的公平性。由此,使用通过所述方法构建的机器学习系统,可以同时实现保护样本数据的隐私安全,以及保障针对目标任务的预测结果的公平性。
与前述实施例中披露的构建方法相对应的,本说明书实施例还披露一种构建装置。具体地,图7示出本说明书实施例披露的保护数据隐私安全的机器学习系统的构建装置结构图,如图7所示,所述装置700包括以下单元。
特征编码单元701,配置为将原始样本数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始样本数据中包括对应于预设敏感项的原始敏感数据;预测单元703,配置为将所述特征表示输入用于执行目标任务的预测模型中,得到预测结果;第一损失确定单元705,配置为基于所述预测结果和所述原始样本数据对应的样本标签,确定第一损失;预测模型训练单元707,配置为以最小化所述第一损失为目标,训练所述样本分类器;第一解码单元709,配置为将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据;第二损失确定单元711,配置为基于所述复原敏感数据和所述原始敏感数据,确定第二损失;编码器训练单元713,配置为以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;第一解码器训练单元715,配置为以最小化所述第二损失为目标,训练所述第一解码器;系统构建单元717,配置为将训练后的所述特征编码器和所述样本分类器,构建为所述机器学习系统。
在一个实施例中,所述装置700还包括:第二解码单元719,配置为将所述特征表示输入第二解码器中,得到模拟所述原始样本数据的复原样本数据;第三损失确定单元721,配置为基于所述复原样本数据和所述原始样本数据,确定第三损失;第二解码器训练单元723,配置为以最小化所述第三损失为目标,训练所述第二解码器;其中编码器训练单元713,具体配置为:以最小化所述第一损失,最小化所述第三损失,以及最大化所述第二损失为目标,训练所述特征编码器。
在一个实施例中,第二损失确定单元711具体配置为:确定所述复原敏感数据和原始敏感数据之间的互信息,作为所述第二损失。
在一个实施例中,编码器训练单元713具体包括:综合损失确定模块7131,配置 为确定综合损失对应的原始梯度,所述综合损失与所述第一损失正相关,且与所述第二损失负相关;干扰噪声添加模块7132,配置为对所述原始梯度添加用于实现所述差分隐私的噪声,得到添加后梯度;编码器调参模块7133,配置为利用所述添加后梯度,调整所述特征编码器的模型参数。
在一个实施例中,所述编码器训练单元713还包括:梯度裁剪模块7134,配置为基于预设的裁剪阈值,对所述原始梯度进行梯度裁剪,得到裁剪后梯度;其中,干扰噪声添加模块7132具体配置为:基于所述裁剪阈值和预定的噪声缩放系数,确定用于实现所述差分隐私的高斯噪声;计算所述裁剪后梯度与所述高斯噪声的和值,作为所述添加后梯度。
综上,在本说明是实施例披露的构建装置中,利用引入差分隐私的特征编码器,得到具有差分隐私特性的特征表示,使得以特征表示作为输入的用户分类器同样可以保持差分隐私特性,从而实现对样本数据的隐私安全的保护;同时,引入第一解码器与特征编码器进行对抗学习,使得特征表示中可以最大程度上去除样本数据中包含的敏感数据的影响,进而保障预测分类结果的公平性。由此,使用通过所述方法构建的机器学习系统,可以同时实现保护样本数据的隐私安全,以及保障针对目标任务的预测结果的公平性。
如上,根据又一方面的实施例,还提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行结合图2或图6所描述的方法。
根据又一方面的实施例,还提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现结合图2或图6所描述的方法。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本说明书披露的多个实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。
以上所述的具体实施方式,对本说明书披露的多个实施例的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本说明书披露的多个实施例的具体实施方式而已,并不用于限定本说明书披露的多个实施例的保护范围,凡在本说明书披露的多个实施例的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本说明书披露的多个实施例的保护范围之内。

Claims (18)

  1. 一种保护用户隐私的用户分类系统的构建方法,包括:
    将原始用户数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始用户数据中包括对应于预设敏感项的原始敏感数据;
    将所述特征表示输入用户分类器中,得到用户分类预测结果;
    基于所述用户分类预测结果和所述原始用户数据对应的分类标签,确定第一损失;
    以最小化所述第一损失为目标,训练所述用户分类器;
    将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据;
    基于所述复原敏感数据和所述原始敏感数据,确定第二损失;
    以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;
    以最小化所述第二损失为目标,训练所述第一解码器;
    将训练后的所述特征编码器和所述用户分类器,构建为所述用户分类系统。
  2. 根据权利要求1所述的方法,其中,在将原始用户数据输入基于差分隐私的特征编码器中,得到特征表示之后,所述方法还包括:
    将所述特征表示输入第二解码器中,得到模拟所述原始用户数据的复原用户数据;
    基于所述复原用户数据和所述原始用户数据,确定第三损失;
    以最小化所述第三损失为目标,训练所述第二解码器;
    其中,以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器,包括:
    以最小化所述第一损失,最小化所述第三损失,以及最大化所述第二损失为目标,训练所述特征编码器。
  3. 根据权利要求1所述的方法,其中,基于所述复原敏感数据和所述原始敏感数据,确定第二损失,包括:
    确定所述复原敏感数据和原始敏感数据之间的互信息,作为所述第二损失。
  4. 根据权利要求1所述的方法,其中,以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器,包括:
    确定综合损失对应的原始梯度,所述综合损失与所述第一损失正相关,且与所述第二损失负相关;
    对所述原始梯度添加用于实现所述差分隐私的噪声,得到添加后梯度;
    利用所述添加后梯度,调整所述特征编码器的模型参数。
  5. 根据权利要求1所述的方法,其中,在确定综合损失对应的原始梯度之后,所 述方法还包括:
    基于预设的裁剪阈值,对所述原始梯度进行梯度裁剪,得到裁剪后梯度;
    其中,对所述原始梯度进行噪声添加处理,得到处理后梯度,包括:
    基于所述裁剪阈值和预定的噪声缩放系数,确定用于实现所述差分隐私的高斯噪声;
    计算所述裁剪后梯度与所述高斯噪声的和值,作为所述添加后梯度。
  6. 根据权利要求1所述的方法,其中,所述分类标签指示对应用户的风险等级,或用户所属的人群,或用户的信用等级。
  7. 一种保护用户隐私的用户分类系统的构建装置,包括:
    特征编码单元,配置为将原始用户数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始用户数据中包括对应于预设敏感项的原始敏感数据;
    分类预测单元,配置为将所述特征表示输入用户分类器中,得到用户分类预测结果;
    第一损失确定单元,配置为基于所述用户分类预测结果和所述原始用户数据对应的分类标签,确定第一损失;
    分类器训练单元,配置为以最小化所述第一损失为目标,训练所述用户分类器;
    第一解码单元,配置为将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据;
    第二损失确定单元,配置为基于所述复原敏感数据和所述原始敏感数据,确定第二损失;
    编码器训练单元,配置为以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;
    第一解码器训练单元,配置为以最小化所述第二损失为目标,训练所述第一解码器;
    分类系统构建单元,配置为将训练后的所述特征编码器和所述用户分类器,构建为所述用户分类系统。
  8. 根据权利要求7所述的装置,其中,所述装置还包括:
    第二解码单元,配置为将所述特征表示输入第二解码器中,得到模拟所述原始用户数据的复原用户数据;
    第三损失确定单元,配置为基于所述复原用户数据和所述原始用户数据,确定第三损失;
    第二解码器训练单元,配置为以最小化所述第三损失为目标,训练所述第二解码器;
    其中编码器训练单元,具体配置为:
    以最小化所述第一损失,最小化所述第三损失,以及最大化所述第二损失为目标,训练所述特征编码器。
  9. 根据权利要求7所述的装置,其中,第二损失确定单元具体配置为:
    确定所述复原敏感数据和原始敏感数据之间的互信息,作为所述第二损失。
  10. 根据权利要求7所述的装置,其中,编码器训练单元具体包括:
    综合损失确定模块,配置为确定综合损失对应的原始梯度,所述综合损失与所述第一损失正相关,且与所述第二损失负相关;
    干扰噪声添加模块,配置为对所述原始梯度添加用于实现所述差分隐私的噪声,得到添加后梯度;
    编码器调参模块,配置为利用所述添加后梯度,调整所述特征编码器的模型参数。
  11. 根据权利要求7所述的装置,其中,所述编码器训练单元还包括:
    梯度裁剪模块,配置为基于预设的裁剪阈值,对所述原始梯度进行梯度裁剪,得到裁剪后梯度;
    其中,所述干扰噪声添加模块具体配置为:
    基于所述裁剪阈值和预定的噪声缩放系数,确定用于实现所述差分隐私的高斯噪声;
    计算所述裁剪后梯度与所述高斯噪声的和值,作为所述添加后梯度。
  12. 根据权利要求7所述的装置,其中,所述分类标签指示对应用户的风险等级,或用户所属的人群,或用户的信用等级。
  13. 一种保护数据隐私安全的机器学习系统的构建方法,包括:
    将原始样本数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始样本数据中包括对应于预设敏感项的原始敏感数据;
    将所述特征表示输入用于执行目标任务的预测模型中,得到预测结果;
    基于所述预测结果和所述原始样本数据对应的样本标签,确定第一损失;
    以最小化所述第一损失为目标,训练所述预测模型;
    将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据;
    基于所述复原敏感数据和所述原始敏感数据,确定第二损失;
    以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;
    以最小化所述第二损失为目标,训练所述第一解码器;
    将训练后的所述特征编码器和所述预测模型,构建为执行所述目标任务的所述机器学习系统。
  14. 根据权利要求13所述的方法,其中,所述目标任务包括针对目标对象的分类 或评分,所述目标对象包括用户或商品。
  15. 一种保护数据隐私安全的机器学习系统的构建装置,包括:
    特征编码单元,配置为将原始样本数据输入基于差分隐私的特征编码器中,得到对应的特征表示,所述原始样本数据中包括对应于预设敏感项的原始敏感数据;
    预测单元,配置为将所述特征表示输入用于执行目标任务的预测模型中,得到预测结果;
    第一损失确定单元,配置为基于所述预测结果和所述原始样本数据对应的样本标签,确定第一损失;
    预测模型训练单元,配置为以最小化所述第一损失为目标,训练所述预测模型;
    第一解码单元,配置为将所述特征表示输入第一解码器中,得到模拟所述原始敏感数据的复原敏感数据;
    第二损失确定单元,配置为基于所述复原敏感数据和所述原始敏感数据,确定第二损失;
    编码器训练单元,配置为以最小化所述第一损失以及最大化所述第二损失为目标,训练所述特征编码器;
    系统构建单元,配置为以最小化所述第二损失为目标,训练所述第一解码器;
    系统构建单元,配置为将训练后的所述特征编码器和所述预测模型,构建为执行所述目标任务的所述机器学习系统。
  16. 根据权利要求15所述的装置,其中,所述目标任务包括针对目标对象的分类或评分,所述目标对象包括用户或商品。
  17. 一种计算机可读存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机中执行时,令计算机执行权利要求1-6、13-14中任一项的所述的方法。
  18. 一种计算设备,包括存储器和处理器,其中,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现权利要求1-6、13-14中任一项所述的方法。
PCT/CN2021/074481 2020-03-11 2021-01-29 保护用户隐私的用户分类系统的构建方法及装置 WO2021179839A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010174719.2A CN111400754B (zh) 2020-03-11 2020-03-11 保护用户隐私的用户分类系统的构建方法及装置
CN202010174719.2 2020-03-11

Publications (1)

Publication Number Publication Date
WO2021179839A1 true WO2021179839A1 (zh) 2021-09-16

Family

ID=71428732

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/074481 WO2021179839A1 (zh) 2020-03-11 2021-01-29 保护用户隐私的用户分类系统的构建方法及装置

Country Status (2)

Country Link
CN (1) CN111400754B (zh)
WO (1) WO2021179839A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114330514A (zh) * 2021-12-14 2022-04-12 深圳大学 一种基于深度特征与梯度信息的数据重建方法及系统
WO2023045503A1 (zh) * 2021-09-27 2023-03-30 支付宝(杭州)信息技术有限公司 基于差分隐私进行特征处理的方法及装置
CN116432039A (zh) * 2023-06-13 2023-07-14 支付宝(杭州)信息技术有限公司 协同训练方法及装置、业务预测方法及装置

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400754B (zh) * 2020-03-11 2021-10-01 支付宝(杭州)信息技术有限公司 保护用户隐私的用户分类系统的构建方法及装置
CN112329052A (zh) * 2020-10-26 2021-02-05 哈尔滨工业大学(深圳) 一种模型隐私保护方法及装置
CN112948836B (zh) * 2020-11-16 2022-05-17 支付宝(杭州)信息技术有限公司 保护神经网络模型安全的方法及装置
CN112699408B (zh) * 2020-12-31 2024-06-21 重庆大学 一种基于自编码器的穿戴设备数据隐私保护方法
CN113011966A (zh) * 2021-03-18 2021-06-22 中国光大银行股份有限公司 基于深度学习的信用评分方法及装置
CN113779633B (zh) * 2021-09-16 2024-04-09 咪咕文化科技有限公司 一种数据处理方法、装置及设备
KR20240034470A (ko) * 2022-09-07 2024-03-14 삼성전자주식회사 음성 인식 모델을 학습시키기 위한 전자 장치 및 이의 제어 방법

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368752A (zh) * 2017-07-25 2017-11-21 北京工商大学 一种基于生成式对抗网络的深度差分隐私保护方法
CN109784091A (zh) * 2019-01-16 2019-05-21 福州大学 一种融合差分隐私gan和pate模型的表格数据隐私保护方法
CN109993224A (zh) * 2019-03-27 2019-07-09 中国人民解放军战略支援部队航天工程大学 基于深度学习与多核学习的geo卫星形状与姿态识别方法
CN110647921A (zh) * 2019-09-02 2020-01-03 腾讯科技(深圳)有限公司 一种用户行为预测方法、装置、设备及存储介质
CN111400754A (zh) * 2020-03-11 2020-07-10 支付宝(杭州)信息技术有限公司 保护用户隐私的用户分类系统的构建方法及装置

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10607319B2 (en) * 2017-04-06 2020-03-31 Pixar Denoising monte carlo renderings using progressive neural networks
CN107330954A (zh) * 2017-07-14 2017-11-07 深圳市唯特视科技有限公司 一种基于衰减网络通过滑动属性操纵图像的方法
US20190244138A1 (en) * 2018-02-08 2019-08-08 Apple Inc. Privatized machine learning using generative adversarial networks
US20190325861A1 (en) * 2018-04-18 2019-10-24 Maneesh Kumar Singh Systems and Methods for Automatic Speech Recognition Using Domain Adaptation Techniques
CN108664953B (zh) * 2018-05-23 2021-06-08 清华大学 一种基于卷积自编码器模型的图像特征提取方法
CN108875818B (zh) * 2018-06-06 2020-08-18 西安交通大学 基于变分自编码机与对抗网络结合的零样本图像分类方法
CN109711426B (zh) * 2018-11-16 2022-09-16 中山大学 一种基于gan和迁移学习的病理图片分类装置及方法
CN109753608B (zh) * 2019-01-11 2023-08-04 腾讯科技(深圳)有限公司 确定用户标签的方法、自编码网络的训练方法及装置
CN110009013B (zh) * 2019-03-21 2021-04-27 腾讯科技(深圳)有限公司 编码器训练及表征信息提取方法和装置
CN110222588B (zh) * 2019-05-15 2020-03-27 合肥进毅智能技术有限公司 一种人脸素描图像衰老合成方法、装置及存储介质
CN110334781A (zh) * 2019-06-10 2019-10-15 大连理工大学 一种基于Res-Gan的零样本学习算法
CN110689048A (zh) * 2019-09-02 2020-01-14 阿里巴巴集团控股有限公司 用于样本分类的神经网络模型的训练方法和装置
CN110728729B (zh) * 2019-09-29 2023-05-26 天津大学 一种基于注意机制的无监督ct投影域数据恢复方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368752A (zh) * 2017-07-25 2017-11-21 北京工商大学 一种基于生成式对抗网络的深度差分隐私保护方法
CN109784091A (zh) * 2019-01-16 2019-05-21 福州大学 一种融合差分隐私gan和pate模型的表格数据隐私保护方法
CN109993224A (zh) * 2019-03-27 2019-07-09 中国人民解放军战略支援部队航天工程大学 基于深度学习与多核学习的geo卫星形状与姿态识别方法
CN110647921A (zh) * 2019-09-02 2020-01-03 腾讯科技(深圳)有限公司 一种用户行为预测方法、装置、设备及存储介质
CN111400754A (zh) * 2020-03-11 2020-07-10 支付宝(杭州)信息技术有限公司 保护用户隐私的用户分类系统的构建方法及装置

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023045503A1 (zh) * 2021-09-27 2023-03-30 支付宝(杭州)信息技术有限公司 基于差分隐私进行特征处理的方法及装置
CN114330514A (zh) * 2021-12-14 2022-04-12 深圳大学 一种基于深度特征与梯度信息的数据重建方法及系统
CN114330514B (zh) * 2021-12-14 2024-04-05 深圳大学 一种基于深度特征与梯度信息的数据重建方法及系统
CN116432039A (zh) * 2023-06-13 2023-07-14 支付宝(杭州)信息技术有限公司 协同训练方法及装置、业务预测方法及装置
CN116432039B (zh) * 2023-06-13 2023-09-05 支付宝(杭州)信息技术有限公司 协同训练方法及装置、业务预测方法及装置

Also Published As

Publication number Publication date
CN111400754B (zh) 2021-10-01
CN111400754A (zh) 2020-07-10

Similar Documents

Publication Publication Date Title
WO2021179839A1 (zh) 保护用户隐私的用户分类系统的构建方法及装置
Coston et al. Characterizing fairness over the set of good models under selective labels
US11263550B2 (en) Audit machine learning models against bias
Shrivastava et al. Failure prediction of Indian Banks using SMOTE, Lasso regression, bagging and boosting
De et al. Learning and forecasting opinion dynamics in social networks
TWI631518B (zh) 具有一或多個計算裝置的電腦伺服系統及訓練事件分類器模型的電腦實作方法
Turkson et al. A machine learning approach for predicting bank credit worthiness
CN105426356B (zh) 一种目标信息识别方法和装置
CN110232473B (zh) 一种基于大数据金融的黑产用户预测方法
CN110737730B (zh) 基于无监督学习的用户分类方法、装置、设备及存储介质
CN112700252A (zh) 一种信息安全性检测方法、装置、电子设备和存储介质
Wang et al. Integrating machine learning algorithms with quantum annealing solvers for online fraud detection
CN111966886A (zh) 对象推荐方法、对象推荐装置、电子设备及存储介质
US20230342606A1 (en) Training method and apparatus for graph neural network
CN106354783A (zh) 一种基于信任关系隐含相似度的社会化推荐方法
CN113095927A (zh) 一种反洗钱可疑交易识别方法及设备
Zhang et al. Non-tradable shares pricing and optimal default point based on hybrid KMV models: Evidence from China
Kothamasu et al. Sentiment analysis on twitter data based on spider monkey optimization and deep learning for future prediction of the brands
Zhuang et al. Deperturbation of online social networks via bayesian label transition
CN112560105B (zh) 保护多方数据隐私的联合建模方法及装置
Li et al. A credit risk model with small sample data based on G-XGBoost
CN116029760A (zh) 消息推送方法、装置、计算机设备和存储介质
CN115114851A (zh) 基于五折交叉验证的评分卡建模方法及装置
Bordbar et al. Detecting fake accounts through Generative Adversarial Network in online social media
CN110909777A (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: 21767223

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

Country of ref document: EP

Kind code of ref document: A1