Learning device, learning method and program

The learning device adjusts output values using penalties to enhance gradient magnitude, solving the vanishing gradient issue and enhancing object classification accuracy in images.

JP2024112005APending Publication Date: 2024-08-20HONDA MOTOR CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2023016805
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-02-07
Publication Date
2024-08-20

AI Technical Summary

Technical Problem

Existing machine learning techniques for object classification in images face complications due to the need for gradient monitoring and can result in deteriorated recognition accuracy for classes with small sample sizes, particularly when gradients become saturated during learning.

Method used

A learning device and method that adjusts the output values of a machine learning model by applying a predetermined parameter to decrease the accuracy for correct classes and increase it for incorrect classes, using penalties to enhance gradient magnitude and prevent saturation.

Benefits of technology

This approach allows for easy and highly accurate classification of object types in images by addressing the vanishing gradient problem, thereby improving learning efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024112005000001
    Figure 2024112005000001
Patent Text Reader

Abstract

To train a machine learning model to classify an object included in an image simply and with high precision.SOLUTION: A learning device that uses an image including a plurality of pixels as input to train a machine learning model which outputs a degree of accuracy in which each of the pixels corresponds to a class indicating a classification of an object, includes: an adjustment unit that uses predetermined parameters to adjust an output value of the degree of accuracy with a tendency that the output value of the degree of accuracy corresponding to a correct answer class is reduced and the output value of the degree of accuracy corresponding to a class other than the correct answer class is increased; and a learning unit that trains the machine learning model on the basis of the adjusted output value.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

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

[0002] Conventionally, a method for training a machine learning model that uses an image as an input and classifies the type of object contained in the image into classes is known. For example, Non-Patent Document 1 describes a technique for improving long-tail object detection by scaling the gradient of a logit corresponding to a correct class of training data and the gradient of a logit corresponding to a non-correct class using a parameter. Furthermore, Non-Patent Document 2 describes a technique for improving the recognition accuracy of a class with a small number of samples by selecting the gradient of a logit corresponding to a class with a small number of training data samples while ignoring the gradient of a logit corresponding to a class with a large number of training data samples. [Prior art documents] [Non-patent literature]

[0003] [Non-Patent Document 1] Tan, Jingru, et al. "Equalization loss v2: A new gradient balance approach for long-tailed object detection." Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2021. [Non-Patent Document 2] Tan, Jingru, et al. "Equalization loss for long-tailed object recognition." Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2020. Summary of the Invention [Problem to be solved by the invention]

[0004] However, the technique described in Non-Patent Document 1 requires monitoring information related to gradients (e.g., the magnitude of the gradient) during learning, which can lead to cumbersome processing. Furthermore, the technique described in Non-Patent Document 2 ignores the gradient of a specific logit, which can lead to degradation in recognition accuracy for a class in which the gradient of the logit is ignored.

[0005] The present invention has been made in consideration of the above circumstances, and one of its objectives is to provide a learning device, a learning method, and a program that can easily and accurately learn a machine learning model that classifies the types of objects contained in an image. [Means for solving the problem]

[0006] The learning device, learning method, and program according to the present invention employ the following configuration. (1): A learning device according to one embodiment of the present invention is a learning device that learns a machine learning model that uses an image including a plurality of pixels as input and outputs a probability that each of the pixels corresponds to a class representing a type of object, and is equipped with an adjustment unit that adjusts the output value using a predetermined parameter so as to decrease the output value of the probability that corresponds to a correct class and increase the output value of the probability that corresponds to a class other than the correct class, and a learning unit that learns the machine learning model based on the adjusted output value.

[0007] (2): In the above aspect (1), the adjustment unit adjusts the output value by subtracting the specified parameter, which is a positive constant, from the output value of the accuracy corresponding to the correct class, and adding the specified parameter to the output value of the accuracy corresponding to a class other than the correct class.

[0008] (3): In the above aspect (1), when each of the multiple classes is the correct class, the adjustment unit sets a different positive constant as the specified parameter depending on the type of the correct class, and the adjustment unit adjusts the output value by subtracting the specified parameter from the output value of the accuracy corresponding to the correct class and adding the specified parameter to the output value of the accuracy corresponding to a class other than the correct class.

[0009] (4): In the above aspect (1), the adjustment unit sets a different positive constant as the specified parameter depending on the type of the correct class when each of the multiple classes is the correct class, and for each class other than the correct class, and the adjustment unit adjusts the output value by subtracting the specified parameter from the output value of the accuracy corresponding to the correct class while adding the specified parameter to the output value of the accuracy corresponding to a class other than the correct class.

[0010] (5): In the above aspect (1), the adjustment unit sets the same predetermined parameters for two or more classes among the plurality of classes that are determined to have a semantic similarity equal to or greater than a threshold value.

[0011] (6): In the above aspect (1), the adjustment unit sets the same specified parameters for two or more of the multiple classes for which the learning unit has determined that the difference in the amount of learning data used for learning as the correct class is within a threshold value.

[0012] (7): In the above aspect (1), the adjustment unit sets the same specified parameters for two or more classes among the multiple classes for which it is determined that the difference in the performance index of the accuracy output by the machine learning model is within a threshold.

[0013] (8): A learning method according to another aspect of the present invention is a learning method in which a computer learns a machine learning model that receives an image including a plurality of pixels as input and outputs a probability that each of the pixels corresponds to a class representing a type of object, the method adjusting the output values ​​using predetermined parameters in a manner that tends to reduce the output value of the probability that corresponds to a correct class and increase the output value of the probability that corresponds to a class other than the correct class, and learns the machine learning model based on the adjusted output values.

[0014] (9): A program according to another aspect of the present invention is a program for causing a computer to learn a machine learning model that receives an image including a plurality of pixels as input and outputs a probability that each of the pixels corresponds to a class representing a type of object, the program adjusting the output values ​​using predetermined parameters so as to decrease the output value of the probability that corresponds to a correct class and to increase the output value of the probability that corresponds to a class other than the correct class, and training the machine learning model based on the adjusted output values. Effect of the Invention

[0015] According to (1) to (9), a machine learning model for classifying the types of objects included in an image can be easily and accurately trained. [Brief description of the drawings]

[0016] [Figure 1] 1 is a diagram illustrating a configuration of a learning device 100 according to the present embodiment. [Diagram 2] FIG. 2 is a diagram showing an example of the configuration of learning data 130A. [Diagram 3] FIG. 2 is a diagram for explaining an overview of machine learning executed by an adjustment unit 110 and a learning unit 120. [Figure 4] 4 is a flowchart showing an example of the flow of processing executed by the learning device 100 according to the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0017] Hereinafter, embodiments of a learning device, a learning method, and a program according to the present invention will be described with reference to the drawings.

[0018] [composition] FIG. 1 is a diagram showing a configuration of a learning device 100 according to this embodiment. The learning device 100 is an information processing device that learns a machine learning model that receives an image including a plurality of pixels as input and outputs a probability that each pixel corresponds to a class representing a type of object. The learning device 100 includes, for example, an adjustment unit 110, a learning unit 120, and a storage unit 130. The adjustment unit 110 and the learning unit 120 are each realized by, for example, a hardware processor such as a CPU (Central Processing Unit) executing a program (software). In addition, some or all of these components may be realized by hardware (including circuitry) such as an LSI (Large Scale Integration), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or a GPU (Graphics Processing Unit), or may be realized by cooperation between software and hardware. The program may be stored in advance in a storage device (a storage device equipped with a non-transient storage medium) such as the HDD or flash memory of the learning device 100, or may be stored in a removable storage medium such as a DVD or CD-ROM, and installed in the HDD or flash memory of the learning device 100 by mounting the storage medium (non-transient storage medium) in a drive device. The storage unit 130 stores, for example, learning data 130A and machine learning model 130B. The storage unit 130 is realized by, for example, a RAM, a flash memory, an SD card, or the like.

[0019] FIG. 2 is a diagram showing an example of the configuration of the learning data 130A. For example, the learning data 130A is obtained by associating a class representing a type of object represented by the pixel as a correct class with a pixel (pixel group) of one or more images IM. For example, in the case of FIG. 2, the image IM includes a pixel P1 representing a four-wheeled vehicle and a pixel P2 representing a two-wheeled vehicle. At this time, the pixel P1 is associated with a vector in which only the component of the class representing the four-wheeled vehicle is set to 1 and the components of the other classes are set to 0, thereby obtaining the learning data 130A in which the four-wheeled vehicle class is the correct class. Also, for example, the pixel P2 is associated with a vector in which only the component of the class representing the two-wheeled vehicle is set to 1 and the components of the other classes are set to 0, thereby obtaining the learning data 130A in which the two-wheeled vehicle class is the correct class. The storage unit 130 stores the correspondence between these pixels and the correct classes as the learning data 130A.

[0020] The learning data 130A is generated, for example, by an administrator or operator of the learning device 100 specifying each pixel of the image IM and a correct class in advance on his / her own terminal, and is stored in the storage unit 130. Alternatively, the learning device 100 may download the learning data 130A stored in an external server to the storage unit 130 via a network when the learning unit 120 executes learning.

[0021] The machine learning model 130B is a machine learning model that receives a pixel of an image IM as an input and outputs a probability (logit) that the pixel corresponds to a class representing a type of object. Here, the probability means the probability that the pixel of the image IM corresponds to a class representing a type of object, and more generally, may be a value that correlates with the probability that the pixel of the image IM corresponds to a class representing a type of object. The machine learning model 130B is, for example, a convolutional neural network (CNN), and outputs the probability that the pixel corresponds to each class by extracting the feature amount of the input pixel.

[0022] [Machine Learning Overview] 3 is a diagram for explaining an overview of the machine learning executed by the adjustment unit 110 and the learning unit 120. In FIG. 3, C represents the total number of classes to be classified, and Z 1 ~Z C represents the logits output by the machine learning model 130B. In the conventional technology, each output logit is converted into a probability value normalized to a value between 0 and 1 by substituting it into a softmax function, and the error between the converted probability value and the correct vector is calculated using an error function such as a cross-entropy error L, and the machine learning model is trained using a method such as an error backpropagation method so as to minimize the calculated error. In this case, as the learning progresses, the logits output by the machine learning model tend to saturate for both the correct class and the incorrect class, and the magnitude of the gradient tends to decrease (the gradient vanishing problem). As a result, the learning speed of the machine learning model slows down, and in some cases, the learning of the machine learning model may fail.

[0023] In light of this situation, as shown in FIG. 3, the adjustment unit 110 adjusts the logit Z 1 ~Z C , respectively with a penalty Δ 1 ~Δ C Adding , we get the penalized updated logit Z' 1 ~Z' C Next, the learning unit 120 calculates the calculated updated logit Z' 1 ~Z' C Substituting into the softmax function, we obtain the penalized probability value P' 1 ~P' C Calculate the calculated probability value P' 1 ~P' C The machine learning model 130B is trained using a technique such as backpropagation so as to minimize the cross-entropy error L between the logit Z 1 ~Z C Penalty Δ 1 ~Δ CBy performing learning by adding a penalty, the absolute value of the gradient increases compared to the case where a penalty is not added, and the gradient vanishing problem can be solved, as described below. The penalty is an example of a "predetermined parameter."

[0024] In this embodiment, as an example, multi-value class classification of pixels included in an image is described, and therefore a softmax function is applied in Fig. 3. However, the present invention is not limited to such a configuration, and when performing binary classification of pixels included in an image, a sigmoid function may be applied instead of the softmax function in Fig. 3. Furthermore, in this case, a binary cross-entropy error L may be calculated as the cross-entropy error L instead of the softmax cross-entropy error L. Also, for example, FOCAL Loss (FL) may be applied as an error function instead of the cross-entropy error L.

[0025] [Penalty Settings] Penalty Δ by the adjustment unit 110 1 ~Δ C The adjustment unit 110 sets, for example, the penalty Δ 1 ~Δ C In this case, the adjustment unit 110 may set a single positive constant Δ as the logit Z i For classes j other than the correct class, the logit j By adding a penalty Δ to i and Z' j Calculate.

[0026]

number

[0027] Next, the learning unit 120 calculates the updated logit Z' i and Z' jBy substituting into the softmax function, the probability value P' expressed by the following equation (2) is obtained. i and P' j get.

[0028]

number

[0029] Next, the learning unit 120 calculates the probability value P' i and P' j The cross-entropy error L between the vector and the correct vector is calculated. At this time, the gradient G' of the calculated cross-entropy error L is calculated. i and G' j is expressed by the following equation (3).

[0030]

number

[0031] Here, the penalty Δ is a positive constant, so Z' i <Z i And Z' j >Z j holds, and furthermore, the inequality expressed by the following equation (4) holds.

[0032]

number

[0033] In equation (4), the probability value P i and P j And gradient G i and G j is the logit Z without adding any penalty. i and Z j represents the probability value and gradient obtained by substituting into the softmax function. As shown in equation (4), when the penalty Δ is a positive constant, the gradient G' when the penalty is added is i and G'j is the gradient G without the penalty. i and G j In other words, this solves the vanishing gradient problem in which the logits output by the machine learning model are saturated for both the correct and incorrect classes during training, thereby reducing the magnitude of the gradient.

[0034] In the above description, the adjustment unit 110 sets the penalty Δ 1 ~Δ C is set as a single positive constant Δ, the present invention is not limited to such a configuration. For example, the adjustment unit 110 may 1 ~Z C Each of these is the logit Z of the correct class. i If i That is, the adjustment unit 110 may set C types of penalties Δ i In this case, the adjustment unit 110 may set the logit Z i From the penalty Δ i and subtract the logit Z of classes other than the correct class. j Penalty Δ i By adding i and Z' j This also solves the vanishing gradient problem.

[0035] Also, for example, the adjustment unit 110 may use multiple logits Z 1 ~Z C Each of these is the logit Z of the correct class. i If the correct class is a class other than the correct class, a positive constant Δ ij That is, the adjustment unit 110 may set C×C penalties Δ ij In this case, the adjustment unit 110 may set the logit Z i From the penalty Δ ijand subtract the logit Z of classes other than the correct class. j Penalty Δ ij By adding i and Z' j This also solves the vanishing gradient problem.

[0036] [Reduction in the number of penalties] The adjustment unit 110 may further apply a penalty Δ to the logit of each class so that the gradient does not saturate, and may share the penalty Δ between classes. This can reduce the learning load while solving the gradient vanishing problem. As an example, the adjustment unit 110 may set the same penalty Δ to two or more classes having high semantic similarity among the multiple classes 1 to C. For example, the adjustment unit 110 may convert names representing the multiple classes 1 to C into distributed representations, calculate the semantic similarity between the converted distributed representations by cosine similarity, and set the same penalty Δ to two or more classes whose calculated cosine similarity is equal to or greater than a threshold.

[0037] Furthermore, for example, the adjustment unit 110 may set the same penalty Δ to two or more classes having approximately the same number of pieces of learning data 130A as correct classes among the multiple classes 1 to C. For example, the adjustment unit 110 may set the same penalty Δ to two or more classes determined to have a difference in the number of pieces of learning data 130A as correct classes within a threshold among the multiple classes 1 to C.

[0038] Furthermore, for example, the adjustment unit 110 may set the same penalty Δ to two or more classes having similar performance indices of the logits output by the machine learning model 130B among the multiple classes 1 to C. For example, the adjustment unit 110 may set the same penalty Δ to two or more classes having similar performance indices of the logits output by the machine learning model 130B among the multiple classes 1 to C, for which the adjustment unit 110 has determined that the difference in the performance indices (e.g., accuracy rate, precision rate, recall rate, etc.) of the logits output by the machine learning model 130B is within a threshold value.

[0039] As another method for reducing the number of penalties, the adjustment unit 110 may limit the logits to which the penalty Δ is applied based on a predetermined condition. As an example of the predetermined condition, the adjustment unit 110 may limit the logits Z i The probability value P i is the logit Z of the incorrect class j j The probability value P j If and only if the logit Z is smaller than i and Z j Learning may be facilitated by applying a penalty Δ to the probability value P j "When the probability value P j or "for all probability values ​​P j It may also be "when it is smaller than."

[0040] As another example of the predetermined condition, the adjustment unit 110 sets constants α, β, γ, ε∈(0,1) (α<β, γ<ε) as follows: <P i <β,γ <P j <ε Probability value P i and P j The logit Z corresponding to i and Z j That is, the adjustment unit 110 may apply the penalty Δ only to the probability value P i and P j have not converged to 1 and 0, respectively. i and Z j Learning may be accelerated by applying a penalty Δ to preferentially increase the absolute value of the gradient only for logits that have not yet progressed in learning (in other words, logits that have not yet progressed in learning).

[0041] [Processing flow] Hereinafter, the flow of processing executed by the learning device 100 according to this embodiment will be described with reference to Fig. 4. Fig. 4 is a flowchart showing an example of the flow of processing executed by the learning device 100 according to this embodiment.

[0042] First, the learning unit 120 extracts samples from the learning data 130A (step S100). Next, the learning unit 120 inputs the extracted samples to the machine learning model 130B to obtain logits (step S102). Next, the adjustment unit 110 applies a penalty to the logit to calculate an updated logit (step S104).

[0043] Next, the learning unit 120 calculates a probability value from the updated logit, and calculates the error between the sample and the correct data (step S106). Next, the learning unit 120 trains the machine learning model 130B so as to minimize the calculated error (step S108). Next, the learning unit 120 determines whether or not all samples have been extracted from the learning data 130A (step S110). If it is determined that all samples have not been extracted, the learning unit 120 returns the process to step S100. On the other hand, if it is determined that all samples have been extracted, the learning unit 120 acquires the machine learning model 130B at the time of the determination as a trained model. This ends the process of this flowchart.

[0044] In the above flowchart, the learning unit 120 has been described as extracting samples from the learning data 130A. In this case, the image IM as the sample is not limited to the original image itself, and may include an image obtained by performing a predetermined data extension on the original image (for example, rotating, translating, enlarging, reducing, shearing, inverting, adjusting brightness, etc. of the image IM). In this case, the machine learning model 130B can be trained with higher accuracy by increasing the number of times of learning based on the same image IM.

[0045] According to the present embodiment described above, the output values ​​are adjusted using a predetermined parameter so as to decrease the output value of the machine learning model corresponding to the correct class and to increase the output value of the machine learning model corresponding to the class other than the correct class, and the machine learning model is trained based on the adjusted output values. This makes it possible to simply and accurately train a machine learning model that classifies the types of objects included in an image.

[0046] The above-described embodiment can be expressed as follows. a storage medium for storing computer-readable instructions; a processor coupled to the storage medium; The processor executes the computer-readable instructions to: A machine learning model is trained by inputting an image including a plurality of pixels and outputting a probability that each of the pixels corresponds to a class representing a type of object; adjusting the output values ​​using a predetermined parameter in such a manner that the output value of the probability corresponding to the correct class is decreased and the output value of the probability corresponding to a class other than the correct class is increased; training the machine learning model based on the adjusted output values; The learning device is configured as follows.

[0047] The above describes the form for carrying out the present invention using an embodiment, but the present invention is not limited to such an embodiment, and various modifications and substitutions can be made within the scope that does not deviate from the gist of the present invention. [Explanation of symbols]

[0048] 100 Learning Device 110 Adjustment section 120 Learning Department 130 Storage section 130A Training Data 130B Machine Learning Model

Claims

1. A learning device that learns a machine learning model that receives an image including a plurality of pixels as input and outputs a probability that each of the pixels corresponds to a class representing a type of object, an adjustment unit that adjusts the output value using a predetermined parameter so as to decrease an output value of the accuracy corresponding to a correct class and increase an output value of the accuracy corresponding to a class other than the correct class; A learning unit that learns the machine learning model based on the adjusted output value. Learning device.

2. the adjustment unit adjusts the output value by subtracting the predetermined parameter, which is a positive constant, from the output value of the accuracy corresponding to the correct class and adding the predetermined parameter to the output value of the accuracy corresponding to a class other than the correct class. The learning device according to claim 1 .

3. the adjustment unit sets, when each of the plurality of classes is the correct class, a different positive constant according to a type of the correct class as the predetermined parameter; the adjustment unit adjusts the output value by subtracting the predetermined parameter from the output value of the accuracy corresponding to the correct class and adding the predetermined parameter to the output value of the accuracy corresponding to a class other than the correct class. The learning device according to claim 1 .

4. the adjustment unit sets, as the predetermined parameter, a different positive constant in accordance with a type of the correct class when each of the plurality of classes is the correct class and for each of the classes other than the correct class; the adjustment unit adjusts the output value by subtracting the predetermined parameter from the output value of the accuracy corresponding to the correct class and adding the predetermined parameter to the output value of the accuracy corresponding to a class other than the correct class. The learning device according to claim 1 .

5. The adjustment unit sets the same predetermined parameter to two or more classes determined to have a semantic similarity equal to or greater than a threshold among the plurality of classes. The learning device according to claim 1 .

6. the adjustment unit sets the same predetermined parameters for two or more classes determined by the learning unit to have a difference in the number of pieces of learning data used for learning as the correct class within a threshold value among the plurality of classes; The learning device according to claim 1 .

7. The adjustment unit sets the same predetermined parameters for two or more classes among the plurality of classes for which a difference between the performance indexes of the accuracy output by the machine learning model is determined to be within a threshold. The learning device according to claim 1 .

8. The computer A learning method for learning a machine learning model that receives an image including a plurality of pixels as input and outputs a probability that each of the pixels corresponds to a class representing a type of object, comprising: Adjusting the output values ​​using a predetermined parameter in such a manner that the output value of the probability corresponding to the correct class is decreased and the output value of the probability corresponding to a class other than the correct class is increased; training the machine learning model based on the adjusted output values; How to learn.

9. On the computer, A program for training a machine learning model that receives an image including a plurality of pixels as input and outputs a probability that each of the pixels corresponds to a class representing a type of object, adjusting the output values ​​using a predetermined parameter so as to decrease the output value of the accuracy corresponding to the correct class and increase the output value of the accuracy corresponding to a class other than the correct class; training the machine learning model based on the adjusted output values; program.

Citation Information

Patent Citations

  • Semantic segmentation of 2d floor plans using pixel-wise classifier

    JP2019149148A

  • Regularizing machine learning models

    US20170132512A1

  • Accounting for long-tail training data through logit adjustment

    US20230017505A1