The present invention relates to a learning apparatus, a learning method, and a learning program.
In recent years, machine learning has achieved great success. In particular, machine learning has become a mainstream method in the fields of images and natural languages with the appearance of deep learning.
On the other hand, it is known that deep learning is vulnerable to attacks from an adversarial example in which malicious noise is added. As an effective countermeasure against such an adversarial example, a technique called tradeoff-inspired adversarial defense via surrogate-loss minimization (TRADES) using a proxy loss has been proposed (refer to Non Patent Literatures 1 and 2).
However, in TRADES in the related art, it may be difficult to improve generalization performance for the adversarial example. That is, in TRADES, a loss function is approximated and minimized to an upper bound which can be calculated, and as a result, there are cases where the loss function is not approximated to a sufficiently low upper bound and the generalization performance deteriorates.
The present invention has been made in view of the above, and an object of the present invention is to learn a model that is robust to the adversarial example.
In order to solve the above-described problems and achieve the object, according to the present invention, there is provided a learning apparatus including: an acquisition unit that acquires data for which a label is to be predicted; and a learning unit that learns a model representing a probability distribution of a label of the acquired data by using, as a filter, a correct answer label of the data so as to correctly predict a label for an adversarial example in which noise is added to the data.
According to the present invention, it is possible to learn a model that is robust to the adversarial example.
Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings. Note that the present invention is not limited by the embodiment. Further, in the description of the drawings, the same portions are denoted by the same reference numerals.
The input unit 11 is realized by using an input device such as a keyboard and a mouse, and inputs various kinds of instruction information such as a processing start to the control unit 15 in response to input operations of an operator. The output unit 12 is realized by a display device such as a liquid crystal display, a printing device such as a printer, or the like.
The communication control unit 13 is realized by a network interface card (NIC) or the like, and controls communication between the control unit 15 and an external apparatus such as a server via a network. For example, the communication control unit 13 controls communication between the control unit 15 and a management apparatus or the like that manages data to be learned.
The storage unit 14 is realized by a semiconductor memory element such as a random access memory (RAM) or a flash memory or a storage device such as a hard disk or an optical disk, and stores parameters and the like of a model learned by learning processing to be described later. Note that the storage unit 14 may be configured to perform communication with the control unit 15 via the communication control unit 13.
The control unit 15 is realized by using a central processing unit (CPU) or the like, and executes a processing program stored in a memory. Thereby, the control unit 15 functions as an acquisition unit 15a, a learning unit 15b, and a detection unit 15c as illustrated in
The acquisition unit 15a acquires data for predicting a label. For example, the acquisition unit 15a acquires data to be used for learning processing and detection processing to be described later via the input unit 11 or the communication control unit 13. In addition, the acquisition unit 15a may store the acquired data in the storage unit 14. Note that the acquisition unit 15a may transmit the information to the learning unit 15b or the detection unit 15c without storing the information in the storage unit 14.
The learning unit 15b learns a model representing a probability distribution of a label of the acquired data so as to correctly predict a label for an adversarial example in which noise is added to the data, by using, as a filter, a correct answer label of the data. Specifically, the learning unit 15b learns the model by searching for a model that minimizes a loss function.
Here, a model representing a probability distribution of a label y of data x is expressed by the following Equation (1) using a parameter θ. f is a vector representing a label which is output by the model.
The learning unit 15b learns the model by determining the parameter θ of the model such that the loss function expressed by the following Equation (2) is decreased. Here, p(y|x) represents a true probability.
[Equation 2]
l(x,y;θ)=p(y|x)log pθ(y|x) (2)
Further, the learning unit 15b learns the model so as to correctly predict a label for the adversarial example in which noise η is added to the data x and which is expressed by the following Equation (3).
In TRADES, a model that is robust to the adversarial example is learned by searching for and determining θ that minimizes the loss function expressed by the following Equation (4). Note that D is a constant.
Here, as expressed in the following Equation (5), a natural error Rnat(f), a robust error Rrob(f), and a boundary error Rbdy(f) are defined. Note that, in the following Equation (5), 1(*) is an indication function that indicates 1 in a case where the content * is true and indicates 0 in a case where the content * is false.
(X,ϵ)≡{x|x′∈:∥x′−x∥≤ε}
(DB(f),ϵ)≡{x|x∈X:x′∈(x,ϵ) s.t. f(x)f(x′)≤0}
Further, these relationships are expressed by the following Equation (6). Therefore, it can be seen that a model which is robust to the adversarial example is obtained in a case where the robust error is reduced.
[Equation 6]
(f)=(f)+(f) (6)
Here, it is known that the following Equation (7) is established (refer to Non Patent Literature 2).
For a second term of Equation (7), the following Equation (8) is established.
Thus, the learning unit 15b sets the loss function as the following Equation (9) (hereinafter, this method is referred to as “1+loss”). Thereby, as can be seen from a third row and a fourth row of Equation (8), an upper bound becomes stricter than in the loss function in the related art that is expressed by Equation (4). Therefore, it is possible to learn a model that is more robust to the adversarial example than in the related art.
The method according to Equation (9) means that, in the loss function, a filter limited only to the correct answer label of the data x is applied to a second term related to the adversarial example in which noise is added to the data x. Thereby, in TRADES which is a method of adjusting a trade-off between a correct answer rate by normal data and an achievement rate by the adversarial example, it is possible to omit unnecessary data that cannot be correctly predicted from the beginning.
Further, the learning unit 15b may replace the filter represented by the indication function of Equation (9) with a probability of a correct answer label as in the following Equation (10) (hereinafter, this method is referred to as “p+loss”). Thereby, an upper bound also becomes stricter than in the loss function in the related art.
Further, in order to minimize the loss function of (10), the learning unit 15b searches for a second term of Equation (10) by a gradient method. Thus, the learning unit 15b may minimize a probability distribution of a label of the data, as a fixed value, in the loss function for the adversarial example. That is, the learning unit 15b may exclude the second term of Equation (10) from optimization targets of the loss function by the gradient method (hereinafter, this method is referred to as “fixed p+loss”). Specifically, the learning unit 15b searches for the second term of Equation (10) in a state where pθ is fixed. Thereby, it is possible to efficiently optimize the loss function by excluding a case where pθ is close to 0.
The detection unit 15c predicts a label of the acquired data by using the learned model. In this case, the detection unit 15c calculates a probability of each label of newly acquired data by applying the learned parameter θ to Equation (1), and outputs a label having a highest probability. Thereby, it is possible to output a correct label even in a case where, for example, the data corresponds to the adversarial example. In this way, the detection unit 15c can predict a correct label for the adversarial example that withstands a blind spot attack.
Next, learning processing performed by the learning apparatus 10 according to the present embodiment will be described with reference to
First, the acquisition unit 15a acquires data for which a label is to be predicted (step S1).
Next, the learning unit 15b learns a model representing a probability distribution of a label of the acquired data (step S2). At this time, the learning unit 15b learns the model so as to correctly predict a label for an adversarial example in which noise is added to the data, by using, as a filter, a correct answer label of the data. Thereby, the series of learning processing ends.
Next, detection processing performed by the learning apparatus 10 according to the present embodiment will be described with reference to
First, the acquisition unit 15a acquires new data for which a label is to be predicted as in the processing in step S1 of
Next, the detection unit 15c predicts a label of the acquired data by using the learned model (step S12). In this case, the detection unit 15c calculates p(x′) of newly acquired data x′ by applying the learned parameter e to Equation (1), and outputs a label having a highest probability. Thus, for example, even in a case where the data x′ corresponds to an adversarial example, it is possible to output a correct label. Thereby, the series of detection processing ends.
As described above, the acquisition unit 15a acquires data for which a label is to be predicted. Further, the learning unit 15b learns a model representing a probability distribution of a label of the acquired data so as to correctly predict a label for an adversarial example in which noise is added to the data, by using, as a filter, a correct answer label of the data.
Thereby, the learning apparatus 10 can learn a model that is robust to the adversarial example by approximating the loss function in the strict upper bound.
In addition, the learning unit 15b minimizes a probability distribution of a label of the data, as a fixed value, in the loss function for the adversarial example. Thereby, the learning apparatus 10 can efficiently perform optimization of the loss function by the gradient method.
Further, the detection unit 15c predicts a label of the acquired data by using the learned model. Thereby, the detection unit 15c also can predict a correct label for the adversarial example that withstands a blind spot attack.
As parameters of PGD, esp=8/255, train_iter=10, eval_iter=20, eps_iter=0.031, rand_init=True, clip_min=0.0, and clip_max=1.0 are used.
Then, a correct answer rate (hereinafter referred to as natural acc) of top1 with respect to the test data and a correct answer rate (an achievement rate, hereinafter referred to as robust acc) of top1 with respect to the adversarial example generated from the test data are calculated.
First,
For the set S, a model (None in
On the other hand, it can be seen that the model according to the method 1− inhibits improvement of the robust acc. In addition, as illustrated in
Further,
As illustrated in
Therefore, B in a case where the robust acc is high is adopted, and accuracy of the model according to the method in the related art and accuracy of the model according to the method “1+loss” are compared. As a result, in the model according to the method in the related art, β=20, Robust Acc=50.74, and Natural Acc=75.39. Further, in the model according to the method “1+loss” of the present embodiment, β=10, Robust Acc=51.3, and Natural Acc=76.01. In this way, it is confirmed that the model according to the present embodiment has a slightly higher robust acc than the model according to the method in the related art. In addition, it is confirmed that the model according to the present embodiment does not impair the natural acc as much as the method in the related art even in a case where is changed. In this way, it is confirmed that, in the model according to the embodiment, a model which is robust to the adversarial example can be learned in accordance with the second item of the loss function.
It is also possible to create a program in which the processing to be executed by the learning apparatus 10 according to the embodiment is described in a language that can be executed by a computer. In an embodiment, the learning apparatus 10 can be implemented by installing a learning program for executing the learning processing as packaged software or online software in a desired computer. For example, by causing an information processing apparatus to execute the learning program, the information processing apparatus can be caused to function as the learning apparatus 10. Further, the information processing apparatus includes mobile communication terminals such as a smartphone, a mobile phone, and a personal handyphone system (PHS) in addition to the computer, and further includes a slate terminal such as a personal digital assistant (PDA). Further, the functions of the learning apparatus 10 may be implemented in a cloud server.
The memory 1010 includes a read only memory (ROM) 1011 and a RAM 1012. The ROM 1011 stores, for example, a boot program such as a basic input output system (BIOS). The hard disk drive interface 1030 is connected to a hard disk drive 1031. The disk drive interface 1040 is connected to a disk drive 1041. For example, a removable storage medium such as a magnetic disk or an optical disc is inserted into the disk drive 1041. For example, a mouse 1051 and a keyboard 1052 are connected to the serial port interface 1050. For example, a display 1061 is connected to the video adapter 1060.
Here, the hard disk drive 1031 stores, for example, an OS 1091, an application program 1092, a program module 1093, and program data 1094. All information described in the embodiment is stored, for example, in the hard disk drive 1031 or the memory 1010.
In addition, the learning program is stored in the hard disk drive 1031, for example, as a program module 1093 in which commands to be executed by the computer 1000 are described. Specifically, the program module 1093 in which all of the processing to be executed by the learning apparatus 10 described in the embodiment is described is stored in the hard disk drive 1031.
Further, data to be used for information processing performed by the learning program is stored as the program data 1094, for example, in the hard disk drive 1031. Then, the CPU 1020 reads, into the RAM 1012, the program module 1093 and the program data 1094 stored in the hard disk drive 1031 as necessary, and executes each procedure described above.
Note that the program module 1093 and the program data 1094 related to the learning program are not limited to a case of being stored in the hard disk drive 1031. For example, the program module 1093 and the program data 1094 may be stored in a removable storage medium, and may be read by the CPU 1020 via the disk drive 1041 or the like. Alternatively, the program module 1093 and the program data 1094 related to the learning program may be stored in another computer connected via a network such as a local area network (LAN) or a wide area network (WAN), and may be read by the CPU 1020 via the network interface 1070.
Although the embodiment to which the invention made by the present inventor is applied has been described above, the present invention is not limited by the description and the drawings according to the present embodiment as a part of the disclosure of the present invention. In other words, other embodiments, examples, operation techniques, and the like made by those skilled in the art or the like based on the present embodiment are all included in the scope of the present invention.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2020/034986 | 9/15/2020 | WO |