Inference method, learning method, inference device, learning device, and program

By applying a bounded logit function and softmax conversion in the final layer of deep neural networks, the robustness of deep learning models against noise and adversarial attacks is significantly improved.

JP7533587B2Active Publication Date: 2024-08-14NIPPON TELEGRAPH & TELEPHONE CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2022541031
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2020-08-05
Publication Date
2024-08-14
Estimated Expiration
2040-08-05

AI Technical Summary

Technical Problem

Conventional deep learning models are not robust against noise, particularly in the presence of adversarial attacks, and methods like logit squeezing do not sufficiently enhance their robustness.

Method used

Implement a bounded logit function in the final layer of a deep neural network, followed by a softmax function, to constrain the output of intermediate layers, using a nonlinear function with a bounded logit function and a coefficient to keep the logit values within a finite range.

Benefits of technology

Enhances the robustness of deep learning models against noise and adversarial attacks by bounding the logit values, thereby improving their resistance to misclassification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007533587000020
    Figure 0007533587000020
  • Figure 0007533587000014
    Figure 0007533587000014
  • Figure 0007533587000016
    Figure 0007533587000016
Patent Text Reader

Abstract

An inference device according to the present invention executes a first conversion step in which, in a final layer of a deep neural network having an intermediate layer and a final layer, an output from the intermediate layer is converted using a bounded nonlinear function. Additionally, the inference device executes a second conversion step in which a value obtained through the conversion in the first conversion step is converted using an activation function.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to an inference method, a learning method, an inference device, a learning device, and a program. [Background technology]

[0002] Traditionally, deep learning and deep neural networks have been very successful in image recognition, speech recognition, and the like. For example, in image recognition using deep learning, when an image is input into a model that includes many nonlinear functions of deep learning, the model outputs a classification result of what the image depicts. In particular, convolutional networks and ReLU are commonly used in image recognition. In the following explanation, a deep neural network trained by deep learning may be simply called a deep learning model or model.

[0003] On the other hand, if a malicious attacker adds noise to an input image, small noise can easily cause a deep learning model to misclassify (for example, see Non-Patent Document 1). This is called an adversarial attack, and attack methods such as PGD (projected gradient descent) are known (for example, see Non-Patent Document 2). In response to this, a method called logit squeezing has been proposed as a method for making a model more robust, which constrains the norm of the vector (logit) immediately before the model's output (for example, see Non-Patent Document 3). [Prior art documents] [Non-patent literature]

[0004] [Non-Patent Document 1] Christian Szegedy, et al. "Intriguing properties of neural networks." arXiv preprint: 1312.6199, 2013. [Non-Patent Document 2] Madry Aleksander, et al. "Towards deep learning models resistant to adversarial attacks." arXiv preprint: 1706.06083, 2017. [Non-Patent Document 3] Kannan Harini, Alexey Kurakin, and Ian Goodfellow. "Adversarial logit pairing." arXiv preprint:1803.06373 (2018). Summary of the Invention [Problem to be solved by the invention]

[0005] However, conventional deep learning models have a problem in that they may not be robust against noise. For example, logit squeezing described in Non-Patent Document 3 may not sufficiently improve robustness. [Means for solving the problem]

[0006] In order to solve the above-mentioned problems and achieve the objective, an inference method executed by an inference device is characterized in that it includes a first transformation step of transforming an output from an intermediate layer in a final layer of a deep neural network having an intermediate layer and a final layer by a bounded nonlinear function, and a second transformation step of transforming a value obtained by the transformation in the first transformation step by an activation function. Effect of the Invention

[0007] According to the present invention, it is possible to make a deep learning model robust to noise. [Brief description of the drawings]

[0008] [Figure 1] FIG. 1 is a diagram illustrating the overall structure of a deep learning model. [Diagram 2]FIG. 2 is a diagram illustrating an example of the configuration of the learning device according to the first embodiment. [Diagram 3] FIG. 3 is a diagram illustrating the structure of the final layer of a deep learning model. [Figure 4] FIG. 4 is a diagram illustrating an example of the configuration of the inference device according to the first embodiment. [Diagram 5] FIG. 5 is a flowchart showing a process flow of the learning device of the first embodiment. [Figure 6] FIG. 6 is a flowchart showing the flow of processing of the inference device of the first embodiment. [Figure 7] FIG. 7 is a diagram illustrating an example of a computer that executes a program. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0009] [Conventional deep learning model and logit squeezing] First, we will explain the conventional deep learning model and logit squeezing. As an example, we will assume that the deep learning model is a model for image recognition. Image recognition is performed by inputting an image signal x∈R C×H×W The problem is to recognize the image and find the label y of the image from M labels. Here, C is the channel of the image (3 channels in the case of RGB format), H and W are the vertical and horizontal sizes (number of pixels) of the image, respectively. In addition, in the following formulas, capital bold letters represent matrices, lowercase bold letters represent column vectors, and row vectors are expressed using transpose.

[0010] Fig. 1 is a diagram illustrating the overall structure of a deep learning model. As shown in Fig. 1, the deep learning model is a deep neural network having an input layer, one or more intermediate layers, and a final layer. In the example of Fig. 1, the deep learning model has L intermediate layers.

[0011] The input layer accepts a signal as input. Each intermediate layer further transforms the output from the input layer or the output from the previous intermediate layer and outputs it. The final layer further transforms the output from the intermediate layer and outputs it. The output from the final layer is the output of the entire deep learning model, e.g. a probability.

[0012] Here, the output of the Lth hidden layer is expressed as (1). Here, θ is a parameter of the deep learning model. Also, z θ (x) is logit.

[0013]

number

[0014] The softmax function is s (·), the output of the deep learning model is the output of the softmax function f s (z θ (x)∈R M and the output of the kth element is expressed as equation (2).

[0015]

number

[0016] The output shown in equation (2) represents the score for each label in class classification. Furthermore, the element ^y i (The ^ directly above y) is the result of the class classification.

[0017]

number

[0018] Image recognition is a type of classification, and the model that performs the classification s (z θ (·)) is called a classifier or discriminator. The parameters θ are determined by learning. For example, learning is done by using a set of N data sets {(x i,y i )}, i = 1, ..., N, where x i is the signal-like feature of the image, and y i is the correct label.

[0019] Learning is performed so that the deep model outputs the highest score for the element that corresponds to the correct label, i.e., so that equation (4) holds.

[0020]

number

[0021] Specifically, in the learning process, a loss function L(x, y, θ) such as cross entropy is optimized as shown in equation (5). In other words, the parameter θ is updated so that equation (5) is satisfied.

[0022]

number

[0023] Conventional deep learning models have vulnerabilities and can be misrecognized by adversarial attacks. Adversarial attacks are formulated as the optimization problem in Equation (6).

[0024]

number

[0025] ||·|| p is p p is the norm, and p=2 and p=∞ are commonly used. The optimization problem in equation (5) is a problem of finding noise with the smallest norm that will cause erroneous recognition, and known attack methods use the gradient of models such as FGSM (Fast Gradient Sign Method) and PGD. Note that the smaller the norm of the noise, the more natural the recognition result will appear, and the harder it will be to detect an attack.

[0026] On the other hand, as mentioned above, logit squeezing, which suppresses the logit norm, has been proposed as a method of defense against adversarial attacks on deep learning models. In logit squeezing, an objective function such as equation (7) is used during learning.

[0027]

number

[0028] The objective function in equation (7) can be said to be a function obtained by adding the logit norm to the objective function in equation (5). Also, λ is an adjustment parameter determined by trial and error.

[0029] According to logit squeezing, the output of the softmax function f s (z θ (x)) can be suppressed. On the other hand, logit squeezing may not sufficiently improve the robustness of deep learning models.

[0030] [First embodiment] Hereinafter, an inference method, a learning method, an inference device, a learning device, and a program according to the present application will be described in detail with reference to the drawings. Note that the present invention is not limited to the embodiments described below.

[0031] First, the configuration of the learning device according to the first embodiment will be described with reference to Fig. 2. Fig. 2 is a diagram showing an example of the configuration of the learning device according to the first embodiment. As shown in Fig. 2, the learning device 10 receives an input of a learning data set, learns a model, and outputs a learned model.

[0032] Here, each unit of the learning device 10 will be described. As shown in Fig. 2, the learning device 10 has an interface unit 11, a storage unit 12, and a control unit 13. As shown in Fig. 3, an inference device 20, which will be described later, has the same components as the learning device 10. That is, the inference device 20 has an interface unit 21, a storage unit 22, and a control unit 23. The learning device 10 may also have the same functions as the inference device 20 and perform inference processing.

[0033] 2, the interface unit 11 is an interface for inputting and outputting data. For example, the interface unit 11 includes a NIC (Network Interface Card). The interface unit 11 may also include input devices such as a mouse and a keyboard, and an output device such as a display.

[0034] The storage unit 12 is a storage device such as a hard disk drive (HDD), a solid state drive (SSD), an optical disk, etc. The storage unit 12 may be a semiconductor memory in which data can be rewritten, such as a random access memory (RAM), a flash memory, or a non-volatile static random access memory (NVSRAM). The storage unit 12 stores an operating system (OS) and various programs executed by the learning device 10. The storage unit 12 also stores model information 121.

[0035] The model information 121 is information such as parameters for constructing a deep learning model. For example, the model information 121 includes weights and biases of each layer of a deep neural network. In addition, the deep learning model constructed by the model information 121 may be a trained model or a pre-trained model.

[0036] The deep learning model of this embodiment has a different structure of the final layer compared to the conventional deep learning model described above. FIG. 4 is a diagram illustrating the structure of the final layer of the deep learning model. As shown in FIG. 4, a first conversion step and a second conversion step are executed in the final layer of this embodiment. In the first conversion step, conversion is performed using g(·), which is a BLF (bounded logit function, a nonlinear function), and a coefficient γ. In addition, in the second conversion step, conversion is performed using a softmax function. Details of each conversion step will be described later.

[0037] The control unit 13 controls the entire learning device 10. The control unit 13 is, for example, an electronic circuit such as a CPU (Central Processing Unit) or an MPU (Micro Processing Unit), or an integrated circuit such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array). The control unit 13 also has an internal memory for storing programs that define various processing procedures and control data, and executes each process using the internal memory. The control unit 13 also functions as various processing units by the operation of various programs. For example, the control unit 13 has a conversion unit 131, a calculation unit 132, and an update unit 133.

[0038] The conversion unit 131 repeats a nonlinear function and a linear operation on the image signal input to the input layer in each intermediate layer, and then executes a first conversion process and a second conversion process in the final layer.

[0039] The conversion unit 131 executes a first conversion step on the output of the intermediate layer. The first conversion step is a step in which the conversion unit 131 converts the output from the intermediate layer in the final layer of the deep learning model using a bounded nonlinear function. In the first conversion step, the conversion unit 131 inputs the output from the Lth intermediate layer to a function g(·), and further multiplies the output of the function g(·) by a coefficient γ.

[0040] Specifically, in the first conversion step, the conversion unit 131 converts z, which is the logit output from the hidden layer, by a nonlinear function g(·) as shown in equation (8). Here, σ(·) is a sigmoid function. Also, z is an argument input to the nonlinear function g(·). For example, the output z of the Lth hidden layer is θ Equivalent to (x).

[0041]

number

[0042] Furthermore, in the first conversion step, the conversion unit 131 performs conversion by multiplying the output of the nonlinear function by a parameter γ (where 0<γ<∞) that is determined by trial and error.

[0043] Here, equation (9) holds true from equation (8). As shown in equation (9), the maximum absolute value of γg(z), which is the output of the first transformation step, exists in the range between two constants, neither of which is infinite. Also, the output of the first transformation step is the input to the softmax function, which is the second transformation step, that is, logit. Therefore, in this embodiment, logit is kept at a bounded value.

[0044]

number

[0045] Furthermore, since formula (10) holds, the output of the first conversion step, γg(z), i.e., the value of z when logit is at its maximum value, exists in the range between two constants, neither of which is infinite. Therefore, in this embodiment, the output of the intermediate layer when logit is at its maximum value is kept at a bounded value.

[0046]

number

[0047] In this way, the conversion unit 131 performs conversion using a nonlinear function whose maximum absolute value is not infinity and whose argument value when the maximum value is reached is not infinity. As a result, according to this embodiment, logit is bounded, and further, the output of the intermediate layer when logit reaches the maximum value is also bounded, so that the deep learning model becomes more robust against adversarial attacks.

[0048] The softmax function is an example of an activation function. In the second conversion step, the conversion unit 131 executes a second conversion step in which the value obtained by the conversion in the first conversion step is converted by the activation function. The output of the second conversion step in this embodiment is expressed by Equation (11), which is a modification of Equation (2).

[0049]

number

[0050] In this embodiment, the element ^y i is expressed as in equation (12).

[0051]

number

[0052] The calculation unit 132 calculates the loss function L(x i ,y i , θ) is calculated. Learning is performed so that equation (13) holds.

[0053]

number

[0054] The update unit 133 updates the parameters of the deep neural network so that the objective function based on the value obtained by the conversion in the second conversion step is optimized. For example, the update unit 133 optimizes a loss function L(x, y, θ) such as cross entropy as shown in Equation (5). The update unit 133 updates the model information 121.

[0055] Next, the configuration of the inference device according to the first embodiment will be described with reference to Fig. 3. Fig. 3 is a diagram showing an example of the configuration of the inference device according to the first embodiment. As shown in Fig. 3, the inference device 20 receives an input of an inference data set, and outputs an inference result obtained by performing an inference process.

[0056] Here, we will explain each unit of the inference device 20. As shown in Fig. 3, the inference device 20 has an interface unit 21, a storage unit 22, and a control unit 23. The interface unit 21, the storage unit 22, and the control unit 23 have similar functions to the interface unit 11, the storage unit 12, and the control unit 13 of the learning device 10.

[0057] The model information 221 is data equivalent to the updated model information 121 in the learning device 10. The conversion unit 231 executes the first conversion step and the second conversion step in the same manner as the conversion unit 131. However, since the labels are unknown in the data set for inference, the inference device 20 converts the data x i The label y obtained by using the input as (4) is i Output.

[0058] [Processing of the first embodiment] Fig. 5 is a flowchart showing a process flow of the learning device of the first embodiment. As shown in Fig. 5, the conversion unit 131 applies an input randomly selected from a data set to a classifier (step S101). For example, the conversion unit 131 inputs a signal x of an image included in the data set to a deep learning model. Next, the conversion unit 131 converts the input at each intermediate layer (step S102).

[0059] Here, the conversion unit 131 converts the output of the intermediate layer by a bounded nonlinear function (step S103). For example, the conversion unit 131 performs the conversion by equation (8). Furthermore, the conversion unit 131 may multiply the conversion result by equation (8) by a parameter γ. Step S103 corresponds to a first conversion step.

[0060] Furthermore, the transform unit 131 transforms the value transformed by the nonlinear function by a softmax function and outputs it from the final layer (step S104). Step S104 corresponds to a second transforming step.

[0061] The calculation unit 132 calculates a loss function from the output of the final layer obtained in step S10 and the label of the dataset (step S105). Then, the update unit 133 updates the parameters of the classifier using the gradient of the loss function (step S106). If the evaluation criterion is not satisfied (step S107, No), the learning device 10 returns to step S101 and repeats the process. If the evaluation criterion is satisfied (step S107, Yes), the learning device 10 ends the process. The evaluation criterion is that the processes from steps S101 to S106 have been repeated a certain number of times or more, the parameter update width in step S106 has become equal to or smaller than a threshold, etc.

[0062] Fig. 6 is a flowchart showing the flow of processing of the inference device of the first embodiment. As shown in Fig. 6, the conversion unit 231 applies data for inference to a discriminator (step S201). For example, the conversion unit 131 inputs an image signal x to a deep learning model. Next, the conversion unit 231 converts the input at each intermediate layer (step S202).

[0063] Here, the conversion unit 231 converts the output of the intermediate layer by a bounded nonlinear function (step S203). For example, the conversion unit 231 performs the conversion by equation (8). Furthermore, the conversion unit 231 may multiply the result of the conversion by equation (8) by a parameter γ.

[0064] Furthermore, conversion unit 231 converts the value converted by the nonlinear function by a softmax function and outputs it from the final layer (step S204). For example, the output from the final layer is a score (probability) for each label. Inference device 20 may output the score for each label obtained in step S204 as is, or may output information for identifying the label with the maximum score.

[0065] [Advantages of the First Embodiment] As described above, the conversion unit 231 executes a first conversion step in which the output from the intermediate layer is converted by a bounded nonlinear function in the final layer of the deep neural network having an intermediate layer and a final layer. The conversion unit 231 executes a second conversion step in which the value obtained by the conversion in the first conversion step is converted by an activation function. This suppresses the norm of logit input to the activation function, and logit becomes bounded. As a result, according to this embodiment, the deep learning model becomes robust against noise.

[0066] The conversion unit 131 performs conversion using a nonlinear function whose maximum absolute value is not infinity and whose argument value when the maximum value is taken is not infinity. This makes the input as well as the output of the nonlinear function bounded, making the deep learning model more robust against noise.

[0067] Here, both sigmoid and tanh are bounded but monotonically increasing functions. On the other hand, g(·), which is the BLF of this embodiment, is a bounded nonlinear function whose maximum absolute value is not infinity and whose argument value at the maximum value is not infinity. Therefore, according to this embodiment, by reducing not only the output norm of the softmax function but also the input norm, the robustness of the deep learning model can be further improved.

[0068] In the first conversion step, the conversion unit 231 performs conversion by multiplying the output of the nonlinear function by a parameter γ (where 0<γ<∞) that is determined by trial and error. This makes it possible to adjust the robustness of the deep learning model.

[0069] The conversion unit 131 executes a first conversion step of converting an output from an intermediate layer by a bounded nonlinear function in the final layer of a deep neural network having an intermediate layer and a final layer. The conversion unit 131 executes a second conversion step of converting a value obtained by the conversion in the first conversion step by an activation function. The update unit 133 updates parameters of the deep neural network so that an objective function based on the value obtained by the conversion in the second conversion step is optimized. This makes it possible to perform learning of a deep learning model with improved robustness.

[0070] [System configuration, etc.] In addition, each component of each device shown in the figure is a functional concept, and does not necessarily have to be physically configured as shown in the figure. In other words, the specific form of distribution and integration of each device is not limited to that shown in the figure, and all or a part of them can be functionally or physically distributed or integrated in any unit depending on various loads, usage conditions, etc. Furthermore, each processing function performed by each device can be realized in whole or in any part by a CPU (Central Processing Unit) and a program analyzed and executed by the CPU, or can be realized as hardware using wired logic.

[0071] Furthermore, among the processes described in this embodiment, all or part of the processes described as being performed automatically can be performed manually, or all or part of the processes described as being performed manually can be performed automatically by a known method. In addition, the information including the processing procedures, control procedures, specific names, various data and parameters shown in the above documents and drawings can be changed arbitrarily unless otherwise specified.

[0072] [program] As an embodiment, the learning device 10 and the inference device 20 can be implemented by installing a program that executes the above learning process or inference process as package software or online software on a desired computer. For example, by executing the above program on an information processing device, the information processing device can function as the learning device 10 or the inference device 20. The information processing device here includes desktop and notebook personal computers. In addition, the information processing device also includes mobile communication terminals such as smartphones, mobile phones, and PHS (Personal Handyphone System), and even slate terminals such as PDA (Personal Digital Assistant), etc.

[0073] The learning device 10 and the inference device 20 can also be implemented as a server device that provides services related to the above-mentioned processes to a client, the client being a terminal device used by a user. For example, the server device is implemented as a server device that provides a service that uses a dataset as input and outputs a trained deep learning model. In this case, the server device may be implemented as a web server or as a cloud that provides services related to the above-mentioned processes by outsourcing.

[0074] 7 is a diagram showing an example of a computer that executes a program. The computer 1000 includes, for example, a memory 1010 and a CPU 1020. The computer 1000 also includes a hard disk drive interface 1030, a disk drive interface 1040, a serial port interface 1050, a video adapter 1060, and a network interface 1070. These components are connected by a bus 1080.

[0075] The memory 1010 includes a read only memory (ROM) 1011 and a random access memory (RAM) 1012. The ROM 1011 stores a boot program such as a basic input output system (BIOS). The hard disk drive interface 1030 is connected to a hard disk drive 1090. The disk drive interface 1040 is connected to a disk drive 1100. A removable storage medium such as a magnetic disk or an optical disk is inserted into the disk drive 1100. The serial port interface 1050 is connected to a mouse 1110 and a keyboard 1120, for example. The video adapter 1060 is connected to a display 1130, for example.

[0076] The hard disk drive 1090 stores, for example, an OS 1091, an application program 1092, a program module 1093, and program data 1094. That is, the programs that define each process of the learning device 10 and the inference device 20 are implemented as a program module 1093 in which computer-executable code is written. The program module 1093 is stored, for example, in the hard disk drive 1090. For example, a program module 1093 for executing processes similar to those of the functional configurations in the learning device 10 and the inference device 20 is stored in the hard disk drive 1090. The hard disk drive 1090 may be replaced by an SSD (Solid State Drive).

[0077] Furthermore, setting data used in the processing of the above-described embodiment is stored as program data 1094, for example, in the memory 1010 or the hard disk drive 1090. Then, the CPU 1020 reads out the program module 1093 or the program data 1094 stored in the memory 1010 or the hard disk drive 1090 into the RAM 1012 as necessary, and executes the processing of the above-described embodiment.

[0078] Note that the program module 1093 and the program data 1094 are not limited to being stored in the hard disk drive 1090, but may be stored in, for example, a removable storage medium and read by the CPU 1020 via the disk drive 1100 or the like. Alternatively, the program module 1093 and the program data 1094 may be stored in another computer connected via a network (such as a local area network (LAN) or wide area network (WAN)). The program module 1093 and the program data 1094 may then be read by the CPU 1020 from the other computer via the network interface 1070. [Explanation of symbols]

[0079] 10 Learning Device 20 Reasoning device 11, 21 Interface section 12, 22 Storage section 13, 23 Control section 121, 221 Model Information 131, 231 conversion unit 132 Calculation section 133 Update Department

Claims

1. 1. An inference method performed by an inference device, comprising: a first transformation step of transforming an output from the intermediate layer in the final layer of a deep neural network having an intermediate layer and a final layer by a nonlinear function whose maximum absolute value is not infinity and whose argument value when the maximum value is taken is not infinity; a second transformation step of transforming the value obtained by the transformation in the first transformation step using an activation function; 13. An inference method comprising:

2. 2. The inference method according to claim 1, wherein the first conversion step converts the output of the nonlinear function by multiplying the output by a parameter γ (where 0<γ<∞).

3. A learning method performed by a learning device, comprising: a first transformation step of transforming an output from the intermediate layer in the final layer of a deep neural network having an intermediate layer and a final layer by a nonlinear function whose maximum absolute value is not infinity and whose argument value when the maximum value is taken is not infinity; a second transformation step of transforming the value obtained by the transformation in the first transformation step using an activation function; an updating step of updating parameters of the deep neural network so that an objective function based on values ​​obtained by the conversion in the second conversion step is optimized; A learning method comprising:

4. An inference device comprising: a conversion unit that executes a first conversion step in which, in the final layer of a deep neural network having an intermediate layer and a final layer, an output from the intermediate layer is converted by a nonlinear function whose maximum absolute value is not infinity and whose argument value when the maximum value is taken is not infinity; and a second conversion step that converts the value obtained by the conversion in the first conversion step by an activation function.

5. a conversion unit that executes a first conversion step in which an output from the intermediate layer in the final layer of a deep neural network having an intermediate layer and a final layer is converted by a nonlinear function whose maximum absolute value is not infinity and whose argument value when the maximum value is taken is not infinity, and a second conversion step in which the value obtained by the conversion in the first conversion step is converted by an activation function; an update unit that updates parameters of the deep neural network so that an objective function based on values ​​obtained by the conversion in the second conversion step is optimized; A learning device comprising:

6. A program for causing a computer to function as the inference device according to claim 4 or the learning device according to claim 5.

Citation Information

Patent Citations

  • Arithmetic unit, arithmetic method and program

    JP2016177344A

  • Learning device, learning method, and learning program

    JP2019191868A