The present invention relates to a machine learning method, a machine learning system, and a program.
Membership inference attacks (MI attacks) that leak confidential information (for instance, customer information, trade secrets, etc.) used for training from learned parameters of machine learning are known (refer to Non-Patent Literatures (NPLs) 1 and 2). For instance, NPL 1 discloses a method for launching an MI attack under the condition that access to an inference algorithm is possible. The MI attack utilizes a phenomenon called “overfitting” in machine learning. Overfitting is a phenomenon in which a machine learning overfits to data used for training, and thereby the output tendency of an inference algorithm may differ when data that was used for training is inputted thereto from when data that was not used for training is inputted thereto. An attacker engaging in the MI attack maliciously exploits this difference in tendency, thereby determining whether or not the data at hand is used for training.
NPL 3 proposes a learning algorithm resistant to the MI attack. More concretely, NPL 3 adopts a method for increasing the inference accuracy of any known machine learning inference algorithm f and the resistance thereof to the MI attack, in which each parameter is trained adversarially using the inference algorithm f and a discriminator h that determines whether or not input data to f is used to train f.
NPL 4 discloses a method called MemGuard that misleads the attacker's discriminator as a defense against black-box attacks under the condition that a learned parameter of the inference algorithm under attack is unknown.
Patent Literature (PTL) 1 discloses a method in which the generation of data unfavorable to a user can be suppressed in a generative model learning method that generates data similar to training data using an adversarial network.
The following analysis is given by the inventor of the present invention. A method for updating parameters θ of an inference algorithm in a method of NPL 3 as a defense against the MI attack is understood as the min-max optimization problem of the following [Math. 1] (refer to Math. (7) on page 5 of NPL 3).
Here, the “optimal inference” term in [Math. 1] represents maximizing a performance (gain G) of a discriminator h given an inference algorithm f. Further, LD(f) in the parentheses of [Math. 1] represents an Empitical [sic. Empirical] Loss obtained by passing arbitrary data belonging to a dataset into a loss function in the inference algorithm f. The “optimal privacy-preserving classification” of the entire [Math. 1] represents searching for optimal parameters of the inference algorithm f, given the discriminator h having the required gain G. In other words, [Math. 1] shows that there is a trade-off between an accuracy and an attack resistance of the inference algorithm f, and λ is a parameter controlling a balance of the trade-off.
Therefore, in the method of NPL 3, increasing the parameter λ of [Math. 1], thereby prioritizing the performance (gain G) of the discriminator h, will sacrifice the accuracy of the inference algorithm f to some extent.
Further, since the method of NPL 4 creates a defense mechanism by adding noise to an inference result, it has a problem that the noise affects the inference result regardless of a performance of the defense mechanism.
It is an object of the present invention to provide a machine learning method, a machine learning system, and a program capable of contributing to improving both the performance of the defense against the MI attack and the accuracy of an inference algorithm described above to satisfy required levels.
According to a first aspect, there is provided a machine learning method comprising:
a first learning phase in which a machine learning is performed using first dataset with a teacher label as training data to create a learning model f having a parameter θ; and
a second learning phase in which
the first dataset or a second dataset is randomly selected;
a result obtained by inputting data of the first dataset and the second dataset to the learning model f is inputted to a discriminator h having a parameter ω as an input data;
a machine learning is performed using a result and a ground truth data to train the parameter ω of the discriminator h, the result being obtained by having the discriminator h discriminate whether the input data belongs to the first dataset or the second dataset; and
when the first dataset is selected, a result obtained by inputting the data of the first dataset to the learning model f is inputted to a defender u having a parameter τ that modifies an output of the learning model f to train the parameter τ of the defender u by using an output of the discriminator h that has passed through the defender u.
This method is associated with a particular machine referred to as a computer that receives training data as input and updates the learning model f.
According to a second aspect, there is provided a machine learning system comprising a control part capable of executing:
a first learning phase in which a machine learning is performed using a first dataset with a teacher label as training data to create a learning model f having a parameter θ; and
a second learning phase in which
the first dataset or a second dataset is randomly selected; a result obtained by inputting data of the first dataset and the second dataset to the learning model f is inputted to a discriminator h having a parameter ω as an input data;
a machine learning is performed using a result and a ground truth data to train the parameter ω of the discriminator h, the result being obtained by having the discriminator h discriminate whether the input data belongs to the first dataset or the second dataset; and
when the first dataset is selected, a result obtained by inputting the data of the first dataset to the learning model f is inputted to a defender u having a parameter τ that modifies an output of the learning model f to train the parameter τ of the defender u by using an output of the discriminator h that has passed through the defender u.
According to a third aspect, there is provided a computer program for realizing the functions of the computer. The program is supplied to a computer apparatus using an input device or from the outside via a communication interface, is stored in a storage device, operates a processor according to predetermined steps or processes, is capable of displaying the processing results thereof including an intermediate state as necessary via a display device step by step, or is able to communicate with the outside via the communication interface. For instance, the computer apparatus for this purpose comprises a processor, a storage device, an input device, a communication interface and a display device, if necessary, that can typically be connected to each other by a bus. Further, this program can be stored in a computer-readable (non-transitory) storage medium.
According to the present invention, it becomes possible to contribute to the execution of machine learning in which both the performance of the defense against the MI attack and the accuracy of an inference algorithm described above are improved to satisfy the required levels.
First, an outline of a first example embodiment of the present invention will be given with reference to drawings. It should be noted that the drawing reference signs in the outline are given to each element for convenience as an example to facilitate understanding and are not intended to limit the present invention to the illustrated aspects. Further, connection lines between blocks in the drawings referred to in the following description can be both bidirectional and unidirectional. A unidirectional arrow schematically shows the main flow of a signal (data) and does not exclude bidirectionality. A program is executed by a computer apparatus, and the computer apparatus comprises, for instance, a processor, storage device, input device, communication interface, and a display device as necessary. Further, the computer apparatus is configured to be able to execute wired or wireless communication with an internal device therein or with an external device (including a computer) via the communication interface. Although the input/output connection points of each block in the drawings have ports or interfaces, these are not illustrated. Further, in the following description, “A and/or B” means at least one of A and B.
With reference to
In the first learning phase, a parameter θ of the inference f is trained by machine learning using training data S1 created in advance by attaching a teacher label (simply referred to as a “label” hereinafter) to arbitrary data (refer to a parameter learning part 101). Since there is no need to consider the defense performance against an MI attack when training the parameter θ of the inference f, it is possible to pursue accuracy using the training data S1.
In the second learning phase, a data selection part 201 randomly selects training data from the training data S1 and training data S0, which is different from the training data S1. The training data S1 corresponds to data called “members” in an MI attack, and the training data S0 corresponds to data called “non-members” therein.
When selecting the training data S1, the data selection part 201 inputs the training data S1 to an inference f 202a and makes the output of the inference f 202a go through a defender u updating part 203.
When selecting the training data S0, the data selection part 201 inputs the training data S0 to an inference f 202b and makes the output of the inference f 202b go directly to a discriminator h updating part 204.
Further, regardless of whether the training data S1 or S0 is selected, the data selection part 201 inputs the selected data and labels to both the defender u updating part 203 and the discriminator h updating part 204.
When the training data is inputted, each of the inferences f 202a and 202b outputs an inference result. It should be noted that, in the inferences f 202a and 202b, the same parameter θ, which has trained in the first learning phase, is set.
The defender u updating part 203 holds the defender u that modifies an inference result from the inference f 202a so that the discriminator h held in the discriminator h updating part 204 cannot distinguish between the training data S1 and S0, and outputs the modified inference result to the discriminator h updating part 204. For instance, the inference f 202a may output an exceptionally high inference result for some data belonging to the training data S1. In this case, the defender u modifies the output of the inference f 202a so that it is not possible to distinguish if the output is from the data belonging to the training data S1 or the training data S0. Further, the defender u updating part 203 updates the parameter of the defender u using a discrimination result at the discriminator h updating part 204 and the ground truth data (the data and the labels) received from the data selection part 201.
When receiving an inference result of the output of the inference f 202a via the defender u or an inference result of the output of the inference f 202b, the discriminator h updating part 204 discriminates whether the received inference result is the inference result from the training data S1 or S0, and outputs the discrimination result to the defender u updating part 203. Further, the discriminator h updating part 204 updates the parameter of the discriminator h using its own discrimination result with respect to the received inference result and the ground truth data (the data and the labels) received from the data selection part 201.
Therefore, the defender u updating part 203 and the discriminator h updating part 204 perform so-called adversarial learning, updating the respective parameters of the defender u and discriminator h, and improve the performance thereof. As a result, it is possible to obtain the defender u having high defense performance that makes it difficult to distinguish between the output of the inference f 202a going through the defender u and the output of the inference f 202b without going through the defender.
As shown in
Next, the following describes a second example embodiment in which a step of increasing the performance of the defender u is added to the second learning phase of the first example embodiment described above.
A control part 100 sequentially performs each process shown in
If the training data S1 is selected, the control part 100 performs a process 1 in
The inference fθ computes an inference result for the training data S1 inputted thereto. The inference result from the inference fθ is inputted to the defender uτ.
For the inference result from the inference fθ, the defender uτ performs defensive processing that modifies the inference result so that it is indistinguishable from an inference result when the training data S0 is inputted to the inference fθ.
If the training data S0 is selected, the control part 100 performs a process 0 in
The inference fθ computes an inference result for the training data S0 inputted thereto.
By executing the process 1 or 0 described above, it is possible to obtain an inference result of the training data S1 that has gone through the defender uτ or an inference result of the training data S0, in addition to the labels and the data. The control part 100 inputs these three sets of data to the discriminator hω and makes it discriminate whether the inference target data is the training data S1 used to train the inference fθ or the training data S0 not used to train the inference fθ.
Using this discrimination result and the ground truth data (the data and the labels), the control part 100 updates the parameter ω of the discriminator hω. Further, the control part 100 updates the parameter τ of the defender uτ using the discrimination result at the discriminator hω and the ground truth data (the data and the labels).
The control part 100 updates the parameter ω of the discriminator hω and the parameter τ of the defender uτ by repeating the above processing a predetermined number of times. This processing can be achieved by the following algorithm.
(1): Receive a predetermined number of sets of the training data S1 and the training data S0 as input.
(2): Repeat (10) and (20) below l1 times. Here, l1, kh, mh, ku, and mu are predetermined constants.
(10): Repeat (11) to (13) below kh times.
(11): From the training data S0, randomly select mh pairs of data and the labels thereof (x1, y1), . . . , (xmh, ymh).
(12): From the training data S1, randomly select mh pairs of data and the labels thereof (x′1, y′1), . . . , (x′mh, y′mh).
(13): Update ω in a direction that a value of following [Math. 2] increases. Note that ∇ in [Math. 2] and [Math. 3] below denotes the nabla operator (=the derivative for each component).
(20): Repeat (21) and (22) below ku times.
(21): From the training data S1, randomly select mu pairs of data and the labels thereof (x′1, y′1), . . . , (x′mu, y′mu).
(22): Update τ in a direction that a value of following [Math. 3] decreases.
(3): Output ω and τ obtained by performing the above (10) and (20) l1 times.
By performing the step ST1 of the second learning phase described above, the parameter ω of the discriminator hω and the parameter τ of the defender uτ are updated.
As shown in
The control part 100 inputs such training data S2 to the inference fθ having the parameter θ updated in the first learning phase and obtains the output result.
Then, the control part 100 inputs the output of the inference fθ and the training data S2 to the defender uτ described above, and further updates the parameter τ of the defender uτ so that the defender uτ outputs the output of the inference fθ as it is when the training data S2 is inputted to the inference fθ. This processing can be achieved by the following algorithm.
(4): Receive a predetermined number of sets of the training data S2 (labels are unnecessary) as input.
(5): Repeat (30) below l2 times. Here, l2 and m are predetermined constants. Further, L denotes a predetermined loss function.
(30): Repeat (31) and (32) below l2 times.
(31): From the training data S2, randomly select m sets of data x1, . . . xm.
(32): Update τ in a direction that a value of following [Math. 4] decreases. Note that ∇ in [Math. 4] denotes the nabla operator (=the derivative for each component).
(6): Output τ obtained by performing the above (30) l2 times.
By performing the step ST2 of the second learning phase described above, the parameter τ of the defender uτ is further updated.
As a result of the above, it becomes difficult to distinguish the inference results of the following (a) to (c).
(a) Output from an inference uτfθ with the defender uτ, when the training data S1 used for training is inputted thereto.
(b) Output from the inference fθ without the defender uτ, when the training data S0 not used for training is inputted thereto.
(c) Output from the inference uτfθ with the defender uτ, when the training data S0 not used for training is inputted thereto.
The first example embodiment makes it difficult to distinguish between (a) and (b) above. In the second example embodiment, the parameter τ of the defender uτ is optimized so as to make it difficult to distinguish between (b) and (c) above by adding the step ST2 of the second learning phase. As a result, it is impossible to distinguish from the output of the inference uτfθ with the defender uτ shown in
Further, in the present example embodiment, as explained in the first and the second learning phases, the configuration is employed that the inference fθ is optimized until the required accuracy is obtained using the training data S1, and the inference fθ is used as it is for machine learning of the defender uτ. Therefore, the inference accuracy of the inference uτfθ with the defender uτ can be regarded as substantially the same as the inference accuracy of the inference fθ without any defender for data not used for training. As described, with the present example embodiment, we have succeeded in ensuring an inference accuracy similar to that of a configuration without a defender. This is an advantage of the present example embodiment over the method of NPL 3 in which inference accuracy and security are in a trade-off relationship, as described in Background.
Further, compared with the method of NPL 4, since the present example embodiment updates the parameter τ so that the output of the inference uτfθ with the defender uτ is the same as that of the inference fθ without a defender unless the training data is inputted thereto, the inference result is not affected by noise. Further, in the method of NPL 4 since an exceptionally high score is outputted as a high score, albeit with noise, it is vulnerable to the attacks described in NPL 2. In contrast, in the present example embodiment, it is not possible to determine whether an inference result with an exceptionally high score is obtained from data used for training or data not used for training, as described above. Therefore, according to the present example embodiment security against the attacks described in NPL 2 is ensured.
Next, the following describes a third example embodiment in which an inference system equivalent to those of the first and the second example embodiments can be obtained by an approach different from the first and the second example embodiments.
In the second learning phase, a data selection part 401 randomly selects training data from the training data S1 (Mem) and training data S0 (NoM), which is different from the training data S1. Here, “Mem” denotes members and “NoM” non-members.
When selecting the training data S1 (Mem), the data selection part 401 inputs the training data S1 (Mem) to an inference H updating part 402.
When selecting the training data S0 (NoM), the data selection part 401 inputs the training data S0 (NoM) to an inference F 403 having the parameter θ1 trained in the first learning phase.
Further, regardless of whether the training data S1 (Mem) or S0 (NoM) is selected, the data selection part 401 inputs the selected data and a label to a discriminator D updating part 404.
The inference H updating part 402 outputs an inference result for the input data obtained by the inference H, and updates a parameter θ2 of the inference H so that the discriminator D held in the discriminator D updating part 404 cannot distinguish between the training data S1 (Mem) and S0 (NoM). More concretely, the inference H updating part 402 updates the parameter θ2 of the inference H using a discrimination result at the discriminator D updating part 404 and the ground truth data (the data and the labels) received from the data selection part 401.
When receiving an inference result, either an output of the inference H updating part 402 or an output of the inference F 403, the discriminator D updating part 404 discriminates whether the received inference result is the inference result from the training data S1 (Mem) or S0 (NoM), and outputs the discrimination result to the inference H updating part 402. Further, the discriminator D updating part 404 updates a parameter of the discriminator D using its own discrimination result with respect to the received inference result and the ground truth data (the data and the labels) received from the data selection part 401.
Therefore, the inference H updating part 402 and the discriminator D updating part 404 perform so-called adversarial learning, updating the respective parameters of the inference H and discriminator D. As a result, it is possible to obtain the inference H having high defense performance that makes it difficult to distinguish between the output of the inference H and the output of the inference F 403.
Next, a parameter of the pseudo attacker S used in the inference system are trained.
As shown in
When selecting the training data S1 (Mem), the data selection part 501 inputs the training data S1 (Mem) to an inference H 502 having the parameter θ2 trained in the step ST1 of the second learning phase.
When selecting the training data S0 (NoM), the data selection part 501 inputs the training data S0 (NoM) to an inference F 503 having the parameter θ1 trained in the first learning phase.
The pseudo attacker S updating part 504 receives an inference result from the inference H 502 to which the training data S1 (Mem) is inputted or an inference result from the inference F 503 to which the training data S0 (NoM) is inputted, and updates the parameters of the pseudo attacker S using the ground truth data inputted by the data selection part 501 so that the training data S1 (Mem) and the training data S0 (NoM) can be distinguished from the inference result.
As described above, the inference H 502, the inference F 503, and the pseudo attacker S 601, with sufficient accuracy, can be obtained.
As shown in
As a result, in the third example embodiment, it is also not possible to distinguish whether or not the input, which is the source of an inference result, is data used for training, from an output of the pseudo attacker S that uses the inference H 502 or F 503 depending on the input data.
As described above, the accurate parameter θ1 is set in the inference F 503 trained using the training data S1 without consideration to security (the defense performance against MI attacks). Meanwhile, the inference H 502 has the parameter θ2 that can ensure a security of the training data S1 (the defense performance against MI attacks) when the training data S1 is inputted thereto. Therefore, according to the present example embodiment, it is possible to build an inference system with improved accuracy and security (the defense performance against MI attacks).
Therefore, it also becomes difficult to distinguish the inference results of the following (a) to (c) in the present example embodiment.
(a) Output from the inference H 502 when the training data S1 used for training is inputted thereto.
(b) Output from the inference F 503 when the training data S0 not used for training is inputted thereto.
(c) Output from the inference H 502 when the training data S0 not used for training is inputted thereto.
As described, according to the present example embodiment, also achieved is the advantage over the method of NPL 3 in which inference accuracy and security are in a trade-off relationship.
While each example embodiment of the present invention has been described, it is to be understood that the present invention is not limited to the example embodiments above and that further modifications, replacements, and adjustments may be added without departing from the basic technical concept of the present invention. For instance, the system configuration, the configuration of each element, and the expression of the data shown in each drawing are examples to facilitate understanding of the present invention and are not limited to the configurations shown in the drawings.
The procedures described in the example embodiments above can be implemented by a program causing a computer (9000 in
In other words, the learning processing of the machine learning system or the inference processing obtained thereby described in the example embodiments above can be realized by a computer program causing a processor provided in these apparatuses to execute each processing described above using the hardware thereof.
Further, the disclosure of each Patent Literature and NPL cited above is incorporated herein in its entirety by reference thereto and can be used as a basis or a part of the present invention as needed. It is to be noted that it is possible to modify or adjust the example embodiments or examples within the scope of the whole disclosure of the present invention (including the Claims) and based on the basic technical concept thereof. Further, it is possible to variously combine or select (or partially remove) a wide variety of the disclosed elements (including the individual elements of the individual claims, the individual elements of the individual example embodiments or examples, and the individual elements of the individual figures) within the scope of the whole disclosure of the present invention. That is, it is self-explanatory that the present invention includes any types of variations and modifications to be done by a skilled person according to the whole disclosure including the Claims and the technical concept of the present invention. Particularly, any numerical ranges disclosed herein should be interpreted that any intermediate values or subranges falling within the disclosed ranges are also concretely disclosed even without specific recital thereof. In addition, using some or all of the disclosed matters in the literatures cited above as necessary, in combination with the matters described herein, as part of the disclosure of the present invention in accordance with the object of the present invention shall be considered to be included in the disclosed matters of the present application.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2020/019065 | 5/13/2020 | WO |