The present invention relates to a learning device, a learning method, and learning program.
In recent years, machine learning has achieved great success. Machine learning has become a mainstream method in the fields of images and natural language, particularly with appearance of deep learning.
On the other hand, it is known that deep learning is vulnerable to attacks from adversarial examples with malicious noise loaded therein. As a powerful countermeasure against such adversarial examples, a technique called tradeoff-inspired adversarial defense via surrogate-loss minimization (TRADES) using a proxy loss has been proposed (see Non Patent Literatures 1 and 2).
However, it may be difficult to improve generalization performance against adversarial examples in the conventional TRADES. In other words, random numbers are used as initial values to avoid points where differentiation cannot be conventionally performed when optimal models are searched for through approximation with proxy losses, and it may thus be difficult to improve generalization performance.
The present invention was made in view of the above, and an object thereof is to learn a model that is robust to adversarial examples.
In order to solve the aforementioned problem and to achieve the object, a learning device according to the present invention includes: an acquisition unit that acquires data with a label to be predicted; and a learning unit that learns a model that represents probability distribution of the label of the acquired data using an eigenvector corresponding to a maximum eigenvalue in a Fisher information matrix for the data in the model.
According to the present invention, it is possible to learn a model that is robust to adversarial examples.
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 this embodiment. Further, the same portions are denoted by the same reference signs in the description of the drawings.
[Configuration of learning device]
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 an external device such as a server and the control unit 15 via a network. For example, the communication control unit 13 controls communication between the control unit 15 and a management device 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 through learning processing, which will be described later. Note that the storage unit 14 may be configured to communicate 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. In this manner, the control unit 15 functions as an acquisition unit 15a, a learning unit 15b, and a detection unit 15c as illustrated in
An acquisition unit (15a) acquires data with a label to be predicted. For example, the acquisition unit 15a acquires data used for learning processing and detection processing, which will be described later, via the input unit 11 or the communication control unit 13. In addition, the acquisition unit 15a may cause the storage unit 14 to store the acquired data. Note that the acquisition unit 15a may transfer this information to the learning unit 15b or the detection unit 15c without storing it in the storage unit 14.
The learning unit 15b learns a model that represents probability distribution of the label of the acquired data using an eigenvector corresponding to a maximum eigenvalue in a Fisher information matrix for the data. Specifically, the learning unit 15b learns the model by searching for a model that minimizes a loss function using an eigenvector corresponding to the maximum eigenvalue in the Fisher information matrix for the data as an initial value of noise to be added to the data in the loss function.
Here, the model that represents the probability distribution of a label y of data x is expressed by Expression (1) below using a parameter 9. f is a vector that represents a label output by the model.
The learning unit 15b learns the model by determining the parameter θ of the model such that the loss function represented by Expression (2) below becomes small. Here, p(y|x) represents true probability.
Further, the learning unit 15b learns the model such that the label can be correctly predicted for the adversarial example represented by Expression (3) below with noise η added to the data x.
The learning unit 15b searches for and determines θ that minimizes the loss function represented by Expression (4) below, thereby learning a model that is robust to adversarial examples. Here, β is a constant.
In order to minimize the loss function of Equation (4) above, the second item of Equation (4) above is differentiated and searched for as represented by Expression (5) below.
Here, if the initial value η0 of η is set to 0 when the maximum value of the noise η is searched for while the noise η is changed in the second item of Expression (4), x 1= x is obtained, and thus the differentiation of the second item in Expression (4) cannot be executed.
Therefore, the initial value η0 of the noise η is set to a random number ηrand in the conventional TRADES. However, it may be difficult to sufficiently improve generalization performance against adversarial examples.
Here, the loss function of Expression (4) above can be transformed into Expression (6) below using the Fisher information matrix G and its eigenvalue λ.
The learning unit 15b according to the present embodiment learns the model using an eigenvector corresponding to a maximum eigenvalue in a Fisher information matrix G for the data x. Specifically, the learning unit 15b uses an eigenvector ηeig corresponding to the maximum eigenvalue of the Fisher information matrix G for the data x as the initial value η0 of the noise η to be added to the data x as represented by Expression (7) below in Expression (5) above. Then, the model is learned by searching for θ that minimizes the loss function represented by Expression (4) above.
In this manner, the learning unit 15b can accurately search for the parameter θ that minimizes the loss function. Therefore, the learning unit 15b can learn a model that is robust to adversarial examples.
The detection unit 15c predicts a label of the acquired data using the learned model. In this case, the detection unit 15c calculates the probability of each label of newly acquired data by applying the learned parameter θ to Expression (1) above and outputs the label with the highest probability. It is thus possible to output a correct label even in a case in which the data is an adversarial example, for example. As described above, the detection unit 15c can withstand a blind spot attack and predict the correct label for the adversarial example.
[Learning processing] Next, learning processing performed by the learning device 10 according to the present embodiment will be described with reference to
First, the acquisition unit 15a acquires data with a label to be predicted (Step S1).
Next, the learning unit 15b learns a model that represents probability distribution of the label of the acquired data (step S1). At that time, the learning unit 15b learns the model using an eigenvector corresponding to a maximum eigenvalue in a Fisher information matrix for the data in the model. Specifically, the learning unit 15b learns the model by searching for a model that minimizes a loss function using an eigenvector corresponding to the maximum eigenvalue in the Fisher information matrix for the data as an initial value of noise to be added to the data in the loss function. In this manner, a series of learning processing ends.
[Detection processing] Next, detection processing performed by the learning device 10 according to the present embodiment will be described with reference to
First, the acquisition unit 15a acquires new data with a label to be predicted similarly to the processing in Step S1. of
Next, the detection unit 15c predicts the label of the acquired data 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 θ to Expression (1) above and outputs the label with the highest probability. It is thus possible to output a correct label even in a case in which the data x′ is an adversarial example, for example. In this manner, a series of detection processing ends.
As described above, the acquisition unit 15a acquires data with a label to be predicted. The learning unit 15b learns a model that represents probability distribution of the label of the acquired data using an eigenvector corresponding to a maximum eigenvalue in a Fisher information matrix for the data in the model. Specifically, the learning unit 15b searches for the model that minimizes the loss function using the eigenvector corresponding to the maximum eigenvalue in the Fisher information matrix for the data as an initial value of noise to be added to the data in the loss function.
In this manner, the learning device 10 can learn the model that is robust to adversarial examples.
Also, the detection unit 15c predicts the label of the acquired data using the learned model. In this manner, the detection unit 15c can withstand a blind spot attack and predict the correct label for the adversarial example.
[Example]
As parameters of PGD, esp = 8/255, train iter = 7, eval_iter = 20, eps_iter = 0.01, rand_init = True, clip_min = 0.0, and clip_max = 1.0 were used.
Then, an accuracy rate (hereinafter, referred to as natural acc) of top1 for the test data and an accuracy rate (hereinafter, referred to as robust acc) of top1 for the adversarial example generated from the test data were calculated.
Therefore, β in a case where robust acc was high was employed to compare accuracy of each model. As a result, β = 20, Robust Acc = 56.87, and Natural Acc = 95.75 in the model in the conventional method. Also, β = 10, Robust Acc = 61.62, and Natural Acc = 95.84 in the model in the present invention. In this manner, it is possible to ascertain that the values of the model of the present invention were higher than those of the model in the conventional method regardless of β. In this manner, it was confirmed that the model in the embodiment was able to learn the model that was robust to adversarial examples in accordance with the second item in Expression (4) above.
[Program] It is also possible to produce a program that describes, in a computer executable language, the processing executed by the learning device 10 according to the above embodiment. In an embodiment, the learning device 10 can be implemented by installing a learning program for executing the above learning processing as packaged software or online software in a desired computer. For example, an information processing apparatus can be caused to function as the learning device 10 by causing the information processing apparatus to execute the above learning program. In addition to the above, the information processing apparatus includes, within its range, mobile communication terminals such as a smartphone, a mobile phone, and a personal handyphone system (PHS), and further includes slate terminals such as a personal digital assistant (PDA). Further, the functions of the learning device 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. A mouse 1051 and a keyboard 1052, for example, are connected to the serial port interface 1050. A display 1061, for example, 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 of the information described in the above embodiment is stored in the hard disk drive 1031 or the memory 1010, for example.
In addition, the learning program is stored in the hard disk drive 1031 as a program module 1093 in which commands to be executed by the computer 1000, for example, are described. Specifically, the program module 1093 in which all of the processing executed by the learning device 10 described in the above embodiment is described is stored in the hard disk drive 1031.
Further, data used for information processing performed by the learning program is stored as program data 1094 in the hard disk drive 1031, for example. Then, the CPU 1020 reads, in the RAM 1012, the program module 1093 and the program data 1094 stored in the hard disk drive 1031 as needed 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 being stored in the hard disk drive 1031, and may be stored in, for example, a removable storage medium and read by the CPU 1020 via a 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 embodiments to which the invention made by the present inventor is applied have been described above, the present invention is not limited by the description and drawings constituting a part of the disclosure of the present invention according to the present embodiments. In other words, other embodiments, examples, operation techniques, and the like made by those skilled in the art and the like on the basis of the present embodiments are all included in the scope of the present invention.
10
11
12
13
14
15
15
a
15
b
15
c
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2020/027875 | 7/17/2020 | WO |