Machine learning device, method, and program
The machine learning device optimizes data expansion parameters for individual target samples using a neural network-based approach, improving the generalization of the target value prediction model by generating diverse expansion samples that maintain class information.
Patent Information
- Application Number
- JP2023120001
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-07-24
- Publication Date
- 2025-02-05
- Estimated Expiration
- 2043-07-24
Smart Images

Figure 2025017111000001_ABST
Abstract
Description
[Technical field]
[0001] An embodiment of the present invention relates to a machine learning device, a method, and a program. [Background technology]
[0002] Data augmentation is used to train a machine learning model (hereafter referred to as a target value prediction model) that predicts a target value from a target sample. Data augmentation is a method to increase the diversity of data by performing "some kind of transformation" on the target sample, such as rotating, enlarging, or reducing the image when the target sample is an image. Increasing the diversity of data is important because it leads to generalization of the target value prediction model being trained. It is desirable for data augmentation to be a data transformation that is invariant to the target value of the task of the target value prediction model. For example, if the task is image class classification, it is desirable for data augmentation to be a data transformation that is invariant to the image class.
[0003] In Patent Document 1, multiple candidates for data augmentation parameters such as the rotation angle and magnification rate of an image are prepared, and an augmented sample is generated for each candidate. For a trained model based on an original sample that has not been subjected to data augmentation, the score of each augmented sample (e.g., accuracy rate) and the score of a sample other than the original sample are investigated, and data augmentation parameters that achieve a score within a predetermined range from the score of the other sample are adopted. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2020-140466 A Summary of the Invention [Problem to be solved by the invention]
[0005] In Patent Document 1, knowledge of the task to be solved and the properties of the data are required to design candidates for data augmentation parameters. In addition, Patent Document 1 is a method for designing data augmentation parameters common to all data, and does not design optimal data augmentation parameters for each target sample. For example, in a classification problem of digit images, the shape of an image of "0" remains "0" no matter how much it is rotated, so there is no need to limit the rotation angle. On the other hand, images of "6" and "9" become indistinguishable from "9" and "6" when rotated 180 degrees, so it is necessary to limit the rotation angle so that they can be distinguished. In this way, knowledge of the task and data is required to design data augmentation, and data augmentation suitable for each data should be designed.
[0006] Furthermore, since Patent Document 1 is a technology that employs data augmentation to bring the score of an augmented sample within a predetermined range from the score of another sample, it is not necessarily possible to achieve the original purpose of data augmentation, which is to generalize the target value prediction model.
[0007] The problem to be solved by the present invention is to provide a machine learning device, method, and program capable of designing appropriate data augmentation parameters according to individual target samples. [Means for solving the problem]
[0008] A machine learning device according to an embodiment includes an acquisition unit, a data augmentation unit, and a first training unit. The acquisition unit acquires a training sample including a target sample and a target value associated with the target sample. The data augmentation unit applies data augmentation to the target sample according to a first data augmentation parameter to generate a first augmented sample. The first training unit generates a parameter output function that inputs the target sample and outputs a second data augmentation parameter corresponding to the target sample by machine learning based on the target sample, the target value, and the first augmented sample. [Brief description of the drawings]
[0009] [Figure 1] FIG. 1 is a diagram showing an example of the configuration of a machine learning device according to an embodiment of the present invention; [Diagram 2] FIG. 1 is a diagram showing an example of a target sample and a target value. [Diagram 3] A diagram showing the input / output relationship of the parameter output function [Figure 4] A diagram showing the input / output relationship of the target value prediction model [Diagram 5] FIG. 1 is a diagram showing a processing procedure of machine learning processing according to the present embodiment; [Figure 6] FIG. 6 is a diagram showing a schematic representation of the parameter output function training phase from steps S1 to S4 in FIG. 5; [Figure 7] FIG. 6 is a diagram showing a training phase of the target value prediction model from steps S5 to S8 in FIG. 5; [Figure 8] FIG. 13 is a diagram showing an example of a second data extension parameter. [Figure 9] A graph showing the frequency distribution of data augmentation parameters for each target value class. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Hereinafter, the machine learning device, method, and program according to the present embodiment will be described with reference to the drawings.
[0011] Fig. 1 is a diagram showing an example of the configuration of a machine learning device 100 according to this embodiment. As shown in Fig. 1, the machine learning device 100 is a computer having a processing circuit 1, a storage device 2, an input device 3, a communication device 4, and a display device 5. Data communication between the processing circuit 1, the storage device 2, the input device 3, the communication device 4, and the display device 5 is performed via a bus or the like.
[0012] The processing circuit 1 has a processor such as a central processing unit (CPU) or a graphics processing unit (GPU) and a memory such as a random access memory (RAM). The processing circuit 1 executes a program to realize an acquisition unit 11, a calculation unit 12, a data extension unit 13, a first training unit 14, a determination unit 15, a second training unit 16, and an output control unit 17. The program may be stored in a non-transitory recording medium readable by the processor. The program may be stored in a stationary recording medium such as a storage device 2, or may be stored in a portable recording medium. The hardware implementation of the processing circuit 1 is not limited to the above-mentioned embodiment. For example, the processing circuit 1 may be configured by an integrated circuit such as an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA) that realizes each of the units 11 to 17. Each of the units 11 to 17 may be implemented in a single integrated circuit, or may be implemented individually in multiple integrated circuits.
[0013] The acquisition unit 11 acquires training samples including a target sample and a target value associated with the target sample. The target sample means a data sample to be processed, and is a data sample to be subjected to machine learning for a parameter output function and a target value prediction model, which will be described later. As an example of the target sample, image data is used. The target value means a teacher label in the machine learning of the target value prediction model.
[0014] 2 is a diagram showing an example of a target sample and a target value. The target sample shown in FIG. 2 is a 28×28 pixel grayscale image x∈R on which only one handwritten digit from 0 to 9 is drawn. 28×28 When the task of the target value prediction model is image classification, the target value is a label y ∈ [9] representing a number drawn in the target sample. For example, the target value of a target sample in which "0" is drawn is "0". The acquisition unit 11 may acquire the target sample and the target value from another computer or from the storage device 2.
[0015] The image data according to this embodiment is not limited to the image data with handwritten numbers as shown in FIG. 2, and can be applied to any image data. For example, it can be applied to an inspection image in which a manufactured product is the subject in the inspection of a manufacturing process. As the inspection image, for example, a semiconductor inspection image obtained by photographing a semiconductor manufactured in a semiconductor manufacturing factory with an electron microscope can be used. In this case, the target value differs depending on the task of the target value prediction model. For example, when the task of the target value prediction model is image classification, the target value is the presence or absence of an abnormality in the semiconductor product depicted in the inspection image, the type of abnormality, etc.
[0016] 3 is a diagram showing the input / output relationship of the parameter output function φ. As shown in FIG. 3, the parameter output function φ is 28×28 The data augmentation parameter θ is output. The data augmentation parameter θ has different dimensions depending on the type of data augmentation. For example, when the data augmentation is performed by rotating, translating up and down, and translating left and right with respect to the image x, the data augmentation parameter θ is the rotation parameter θ r ∈R, lateral translation parameter θ h ∈R and the vertical translation parameter θ v ∈R. In this case, the transformation by the parameter output function φ can be expressed as the following equation (1).
number
[0017] The parameter output function φ can be realized by a machine learning model, specifically, a three-layer convolutional neural network. The parameter output function φ may be a four-layer or more convolutional neural network. The parameter output function φ may include other network layers such as a fully connected layer, a normalization layer, and a pooling layer in addition to the convolutional layer.
[0018] FIG. 4 is a diagram showing the input / output relationship of the target value prediction model g. As shown in FIG. 4, the target value prediction model g inputs a data sample x and outputs a predicted value of the target value (hereinafter, predicted target value) g(x). As the data sample x, a target sample or a data sample generated by applying data extension to the target sample (hereinafter, extended sample) is input. The predicted target value g(x) has 10 elements, the numbers 0 to 9, and each element is a 10-dimensional vector that takes two values, "1" indicating that the corresponding number applies, or "0" indicating that the corresponding number does not apply. In this case, the conversion by the target value prediction model g is g:R 28×28 →[0,1] 10 The target value prediction model g may be a machine learning model, specifically, a neural network including three or more network layers such as a convolution layer, a fully connected layer, a normalization layer, and / or a pooling layer.
[0019] The calculation unit 12 calculates a first data expansion parameter. The first data expansion parameter is used in a learning phase of the parameter output function. As an example, the calculation unit 12 applies an unlearned parameter output function to a target sample to calculate the first data expansion parameter.
[0020] The data extension unit 13 performs data extension on the target sample according to the data extension parameters to generate an extended sample. The extended sample means the target sample to which data extension has been performed. As an example, the data extension unit 13 performs data extension on the target sample according to the first data extension parameter to generate a first extended sample.
[0021] The first training unit 14 generates a parameter output function by machine learning based on a target sample, a target value associated with the target sample, and a first extended sample. The first training unit 14 trains the parameter output function so as to reduce a prediction error from the first extended sample to the target value while reducing the similarity between the target sample and the first extended sample.
[0022] The determination unit 15 applies the learned parameter output function to the target sample to calculate a second data augmentation parameter. The second data augmentation parameter means a data augmentation parameter output by the learned parameter output function. The determination unit 15 determines a third data augmentation parameter based on the second data augmentation parameter for each target value class. The third data augmentation parameter means a data augmentation parameter for generating a second augmented sample used for training the target value prediction model.
[0023] The second training unit 16 generates a target value prediction model by machine learning based on the target sample, the target value, and the second extended sample. The second training unit 16 trains the target value prediction model so that the loss based on the predicted value and the target value is small.
[0024] The output control unit 17 outputs various information. The information may be displayed on the display device 5, may be output to an external device such as a computer via the communication device 4, or may be stored in the storage device 2. For example, the output control unit 17 outputs a parameter output function or a target value prediction model.
[0025] The storage device 2 is configured by a ROM (Read Only Memory), an HDD (Hard Disk Drive), an SSD (Solid State Drive), an integrated circuit storage device, etc. The storage device 2 stores various calculation results by the processing circuit 1, various programs executed by the processing circuit 1, etc.
[0026] The input device 3 inputs various commands from an operator. As the input device 3, a keyboard, a mouse, various switches, a touch pad, a touch panel display, etc. can be used. An output signal from the input device 3 is supplied to the processing circuit 1. The input device 3 may be a computer connected to the processing circuit 1 via a wired or wireless connection. The input device 3 may also be a voice input device that converts the user's voice into an electrical signal that can be processed by the processing circuit 1.
[0027] The communication device 4 includes a communication interface such as a network interface card (NIC) for communicating information with an external device connected to the machine learning device 100 via a network.
[0028] The display device 5 displays various information under the control of the output control unit 17. As the display device 5, a CRT (Cathode-Ray Tube) display, a liquid crystal display, an organic EL (Electro Luminescence) display, an LED (Light-Emitting Diode) display, a plasma display, or any other display known in the art can be appropriately used. The display device 5 may be a projector.
[0029] The machine learning device 100 according to this embodiment will be described in detail below.
[0030] FIG. 5 is a diagram showing a processing procedure of the machine learning processing according to this embodiment. FIG. 6 is a diagram showing a model of the training phase of the parameter output function φ from steps S1 to S4 in FIG. 5. FIG. 7 is a diagram showing a model of the training phase of the target value prediction model g from steps S5 to S8 in FIG. 5. In the following examples, the neural network shown in FIG. 3 is used as the parameter output function φ, and the neural network shown in FIG. 4 is used as the target value prediction model c. In addition, rotation, vertical translation, and horizontal translation are performed for the image x as data expansion, and the data expansion parameter θ is a rotation parameter θ r ∈R, lateral translation parameter θ h ∈R and the vertical translation parameter θ v ∈R. Also, the target sample x is an image in which any number from "0" to "9" is drawn as shown in Figure 2, and the target value is a label representing the number drawn on the target sample.
[0031] 5, the acquiring unit 11 acquires a training sample including a target sample x and a target value y (step S1). The number of acquired training samples is not particularly limited as long as it is 2 or more.
[0032] When step S1 is performed, the calculation unit 12 uses the unlearned parameter output function φ to determine a first data extension parameter θ based on the target sample x acquired in step S1 (step S2). When step S2 is performed, the data extension unit 13 performs data extension on the target sample x acquired in step S1 in accordance with the first data extension parameter θ1 determined in step S2 to generate a first extended sample a1(x;θ) (step S3).
[0033] Data augmentation is performed by using the angle θ of the target sample x. r Rotation at and vertical translation θ x and left / right translation θ y The data extension unit 13 sets a data extension parameter θ1 for the data extender a, and applies the target sample x to the data extender a to generate a first extended sample a1. x ,i y ) to the coordinate (i´ h ,i´ v The mathematical expression of the data extension to convert the coordinates (i´ h ,i´ v ) is the pixel value of the original image x coordinate (i x ,i y If the coordinates are not integers, for example, the linear interpolation of the four neighboring integer coordinates or the closest integer coordinate is used.
[0034]
number
[0035] When step S3 is performed, the first training unit 14 trains the parameter output function φ by machine learning based on the target sample x acquired in step S1, the target value y acquired in step S1, and the first extended sample a1(x;θ) generated in step S3 (step S4). In step S4, the first training unit 14 trains the parameter output function φ so as to reduce the prediction error from each of the target sample x and the first extended sample a1(x;θ) to the target value y while reducing the similarity between the target sample x and the first extended sample a1(x;θ). By training the parameter output function φ in this way, the learned parameter output function φ can output data extension parameters that minimize the similarity between the generated extended sample and the original sample within the range in which the label associated with the original sample can be predicted.
[0036] Specifically, as shown in FIG. 6, the first training unit 14 applies a target sample x to a feature extractor f to calculate a feature f(x), applies a first extended sample a1 to the feature extractor f to calculate a feature f(a1), and calculates a loss L based on the feature f(x) and the feature f(a1). ntxent Specifically, an encoder network that converts data samples into 256-dimensional features is used as the feature extractor f. As an example, a three-layer convolutional neural network is assumed as the feature extractor f according to this embodiment. The conversion by the encoder network is expressed as f:R 28×28 →R 256 In this case, the loss L ntxent The normalized temperature cross entropy loss may be used for . Note that the dimension of the feature after conversion by the feature extractor f is not limited to 256 dimensions, but may be lower than the dimension of the target sample x.
[0037] As shown in FIG. 6, the first training unit 14 applies each of the target sample x and the first extended sample a1 to the label information retaining model c to calculate a predicted target value c(x), and calculates a loss L based on the predicted target value c(x) and the target value y.xent The label information retaining model c is a neural network that converts each of the target sample x and the first extended sample a1 into a predicted target value c(x) for class classification, similar to the target value prediction model g. As an example, a three-layer convolutional neural network is assumed as the label information retaining model c according to this embodiment. The predicted target value c(x) is a 10-dimensional vector that has 10 elements, the numbers 0 to 9, similar to the predicted target value g(x), and each element takes two values, "1" indicating that the corresponding number applies, or "0" indicating that the corresponding number does not apply. The conversion by the label information retaining model c is as follows: c:R 28×28 →[0,1] 10 In this case, the loss L xent Cross entropy loss may be used.
[0038] In step S4, the first training unit 14 calculates the loss L ntxent , and the loss L ntxent While increasing the loss L xent To reduce the size of the input image, the parameter output function φ, the feature extractor f, and the label information retaining model c are trained. The training is expressed by the following formula (3).
[0039]
number
[0040] The first training unit 14 alternately performs the stochastic gradient descent method between minimization and maximization shown in equation (3). ntxent and loss L xent is a mini-batch of target samples {x n} N n=1 , its data extension {x n} 2N n=N+1 = {φ(x n )} N n=1 , label {y n}N n=1 can be defined as the following equations (4) and (5), respectively. i is the output f(x i ), c(x) y is the y of the predicted target value c(x) n +1st element. As an example, the mini-batch size N = 512 and the temperature parameter τ = 1 are set.
[0041]
number
[0042] Training of the parameter output function φ, the feature extractor f, and the label information retention model c is repeated by replacing the contents of the mini-batch until a predetermined iteration condition is satisfied. The iteration condition may be set to reach a predetermined number of iterations, or the like. When the iteration condition is satisfied, step S4 ends and the learned parameter output function φ is generated. The learned parameter output function φ is stored in the storage device 2.
[0043] When step S4 is performed, the determination unit 15 uses the learned parameter output function φ generated in step S4 to calculate the second data expansion parameter θ2 based on the target sample x acquired in step S1 (step S5). In step S5, the determination unit 15 prepares a target sample x for each class of the target value y, and applies the learned parameter output function φ to the target sample x to calculate the second data expansion parameter θ2. This results in the second data expansion parameter θ2 being obtained for each class of the target value y.
[0044] As described above, the parameter output function φ is trained to reduce the prediction error from each of the target sample x and the first extended sample a1 to the target value y while reducing the similarity between the target sample x and the first extended sample a1. Therefore, the second data extension parameter θ2 calculated in step S5 has the smallest similarity to the original sample within the range in which the extended sample generated based on the data extension parameter θ2 can predict the label associated with the original sample.
[0045] 8 is a diagram showing an example of the second data augmentation parameter θ2. As shown in FIG. 8, the data augmentation according to this embodiment is performed by using the angle θ r Rotation at and vertical translation θ x and left / right translation θ y The data expansion is expressed as (θ r ,θ x ,θ y As an example, the second data augmentation parameter of the target sample x of class “0” is expressed as a combination of three parameters (θ r ,θ x ,θ y )=(-π / 2,0,0). This represents data augmentation for class "0" images, with rotation in a wide range between -90° and 0°, and no up / down / left / right translation. As another example, the second data augmentation parameter for the target sample x of class "1" is (θ r ,θ x ,θ y ) = (π / 9,5,0), which represents data augmentation for class "1" images with a small rotation range between 0° and 20°, a translation between 0 and 5 pixels left and right, and no translation up and down.
[0046] An image of class "0" does not change shape no matter how much it is rotated, and when it is translated up, down, left, or right, the contour of 0 tends to be interrupted and the class information tends to be lost. On the other hand, an image of class "1" loses class information when it is rotated, but there is margin on the left and right, so the contour does not get interrupted even when it is translated, and the class information tends to be maintained. According to this embodiment, it is possible to automatically obtain the data expansion parameters (second data expansion parameters) at the limit at which the class information is maintained, without requiring such specialized knowledge.
[0047] When step S5 is performed, the determination unit 15 determines a third data expansion parameter based on the second data expansion parameter calculated in step S5 (step S6). In step S6, the determination unit 15 determines a third data expansion parameter θ3 based on the frequency distribution of the second data expansion parameter θ2 for each class of target values. As an example, the determination unit 15 samples a plurality of data expansion parameters in a range between the second data expansion parameter θ2 determined in step S6 and a reference value. The sampling may be performed according to a random function or any other function. The sampled data expansion parameter is used as the third data expansion parameter θ3. The number of samples may be set to the number required for training the target value prediction model c.
[0048] As an example, for an image of class “0” in Fig. 8, the data augmentation parameter θ r For the second data expansion parameter θ2, sampling is performed between "-π / 2" and the reference value "0", and the data expansion parameter θ x and θ y For the second data expansion parameter θ2, sampling is performed between “0” and the reference value “0”. That is, the data expansion parameter θ r For θ, the third data augmentation parameter θ3 has a value between “−π / 2” and “0”, and the data augmentation parameter θ x and θ y , the third data augmentation parameter θ3 will have a value of “0”. Similarly, for an image of class “1” in FIG.r For the second data expansion parameter θ2, sampling is performed between “π / 9” and the reference value “0”, and the data expansion parameter θ x For the second data extension parameter θ2, sampling is performed between “5” and the reference value “0”, and the data extension parameter θ y For the second data expansion parameter θ2, sampling is performed between “0” and the reference value “0”. That is, the data expansion parameter θ r For , the third data augmentation parameter θ3 has a value between “π / 9” and “0”, and the data augmentation parameter θ x For θ, the third data augmentation parameter θ3 has a value between “5” and “0”, and the data augmentation parameter θ y , the third data augmentation parameter θ3 will have the value “0”.
[0049] In this manner, according to the present embodiment, the third data augmentation parameter θ3 is determined from the second data augmentation parameter θ2, so that it is possible to automatically obtain various data augmentation parameters while maintaining class information without requiring specialized knowledge of the target sample. Note that the third data augmentation parameter θ3 does not necessarily need to be determined for each of all classes, and may be determined for only a portion of all classes. Alternatively, the third data augmentation parameter θ3 may be determined for each group obtained by dividing all target samples in an appropriate manner.
[0050] When step S6 is performed, the data extension unit 13 performs data extension on the target sample x acquired in step S1 according to the third data extension parameter θ3 determined in step S6 to generate a second extended sample a2(x;θ3) (step S7). Specifically, the data extension unit 13 sets the data extension parameter θ3 in the data extender a, and applies the target sample x to the data extender a to generate a second extended sample a2. The second extended sample a2 is generated for each of the multiple third data extension parameters θ3 determined in step S6.
[0051] When step S7 is performed, the second training unit 16 trains the target value prediction model g by machine learning based on the target value y acquired in step S1 and the second extended sample a2 determined in step S7 (step S8). In step S8, the second training unit 16 trains the target value prediction model g so that the loss between the predicted target value g (a2) obtained by applying the second extended sample a2 to the target value prediction model g and the target value y is reduced.
[0052] Specifically, as shown in FIG. 7, the second training unit 16 applies the second extended sample a2 to the target value prediction model g to calculate a predicted target value g(a2), and calculates a loss L representing the error between the predicted target value g(a2) and the target value y. xent Calculate the loss L xent The cross entropy based on the second extended sample a2 and the target value prediction model g may be used as the loss L xent The minimization of is expressed mathematically as in equation (6) below.
[0053]
number
[0054] Loss L xent The loss L can be minimized using stochastic gradient descent. xent is a mini-batch of randomly sampled target samples x from the training dataset {x n} N n=1 and label {y n} N n=1 is defined as the following equation (7). Here, g(a(x)) y is the y of the predicted target value g(a(x)) n +1st element. The mini-batch size N is set to, for example, 512.
[0055]
number
[0056] Training of the target value prediction model g is repeated by replacing the contents of the mini-batch until a predetermined iteration condition is satisfied. The iteration condition may be set to reach a predetermined number of iterations, etc. When the iteration condition is satisfied, step S8 ends and a trained target value prediction model g is generated.
[0057] After step S8 is performed, the output control unit 17 outputs the learned target value prediction model g generated in step S8 (step S9). The learned target value prediction model g is stored in the storage device 2.
[0058] This ends the machine learning process by the machine learning device 100 according to this embodiment.
[0059] Various additions, modifications, and / or deletions can be made to the machine learning process shown in Fig. 6 without departing from the spirit of the invention. Some modifications will be described below.
[0060] (Variation 1) In the above embodiment, the determination unit 15 determines the third data extension parameter by sampling a plurality of data extension parameters in the range between the second data extension parameter θ2 and a reference value in step S6 of Fig. 5. The determination unit 15 according to the first modification determines the third data extension parameter based on the frequency distribution of the second data extension parameter θ2.
[0061] FIG. 9 is a diagram showing the frequency distribution of data augmentation parameters for each class of target values. As an example, the left column shows "0", the center column shows "6", and the right column shows "9". The top row of FIG. 9 shows the rotation angle 180×θ for each class. r The frequency distribution of / π, the middle part of Fig. 9 shows the movement distance θ on the x-axis for each class. x The frequency distribution of,the movement distance θ,for each class on the y-axis is shown in the,lower part of Fig. 9. yrepresents a frequency distribution of θ3. The determination unit 15 obtains the frequency distribution by applying a plurality of target samples to the learned parameter output function φ for each of the plurality of classes. The determination unit 15 samples a plurality of data augmentation parameters in a range between the maximum and minimum values of the data augmentation parameters in the frequency distribution for each of the target value classes. The sampling may be performed according to a random function or any other function. The sampled data augmentation parameters are used as the third data augmentation parameter θ3. The number of samples may be set to the number required for training the target value prediction model c.
[0062] For example, data augmentation for a target sample of class "0" rotates in a wide range from a maximum value of "+10°" to a minimum value of "-230°", while data augmentation for target samples of classes "6" and "9" rotates in a limited range that allows the classes to be distinguished from each other, such as a minimum value of "-30°" to a maximum value of "+30°". According to the first modification, the third data augmentation parameter is determined from within such a range between the minimum and maximum values, so that it is possible to automatically obtain a variety of data augmentation parameters while maintaining class information, without requiring specialized knowledge of the target sample.
[0063] (Variation 2) In the above embodiment, the target sample is image data, but the present embodiment is not limited to this, and data samples of any data format can be used. For example, the target sample can be image data, audio data, time series data such as acceleration and voltage, or any other data format.
[0064] (Variation 3) In the above embodiment, the data extension is a combination of rotation and translation, but the present embodiment is not limited to this and can be applied to all kinds of deformations. For example, when the target sample is an image, the data extension can be affine transformation, addition of frequency noise, addition of a Gaussian filter, etc. When the target sample is a grayscale image, the data extension can be luminance value transformation, and when the target sample is a color image, the data extension can be RGB value transformation. When the target sample is time series data, the data extension can be sampling rate transformation, addition of frequency noise, addition of a Gaussian filter, etc.
[0065] (Variation 4) In the above embodiment, the first training unit 14 sets the loss L ntxent We use the normalized temperature cross entropy loss as the loss L xent We decided to use the cross-entropy loss as the loss L ntxent Any loss that quantifies the similarity between the augmented sample and the original target sample, such as cosine similarity or negative Euclidean distance, can be used as the loss L xent The loss can be any loss that quantifies the deviation between the predicted target value and the target value, such as squared error, absolute error, or hinge loss.
[0066] (Variation 5) In the above embodiment, the first training unit 14 trains the feature extractor and the label information retaining model together with the parameter output function. However, this embodiment is not limited to this. The first training unit 14 according to the fifth modification may use a pre-trained model as the feature extractor and the label information retaining model when training the parameter output function.
[0067] As an example, the feature extractor can be any encoder network pre-trained with any training data set. Since the similarity between the target sample and the augmented sample is calculated using the features of the encoder network, by using a feature extractor that extracts the input components to be focused on in the similarity calculation, data augmentation that deviates more from the original target sample while retaining the labels can be realized. In addition, training of the feature extractor can be omitted in training of the parameter output function, which makes it possible to speed up training of the parameter output function.
[0068] As an example, the label information-retaining model can be any classifier pre-trained with any training data set. This makes it possible to omit training the label information-retaining model in training the parameter output function, thereby speeding up training the parameter output function.
[0069] (Variation 6) In the above embodiment, the second training unit 16 calculates the loss L based on the predicted target value and the target value as shown in the above formula (6). xent The second training unit 16 according to the sixth modification trains the target value prediction model g so that the loss L xent The target value prediction model g is trained so that n The second data augmentation parameter θ2 obtained by applying the learned parameter output function φ to n ), the training by the second training unit 16 according to the sixth modification is expressed mathematically as in the following formula (8).
[0070]
number
[0071] As mentioned above, the second data augmentation parameter φ(x n) is large, the third data augmentation parameter is sampled from a wide range, and the variation of the second augmented samples generated according to the third data augmentation parameter is diverse. Therefore, by training the target value prediction model g according to formula (8), the target value prediction model g can learn target samples with a large second data augmentation parameter preferentially over target samples with a small second data augmentation parameter.
[0072] (Variation 7) In the above embodiment, the second training unit 16 trains the target value prediction model using all target samples regardless of the value of the second data expansion parameter. The second training unit 16 according to the seventh modification trains the target value prediction model excluding target samples having a second data expansion parameter corresponding to an outlier. The second training unit 16 can determine an outlier for each class of target values based on the shape of the frequency distribution of the second data expansion parameter according to the first modification. As an example, the second training unit 16 may determine a data expansion parameter that falls outside a predetermined quantile such as a quartile as an outlier. The second training unit 16 may also calculate a plurality of second data expansion parameters corresponding to a plurality of target samples, respectively, and determine an outlier based on a cluster analysis of the plurality of second data expansion parameters. For example, a second data expansion parameter in which the number of elements of a cluster is less than a threshold may be determined as an outlier.
[0073] A target sample having a second data augmentation parameter that corresponds to an outlier is highly likely to be abnormal data. The second training unit 16 according to the seventh modification can improve the training accuracy and output accuracy of the target value prediction model by excluding a target sample having a second data augmentation parameter that corresponds to an outlier from the learning target of the target value prediction model.
[0074] (Summary) As described above, the machine learning device 100 according to this embodiment includes an acquisition unit 11, a data augmentation unit 13, and a first training unit 14. The acquisition unit 11 acquires training samples including a target sample and a target value associated with the target sample. The data augmentation unit 13 performs data augmentation on the target sample according to a first data augmentation parameter to generate a first augmented sample. The first training unit 14 generates a parameter output function that inputs the target sample and outputs a second data augmentation parameter corresponding to the target sample by machine learning based on the target sample, the target value, and the first augmented sample.
[0075] According to the above configuration, by training the parameter output function using each target sample as a training sample, it is possible to generate a parameter output function that outputs appropriate data augmentation parameters according to each target sample. This allows a user to design data augmentation parameters that can generate various augmented samples while maintaining target value information according to each target sample, without requiring advanced specialized knowledge of the task to be solved or the target sample.
[0076] Thus, according to this embodiment, it becomes possible to design appropriate data augmentation parameters depending on each individual target sample.
[0077] Although some embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope and spirit of the invention, and are included in the scope of the invention and its equivalents described in the claims. [Explanation of symbols]
[0078] 1...processing circuit, 2...memory device, 3...input device, 4...communication device, 5...display device, 11...acquisition unit, 12...calculation unit, 13...data expansion unit, 14...first training unit, 15...decision unit, 16...second training unit, 17...output control unit, 100...machine learning device.
Claims
1. An acquisition unit that acquires a training sample including a target sample and a target value associated with the target sample; a data extension unit that performs data extension on the target sample in accordance with a first data extension parameter to generate a first extended sample; a first training unit that generates a parameter output function that inputs the target sample and outputs a second data augmentation parameter corresponding to the target sample by machine learning based on the target sample, the target value, and the first augmented sample; A machine learning device comprising:
2. The machine learning device according to claim 1 , wherein the first training unit trains the parameter output function so as to reduce a prediction error from each of the target sample and the first extended sample to the target value while reducing a similarity between the target sample and the first extended sample.
3. The machine learning device according to claim 1 , further comprising a determination unit that determines, based on the second data augmentation parameter, a third data augmentation parameter for generating a second augmented sample to be used for training a target value prediction model that inputs the target sample and outputs a predicted value of the target value corresponding to the target sample.
4. The machine learning device according to claim 3 , wherein the determination unit determines the third data augmentation parameter for each of the target value classes based on a frequency distribution of the second data augmentation parameter.
5. Further comprising a second training department; The data extension unit performs data extension in accordance with the third data extension parameter to generate a second extended sample; The second training unit generates the target value prediction model by machine learning based on the target value and the second extended sample, the target sample being input and the predicted value being output. The machine learning device according to claim 3.
6. The machine learning device according to claim 5 , wherein the second training unit trains the target value prediction model so that a loss based on the predicted value and the target value is reduced.
7. 7. The machine learning device according to claim 6, wherein the second training unit trains the target value prediction model so that the loss weighted with a large value is smaller for the target sample having a large second data augmentation parameter than for the target sample having a small second data augmentation parameter.
8. The machine learning device according to claim 5 , wherein the second training unit trains the target value prediction model excluding the target sample having the second data augmentation parameter that corresponds to an outlier.
9. The machine learning device according to claim 1 , wherein the first data augmentation parameter is a data augmentation parameter obtained by applying, to the target sample, a parameter output function that has not been trained by the first training unit.
10. Obtaining a training sample including a target sample and a target value associated with the target sample; performing data augmentation on the target sample in accordance with a first data augmentation parameter to generate a first augmented sample; A parameter output function that inputs the target sample and outputs a second data augmentation parameter corresponding to the target sample is generated by machine learning based on the target sample, the target value, and the first augmented sample. The machine learning method includes:
11. On the computer, A function of acquiring a training sample including a target sample and a target value associated with the target sample; a function of performing data extension on the target sample in accordance with a first data extension parameter to generate a first extended sample; A function of generating a parameter output function that inputs the target sample and outputs a second data extension parameter corresponding to the target sample by machine learning based on the target sample, the target value, and the first extension sample; A machine learning program that makes this possible.
Citation Information
Patent Citations
Learning a Data Augmentation Strategy
JP2021518939A
Data converter, method, and program
JP2023018524A
Information processing method, program and information processing apparatus
JP2023065826A
Information processing device, information processing method, data production method, and program
WO2022254600A1
Training data expansion apparatus, method, and program
JP2020140466A