A user personality privacy protection method based on GAN

Through the user personality privacy protection method based on GAN, reinforcement learning and discriminator extraction features are used to guide the generator to generate texts with similar semantics and large personality differences, solving the problem of obtaining personality information in social engineering attacks, and realizing the control of user personality privacy. Effective protection reduces the attack success rate.

CN113742772BActive Publication Date: 2024-10-22BEIJING UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110927352.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-09
Publication Date
2024-10-22
Estimated Expiration
2041-08-09

AI Technical Summary

Technical Problem

It is difficult for the existing technology to effectively defend against social engineering attacks, especially because its defense methods are too passive and fail to grasp the core of the attack - the particularity of the target "person", and the vulnerabilities of different targets in social attacks vary greatly. This allows attackers to conduct precise attacks by obtaining personality information.

Method used

A user personality privacy protection method based on Generative Adversarial Network (GAN) combined with reinforcement learning is used to reduce the personality privacy in user data at the source of the data through text transformation, and the discriminator is used to extract features to guide the generator to generate semantically similar and widely different personalities. text, preventing attackers from obtaining the user’s true personality information.

Benefits of technology

It effectively reduces the attacker's success rate in analyzing user personality information, improves the protection effect of social engineering attacks, and provides a method to protect "people" security in cyberspace, which has important cognitive domain security significance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113742772B_ABST
    Figure CN113742772B_ABST
Patent Text Reader

Abstract

A user personality privacy protection method based on GAN belongs to the field of social engineering. The present invention uses a generative adversarial network combined with reinforcement learning to transform text, in which the policy gradient solves the problem that GAN is not differentiable for text discreteness. We "leak" the hidden semantic features in the discriminator to the generator class to improve the semantic similarity of the generated text, and at the same time add the semantic similarity and personality difference score between the feature vectors of the real text and the generated text to the original target of GAN, so the sample classifier score J(G θ ), semantic similarity score J sem and personality difference score J pers The weighted average of is used as a feedback signal to guide the learning of the generator, so that the generator can produce highly diverse sentences to match the changes in real sentences and avoid generating text data with a single pattern. The attacker cannot analyze the user's true personality from the transformed text data, thereby achieving the purpose of reducing or blocking the attack effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of social engineering, and in particular relates to a user personality privacy protection method based on GAN. Background Art

[0002] Cyberspace threats are gradually focusing on the target "people". Social engineering attacks against "people" are emerging in an endless stream and have caused huge losses. Social engineering attacks exploit people's psychological weaknesses. Attackers use big data, artificial intelligence, etc. to gain a deeper understanding of the target and discover the target's psychological attributes, thereby launching more precise attacks on the target and greatly increasing the success rate of attacks. However, the current defense measures against social engineering are mainly focused on phishing, mainly using technical means to passively defend against the carriers of social engineering attacks. A large number of cases in recent years have shown that the effect is not ideal.

[0003] At its core, current defense technology mainly considers the information characteristics of the attack, and does not grasp the core of social engineering - the particularity of the target "people", and the defense method is too passive. Different targets have different vulnerabilities in social attacks, and the attackers also have different focuses. An email that does no harm to most people may be a fatal threat to a certain type of people. Discovering how attackers find and exploit the weaknesses of "people" and blocking or interfering at key links is an important prerequisite for effective protection against social engineering attacks.

[0004] Human beings are complex and ever-changing entities. The analysis of human beings involves complex psychological factors. Among the many psychological factors, "personality" is a relatively stable and comprehensive psychological characteristic, which is widely used in the research related to human beings in the field of security. Personality theory is divided into six schools: psychoanalysis, trait, biology, humanism, behaviorism and cognitive. The most commonly used personality model is the most mainstream Big Five personality model in the trait school, such as Figure 1 As shown, it describes personality in terms of five dimensions: openness, conscientiousness, extraversion, agreeableness, and neuroticism.

[0005] As a stable set of psychological characteristics, personality has been widely used in security research. On the other hand, it is also an important factor in social engineering attacks. It is realistic and feasible to use personality as an entry point for early research on people in social engineering. Figure 1 As shown, in the attack preparation stage, the attacker obtains the personality of the attacked object by analyzing the collected information data, and uses the personality information to establish a friendly relationship with the object, maintain the object's emotions, and deceive the object in the subsequent attack stage to achieve the ultimate attack purpose.

[0006] There are two main ways to obtain personality information: traditional measurement methods and big data analysis methods. Traditional measurement methods use psychological personality measurement methods, including self-report data, observer evaluation data, and projective tests; big data analysis methods obtain data generated by the target when browsing the Internet or using terminal devices and participating in social network activities, associate user attributes with the data, discover the rules, and establish analysis models to obtain personality information.

[0007] In the information age and big data, more and more people use social media to share their lives and opinions, making user text data open and accessible. Using machine learning algorithms and other means to analyze the personality information carried by text data is the most effective and accurate method, and it is also one of the main channels for user personality privacy leakage. Protecting the privacy information carried by the text can block attackers from obtaining user personality information.

[0008] Protecting the personality privacy of the attacked object can effectively interfere with or deceive the attacker's personality analysis, causing the attacker to obtain incorrect personality information, avoiding the attacker's exploitation of personality vulnerabilities, and reducing the success rate of social engineering attacks. At present, there is a gap in the research on personality privacy protection. Conducting research on personality privacy protection is a suitable starting point for the security protection of "people" in cyberspace, and it is of great significance for the in-depth research on cognitive domain security in the future. Summary of the invention

[0009] The first prerequisite for social engineering to exploit personality weaknesses is to obtain the target's personality information. The most effective and most difficult to protect channel for obtaining personality is through network text. The present invention proposes a user personality privacy protection method based on generative adversarial networks (GAN, Generative Adversarial Networks), which reduces the personality privacy in user data at the source of the data through text transformation methods, thereby blocking attackers from stealing privacy.

[0010] When the goal of GAN is to generate discrete word sequences, it has certain limitations. One main reason is that the discrete output of the generative model makes it difficult to pass gradient updates from the discriminative model to the generative model. Moreover, the discriminative model can only evaluate a complete sequence, and for a partially generated sequence, it is very important to balance its current score and future score. In addition, current deep neural networks can only approximate continuous mappings, while the transmission mapping is a discontinuous mapping with discontinuities. In other words, during GAN training, the target mapping is not in the representable functional space of the DNN. This obvious contradiction leads to convergence difficulties; if the support of the target probability measure has multiple connected branches, and the GAN training obtains a continuous mapping, it is possible that the value range of the continuous mapping is concentrated on a certain connected branch, resulting in mode collapse.

[0011] In order to solve the above defects and realize the personality transformation of text data under the condition of semantic similarity, the present invention uses a generative adversarial network combined with reinforcement learning (RL) to transform text, in which the policy gradient solves the problem that GAN is not differentiable for text discreteness. We "leak" the hidden semantic features in the discriminator to the generator class to improve the semantic similarity of the generated text, and at the same time add the semantic similarity and personality difference score between the feature vectors of the real sentence and the generated sentence to the original target of GAN, so the sample classifier score J(G θ ), semantic similarity score J sem and personality difference score J pers The weighted average of is used as a feedback signal to guide the learning of the generator, so that the generator generates highly diverse sentences to match the changes in real sentences, avoiding the generation of text data with a single pattern. The attacker cannot analyze the user's true personality from the transformed text data, thereby achieving the purpose of reducing the attack effect or blocking the attack. The present invention consists of the following modules: generator G, discriminator D, semantic module and personality module. The overall network structure is as follows: Figure 3 As shown, the following is a description of the structure and function of each component:

[0012] Generator

[0013] The generator G is divided into two parts: the text generation module and the feature guidance module. Both modules use the Long Short-Term Memory (LSTM) network structure. The text generation module uses a random token as the initial value, and uses the embedding vector obtained after processing it with the word embedding model as the input of the LSTM. According to the specified text length sequence_length = T, it generates the predicted value of each time step (0, 1, 2, ..., T) one by one, and uses the output of the previous time step of the LSTM as the input of the next time step. Combined with the feature guidance module, the generation process of the tth time step in the text generation module is shown in formula (1-3):

[0014] h t =G θ (h t-1 ,x t ) (1)

[0015] P(·|x1,…,x t )=z t (h t )=softmax(W s (h t w t )+cs ) (2)

[0016] y t P(·|x1,…,x t ) (3)

[0017] Where θ represents the parameters of the generator, that is, the parameters in the LSTM network structure. Its key structure is a memory cell, and the parameters include the number of hidden units hidden_size, the sequence length sequence_length, and the size of each training batch batch_size. t-1 is the hidden state of the previous time step, x t Represents the input vector of the current time step. Output the hidden state of the current time step h t The guidance vector w generated by the feature guidance module t Combined and linearly transformed before inputting into the softmax function, where W s is the weight matrix, c s is the bias coefficient. Through the softmax layer, the probability distribution z of the current time step is calculated t and from the probability distribution P(·|x1,…,x t ) for the word y t Take samples.

[0018] Discriminator

[0019] The discriminator D uses a convolutional neural network (CNN) structure. First, the input data is vectorized through the word embedding layer; then the word vector is input into the convolution layer, and the text features are extracted using convolution kernels of different sizes; then the text features are sent to the output layer after being processed by the fully connected layer. The output layer uses the softmax function. The discriminator is trained with negative samples generated by the generator and positive samples in the real data set. It is essentially a binary classification task. For each sample x, the discriminator will output the probability D of whether the sample x is real data. φ (x), and feed it back to the generator as a reward signal in reinforcement learning. The calculation process of the probability value is shown in (4):

[0020] D φ (x) = softmax(φ o F(x)) (4)

[0021] The optimization objective of the discriminator is shown in (5):

[0022]

[0023] Among them, φ is the parameter set of the discriminator, including the parameters of the output layer, convolution layer, and pooling layer. o Represents the parameters of the output layer, including the number of categories num_classes and the weight matrix W of the linear transformation before the softmax function processing d and the bias coefficient c d F represents the parameters of all network layers except the output layer in the discriminator, namely the convolution layer and the pooling layer. The parameters include the convolution kernel size filter_sizes and the number of convolution kernels number_filters. The padding method selects no padding (Valid). In addition to the above parameters, the parameters of the discriminator also include the dimension emb_dim of the embedding vector of the input text and the sequence length sequence_length.

[0024] F can be regarded as a feature extraction network, and its output result f t It is the hidden layer feature vector extracted by CNN and the input of the feature guidance module of the generator. data Represents the probability distribution of real samples, Y~P data represents the data sampled from the positive sample, and Y~G θ represents the data sampled from the negative samples generated by the generator with parameter θ, D φ (Y) represents the probability of inputting the data of positive or negative samples into the discriminator, and E is used to calculate the expected value. In the discriminator, the probability of positive samples should be close to 1, and the probability of negative samples should be close to 0. The goal of discriminator training is to improve the accuracy of identifying positive and negative samples, that is, to maximize the goal in formula (5).

[0025] The generator only uses scalar values ​​to optimize network training. The scalar guidance signal of the entire text output is uninformative, and there is no intermediate syntactic structure and semantics to guide the generator to fully learn. The sequence can only be optimized through a large number of sampling to optimize the training direction, and the limited number of sampling is also very small for the complete spatial distribution. During training, the gradient fed back from the discriminator to the generator is also very small. These problems make it impossible for the generator to effectively optimize the network parameters. In view of the weak guidance of the discriminator feedback signal, a feature guidance module is added to the generator network. The purpose of the feature guidance module is to obtain richer text features from the discriminator to guide the generation. In the discriminator, CNN is used to extract the latent feature f for the generated sequence and the real sequence. t , this vector is transformed using the LSTM network to obtain the feature guide vector g t , maintaining the feature consistency with the text generation module, the process is shown in formula (6).

[0026]

[0027] Where C represents the feature-guided module, f t To identify the potential features extracted by CNN, θ C is the parameter set of the feature guidance module, h t C represents the hidden state vector of the current time step in the feature guidance module, g t Denotes the latent vector f t The feature guidance vector obtained by conversion of the feature guidance module C.

[0028] Since the dimension of the feature guidance vector and the vector output of each time step of the text generation module are inconsistent, there is a problem of inconsistency in network training. Therefore, we added linear transformation to the module. Considering the stability of the network, the feature vectors of the nearest k time steps are linearly transformed to obtain w t , and then connected to the text generation module to determine the next token of the sequence, as shown in formula (7).

[0029]

[0030] Where W c Represents the dimensional transformation matrix. The initial value is generally a random value, which is automatically updated through back propagation when training the model. During the back propagation process, as we and be change, the probability distribution is continuously adjusted, so that the loss function of the generator is continuously reduced until convergence, and its parameter value no longer changes.

[0031] Semantic Module

[0032] The present invention performs personality transformation on the basis of ensuring semantic similarity, and the semantic module evaluates the text semantic similarity in the following manner, that is, the semantic preservation degree of the input content in the generated sentence.

[0033] Assume that the original text P r It consists of n sentences, P r =(s r1 ,s r2 ,…s rn ), generate text P g It consists of m sentences, P g =(s g1 ,s g2 ,…s gm ), then define P r With P g The similarity between Sim(P r ,P g )for:

[0034]

[0035] Among them, Sim_s(s ri ,s gj ) represents two sentences s ri and gj Similarity between j (f) refers to the maximum value of f when traversing variable j. That is, the similarity between two paragraphs depends on the similarity between sentences. The similarity between sentences is proposed to use the Siamese LSTM (Long Short-Term Memory) algorithm. The overall calculation scheme is as follows Figure 4 As shown:

[0036] in, YesP r The last hidden state obtained in the LSTMr model represents s ri semantics;

[0037] YesP g The last hidden state obtained in the LSTMg model represents s gj semantics;

[0038] Sentences ri ,s gj The similarity between them is defined as:

[0039] Personality Module

[0040] The present invention uses a text transformation method to reduce the personality privacy in user data at the source of the data, ensures the personality difference between the source text and the generated text through a personality module, and forms a personality difference evaluation method based on a commonly used similarity calculation method combined with the representation characteristics of the personality assessment results. Since the evaluation results of the Big Five personality model are five dimensions represented by numerical values ​​of 0-100, the corresponding five-dimensional personality vector is U (u1, u2, u3, u4, u5), and the personality difference can be measured by calculating the similarity between vectors. Taking the Euclidean distance as an example, the Euclidean distance dist (U, V) between the personality vectors is first calculated, and the personality difference score is calculated based on the Euclidean distance between the personality vectors. The score range is [0, 1]. The higher the score, the greater the difference, and vice versa. The difference score J between two personalities U (u1, u2, u3, u4, u5) and V (v1, v2, v3, v4, v5) pers The calculation method is:

[0041] BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 Big Five Personality;

[0043] Figure 2 Social engineering attack process using personality;

[0044] Figure 3 The overall network structure diagram of the present invention;

[0045] Figure 4 The framework diagram of semantic similarity calculation based on Siamese LSTM algorithm; DETAILED DESCRIPTION

[0046] The present invention provides a user personality privacy protection method based on a generative adversarial network (GAN) through text transformation, and the specific implementation steps are as follows: step 1, a generator generates text with the help of a feature guide vector extracted by a discriminator; step 2, the generated text sequence is completed by using Monte Carlo search according to a specified sequence length; step 3, the completed text sequence and the source text sequence are input into the discriminator, and the probability distribution is calculated using a softmax function as a true and false sample classification score; step 4, a semantic module is used to calculate the semantic similarity between the real sample and the generated sample; step 5, a personality module is used to calculate the personality difference score between the real sample and the generated sample; step 6, according to reinforcement learning, the true and false classification score of the discriminator, the semantic similarity of the semantic module and the personality difference score of the personality module are weighted and passed to the generator as a reward value to optimize the text generation process.

[0047] Step 1: The generator generates text using the feature vector extracted by the discriminator

[0048] The generator G is divided into two parts: the text generation module and the feature guidance module. Both modules adopt the Long Short-Term Memory (LSTM) network structure. The text generation module uses a random token as the initial value, and uses the embedding vector x0 obtained after processing it with the pre-trained word embedding model as the input of the LSTM. According to the specified text sequence length sequence_length=T, the prediction value of each time step (0,1,2,…,T) is generated one by one. To ensure the quality of the generated text, we set the sequence length T to a maximum of 40, and use the output of the previous time step of the LSTM as the input of the next time step, as shown in formula (10).

[0049] h t =G θ (h t-1 ,x t ) (10)

[0050] Where θ represents the parameters of the generator, that is, the parameters in the LSTM network structure, whose key structure is a memory cell, and the parameters include the number of hidden units hidden_size, the sequence length sequence_length, and the size of each training batch batch_size. The above parameter values ​​can be adjusted according to the objective function of the generator. In the present invention, in order to maximize the semantic similarity and personality difference between the generated text and the real text, the following parameter values ​​are set: the number of hidden units hidden_size = 32, the sequence length sequence_length = 40, and the size of each training batch batch_size = 64. h t-1 is the hidden state of the previous time step, x t Represents the input vector of the current time step, whose vector dimension is determined by the pre-trained word embedding model, emb_dim=32.

[0051] For each sample x, the discriminator will output the probability D of whether the sample x is real data. φ (x), and feeds it back to the generator as a reward signal in reinforcement learning. The generator only uses this scalar value to optimize network training, and the scalar guidance signal of the entire text output is uninformative, and there is no intermediate syntactic structure and semantics to guide the generator to fully learn. The sequence can only be optimized in the training direction through a large number of samplings, and the limited number of samplings is also very small for the complete spatial distribution. During training, the gradient fed back from the discriminator to the generator is also very small. These problems make it impossible for the generator to effectively optimize the network parameters. In view of the weak guidance of the discriminator feedback signal, a feature guidance module is added to the generator network. The purpose of the feature guidance module is to obtain richer text features from the discriminator to guide the generation. In the discriminator, CNN is used to extract the latent feature f for the generated sequence and the real sequence. t , this vector is transformed using the LSTM network to obtain the feature guide vector g t , maintaining the feature consistency with the text generation module, the process is shown in formula (11).

[0052]

[0053] Where C represents the feature guidance module constructed by LSTM, f t To identify the potential features extracted by CNN, θ C is the parameter set of the feature guidance module, h t C represents the hidden state vector of the current time step in the feature guidance module, g t Denotes the latent vector f tThe feature guidance vector is obtained by conversion of the feature guidance module C. Since the feature guidance module also adopts the LSTM network structure, the feature guidance module and the generator module share parameters.

[0054] Since the dimension of the feature guidance vector and the vector output of each time step of the text generation module are inconsistent, there is a problem of inconsistency in network training. Therefore, we added linear transformation to the module. Considering the stability of the network, the feature vectors of the nearest k time steps are linearly transformed to obtain w t , and then connected to the text generation module to determine the next token of the sequence, as shown in formula (12).

[0055]

[0056] Where W c represents the dimension transformation matrix, w t is the feature guide vector after linear transformation.

[0057] Combined with the feature guidance module, the generation process of the tth time step in the text generation module is shown in formula (13-14):

[0058] P(·|x1,…,x t )=z t (h t )=softmax(W s (h t w t )+c s ) (13)

[0059] y t ~P(·|x1,…,x t ) (14)

[0060] Output the hidden state of the current time step h t The guidance vector w generated by the feature guidance module t Combined and linearly transformed before inputting into the softmax function, where W s is the weight matrix, c s is the bias coefficient. Through the softmax layer, the probability distribution z of the current time step is calculated t and from the probability distribution P(·|x1,…,x t ) for the word y t Take samples.

[0061] Dimensional transformation matrix W c , weight matrix W s and the bias coefficient c sThe initial values ​​of the three are generally random values, which are automatically updated through back propagation when training the model. During the back propagation process, as we and be change, the probability distribution is continuously adjusted, so that the loss function of the generator continues to decrease until convergence, and the values ​​of the three no longer change. The loss function of the generator is shown in step 5.

[0062] Step 2: Complete the generated text sequence using Monte Carlo search according to the specified sequence length;

[0063] Since the discriminator can only accept the input of the complete sequence, Monte Carlo sampling can supplement the incomplete sequence, so a large number of sampling operations are required in the intermediate time to fill the incomplete sequence. Then the complete sequence Y 1:T It is sent to the discriminator to determine the reward of the current token, and the subsequent generation is guided by the feedback. The Monte Carlo search process MC for sampling K times is shown in formula (15):

[0064]

[0065] where Y 1:T K represents the complete sequence obtained by the Kth sampling. To ensure the quality and diversity of the generated text and reduce the computational cost, we set the K value to 4.

[0066] Step 3: Input the completed text sequence and the source text sequence into the discriminator and use the softmax function to calculate the probability distribution as the true and false sample classification score;

[0067] The discriminator D uses a convolutional neural network (CNN) structure. First, the input data is vectorized through the word embedding layer; then the word vector is input into the convolution layer, and the text features are extracted using convolution kernels of different sizes; then the text features are sent to the output layer after being processed by the fully connected layer. The output layer uses the softmax function. The discriminator is trained with negative samples generated by the generator and positive samples in the real data set. It is essentially a binary classification task. For each sample x, the discriminator will output the probability D of whether the sample x is real data. φ (x), and feed it back to the generator as a reward signal in reinforcement learning. The calculation process of the probability value is shown in (16):

[0068] D φ (x) = softmax(φ o F(x)) (16)

[0069] In the discriminator, the probability of a positive sample should be close to 1, and the probability of a negative sample should be close to 0. The goal of discriminator training is to improve the accuracy of identifying positive and negative samples, that is, to maximize the goal in formula (17):

[0070]

[0071] Among them, φ is the parameter set of the discriminator, including the parameters of the output layer, convolution layer, and pooling layer. o Represents the parameters of the output layer, including the number of categories num_classes and the weight matrix W of the linear transformation before the softmax function processing d and the bias coefficient c d Since the role of the discriminator is to distinguish the true and false of the input text, num_classes = 2; weight matrix W d and the bias coefficient c d The initial value is generally a random value, which is automatically updated by back propagation during model training and adjusted until the loss function converges. In the present invention, the loss function of the discriminator is a cross entropy loss function.

[0072] F represents the parameters of all network layers except the output layer in the discriminator, namely the convolutional layer and the pooling layer. The parameters include the convolution kernel size filter_sizes and the number of convolution kernels number_filters. The padding method selects no padding (Valid). The above parameter values ​​can also be set manually according to the objective function. In order to improve the classification accuracy of the discriminator and provide a richer text feature guide generator for the feature extraction network, we adjust the convolution kernel size filter_sizes = [1,2,3,4,5,6,7,8,9,10,15,20] and the number of convolution kernels number_filters = [100,200,200,200,200,100,100,100,100,100,160,160].

[0073] In addition to the above parameters, the parameters of the discriminator also include the dimension emb_dim and sequence length sequence_length of the embedding vector of the input text, which are consistent with the parameter values ​​set in the generator module. data Represents the probability distribution of real samples, Y~P data represents the data sampled from the positive sample, and Y~G θ represents the data sampled from the negative samples generated by the generator with parameter θ, D φ (Y) represents the probability of inputting the data of positive or negative samples into the discriminator, and E is used to calculate the expected value.

[0074] Step 4: Use the semantic module to calculate the semantic similarity between the real sample and the generated sample;

[0075] The present invention performs personality transformation on the basis of ensuring semantic similarity, and the semantic module evaluates the text semantic similarity in the following manner, that is, the semantic preservation degree of the input content in the generated sentence.

[0076] Assume that the original text P r It consists of n sentences, P r =(s r1 ,s r2 ,…s rn ), generate text P g It consists of m sentences, P g =(s g1 ,s g2 ,…s gm ), then define the semantic score J sem P r With P g The similarity between Sim(P r ,P g ), namely J sem =Sim(P r ,P g ):

[0077]

[0078] Among them, Sim_s(s ri ,s gj ) represents two sentences s ri and gj Similarity between j (f) refers to the maximum value of f taken by traversing variable j. That is, the similarity between two paragraphs depends on the similarity between sentences. The similarity between sentences is proposed to use the Siamese LSTM (Long Short-Term Memory) algorithm. The overall calculation scheme is as follows Figure 4 As shown:

[0079] in, YesP r The last hidden state obtained in the LSTMr model represents s ri semantics;

[0080] YesP g The last hidden state obtained in the LSTMg model represents s gj semantics;

[0081] Sentences ri ,s gjThe similarity between them is defined as:

[0082] Step 5: Use the personality module to calculate the personality difference scores of the real samples and the generated samples;

[0083] The present invention uses a text transformation method to reduce the personality privacy in user data at the source of the data, ensures the personality difference between the source text and the generated text through a personality module, and forms a personality difference evaluation method based on a commonly used similarity calculation method combined with the representation characteristics of the personality assessment results. Since the evaluation results of the Big Five personality model are five dimensions represented by numerical values ​​of 0-100, the corresponding five-dimensional personality vector is U (u1, u2, u3, u4, u5), and the personality difference can be measured by calculating the similarity between vectors. Taking the Euclidean distance as an example, the Euclidean distance dist (U, V) between the personality vectors is first calculated, and the personality difference score is calculated based on the Euclidean distance between the personality vectors. The score range is [0, 1]. The higher the score, the greater the difference, and vice versa. The difference score J between two personalities U (u1, u2, u3, u4, u5) and V (v1, v2, v3, v4, v5) pers The calculation method is:

[0084]

[0085] Step 6: According to reinforcement learning, the true and false classification scores of the discriminator, the semantic similarity of the semantic module, and the personality difference score of the personality module are weighted and processed, and then transmitted to the generator as feedback signals to optimize the text generation process;

[0086] Due to the discretization of text sequences, the generator cannot solve the gradient from the target function to the scalar signal value. In addition, the current deep neural network can only approximate continuous mapping, while the transmission mapping is a discontinuous mapping with discontinuities. In other words, during the GAN training process, the target mapping is not in the representable functional space of the DNN. This obvious contradiction leads to convergence difficulties; if the support set of the target probability measure has multiple connected branches, and the GAN training obtains a continuous mapping, it is possible that the value range of the continuous mapping is concentrated on a certain connected branch, resulting in mode collapse.

[0087] To solve the above defects and realize the personality transformation of text data under the condition of semantic similarity, we "leak" the hidden semantic features in the discriminator to the generator class to improve the semantic similarity of the generated text. At the same time, we add the semantic similarity and personality difference scores between the feature vectors of real sentences and generated sentences to the original target of GAN to improve the diversity of generated samples. We use a generative adversarial network combined with reinforcement learning to perform text transformation, in which the policy gradient is used to solve the problem that GAN is not differentiable for the discreteness of text.

[0088] In the present invention, the sequence generation process is combined with reinforcement learning theory as a series of action selections, and Monte Carlo search is used to complete the sequence under the current step. The action a of each step is to select the next token y t , that is, a t =y t ; The state of each step is the prefix sequence of the generated tokens, that is, state t =y1,…,y t-1 (In the following, a is used to represent the action taken at a certain step, that is, the next token selected, and state is the state represented by the prefix sequence of the tokens generated at a certain step.) After completing the last time step, the complete sequence is sent to the discriminator, semantic module, and personality module respectively, and then the probability D is output. φ , semantic similarity J sem and personality difference scores J pers Passed to the generator, the weighted average of the three is used as the RL reward signal to guide the learning of the generator, and passed back to the intermediate state-action step using Monte Carlo search.

[0089] The reinforcement learning strategy is represented by G θ (a|state=P(a|state;θ), which specifies the probability of taking an action a in state state; the action reward value function is defined as Q θ (state,a), which represents the total reward value obtained by taking action a in state state according to the strategy. The scores obtained through K samplings are averaged to form the average expected value Q of the current token θ , and reduce the granularity of reward guidance to the level of tokens. The calculation method is shown in (20):

[0090]

[0091] Among them, α, β and η are the sample classifier scores J(G θ ), semantic similarity score J sem and personality difference score J pers The weights can be adjusted according to the objective function of the generator. To balance the impact of these three signals, we set the weights as follows: α = 0.5, β = 0.5, η = 1. The total expected reward is defined as J(G θ ), defined as follows:

[0092]

[0093] The goal of the generator is to maximize the feedback reward signal by taking the policy gradient, so the loss function of the generator should define the negative value of the reward signal, that is, L G (θ)=-J(Gθ ), the gradient descent algorithm for the generator loss is defined as follows:

[0094]

[0095] in represents the gradient descent process in back propagation, and the parameters θ of the generator are adjusted along with the process until the loss value converges; P θ (y t |state t ) means that after a gradient descent is completed, that is, after the sample generation process is completed, the parameter value θ is set, and the state state at the t step is t Next, select the next character y t probability.

Claims

1. A user personality privacy protection method based on GAN, characterized in that: Here are the steps: Step 1: The generator generates text with the help of the feature guide vector extracted by the discriminator; Step 2: Complete the generated text sequence using Monte Carlo search according to the specified sequence length; Step 3: Input the completed text sequence and the source text sequence into the discriminator and use the softmax function to calculate the probability distribution as the true and false sample classification score; Step 4: Use the semantic module to calculate the semantic similarity between the real sample and the generated sample; Step 5: Use the personality module to calculate the personality difference scores of the real samples and the generated samples; Step 6: According to reinforcement learning, the true and false sample classification scores of the discriminator, the semantic similarity of the semantic module, and the personality difference score of the personality module are weighted and passed to the generator as a reward value to optimize the text generation process; The specific steps are as follows: Step 1: The generator generates text using the feature vector extracted by the discriminator The generator G is divided into two parts: a text generation module and a feature guidance module. Both modules adopt a long short-term memory network structure. The text generation module uses a random word as the initial value, and uses the embedding vector x0 obtained after processing it with the pre-trained word embedding model as the input of the LSTM. According to the specified text sequence length sequence_length=T, it generates the prediction value of each time step (0,1,2,…,T) one by one, sets the sequence length T to a maximum of 40, and uses the output of the previous time step of the LSTM as the input of the next time step, as shown in formula (1). h t =G θ (h t-1 ,x t ) (1) Where θ represents the parameters of the generator, that is, the parameters in the LSTM network structure. Its key structure is a memory cell. The parameters include the number of hidden units hidden_size, the sequence length sequence_length, and the size of each training batch batch_size; Set to the following parameter values: hidden_size = 32, sequence_length = 40, and batch_size = 64; h t-1 is the hidden state of the previous time step, x t Represents the input vector of the current time step, whose vector dimension is determined by the pre-trained word embedding model, emb_dim = 32; For each sample x, the discriminator will output the probability D of whether the sample x is real data. φ (x), and feed it back to the generator as a reward signal in reinforcement learning; In view of the weak guidance of the discriminator feedback signal, a feature guidance module is added to the generator network; the purpose of the feature guidance module is to obtain richer text features from the discriminator to guide the generation; in the discriminator, CNN is used to extract the potential features f from the generated sequence and the real sequence t , this vector is transformed using the LSTM network to obtain the feature guide vector g t , maintain the feature consistency with the text generation module, the process is shown in formula (2); Where C represents the feature guidance module constructed by LSTM, f t is the potential feature extracted by CNN in the discriminator, θ C is the parameter set of the feature guidance module, h t C represents the hidden state vector of the current time step in the feature guidance module, g t Denotes the latent vector f t The feature guidance vector obtained by the feature guidance module C. Since the feature guidance module also adopts the LSTM network structure, the feature guidance module and the generator module share parameters. The feature vectors of the nearest k time steps are linearly transformed to obtain w t , which is then connected to the text generation module to determine the next token in the sequence, as shown in formula (3); Where W c Represents the dimension transformation matrix, w t is the feature guide vector after linear transformation; Combined with the feature guidance module, the generation process of the t-th time step in the text generation module is shown in formula (4) and formula (5): P(·|x1,…,x t )=z t (h t )=softmax(W s (h t w t )+c s ) (4) and t ~P(·|x1,…,x t ) (5) Output the hidden state of the current time step h t The guidance vector w generated by the feature guidance module t Combined and linearly transformed before inputting into the softmax function, where W s is the weight matrix, c s is the bias coefficient; through the softmax layer, the probability distribution z of the current time step is calculated t and from the probability distribution P(·|x1,…,x t ) for the word y t Take samples; Dimensional transformation matrix W c , weight matrix W s and the bias coefficient c s The initial values ​​of the three are random values, and the values ​​are automatically updated through back propagation when training the model. During the back propagation process, as we and be change, the probability distribution is continuously adjusted, so that the loss function of the generator is continuously reduced until convergence, and the values ​​of the three no longer change. The loss function of the generator is shown in step 5. Step 2: Complete the generated text sequence using Monte Carlo search according to the specified sequence length; Monte Carlo sampling supplements the incomplete sequence, so a large number of sampling operations are required in the intermediate time to fill the incomplete sequence; then the complete sequence Y 1:T The token is sent to the discriminator to determine the reward of the current token and to perform subsequent generation based on the feedback guidance. The Monte Carlo search process MC for sampling K times is shown in formula (6): where Y 1:T K represents the complete sequence obtained by the Kth sampling, and the K value is set to 4; Step 3: Input the completed text sequence and the source text sequence into the discriminator and use the softmax function to calculate the probability distribution as the true and false sample classification score; The discriminator D uses a convolutional neural network structure. First, the input data is vectorized through the word embedding layer; then the word vector is input into the convolution layer, and the text features are extracted using convolution kernels of different sizes; then the text features are sent to the output layer after being processed by the fully connected layer; the output layer uses the softmax function; the discriminator is trained by the negative samples generated by the generator and the positive samples in the real data set, which is essentially a binary classification task; for each sample x, the discriminator will output the probability D of whether the sample x is real data φ (x), and feed it back to the generator as a reward signal in reinforcement learning; the calculation process of the probability value is shown in (7): D φ (x)=softmax(φ o F(x)) (7) In the discriminator, the probability of a positive sample should be close to 1, and the probability of a negative sample should be close to 0. The goal of discriminator training is to improve the accuracy of identifying positive and negative samples, that is, to maximize the goal in formula (8): Among them, φ is the parameter set of the discriminator, including the parameters of the output layer, convolution layer, and pooling layer; φ o Represents the parameters of the output layer, including the number of categories num_classes and the weight matrix W of the linear transformation before the softmax function processing d and the bias coefficient c d ; Since the role of the discriminator is to distinguish the true and false of the input text, num_classes = 2; weight matrix W d and the bias coefficient c d The initial value is a random value, which is automatically updated by back propagation during model training until the loss function converges. The loss function of the discriminator is the cross entropy loss function. F represents the parameters of all network layers except the output layer in the discriminator, namely the convolutional layer and the pooling layer. The parameters include the convolution kernel size filter_sizes and the number of convolution kernels number_filters. The padding method selects no padding; the convolution kernel size filter_sizes = [1,2,3,4,5,6,7,8,9,10,15,20] and the number of convolution kernels number_filters = [100,200,200,200,200,100,100,100,100,100,160,160]; The parameters of the discriminator also include the dimension emb_dim and sequence length sequence_length of the embedding vector of the input text, which are consistent with the parameter values ​​set in the generator module; data Represents the probability distribution of real samples, Y~P data represents the data sampled from the positive sample, and Y~G θ represents the data sampled from the negative samples generated by the generator with parameter θ, D φ (Y) represents the probability of inputting the data of positive or negative samples into the discriminator, and E is used to calculate the expected value; Step 4: Use the semantic module to calculate the semantic similarity between the real sample and the generated sample; Personality transformation is performed on the basis of ensuring semantic similarity. The semantic module evaluates the text semantic similarity in the following way, that is, the degree of semantic preservation of the input content in the generated sentence; Assume that the original text P r It consists of n sentences, P r =(s r1 ,s r2 ,…s rn ), generate text P g It consists of m sentences, P g =(s g1 ,s g2 ,…s gm ), then define the semantic score J sem P r With P g The similarity between Sim(P r ,P g ), namely J sem =Sim(P r ,P g ): Among them, Sim_s(s ri ,s gj ) represents two sentences s ri and gj Similarity between j (f) refers to the maximum value of f taken by the traversal variable j; that is, the similarity between two paragraphs depends on the similarity between sentences; the similarity between sentences adopts the Siamese LSTM algorithm; in, YesP r The last hidden state obtained in the LSTMr model represents s ri semantics; YesP g The last hidden state obtained in the LSTMg model represents s gj semantics; Sentences ri ,s gj The similarity between them is defined as: Step 5: Use the personality module to calculate the personality difference scores of the real samples and the generated samples; The method of text transformation is used to reduce the personality privacy in user data at the source of the data. The personality difference between the source text and the generated text is ensured by the personality module. A personality difference evaluation method is formed based on the similarity calculation method combined with the representation characteristics of the personality assessment results. Since the evaluation results of the Big Five personality model are five dimensions represented by numerical values ​​of 0-100, the corresponding five-dimensional personality vector is U(u1,u2,u3,u4,u5), and the personality difference is measured by calculating the similarity between vectors. First, the Euclidean distance dist(U,V) between the personality vectors is calculated, and the personality difference score is calculated based on the Euclidean distance between the personality vectors. The score range is [0,1]. The higher the score, the greater the difference, and vice versa. The difference score J between the two personalities U(u1,u2,u3,u4,u5) and V(v1,v2,v3,v4,v5) is calculated. pers The calculation method is: Step 6: According to reinforcement learning, the true and false sample classification scores of the discriminator, the semantic similarity of the semantic module, and the personality difference score of the personality module are weighted and passed to the generator as a reward value to optimize the text generation process; The hidden semantic features in the discriminator are "leaked" to the generator to improve the semantic similarity of the generated text. At the same time, the semantic similarity and personality difference scores between the feature vectors of real sentences and generated sentences are added to the original goal of GAN to improve the diversity of generated samples. The generative adversarial network combined with reinforcement learning is used to convert the text, in which the policy gradient solves the problem that GAN is not differentiable for the discreteness of text. The sequence generation process is combined with reinforcement learning theory as a series of action selections, and Monte Carlo search is used to complete the sequence under the current step; the action a of each step is to select the next token y t , that is, a t =y t ; The state of each step is the prefix sequence of the generated tokens, that is, state t =y1,...,y t-1 ; In this paper, a is used to represent the action taken at a certain step, that is, the next token selected, and state represents the state represented by the prefix sequence of tokens generated at a certain step; after completing the last time step, the complete sequence is sent to the discriminator, semantic module, and personality module respectively, and then the output probability D φ , semantic similarity J sem and personality difference scores J pers Passed to the generator, the weighted average of the three is used as the RL reward signal to guide the learning of the generator, and passed back to the intermediate state action step using Monte Carlo search; The reinforcement learning strategy is represented by G θ (a|state=P(a|state;θ), which specifies the probability of taking an action a in state state; the action reward value function is defined as Q θ (state,a), which represents the total reward value obtained by taking action a in state state according to the strategy; the scores obtained through K samplings are averaged to form the average expected value Q of the current token θ , and reduce the granularity of reward guidance to the level of tokens; the calculation method is shown in (11): Among them, α, β and η are the sample classifier scores J(G θ ), semantic similarity score J sem and personality differences score J pers The weights are adjusted according to the objective function of the generator. To balance the influence of these three signals, the weights are set as follows: α = 0.5, β = 0.5, η = 1; the total expected value of the reward is defined as J(G θ ), defined as follows: The goal of the generator is to maximize the feedback reward signal by taking the policy gradient, so the loss function of the generator should define the negative value of the reward signal, that is, L G (θ)=-J(G θ ), the gradient descent algorithm for the generator loss is defined as follows: in represents the gradient descent process in back propagation, and the parameters θ of the generator are adjusted along with the process until the loss value converges; P θ (y t |state t ) means that after a gradient descent is completed, that is, after the sample generation process is completed, the parameter value θ is set, and the state state at the t step is t Next, select the next character y t probability.