Training methods, equipment, and programs
The training method enhances object detection accuracy by calculating feature and attention maps and incorporating a normal loss to suppress normal regions, improving the model's focus on defective areas.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2026-03-16
AI Technical Summary
Existing object detection technologies using weakly supervised learning struggle to accurately differentiate between normal and defective areas of objects, leading to inaccurate detection.
A training method that calculates feature and attention maps from normal and defective images, incorporates a normal loss to suppress normal regions, and adjusts parameters to minimize a total loss, enhancing the model's ability to focus on defective areas.
Improves the accuracy of object detection by training the model to suppress normal regions and emphasize defective regions, resulting in more precise localization of defects.
Smart Images

Figure 0007830372000004 
Figure 0007830372000005 
Figure 0007830372000006
Abstract
Description
[Technical Field]
[0001] Embodiments of the present invention relate to training methods, apparatus, and programs. [Background technology]
[0002] In object detection technology, machine learning models detect objects from images. Typically, training a machine learning model requires training data that includes the location information and labels of objects in the image (supervised learning). However, because generating training data that includes object location information is a laborious process, methods have been proposed to train machine learning models using training data that only includes object labels (weakly supervised learning).
[0003] In object detection techniques using weakly supervised learning, a machine learning model generates an attention map, for example, that shows the level of attention given to each pixel in an image, and detects the location of an object from the image based on the attention map. In particular, there are cases where the machine learning model wants to detect the location of a defective area in an object. In this case, it is necessary to train the machine learning model so that the defective area of the object is emphasized and the normal area of the object is suppressed in the attention map. [Prior art documents] [Patent Documents]
[0004] [Patent Document 1] Japanese Patent Publication No. 2022-003495 [Overview of the project] [Problems that the invention aims to solve]
[0005] The problem that this invention aims to solve is to improve the accuracy of object detection. [Means for solving the problem]
[0006] The training method according to the embodiment comprises a first step, a second step, a third step, a fourth step, a fifth step, and a sixth step. In the first step, the training method inputs a first image that does not include the defective region of the object and a second image that includes the defective region of the object into a machine learning model to calculate a first feature map and a first attention map from the first image, and a second feature map and a second attention map from the second image. In the second step, the training method calculates a first loss based on the first attention map. In the third step, the training method inputs the second feature map and the second attention map into the machine learning model to calculate an integrated map and a classification of the object. In the fourth step, the training method calculates a second loss based on the classification. In the fifth step, the training method calculates a total loss based on the first loss and the second loss. In the sixth step, the training method updates the parameters of the machine learning model to minimize the total loss. [Brief explanation of the drawing]
[0007] [Figure 1] A block diagram showing an example of the functional configuration of the training device according to the first embodiment. [Figure 2] A flowchart showing an example of operation of the training device according to the first embodiment. [Figure 3] A figure showing an example of the processing results of a machine learning model according to the first embodiment. [Figure 4] A block diagram showing an example of the functional configuration of the inference device according to the second embodiment. [Figure 5] A block diagram showing an example of the hardware configuration of a training device according to the first embodiment or an inference device according to the second embodiment. [Modes for carrying out the invention]
[0008] Hereinafter, a training method, apparatus, and program according to an embodiment will be described with reference to the drawings. In the following embodiments, parts with the same reference numerals perform the same operations, and duplicate descriptions will be omitted as appropriate.
[0009] (First Embodiment) FIG. 1 is a block diagram showing a functional configuration example of a training apparatus 1 according to the first embodiment. The training apparatus 1 is an apparatus that trains a machine learning model 500 using training data T. The training apparatus 1 includes an acquisition unit 11, a feature map calculation unit 12, an attention map calculation unit 13, an integration map calculation unit 14, a class classification calculation unit 15, a normal loss calculation unit 16, a classification loss calculation unit 17, a total loss calculation unit 18, and an update unit 19. Hereinafter, the machine learning model 500 is an object detection model configured by a neural network (NW), which detects the position of a defect area (e.g., damage, crack, hole) of an object (e.g., industrial product, drug, food product) and calculates the class classification of the object.
[0010] The acquisition unit 11 acquires various data or information. For example, the acquisition unit 11 acquires a normal image 100 and an abnormal image 200 as the training data T. The normal image 100 is an image (first image) that does not include a defect area of the object. The abnormal image 200 is an image (second image) that includes a defect area of the object. In other words, the normal image 100 is an image that includes only the normal area of the object, and the abnormal image 200 is an image that includes the normal area and the defect area of the object. The normal image 100 and the abnormal image 200 may be attached with a label (correct vector) of the object. The acquisition unit 11 transmits the acquired training data T to the feature map calculation unit 12.
[0011] The feature map calculation unit 12 calculates a feature map F by inputting the training data T into the machine learning model 500. The feature map F is a map having characteristic information. The feature map F is obtained by applying a convolutional layer or a fully connected layer of the machine learning model 500 to the training data T. When the training data T is an image, the feature map F is represented by a three-dimensional matrix (i, j, k) having two-dimensional elements (i, j) in the spatial direction and one-dimensional elements (k) in the channel direction.
[0012] First, the feature map calculation unit 12 calculates a first feature map F1 by inputting the normal image 100 into the machine learning model 500. Second, the feature map calculation unit 12 calculates a second feature map F2 by inputting the abnormal image 200 into the machine learning model 500. The feature map calculation unit 12 transmits the calculated feature map F to the attention map calculation unit 13.
[0013] The attention map calculation unit 13 calculates an attention map A by inputting the feature map F into the machine learning model 500. The attention map A is a map indicating which part in the spatial direction of the feature map F holds information effective for object detection. The attention map A is obtained by applying a convolutional layer or a fully connected layer of the machine learning model 500 to the feature map F. When the training data T is an image, the attention map A is represented by a two-dimensional matrix (i, j) having two-dimensional elements (i, j) in the spatial direction. That is, the sizes of the feature map F and the attention map A in the spatial direction are the same.
[0014] First, the attention map calculation unit 13 calculates the first attention map A1 by inputting the first feature map F1 to the machine learning model 500. Second, the attention map calculation unit 13 calculates the second attention map A2 by inputting the second feature map F2 to the machine learning model 500. The attention map calculation unit 13 transmits the calculated first attention map A1 to the normal loss calculation unit 16. Meanwhile, the attention map calculation unit 13 transmits the second feature map F2 and the calculated second attention map A2 to the integrated map calculation unit 14. Note that the feature map calculation unit 12 and the attention map calculation unit 13 are examples of the first map calculation unit.
[0015] The integrated map calculation unit 14 calculates the integrated map G by inputting the second feature map F2 and the second attention map A2 into the machine learning model 500. When the training data T is an image, the integrated map G is represented by a three-dimensional matrix (i,j,k) having two-dimensional elements (i,j) in the spatial direction and one-dimensional elements (k) in the channel direction. Generally, the integrated map G is calculated as the product of the values of each element in the feature map F and the values of each element in the attention map A, as shown in equation (1).
number
[0016] The classification calculation unit 15 calculates the classification C by inputting the integrated map G into the machine learning model 500. For example, the classification C is an estimated vector V1 that indicates the probability that an object belongs to each of several classes. The estimated vector V1 is obtained by applying a convolutional layer or a fully connected layer of the machine learning model 500 to the integrated map G. The classification calculation unit 15 transmits the calculated estimated vector V1 to the classification loss calculation unit 17. Note that the integrated map calculation unit 14 and the classification calculation unit 15 are examples of the second map calculation unit.
[0017] The normal loss calculation unit 16 calculates the normal loss L based on the first attention map A1 transmitted from the attention map calculation unit 13. normal Calculate the (first loss). Generally, the normal loss L normal This is calculated as the average value of attention map A, as shown in equation (2).
number
[0018] The classification loss calculation unit 17 calculates the classification loss L based on the estimated vector V1 transmitted from the class classification calculation unit 15. classify The (second loss) is calculated. Specifically, the classification loss calculation unit 17 calculates the classification loss L based on the estimated vector V1 and the correct vector V2. classify The classification loss L is calculated. The ground truth vector V2 is a vector containing information about the class corresponding to the training data T. For example, in the ground truth vector V2, the dimension of the class corresponding to the training data T is "1", and the dimension of the class that does not correspond to the training data T is "0". For example, the classification loss L classify This is the cross-entropy loss. The classification loss calculation unit 17 calculates the classification loss L classify This is transmitted to the total loss calculation unit 18.
[0019] In this embodiment, it is assumed that the object can belong to multiple classes, and the machine learning model 500 performs class classification of the object. On the other hand, when the object can belong to a single class, the machine learning model 500 may perform regression. In this case, the classification loss L classify may be the binary cross-entropy loss as the regression loss.
[0020] The total loss calculation unit 18 calculates the total loss L based on the normal loss L normal sent from the normal loss calculation unit 16 and the classification loss L classify sent from the classification loss calculation unit 17. For example, the total loss calculation unit 18 calculates the total loss L by adding the normal loss L normal and the classification loss L classify (formula: L = L normal + L classify ).
[0021] Note that the total loss calculation unit 18 may calculate the total loss L by multiplying the normal loss L normal by the weight W normal and adding the weighted normal loss L normal multiplied by the weight W normal and the classification loss L classify .
Equation
[0022] The update unit 19 updates the parameters P (e.g., weights and biases of the neural network) of the machine learning model 500 so as to minimize the total loss L. For example, the update unit 19 updates the parameters P of the machine learning model 500 by the gradient descent method or the error backpropagation method.
[0023] Figure 2 is a flowchart showing an example of the operation of the training device 1 according to the first embodiment. This example of operation may be started automatically by the training device 1, or it may be started manually in response to instructions from the user of the training device 1 (e.g., an AI engineer).
[0024] (Step S101) First, the training device 1 initializes the total loss L. Specifically, the training device 1 initializes the total loss L used to update the parameters P of the machine learning model 500 using the update unit 19.
[0025] (Step S102) Next, the training device 1 acquires a minibatch M. Specifically, the training device 1 acquires a minibatch M of training data T to be used to train the machine learning model 500 using an acquisition unit 11. A minibatch M is a subset of data selected from the training data T. For example, the acquisition unit 11 acquires the training data T, generates multiple minibatches M from the acquired training data T, and acquires one minibatch M from the generated multiple minibatches M. The acquisition unit 11 may also generate minibatches M by randomly selecting a predetermined number of data from the training data T.
[0026] (Step S103) Next, the training device 1 acquires a normal image 100 or an abnormal image 200. Specifically, the training device 1, using the acquisition unit 11, acquires one normal image 100 or one abnormal image 200 from among the multiple normal images 100 and multiple abnormal images 200 included in the minibatch M.
[0027] (Step S104) Next, the training device 1 calculates the feature map F. Specifically, the training device 1 uses a feature map calculation unit 12 to calculate a first feature map F1 from the normal image 100 and a second feature map F2 from the abnormal image 200.
[0028] (Step S105) Next, the training device 1 calculates attention map A. Specifically, the training device 1 uses an attention map calculation unit 13 to calculate the first attention map A1 from the first feature map F1 and the second attention map A2 from the second feature map F2.
[0029] (Step S106) Here, the training device 1 determines whether the image to be processed is a normal image 100. Specifically, the training device 1 uses the attention map calculation unit 13 to determine whether the image that was the subject of the series of processes from steps S103 to S105 is a normal image 100. If the image to be processed is a normal image 100 (Step S106-YES), the process proceeds to step S107. If the image to be processed is not a normal image 100 (Step S106-NO), the process proceeds to step S108. The latter case corresponds to the case where the image to be processed is an abnormal image 200.
[0030] (Step S107) In this case, the training device 1 has a normal loss L normal Specifically, the training device 1 calculates the normal loss L based on the first attention map A1 calculated in step S105 using the normal loss calculation unit 16. normal The result is calculated. After step S107, the process proceeds to step S111.
[0031] (Step S108) In this case, the training device 1 calculates the integrated map G. Specifically, the training device 1 uses an integrated map calculation unit 14 to calculate the integrated map G based on the second feature map F2 calculated in step S104 and the second attention map A2 calculated in step S105.
[0032] (Step S109) Next, the training device 1 calculates the class classification C. Specifically, the training device 1 calculates the class classification C based on the integrated map G using the class classification calculation unit 15.
[0033] (Step S110) Next, the training device 1 calculates the classification loss L classifySpecifically, the training device 1 calculates the classification loss L based on the class classification C using the classification loss calculation unit 17. classify The result is calculated. After step S110, the process proceeds to step S111.
[0034] (Step S111) Next, the training device 1 calculates the total loss L. Specifically, the training device 1 uses the total loss calculation unit 18 to calculate the normal loss L calculated in step S107. normal And the classification loss L calculated in step S110 classify Based on this, the total loss L is calculated.
[0035] (Step S112) Here, the training device 1 determines whether the processing of the minibatch M is complete. Specifically, the training device 1 uses the total loss calculation unit 18 to determine whether the processing of all normal images 100 or abnormal images 200 included in the minibatch M acquired in step S102 is complete. If the processing of the minibatch M is complete (step S112-YES), the process proceeds to step S113. If the processing of the minibatch M is not complete (step S112-NO), the process returns to step S103.
[0036] (Step S113) Next, the training device 1 updates the parameters P. Specifically, the training device 1 updates the parameters P of the machine learning model 500 using the update unit 19 to minimize the total loss L calculated in step S111.
[0037] (Step S114) Here, the training device 1 determines whether or not training is complete. Specifically, the training device 1 uses the update unit 19 to determine whether or not the conditions for completing the training of the machine learning model 500 have been met. If the conditions are met (Step S114-YES), the training device 1 terminates the series of processes. If the conditions are not met (Step S114-NO), the process returns to Step S101. The condition may also be whether or not processing is complete for all mini-batches M included in the training data T.
[0038] Figure 3 shows an example of the processing results of the machine learning model 500 according to the first embodiment. Figure 3(A) shows the input image 700. Figure 3(B) shows the attention map 800A calculated by the machine learning model 500 from the input image 700 before training using the training method of Figure 2. Figure 3(C) shows the attention map 800B calculated by the machine learning model 500 from the input image 700 after training using the training method of Figure 2.
[0039] The input image 700 shows a seed 710 as the object. In the input image 700, the image area of the seed 710 includes the image area of the insect-eaten hole 720. That is, the image area obtained by subtracting the image area of the insect-eaten hole 720 from the image area of the seed 710 corresponds to the "normal area" of the seed 710. On the other hand, the image area of the insect-eaten hole 720 corresponds to the "defective area" of the seed 710. In other words, the input image 700 is an example of an abnormal image 200.
[0040] The machine learning model 500 calculates an attention map 800A or 800B to detect the location of the "defect region" of seed 710 from the input image 700. Attention map 800A or 800B is a 15x15 pixel map (number of pixels N: 225) in the spatial direction. Each pixel is represented by shades of black and white (grayscale) according to the probability of the defect being present. Whiter pixels indicate a higher probability, while darker pixels indicate a lower probability.
[0041] The machine learning model 500 detects the location of defective regions in the seed 710 based on the attention map 800A or 800B. The detected locations of the defective regions are indicated by boxes 810A or 810B. On the other hand, the actual locations of the defective regions present in the input image 700 are indicated by box 820. In other words, boxes 810A or 810B correspond to the inference results by the machine learning model 500, and box 820 corresponds to the ground truth data.
[0042] According to attention map 800A, the machine learning model 500 has determined that defects exist across almost the entire area of attention map 800A. In other words, the machine learning model 500 is misidentifying the image region corresponding to the "normal region" of seed 710 as an "abnormal region." As a result, the position of box 810A does not coincide relatively well with the position of box 820. In other words, the machine learning model 500 is not trained to suppress the "normal region" of seed 710 in attention map 800A.
[0043] Conversely, according to attention map 800B, the machine learning model 500 has determined that defects exist only in certain areas of attention map 800B. In other words, the machine learning model 500 has not mistakenly detected the image area corresponding to the "normal area" of seed 710 as an "abnormal area." Therefore, the position of box 810B relatively coincides with the position of box 820. In other words, the machine learning model 500 is trained to suppress the "normal area" of seed 710 in attention map 800B.
[0044] According to attention maps 800A and 800B, the machine learning model 500 trained using the training method shown in Figure 2 detects the "defective regions" of the seeds 710 with greater accuracy compared to the model trained using the training method shown in Figure 2.
[0045] The training device 1 according to the first embodiment has been described above. The training device 1 is based on a normal image 100 and normal loss L normal And classification loss L based on abnormal image 200 classifyThe parameters P of the machine learning model 500 are updated to minimize the summed total loss L. This trains the machine learning model 500 to decrease the pixel values of attention map A corresponding to the "normal region" of the object, and increase the pixel values of attention map A corresponding to the "defective region" of the object. Therefore, the machine learning model 500 can detect the defective region of the object with greater accuracy using attention map A. In other words, the training device 1 can improve the accuracy of object detection by the machine learning model 500.
[0046] (Second Embodiment) Figure 4 is a block diagram showing an example of the functional configuration of the inference device 2 according to the second embodiment. The inference device 2 is a device that performs inference using a machine learning model 500 trained by the training device 1. The inference device 2 comprises an acquisition unit 11, a feature map calculation unit 12, an attention map calculation unit 13, an integrated map calculation unit 14, a classification calculation unit 15, and an output unit 20.
[0047] The acquisition unit 11 acquires either a normal image 100 or an abnormal image 200 as inference data E. The feature map calculation unit 12 calculates a feature map F by inputting the inference data E into the machine learning model 500. The attention map calculation unit 13 calculates an attention map A by inputting the feature map F into the machine learning model 500. The integrated map calculation unit 14 calculates an integrated map G by inputting the feature map F and the attention map A into the machine learning model 500. The classification calculation unit 15 calculates a classification C by inputting the integrated map G into the machine learning model 500.
[0048] The output unit 20 outputs various types of data or information. For example, the output unit 20 outputs attention map A and classification C. Attention map A shows the location of objects included in inference data E. Classification C shows the type of object included in inference data E.
[0049] The inference device 2 according to the second embodiment has been described above. The inference device 2 performs inference on the inference data E using the machine learning model 500 trained by the training device 1. As a result, the inference device 2 can detect the position and type of objects included in the inference data E with greater accuracy.
[0050] Figure 5 is a block diagram showing an example of the hardware configuration of the training device 1 according to the first embodiment or the inference device 2 according to the second embodiment. The training device 1 or the inference device 2 comprises a CPU 81, RAM 82, ROM 83, storage 84, display device 85, input device 86, and communication device 87 as its respective components. Each component is connected to the others via a bus (BUS) so as to be able to communicate with each other. Note that the training device 1 or the inference device 2 may comprise at least some of each component.
[0051] The CPU 81 is a processor that performs various processes (e.g., arithmetic processing, control processing) according to a program. The CPU 81 uses a predetermined area of the RAM 82 as a working area. The CPU 81 reads and executes each program stored in the ROM 83 or storage 84 to realize each part of the training device 1 or inference device 2 (acquisition unit 11, feature map calculation unit 12, attention map calculation unit 13, integrated map calculation unit 14, class classification calculation unit 15, normal loss calculation unit 16, classification loss calculation unit 17, total loss calculation unit 18, update unit 19, output unit 20). The CPU 81 is an example of a processing unit.
[0052] RAM82 is a memory that stores various types of data or information in a rewritable format. For example, RAM82 is SDRAM (Synchronous Dynamic Random Access Memory). RAM82 is an example of a memory unit.
[0053] ROM83 is a memory that stores various types of data or information in a way that prevents rewriting. ROM83 is an example of a memory unit.
[0054] The storage 84 is various types of storage media (e.g., magnetic storage media, semiconductor storage media, optical storage media). Alternatively, the storage 84 may be a drive device that writes or reads various types of data or information to or from the storage media. The storage 84 writes or reads various types of data or information to or from the storage media in accordance with the control of the CPU 81. The storage 84 is an example of a storage unit.
[0055] The display device 85 is a device that displays various data or information. For example, the display device 85 is an LCD (Liquid Crystal Display). The display device 85 displays various data or information based on display signals from the CPU 81. The display device 85 is an example of a display unit or output unit.
[0056] The input device 86 is a device that inputs various data or information to the training device 1 or the inference device 2. For example, the input device 86 is a mouse or a keyboard. The input device 86 receives the information input by the user as an instruction signal and transmits the instruction signal to the CPU 81. The input device 86 is an example of an input unit.
[0057] The communication device 87 communicates with external devices via a network in accordance with the control of the CPU 81. The communication device 87 is an example of a communication unit.
[0058] Furthermore, the various processes performed by training device 1 or inference device 2 can be executed by a computer (e.g., personal computer, microcomputer, arithmetic unit). For example, the computer can store programs corresponding to the various processes in a storage medium, read the stored programs, and execute them. Alternatively, the computer can read and execute programs from an external storage medium connected via a network (e.g., LAN, internet). In this way, the computer can achieve effects similar to those produced by the processing of training device 1 or inference device 2.
[0059] The storage medium may be a magnetic disk (e.g., flexible disk, hard disk), an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD±R, DVD±RW, Blu-ray® Disc), a semiconductor memory, or a similar storage medium. The storage medium may also be a storage medium on which a program has been downloaded from a network. Of course, multiple programs may be stored on multiple storage media.
[0060] Furthermore, instead of a single computer, a system consisting of multiple computers, an operating system (OS), database management software, or middleware (MW) may perform various processes by the training device 1 or the inference device 2.
[0061] While several embodiments of the present invention have been described, these embodiments are presented as examples only and are not intended to limit the scope of the invention. These novel embodiments can be carried out in a variety of other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and their variations are included in the scope and spirit of the invention, as well as in the claims of the invention and its equivalents. [Explanation of Symbols]
[0062] 1...Training device, 2...Inference device, 11...Acquisition unit, 12...Feature map calculation unit, 13...Attention map calculation unit, 14...Integrated map calculation unit, 15...Classification calculation unit, 16...Normal loss calculation unit, 17...Classification loss calculation unit, 18...Total loss calculation unit, 19...Update unit, 20...Output unit, 81...CPU, 82...RAM, 83...ROM, 84...Storage, 85...Display device, 86...Input device, 87...Communication device, 100...Normal image, 200...Abnormal image, 500...Machine learning model, 700...Input image, 710...Seed, 720...Hole, 800A,800B...Attention map, 810A,810B,820...Box
Claims
1. The first step involves inputting a first image of the object that does not include the defective area and a second image of the object that includes the defective area into a machine learning model, thereby calculating a first feature map and a first attention map from the first image, and calculating a second feature map and a second attention map from the second image. A second step is to calculate a first loss based on the first attention map, A third step involves inputting the second feature map and the second attention map into the machine learning model to calculate an integrated map and the classification of the object. A fourth step is to calculate the second loss based on the aforementioned classification, A fifth step is to calculate the total loss based on the first loss and the second loss, A sixth step involves updating the parameters of the machine learning model to minimize the total loss, It is equipped with, In the second step, the average value of the first attention map is calculated as the first loss. Training method.
2. The first step involves inputting a first image of the object that does not include the defective area and a second image of the object that includes the defective area into a machine learning model, thereby calculating a first feature map and a first attention map from the first image, and calculating a second feature map and a second attention map from the second image. A second step is to calculate a first loss based on the first attention map, A third step involves inputting the second feature map and the second attention map into the machine learning model to calculate an integrated map and the classification of the object. A fourth step is to calculate the second loss based on the aforementioned classification, A fifth step is to calculate the total loss based on the first loss and the second loss, A sixth step involves updating the parameters of the machine learning model to minimize the total loss, It is equipped with, In the third step, the product of the values of each element in the second feature map and the values of each element in the second attention map is calculated as the integrated map. Training method.
3. The first step involves inputting a first image of the object that does not include the defective area and a second image of the object that includes the defective area into a machine learning model, thereby calculating a first feature map and a first attention map from the first image, and calculating a second feature map and a second attention map from the second image. A second step is to calculate a first loss based on the first attention map, A third step involves inputting the second feature map and the second attention map into the machine learning model to calculate an integrated map and the classification of the object. A fourth step is to calculate the second loss based on the aforementioned classification, A fifth step is to calculate the total loss based on the first loss and the second loss, A sixth step involves updating the parameters of the machine learning model to minimize the total loss, It is equipped with, In the fifth step, the first loss is multiplied by a weight, and the total loss is calculated by adding the first loss multiplied by the weight and the second loss. Training method.
4. A first map calculation unit inputs a first image that does not include the defective region of the object and a second image that includes the defective region of the object into a machine learning model, thereby calculating a first feature map and a first attention map from the first image and a second feature map and a second attention map from the second image. A first loss calculation unit calculates a first loss based on the first attention map, A second map calculation unit calculates an integrated map and the classification of the object by inputting the second feature map and the second attention map into the machine learning model, A second loss calculation unit calculates a second loss based on the aforementioned class classification, A total loss calculation unit that calculates the total loss based on the first loss and the second loss, An update unit updates the parameters of the machine learning model to minimize the total loss, It is equipped with, The first loss calculation unit calculates the average value of the first attention map as the first loss. training equipment.
5. On the computer, A first map calculation function calculates a first feature map and a first attention map from the first image and a second attention map from the second image by inputting a first image that does not include the defective area of the object and a second image that includes the defective area of the object into a machine learning model, A first loss calculation function that calculates a first loss based on the first attention map, A second map calculation function that calculates an integrated map and the object classification by inputting the second feature map and the second attention map into the machine learning model, A second loss calculation function that calculates a second loss based on the aforementioned class classification, A total loss calculation function that calculates the total loss based on the first loss and the second loss, An update function that updates the parameters of the machine learning model to minimize the total loss, To make it happen, The first loss calculation function calculates the average value of the first attention map as the first loss. Training program.
Citation Information
Patent Citations
Inspection device, unit selection device, inspection method, and inspection program
JP2022003495A
Image recognition learning system, image recognition learning method, image recognition learning program, image recognition machine learning unit, and image recognition system
WO2022185432A1