A data generation method and apparatus
By combining adversarial models and differential privacy identifiers, datasets that meet privacy protection requirements are adaptively generated, solving the challenge of designing privacy protection levels when updating datasets and improving data security and usability.
Patent Information
- Application Number
- CN202010954129.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-11
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2040-09-11
AI Technical Summary
Existing technologies struggle to accurately design differential privacy protection levels when updating datasets, resulting in either excessively high or low levels of privacy protection, making the data vulnerable to attacks and impacting its usability.
By training a first adversarial model and a second adversarial model, and combining a generator, a discriminator, and a differential privacy identifier, an adversarial relationship is formed. The final state dataset that meets the differential privacy requirements is adaptively generated, and the model parameters are adjusted using a loss function until the privacy protection conditions are met.
It achieves adaptive generation of datasets that meet differential privacy requirements, improves data accuracy and security, resists attacks, and optimizes the trade-off between privacy protection and data usability.
Smart Images

Figure CN112115509B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of differential privacy, in particular to a data generation method and device. BACKGROUND
[0002] Differential privacy is a relatively advanced data de-sensitization technology, and its fundamental idea is to add noise to the original data so that the data cannot be analyzed to obtain the actual information of the user in the data, that is, to blur the unique directionality of the data, thereby meeting - differential privacy. The larger the represents the level of privacy protection, the greater the degree of blurring the original data. When the data set is large and involves multiple local privacy protection levels, it greatly increases the design difficulty of the differential privacy algorithm.
[0003] At present, when a data set is protected by differential privacy, a privacy protection level value is obtained by manually analyzing the characteristics of the data, and noise is added to the data set based on the value. However, the data set is dynamic, and when the data set is updated, such as by adding a new data set with a different privacy protection level from the original data set, the privacy protection level needs to be redesigned. It is difficult for human analysis to design this in a timely and accurate manner. This is because when the privacy protection level is too high, the usability of the original data is destroyed by strict differential privacy algorithms. If the privacy protection level is too low, it is easy to be cracked by collusion attacks and other methods. This is a problem that needs to be solved urgently. SUMMARY
[0004] The present application provides a data generation method and device, which solves the problem of difficulty in designing an accurate differential privacy protection level in the prior art.
[0005] In a first aspect, the present application provides a data generation method, comprising: obtaining a first intermediate data set and a second intermediate data set output by a first adversarial model after training of the first adversarial model is completed by using an initial data set; the first adversarial model comprising a generator and a discriminator; the first intermediate data set being a data set determined as the initial data set when the training of the first adversarial model is completed, and the second intermediate data set being a data set determined as a virtual data set when the training of the first adversarial model is completed; obtaining a third intermediate data set output by a second adversarial model after training of the second adversarial model is completed by using the first intermediate data set and the second intermediate data set; the second adversarial model comprising the discriminator and a differential privacy identifier; the differential privacy identifier being used to determine whether the first intermediate data set meets a differential privacy requirement; the discriminator being further used to update the first intermediate data set when the first intermediate data set does not meet the differential privacy requirement; the third intermediate data set being the first intermediate data set when the training of the second adversarial model is completed; and obtaining a final state data set of the initial data set according to the third intermediate data set if a final state convergence condition is met.
[0006] In the above method, the generator and the discriminator form an antagonism through the training of the first adversarial model, which considers the generation performance of the generator in generating the virtual data set effectively disguising the initial data set and the discrimination performance of the discriminator in effectively discriminating the initial data set and the virtual data set. Further, the discriminator and the differential privacy identifier form an antagonism through the second adversarial model, which adds the consideration of the differential privacy requirement. In addition, the final state data set is obtained according to the third intermediate data set if the final state convergence condition is met, so that the final state data set meeting the differential privacy requirement is adaptively generated through the first adversarial model and the second adversarial model.
[0007] Optionally, for any sub-initial data set of the initial data set, the sub-initial data set is input to the generator to generate a sub-virtual data set of the virtual data set; the sub-initial data set and the sub-virtual data set are input to the discriminator to obtain a first process data set and a second process data set; the first process data set is a data set determined by the discriminator as the sub-initial data set; the second process data set is a data set determined by the discriminator as the sub-virtual data set; a first loss function value and a second loss function value are obtained according to the first process data set, the sub-initial data set and the sub-virtual data set; the first loss function value represents the accuracy of the data extracted from the first process data set as the data in the initial data set; the second loss function value represents the accuracy of the data extracted from the first process data set as the data in the virtual data set; if a first adversarial convergence condition is met, the first process data set is taken as a first sub-intermediate data set of the first intermediate data set, and the second process data set is taken as a second sub-intermediate data set of the second intermediate data set; otherwise, the training parameters of the generator and the training parameters of the discriminator are adjusted according to the first loss function value and the second loss function value, and the first process data set is taken as a sub-initial data set of the initial data set, and the step of inputting the sub-initial data set to the generator to generate a sub-virtual data set of the virtual data set is returned, so as to update the sub-initial data set and the sub-virtual data set and continue iterative training.
[0008] In the above method, by inputting the sub-initial data set to the generator to generate a sub-virtual data set of the virtual data set, and obtaining a first loss function value and a second loss function value according to the first process data set, the sub-initial data set and the sub-virtual data set, and adjusting the training parameters of the generator and the training parameters of the discriminator according to the first loss function value and the second loss function value until the first adversarial convergence condition is met, more accurate first intermediate data set and second intermediate data set are obtained through the adversarial of the discriminator and the generator.
[0009] Optionally, the first loss function value is specifically an expected value of the data extracted from the first process data set as the data in the initial data set; and the second loss function value is specifically an expected value of the data extracted from the first process data set as the data in the virtual data set.
[0010] In the above method, the expected value can more accurately represent the accuracy of the extracted data as the data in the initial data set, so that the first adversarial model can be more accurately trained.
[0011] Optionally, after the training of the second adversarial model is completed through the first intermediate data set and the second intermediate data set, a third intermediate data set output by the second adversarial model is obtained, including: for any first sub-intermediate data set in the first intermediate data set and any second sub-intermediate data set in the second intermediate data set, the following steps are performed: inputting the first sub-intermediate data set into the differential privacy identifier to determine whether the first sub-intermediate data set meets the differential privacy requirement; if the differential privacy requirement is met, the first sub-intermediate data set is taken as a third sub-intermediate data set of the third intermediate data set; if the differential privacy requirement is not met and a second adversarial convergence condition is not met, a third loss function value and a fourth loss function value are obtained according to the first sub-intermediate data set, the initial data set and the virtual data set; the third loss function value represents the accuracy of the data extracted from the first sub-intermediate data set as the data in the initial data set; the fourth loss function value represents the accuracy of the data extracted from the second sub-intermediate data set as the data in the initial data set; the training parameters of the discriminator are adjusted according to the third loss function value and the fourth loss function value; if a preset parameter adjustment condition of the differential privacy identifier is met, the training parameters of the differential privacy identifier are adjusted according to the third loss function value and the fourth loss function value; the first sub-intermediate data set and the second sub-intermediate data set are re-discriminated according to the discriminator with adjusted training parameters or according to the discriminator with adjusted training parameters and the differential privacy identifier with adjusted training parameters, so as to update the first sub-intermediate data set and the second sub-intermediate data set, return to the step of inputting the first sub-intermediate data set into the differential privacy identifier to determine whether the first sub-intermediate data set meets the differential privacy requirement, and continue to iteratively train.
[0012] In the above manner, by inputting the first sub-intermediate data set into the differential privacy identifier to determine whether the first sub-intermediate data set meets the differential privacy requirement, and further adjusting the training parameters of the discriminator according to the third loss function value and the fourth loss function value until the differential privacy requirement is met, the second adversarial model adaptively obtains more accurate and appropriate differential privacy requirements, and further obtains accurate final state data sets.
[0013] Optionally, the third loss function value is specifically an expected value of the data extracted from the first sub-intermediate data set as the data in the initial data set; and the fourth loss function value is specifically an expected value of the data extracted from the first sub-intermediate data set as the data in the virtual data set.
[0014] In the method, the expected value can more accurately represent the accuracy of the extracted data in the initial data set, so that the second adversarial model can be more accurately trained.
[0015] Optionally, if the preset parameter adjustment condition of the differential privacy identifier is met, the training parameter of the differential privacy identifier is adjusted according to the third loss function value and the fourth loss function value, including: if the cumulative number of continuously updating the first sub-intermediate data set and the second sub-intermediate data set is greater than or equal to N times, the training parameter of the differential privacy identifier is adjusted according to the third loss function value and the fourth loss function value; N is a positive integer.
[0016] In the above manner, the training parameter of the differential privacy identifier is adjusted only when the cumulative number is greater than or equal to N times, so that the performance of the discriminator can be better stimulated, and the third intermediate data set can be more accurately obtained.
[0017] Optionally, if the terminal state convergence condition is met, the terminal data set of the initial data set is obtained according to the third intermediate data set, including: taking the third intermediate data set as the terminal data set of the initial data set; inputting the third intermediate data set into the generator in the first adversarial model, and taking the virtual data set output by the generator as the terminal data set of the initial data set.
[0018] In the above manner, the third intermediate data set is taken as the terminal data set of the initial data set, or is input into the generator in the first adversarial model to obtain the terminal data set, so that the flexibility of generating the terminal data set of the initial data set is increased.
[0019] In a second aspect, the present application provides a data generation device, comprising: a generation module configured to obtain a first intermediate data set and a second intermediate data set output by a first adversarial model after training of the first adversarial model is completed by using an initial data set; the first adversarial model comprises a generator and a discriminator; the first intermediate data set is a data set determined as the initial data set when the training of the first adversarial model is completed, and the second intermediate data set is a data set determined as a virtual data set when the training of the first adversarial model is completed; a processing module configured to obtain a third intermediate data set output by a second adversarial model after training of the second adversarial model is completed by using the first intermediate data set and the second intermediate data set; the second adversarial model comprises the discriminator and a differential privacy identifier; the differential privacy identifier is configured to determine whether the first intermediate data set meets a differential privacy requirement; the discriminator is further configured to update the first intermediate data set when the first intermediate data set does not meet the differential privacy requirement; the third intermediate data set is the first intermediate data set when the training of the second adversarial model is completed; and a terminal state data set of the initial data set is obtained according to the third intermediate data set when a terminal state convergence condition is met.
[0020] Optionally, the generation module is specifically configured to: input any sub-initial data set of the initial data set into the generator to generate a sub-virtual data set of the virtual data set; input the sub-initial data set and the sub-virtual data set into the discriminator to determine a first process data set and a second process data set; the first process data set is a data set determined as the sub-initial data set by the discriminator; the second process data set is a data set determined as the sub-virtual data set by the discriminator; obtain a first loss function value and a second loss function value according to the first process data set, the sub-initial data set and the sub-virtual data set; the first loss function value represents accuracy of data extracted from the first process data set as data in the initial data set; the second loss function value represents accuracy of data extracted from the first process data set as data in the virtual data set; if a first adversarial convergence condition is met, the first process data set is taken as a first sub-intermediate data set of the first intermediate data set, and the second process data set is taken as a second sub-intermediate data set of the second intermediate data set; otherwise, training parameters of the generator and training parameters of the discriminator are adjusted according to the first loss function value and the second loss function value, the first process data set is taken as a sub-initial data set of the initial data set, and the step of inputting the sub-initial data set into the generator to generate the sub-virtual data set of the virtual data set is returned, so as to update the sub-initial data set and the sub-virtual data set and continue iterative training.
[0021] Optionally, the first loss function value is specifically: the data extracted from the first process data set is an expected value of the data in the initial data set; and the second loss function value is specifically: the data extracted from the first process data set is an expected value of the data in the virtual data set.
[0022] Optionally, the processing module is specifically configured to: for any first sub-intermediate data set in the first intermediate data set and any second sub-intermediate data set in the second intermediate data set, perform the following steps: input the first sub-intermediate data set into the differential privacy identifier to determine whether the first sub-intermediate data set meets the differential privacy requirement; if the first sub-intermediate data set meets the differential privacy requirement, take the first sub-intermediate data set as a third sub-intermediate data set of the third intermediate data set; if the first sub-intermediate data set does not meet the differential privacy requirement and does not meet a second adversarial convergence condition, obtain a third loss function value and a fourth loss function value according to the first sub-intermediate data set, the initial data set and the virtual data set; the third loss function value represents the accuracy of the data extracted from the first sub-intermediate data set as the data in the initial data set; and the fourth loss function value represents the accuracy of the data extracted from the second sub-intermediate data set as the data in the initial data set; adjust the training parameter of the discriminator according to the third loss function value and the fourth loss function value; if a preset parameter adjustment condition of the differential privacy identifier is met, adjust the training parameter of the differential privacy identifier according to the third loss function value and the fourth loss function value; re-discriminate the first sub-intermediate data set and the second sub-intermediate data set according to the discriminator with the adjusted training parameter, or according to the discriminator with the adjusted training parameter and the differential privacy identifier with the adjusted training parameter, so as to update the first sub-intermediate data set and the second sub-intermediate data set, return to the step of inputting the first sub-intermediate data set into the differential privacy identifier to determine whether the first sub-intermediate data set meets the differential privacy requirement, and continue to iteratively train.
[0023] Optionally, the third loss function value is specifically: the data extracted from the first sub-intermediate data set is an expected value of the data in the initial data set; and the fourth loss function value is specifically: the data extracted from the first sub-intermediate data set is an expected value of the data in the virtual data set.
[0024] Optionally, the processing module is specifically configured to: if the cumulative number of times of continuously updating the first sub-intermediate data set and the second sub-intermediate data set is greater than or equal to N times, adjust the training parameter of the differential privacy identifier according to the third loss function value and the fourth loss function value; N is a positive integer.
[0025] Optionally, the processing module is specifically configured to: take the third intermediate data set as a final state data set of the initial data set; and input the third intermediate data set into the generator in the first generative adversarial network, and take the virtual data set output by the generator as the final state data set of the initial data set.
[0026] Optionally, the processing module is further configured to: if the final state convergence condition is not met, return the third intermediate data set as the initial data set to the step of "obtaining the first intermediate data set and the second intermediate data set output by the first generative adversarial network after the training of the first generative adversarial network is completed by using the initial data set", so as to continue to perform the iterative training.
[0027] The beneficial effects of the second aspect and each optional device of the second aspect can refer to the beneficial effects of the first aspect and each optional method of the first aspect, which will not be described here.
[0028] In a third aspect, the present application provides a computer device comprising a program or instructions which, when executed, perform the method of the first aspect and each optional method of the first aspect.
[0029] In a fourth aspect, the present application provides a storage medium comprising a program or instructions which, when executed, perform the method of the first aspect and each optional method of the first aspect.
[0030] These and other aspects of the present application will become more apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0032] Figure 1 A flowchart of a data generation method provided by an embodiment of the present application is shown in the figure.
[0033] Figure 2 A system architecture diagram of a data generation method provided by an embodiment of the present application is shown in the figure.
[0034] Figure 3 A specific flowchart of a data generation method provided by an embodiment of the present application is shown in the figure.
[0035] Figure 4 A structure diagram of a data generation device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0036] In order to make the purposes, technical solutions and advantages of the present application clearer, the following will further describe the present application in detail with reference to the drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
[0037] At present, when a data set is protected by differential privacy, a differential privacy protection level value is obtained by artificial analysis according to the characteristics of the data , and noise is added to the data set based on . However, it is difficult to design a reasonable differential privacy protection level in time and accurately by artificial analysis. Therefore, as shown in Figure 1 , the present application provides a data generation method.
[0038] Step 101: After training of the first adversarial model is completed through an initial data set, a first intermediate data set and a second intermediate data set output by the first adversarial model are obtained.
[0039] Step 102: After training of a second adversarial model is completed through the first intermediate data set and the second intermediate data set, a third intermediate data set output by the second adversarial model is obtained.
[0040] Step 103: If a terminal state convergence condition is met, a terminal data set of the initial data set is obtained according to the third intermediate data set.
[0041] In the method of steps 101-103, the first adversarial model includes a generator and a discriminator; the generator is used to generate a virtual data set according to the initial data set; the discriminator is used to determine whether the data input into the discriminator is the data in the initial data set or the data in the virtual data set; the first intermediate data set is a data set determined as the initial data set when the training of the first adversarial model is completed, and the second intermediate data set is a data set determined as the virtual data set when the training of the first adversarial model is completed.
[0042] The second adversarial model includes the discriminator and a differential privacy identifier; the differential privacy identifier is used to determine whether the first intermediate data set meets the differential privacy requirement; the discriminator is further used to update the first intermediate data set when the first intermediate data set does not meet the differential privacy requirement; and the third intermediate data set is the first intermediate data set when the training of the second adversarial model is completed.
[0043] It should be noted that the method of steps 101-103 can be iteratively executed for multiple rounds. In the process of each round of iteration, after the first adversarial model is trained, the generator remains unchanged in this round of iteration, while the discriminator participates in the training of the second adversarial model in this round of iteration, and the discriminator also changes in the training process of the second adversarial model. The initial data set can be the full data set, or a part of the full data set. Therefore, the full data set can be trained first, or the full data set can be trained together.
[0044] For example, the initial data set is A0, the first adversarial model is M1, when the first adversarial model is trained, the generator in the first adversarial model is M1-1, and the discriminator in the first adversarial model is M1-2; the generator M1-1 can generate a virtual data set A1 according to A0, and then the combination of A0 and A1 is obtained, and the discriminator M1-2 is used to distinguish which data in the combination of A0 and A1 belongs to A0 and which data belongs to A1. The discriminator determines that the data belonging to A0 in the combination of A0 and A1 is A0', and the data belonging to A1 in the combination of A0 and A1 is A1'. Obviously, A0' and A1' are only the discrimination results of the discriminator, and A0 and A0', A1 and A1' are not equal. It should be noted that the first adversarial model is also obtained through multiple rounds of iterative training, and A0 and A1, A0' and A1' are also updated in each round of iteration. For example, A0' obtained in the nth round of iteration in the training process of the first adversarial model can be used as A0 in the n+1th round of iteration, and A1' obtained in the nth round of iteration in the training process of the first adversarial model can be used as A1 in the n+1th round of iteration. A0 and A1 can also be filtered and used as the input of the next round. n is a positive integer. A0' obtained in the final round of iteration is the first intermediate data set A00, and A1' obtained in the final round of iteration is the first intermediate data set A11.
[0045] Further, the second adversarial model is M2, and when the second adversarial model is trained, the discriminator in the first adversarial model is M2-1, and obviously, M2-1 is initially M1-2, and the differential privacy identifier in the second adversarial model is M2-2. The discriminator M2-1 can perform differential privacy discrimination on A11. If A11 meets the differential privacy requirement, A11 can be used as the input of the next round of iteration of steps 101-103 of the first adversarial model. If A11 does not meet the differential privacy requirement, the parameters of the discriminator M2-1 can be adjusted to re-discriminate A00 and A11, update A00 and A11, until A11 meets the differential privacy requirement.
[0046] It should be noted that in step 103, after the first intermediate data set and the second intermediate data set are input into the second adversarial model, in the first case, the first intermediate data set may be input into the differential privacy identifier for the first time, and the differential privacy requirement is met. Therefore, in this case, the discriminator does not need to reclassify the first intermediate data set and the second intermediate data set, and the first intermediate data set does not need to be updated. The first intermediate data set obtained by the first adversarial model is directly used as the third intermediate data set. It may also be that after being input into the differential privacy identifier for multiple times, the differential privacy requirement is not met all the time. After multiple identifications by the discriminator, the differential privacy requirement is met. In this case, the discriminator needs to reclassify the first intermediate data set and the second intermediate data set, and update the first intermediate data set.
[0047] If A11 meets the differential privacy requirement and satisfies the terminal state convergence condition, A11 can be used as the terminal data set of the initial data set.
[0048] The method in steps 101-103 can be applied to Figure 2 the system architecture shown.
[0049] In an optional implementation, step 101 can be specifically as follows:
[0050] Step (1-1): For any sub-initial data set of the initial data set, input the sub-initial data set into the generator to generate a sub-virtual data set of the virtual data set.
[0051] Step (1-2): Input the sub-initial data set and the sub-virtual data set into the discriminator to obtain a first process data set and a second process data set.
[0052] Step (1-3): Obtain a first loss function value and a second loss function value according to the first process data set, the sub-initial data set and the sub-virtual data set.
[0053] Step (1-4): If a first adversarial convergence condition is met, the first process data set is used as a first sub-intermediate data set of the first intermediate data set, and the second process data set is used as a second sub-intermediate data set of the second intermediate data set; otherwise, according to the first loss function value and the second loss function value, the training parameters of the generator and the training parameters of the discriminator are adjusted, the first process data set is used as a sub-initial data set of the initial data set, and the step of inputting the sub-initial data set into the generator to generate a sub-virtual data set of the virtual data set is returned, so as to update the sub-initial data set and the sub-virtual data set, and continue iterative training.
[0054] For example, the initial data set is A0, for any sub-initial data set A0-i, a corresponding sub-virtual data set A1-i is generated, and a first process data set A0-i' and a second process data set A1-i' are determined. Then, the first loss function value y1 and the second loss function value y2 can be obtained according to A0-i, A1-i, A0-i' and A1-i', the training parameters of the generator and the discriminator are adjusted, and A0-i and A1-i are updated to iteratively perform training.
[0055] In steps (1-1) to (1-4), the first process data set is a data set determined by the discriminator as the sub-initial data set; the second process data set is a data set determined by the discriminator as the sub-virtual data set; the first loss function value represents the accuracy of the data extracted from the first process data set as the data in the initial data set; and the second loss function value represents the accuracy of the data extracted from the first process data set as the data in the virtual data set.
[0056] In steps (1-1) to (1-4), the first loss function value can be specifically an expected value of the data extracted from the first process data set as the data in the initial data set; and the second loss function value can be specifically an expected value of the data extracted from the first process data set as the data in the virtual data set.
[0057] (1)
[0058] wherein, refers to an expected value of the original data set in the discriminator D(x) outputting a calculation value of "true", i.e., the first loss function value, which represents that the probability of the original data set being determined as "true" is as large as possible; refers to an expected value of the virtual data set in the discriminator D(x) outputting a calculation value of "true", i.e., the second loss function value, which represents that the probability of the generated data being determined as "false" is as small as possible.
[0059] In an optional embodiment, step 102 can be specifically as follows:
[0060] For any first sub-intermediate data set in the first intermediate data set and any second sub-intermediate data set in the second intermediate data set, the following steps are performed:
[0061] Step (2-1): inputting the first sub-intermediate data set into the differential privacy discriminator to determine whether the first sub-intermediate data set satisfies the differential privacy requirement.
[0062] Step (2-2): If the differential privacy requirement is met, the first sub-intermediate data set is taken as a third sub-intermediate data set of the third intermediate data set.
[0063] Step (2-3): If the differential privacy requirement is not met and the second adversarial convergence condition is not met, a third loss function value and a fourth loss function value are obtained according to the first sub-intermediate data set, the initial data set and the virtual data set.
[0064] Step (2-3): The training parameters of the discriminator are adjusted according to the third loss function value and the fourth loss function value; and if a preset parameter adjustment condition of the differential privacy discriminator is met, the training parameters of the differential privacy discriminator are adjusted according to the third loss function value and the fourth loss function value.
[0065] Step (2-4): The first sub-intermediate data set and the second sub-intermediate data set are re-discriminated according to the discriminator with adjusted training parameters or according to the discriminator with adjusted training parameters and the differential privacy discriminator with adjusted training parameters, so as to update the first sub-intermediate data set and the second sub-intermediate data set, return to step (2-1), and continue to iteratively train.
[0066] For example, the first intermediate data set is A11, any sub-intermediate data set A11-j (such as a part of data extracted therefrom as A11-j) of the first intermediate data set is input into the differential privacy discriminator to determine whether the first sub-intermediate data set meets the differential privacy requirement.
[0067] If the differential privacy requirement is met, A11-j is taken as a third sub-intermediate data set of the third intermediate data set. If the differential privacy requirement is not met and the second adversarial convergence condition is not met, the training parameters of the discriminator are adjusted according to the third loss function value and the fourth loss function value. Moreover, if a preset parameter adjustment condition of the differential privacy discriminator is met, the training parameters of the differential privacy discriminator are adjusted according to the third loss function value and the fourth loss function value.
[0068] Then, the third loss function value y3 and the fourth loss function value y4 can be obtained according to A0, A1, A00 and A11, the training parameters of the discriminator are adjusted, and A00 and the second sub-intermediate data set A11 are updated to iteratively perform training.
[0069] The third loss function value represents the accuracy of the data extracted from the first sub-intermediate data set as the data in the initial data set; and the fourth loss function value represents the accuracy of the data extracted from the second sub-intermediate data set as the data in the initial data set.
[0070] In an optional implementation of steps (2-1) to (2-4), the third loss function value can be specifically that the data extracted from the first sub-intermediate data set is an expected value of the data in the initial data set; and the fourth loss function value can be specifically that the data extracted from the first sub-intermediate data set is an expected value of the data in the virtual data set.
[0071] That is, at this point, there will be two games of antagonism in the model. In addition to the game between the generator and the discriminator described above, the antagonism between the differential privacy identifier I and the discriminator D is another game process. L (D, I) can be used to represent this game.
[0072] Then the process of formula (1) is re-written as:
[0073] 。
[0074] wherein, is a third loss function value, is a fourth loss function value.
[0075] In steps (2-3) to (2-4), if a preset parameter adjustment condition of the differential privacy identifier is met, the training parameters of the differential privacy identifier are adjusted according to the third loss function value and the fourth loss function value, and the specific process can be as follows:
[0076] If the cumulative number of times of continuously updating the first sub-intermediate data set and the second sub-intermediate data set is greater than or equal to N times, the training parameters of the differential privacy identifier are adjusted according to the third loss function value and the fourth loss function value; N is a positive integer.
[0077] For example, N is 10 times. The purpose of this is to make the differential privacy identifier adjust the parameters only when the discriminator fails to meet the differential privacy requirement after being trained for multiple times, so as to fully stimulate the performance of the discriminator.
[0078] An optional implementation of step 103 is as follows:
[0079] The third intermediate data set is taken as a final state data set of the initial data set; and the third intermediate data set is input into the generator in the first adversarial model, and the virtual data set output by the generator is taken as a final state data set of the initial data set.
[0080] It should be noted that in addition to the above embodiments, the data set in the iteration process of the first and second adversarial models can also be used as the final state data set of the initial data set, such as the virtual data set generated after the third data set is input into the generator in the first adversarial model, and the original data set output after the original data set and the virtual data set are input into the discriminator.
[0081] In the method of steps 101-103, the following embodiments can also be implemented:
[0082] If the final state convergence condition is not met, the third intermediate data set is used as the initial data set, and the step of obtaining the first and second intermediate data sets output by the first adversarial model after training the first adversarial model with the initial data set is returned, so that the iteration training is continued.
[0083] It should be noted that the iteration process can be iterated multiple times, and the final state convergence condition can be flexibly set according to specific situations, such as setting the maximum number of iterations, and the convergence of the third intermediate data set.
[0084] The data generation method provided by the present application will be described in detail below. Figure 3 , further in detail.
[0085] Step 301: Obtain an initial data set d and a privacy protection budget B.
[0086] The privacy protection budget is a threshold for differential privacy requirement discrimination.
[0087] Step 302: The generator G generates a differential privacy data set Pg.
[0088] Pg represents a data set that is judged by the discriminator to be the initial data set.
[0089] Step 303: Determine whether the differential privacy data set satisfies the initial data set distribution.
[0090] If yes, step 310 is performed, otherwise step 304 is performed.
[0091] Step 304: Extract m noise samples z from pg(z) and m noise samples x from the initial data set.
[0092] Step 305: Discriminate z and x according to the discriminator, and train the discriminator to update the initial data set and the differential privacy data set.
[0093] Step 306: Extract m samples from the initial data set.
[0094] Step 307: differential privacy identification is performed on the m samples according to the differential privacy identifier model, and the differential privacy identifier model is trained, and the initial data set is updated.
[0095] Step 308: the differential privacy identifier model I converges with the discriminator D.
[0096] If yes, return to step 306; otherwise, step 309 is performed.
[0097] Step 309: update the input data set (initial data set) of the generator G.
[0098] After step 309 is executed, return to step 302.
[0099] Step 310: output the differential privacy data set Pg.
[0100] The present application provides a data generation method, which has the following effects:
[0101] (1) differential privacy identifier is introduced into the neural network to form two groups of confrontation. The final output data adaptively satisfies the differential privacy requirement. Through dynamic and personalized privacy protection level, an optimal trade-off between personalized privacy protection and improved data utility is realized.(2) The differential privacy noise adding process is not externally generated, but learned when generating data, which can meet the demand of multiple users in a group using one privacy protection level.(3) The data generated by the generator in the generative adversarial network is used as noise data in differential privacy, which has high integrity with the original data, decouples the correlation between noises, and can resist attacks on differential privacy by continuously querying and obtaining noise from continuous spatiotemporal data.
[0102] As Figure 4As shown, the present application provides a data generation device, comprising: a generation module 401, configured to obtain a first intermediate data set and a second intermediate data set output by a first adversarial model after completing training of the first adversarial model by an initial data set; the first adversarial model comprises a generator and a discriminator; the generator is used to generate a virtual data set according to the initial data set; the discriminator is used to determine whether the data input into the discriminator is the data in the initial data set or the data in the virtual data set; the first intermediate data set is a data set determined as the initial data set when the first adversarial model is trained, and the second intermediate data set is a data set determined as the virtual data set when the first adversarial model is trained; a processing module 402, configured to obtain a third intermediate data set output by a second adversarial model after completing training of the second adversarial model by the first intermediate data set and the second intermediate data set; the second adversarial model comprises the discriminator and a differential privacy identifier; the differential privacy identifier is used to determine whether the first intermediate data set meets the differential privacy requirement; the discriminator is further used to update the first intermediate data set when the first intermediate data set does not meet the differential privacy requirement; the third intermediate data set is the first intermediate data set when the second adversarial model is trained; and if a terminal state convergence condition is met, a terminal data set of the initial data set is obtained according to the third intermediate data set.
[0103] Optionally, the generating module 401 is specifically configured to: input any sub-initial data set of the initial data set into the generator to generate a sub-virtual data set of the virtual data set; input the sub-initial data set and the sub-virtual data set into the discriminator to obtain a first process data set and a second process data set; the first process data set is a data set determined by the discriminator as the sub-initial data set; the second process data set is a data set determined by the discriminator as the sub-virtual data set; obtain a first loss function value and a second loss function value according to the first process data set, the sub-initial data set and the sub-virtual data set; the first loss function value represents the accuracy of the data extracted from the first process data set as the data in the initial data set; the second loss function value represents the accuracy of the data extracted from the first process data set as the data in the virtual data set; if a first adversarial convergence condition is met, the first process data set is taken as a first sub-intermediate data set of the first intermediate data set, and the second process data set is taken as a second sub-intermediate data set of the second intermediate data set; otherwise, according to the first loss function value and the second loss function value, the training parameters of the generator and the training parameters of the discriminator are adjusted, the first process data set is taken as a sub-initial data set of the initial data set, and the step of inputting the sub-initial data set into the generator to generate a sub-virtual data set of the virtual data set is returned, so as to update the sub-initial data set and the sub-virtual data set and continue the iterative training.
[0104] Optionally, the first loss function value is specifically a desired value of the data extracted from the first process data set as the data in the initial data set; and the second loss function value is specifically a desired value of the data extracted from the first process data set as the data in the virtual data set.
[0105] Optionally, the processing module 402 is specifically configured to: for any first sub-intermediate data set in the first intermediate data set and any second sub-intermediate data set in the second intermediate data set, perform the following steps: input the first sub-intermediate data set into the differential privacy identifier, and determine whether the first sub-intermediate data set meets the differential privacy requirement; if the differential privacy requirement is met, the first sub-intermediate data set is taken as a third sub-intermediate data set of the third intermediate data set; if the differential privacy requirement is not met and a second adversarial convergence condition is not met, a third loss function value and a fourth loss function value are obtained according to the first sub-intermediate data set, the initial data set and the virtual data set; the third loss function value represents the accuracy of the data extracted from the first sub-intermediate data set as the data in the initial data set; the fourth loss function value represents the accuracy of the data extracted from the second sub-intermediate data set as the data in the initial data set; the training parameters of the discriminator are adjusted according to the third loss function value and the fourth loss function value; if a preset parameter adjustment condition of the differential privacy identifier is met, the training parameters of the differential privacy identifier are adjusted according to the third loss function value and the fourth loss function value; the first sub-intermediate data set and the second sub-intermediate data set are re-discriminated according to the discriminator with adjusted training parameters or according to the discriminator with adjusted training parameters and the differential privacy identifier with adjusted training parameters, so as to update the first sub-intermediate data set and the second sub-intermediate data set, return to the step of “inputting the first sub-intermediate data set into the differential privacy identifier and determining whether the first sub-intermediate data set meets the differential privacy requirement”, and continue to iteratively train.
[0106] Optionally, the third loss function value is specifically an expected value of the data extracted from the first sub-intermediate data set as the data in the initial data set; and the fourth loss function value is specifically an expected value of the data extracted from the first sub-intermediate data set as the data in the virtual data set.
[0107] Optionally, the processing module 402 is specifically configured to: if the cumulative number of times of continuously updating the first sub-intermediate data set and the second sub-intermediate data set is greater than or equal to N times, adjust the training parameters of the differential privacy identifier according to the third loss function value and the fourth loss function value; N is a positive integer.
[0108] Optionally, the processing module 402 is specifically configured to: take the third intermediate data set as a final state data set of the initial data set; input the third intermediate data set into the generator in the first adversarial model, and take the virtual data set output by the generator as a final state data set of the initial data set.
[0109] Optionally, the processing module 402 is further configured to: if the terminal state convergence condition is not met, return to the step of "obtaining the first intermediate data set and the second intermediate data set output by the first adversarial model after the training of the first adversarial model is completed by using the initial data set", and continue to perform the iterative training by taking the third intermediate data set as the initial data set.
[0110] Based on the same inventive concept, the embodiments of the present application further provide a computer device comprising programs or instructions, which, when executed, perform the data generation method provided by the embodiments of the present application and any optional method.
[0111] Based on the same inventive concept, the embodiments of the present application further provide a computer-readable storage medium comprising programs or instructions, which, when executed, perform the data generation method provided by the embodiments of the present application and any optional method.
[0112] Those skilled in the art should understand that embodiments of the present application can be provided as a method, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) containing computer-usable program code.
[0113] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in one or more flows and / or blocks.
[0114] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in one or more flows and / or blocks.
[0115] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 one or more flowcharts and / or blocks
[0116] Although preferred embodiments of the application have been described herein, it will be apparent to those skilled in the art that various modifications can be made within the scope of the application without departing from the spirit of the application. Accordingly, it is intended that all such possible modifications be included within the scope of the application as claimed.
[0117] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. A data generating method characterized by comprising: The method comprises the following steps: After the training of the first generative adversarial network is completed through the initial data set, a first intermediate data set and a second intermediate data set output by the first generative adversarial network are obtained; The first generative adversarial network comprises a generator and a discriminator; The first intermediate data set is a data set determined as the initial data set when the training of the first generative adversarial network is completed, and the second intermediate data set is a data set determined as a virtual data set when the training of the first generative adversarial network is completed; After the training of a second generative adversarial network is completed through the first intermediate data set and the second intermediate data set, a third intermediate data set output by the second generative adversarial network is obtained; the second generative adversarial network comprises the discriminator and a differential privacy identifier; the differential privacy identifier is used to determine whether the first intermediate data set meets the differential privacy requirement; the discriminator is further used to update the first intermediate data set when the first intermediate data set does not meet the differential privacy requirement; and the third intermediate data set is the first intermediate data set when the training of the second generative adversarial network is completed; If a terminal state convergence condition is met, a terminal state data set of the initial data set is obtained according to the third intermediate data set.
2. The method of claim 1, wherein, The method comprises the following steps: For any sub-initial data set of the initial data set, the sub-initial data set is input into the generator to generate a sub-virtual data set of the virtual data set; The sub-initial data set and the sub-virtual data set are input into the discriminator to determine a first process data set and a second process data set; the first process data set is a data set determined as the sub-initial data set by the discriminator; and the second process data set is a data set determined as the sub-virtual data set by the discriminator; According to the first process data set, the sub-initial data set and the sub-virtual data set, a first loss function value and a second loss function value are obtained; the first loss function value represents the accuracy of the data extracted from the first process data set as the data in the initial data set; and the second loss function value represents the accuracy of the data extracted from the first process data set as the data in the virtual data set; If a first generative adversarial convergence condition is met, the first process data set is taken as a first sub-intermediate data set of the first intermediate data set, and the second process data set is taken as a second sub-intermediate data set of the second intermediate data set; otherwise, according to the first loss function value and the second loss function value, the training parameters of the generator and the training parameters of the discriminator are adjusted, the first process data set is taken as a sub-initial data set of the initial data set, and the step of inputting the sub-initial data set into the generator to generate a sub-virtual data set of the virtual data set is returned, so that the sub-initial data set and the sub-virtual data set are updated, and the iteration training is continued.
3. The method of claim 2, wherein, The first loss function value is specifically that the data extracted from the first process data set is an expected value of the data in the initial data set; and the second loss function value is specifically that the data extracted from the first process data set is an expected value of the data in the virtual data set.
4. The method of claim 1, wherein, After the training of the second adversarial model is completed through the first intermediate data set and the second intermediate data set, a third intermediate data set output by the second adversarial model is obtained, and the third intermediate data set comprises: For any first sub-intermediate data set in the first intermediate data set and any second sub-intermediate data set in the second intermediate data set, the following steps are performed: The first sub-intermediate data set is input into the differential privacy identifier to determine whether the first sub-intermediate data set meets the differential privacy requirement; If the differential privacy requirement is met, the first sub-intermediate data set is taken as a third sub-intermediate data set of the third intermediate data set; If the differential privacy requirement is not met and a second adversarial convergence condition is not met, third and fourth loss function values are obtained according to the first sub-intermediate data set, the initial data set and the virtual data set; the third loss function value represents the accuracy of the data extracted from the first sub-intermediate data set as the data in the initial data set; and the fourth loss function value represents the accuracy of the data extracted from the second sub-intermediate data set as the data in the initial data set; The training parameters of the discriminator are adjusted according to the third and fourth loss function values; and if a preset parameter adjustment condition of the differential privacy identifier is met, the training parameters of the differential privacy identifier are adjusted according to the third and fourth loss function values; The first and second sub-intermediate data sets are re-discriminated according to the discriminator with adjusted training parameters or according to the discriminator with adjusted training parameters and the differential privacy identifier with adjusted training parameters, so as to update the first and second sub-intermediate data sets, return to the step of inputting the first sub-intermediate data set into the differential privacy identifier to determine whether the first sub-intermediate data set meets the differential privacy requirement, and continue iterative training.
5. The method of claim 4, wherein, The third loss function value is specifically that the data extracted from the first sub-intermediate data set is an expected value of the data in the initial data set; and the fourth loss function value is specifically that the data extracted from the first sub-intermediate data set is an expected value of the data in the virtual data set.
6. The method of claim 4, wherein, If the preset parameter adjustment condition of the differential privacy identifier is met, the training parameters of the differential privacy identifier are adjusted according to the third and fourth loss function values, which comprises: If the cumulative number of times of updating the first and second sub-intermediate data sets continuously is greater than or equal to N times, the training parameters of the differential privacy identifier are adjusted according to the third and fourth loss function values; N is a positive integer.
7. The method according to any one of claims 1 to 6, characterized in that, If the end state convergence condition is met, an end state data set of the initial data set is obtained according to the third intermediate data set, including: The third intermediate data set is taken as the end state data set of the initial data set; The third intermediate data set is input into the generator in the first adversarial model, and the virtual data set output by the generator is taken as the end state data set of the initial data set.
8. The method according to any one of claims 1 to 6, wherein, Further comprising: If the end state convergence condition is not met, the third intermediate data set is taken as the initial data set, and the step of obtaining the first intermediate data set and the second intermediate data set output by the first adversarial model after training of the first adversarial model is completed by the initial data set is returned, so that iterative training is continued.
9. A data generating apparatus characterized by comprising: Comprising: A generation module is configured to obtain the first intermediate data set and the second intermediate data set output by the first adversarial model after training of the first adversarial model is completed by the initial data set; The first adversarial model comprises a generator and a discriminator; The first intermediate data set is a data set determined as the initial data set when the training of the first adversarial model is completed, and the second intermediate data set is a data set determined as a virtual data set when the training of the first adversarial model is completed; A processing module is configured to obtain a third intermediate data set output by a second adversarial model after training of the second adversarial model is completed by the first intermediate data set and the second intermediate data set; the second adversarial model comprises the discriminator and a differential privacy identifier; the differential privacy identifier is configured to determine whether the first intermediate data set meets a differential privacy requirement; the discriminator is further configured to update the first intermediate data set when the first intermediate data set does not meet the differential privacy requirement; the third intermediate data set is the first intermediate data set when the training of the second adversarial model is completed; and configured to obtain an end state data set of the initial data set according to the third intermediate data set if the end state convergence condition is met.
10. A computer device, comprising: A program or instruction is included, and when the program or instruction is executed, the method in any one of claims 1 to 8 is executed.
Citation Information
Patent Citations
Generative adversarial network training method and device
CN110796253A
Training method and device of data generation system based on differential privacy
CN111523668A