Image processing device and image processing method
The image processing device automates the learning, verification, and relearning of machine learning models to address user challenges in selecting training images, ensuring accurate classification by reducing user burden and improving efficiency.
Patent Information
- Application Number
- JP2023034671
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2024-09-20
AI Technical Summary
Users face challenges in determining which images to use for training a machine learning model, leading to a trial-and-error process that increases the burden and time required for learning, with risks of overfitting and difficulty in assessing classification accuracy.
An image processing device that automatically performs learning, verification, and relearning of a machine learning model until sufficient accuracy is achieved, reducing user burden by evaluating classification processing and retraining images with high incorrect classification probabilities.
The device reduces user workload by automating the learning process, ensuring accurate classification results through efficient image selection and retraining, thereby minimizing incorrect classifications.
Smart Images

Figure 2024126353000001
Abstract
Description
[Technical field]
[0001] The present disclosure relates to an image processing device and an image processing method that include a processor that executes image processing using a machine learning model. [Background technology]
[0002] For example, as an inspection device for visually inspecting industrial products, an inspection device configured to input a target image acquired by an imaging unit into a machine learning model and execute a classification process to determine whether the target image belongs to a good or defective group is known (see, for example, Patent Document 1). In the inspection device of Patent Document 1, a machine learning model is trained using learning images belonging to a good group and learning images belonging to a defective group, and images that are ambiguous as to whether they belong to the good or defective group are proposed to the user as additional learning images.
[0003] Furthermore, Patent Document 2 discloses presenting to a user the number of additional defect images required for further performance improvement based on the performance accuracy of a defect detection section. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Patent No. 6643856 [Patent Document 2] JP 2021-196363 A Summary of the Invention [Problem to be solved by the invention]
[0005] However, multiple learning images are required to train a machine learning model, but it is difficult for users to know which images to use as learning images from among multiple images. This leads to trial and error in learning the machine learning model, which increases the burden on users and may increase the number of learning images and the learning time. In addition, there is a risk of overlearning depending on the user's judgment.
[0006] In the case of the inspection device of Patent Document 1, it is possible to propose learning images to a user, but the user must decide whether or not to input the proposed learning images into a machine learning model for learning, which places a large burden on the user. In addition, it is difficult for the user to confirm whether the accuracy of the classification process by the machine learning model is sufficient, and the burden on the user who performs the confirmation work is large. Furthermore, if the result of the confirmation shows that the accuracy of the classification process is insufficient and that additional learning is necessary, the user must repeat the learning using the learning images, which also increases the burden on the user.
[0007] Furthermore, in the case of the defect detection system of Patent Document 2, it is possible to present to the user the number of additional defect images required to further improve performance based on the performance accuracy of the defect detection section, but the user must decide which learning images should be added, which places a heavy burden on the user.
[0008] The present disclosure has been made in consideration of these points, and its purpose is to reduce the burden on users by automatically training, verifying, and relearning a machine learning model until the accuracy of the classification process is sufficient. [Means for solving the problem]
[0009] In order to achieve the above object, the present aspect may be premised on an image processing device including a processor that inputs an image into a machine learning model and executes a classification process of classifying the image into a plurality of classes. The processor causes the machine learning model to learn a plurality of training images, inputs a plurality of verification images into the machine learning model trained with the plurality of training images, and executes a classification process of classifying the plurality of verification images into the plurality of classes, obtains a degree of separation of the plurality of classes by the classification process of the plurality of verification images, evaluates the accuracy of the classification process of the plurality of verification images based on the obtained degree of separation of the plurality of classes, evaluates whether or not re-learning of the machine learning model is necessary based on the evaluation result of the accuracy of the classification process of the plurality of verification images, and if it is evaluated that re-learning of the machine learning model is necessary, extracts a verification image that is relatively likely to have an incorrect classification result from the plurality of verification images and automatically causes the machine learning model to re-learn the verification image, while if it is evaluated that re-learning of the machine learning model is unnecessary, completes the learning process of the machine learning model.
[0010] According to this configuration, after the machine learning model is trained using a plurality of learning images, a plurality of verification images are input to the machine learning model to execute classification processing, thereby verifying the machine learning model. If the accuracy of the classification processing evaluated based on the degree of separation obtained by the verification is insufficient, a verification image with a relatively high possibility of the classification result being erroneous is input to the machine learning model and automatically re-learned. On the other hand, if the accuracy of the classification processing evaluated based on the degree of separation obtained by the verification is sufficient and re-learning of the machine learning model is not necessary, the learning processing of the machine learning model is completed. In short, according to this configuration, the learning, verification, and re-learning of the machine learning model are automatically executed, so that the burden on the user is reduced, and efficient learning can be performed by using a verification image with a relatively high possibility of the classification result being erroneous during re-learning.
[0011] The processor can automatically repeat the classification process, the evaluation of the accuracy of the classification process, the evaluation of whether or not the machine learning model needs to be retrained, and the retraining process until it is determined that retraining of the machine learning model is unnecessary. That is, examples of cases in which retraining is unnecessary include a case in which sufficient accuracy of the classification process is obtained, a case in which the accuracy of the classification process does not improve even if additional learning images are input and reaches a plateau, and a case in which there are insufficient learning images. However, it is difficult for a user to determine, for example, whether sufficient accuracy of the classification process has been obtained or when the accuracy of the classification process has reached a plateau and does not improve. Therefore, by automatically repeating the above-mentioned retraining process by the image processing device according to this embodiment, the user does not need to make each of the above-mentioned judgments, and the burden on the user can be further reduced.
[0012] The image processing device may also execute a classification process for classifying a plurality of verification images into a first class and a second class. In this case, a first evaluation value indicating the degree of belonging to the first class may be calculated for each of the plurality of verification images, and when it is evaluated that re-learning of the machine learning model is necessary, a second class image having a relatively high first evaluation value or a first class image having a relatively low first evaluation value may be extracted and automatically re-learned by the machine learning model. Furthermore, the classification process, evaluation of the accuracy of the classification process, evaluation of whether or not re-learning of the machine learning model is necessary, and re-learning process may be repeatedly executed until a degree of separation between the distributions of the first class image and the second class image is obtained and it is evaluated that re-learning of the machine learning model is unnecessary based on the degree of separation. In other words, the accuracy of the classification process can be further improved by using the first evaluation value indicating the degree of belonging to the first class as the basis for evaluating the necessity of re-learning.
[0013] When the image processing device performs a classification process to classify a plurality of verification images into a first class and a second class, the image processing device can repeatedly perform the classification process, evaluation of the accuracy of the classification process, evaluation of whether or not re-learning of the machine learning model is necessary, and the re-learning process until the degree of separation between the distributions of the first class images and the second class images reaches a predetermined value or greater.
[0014] The multiple verification images may include non-defective images with a non-defective label and defective images with a defective label. In this case, in the classification process, an evaluation value indicating the degree of defect of each of the multiple verification images is calculated, and if re-learning is necessary, a non-defective image with a relatively high evaluation value or a defective image with a relatively low evaluation value is extracted, and the machine learning model can be automatically re-learned. Then, the degree of separation between the distribution of the non-defective images and the defective images on the evaluation value axis is calculated, and the classification process, evaluation of the accuracy of the classification process, evaluation of whether or not re-learning of the machine learning model is necessary, and re-learning process can be repeatedly performed until the degree of separation is equal to or greater than a predetermined value.
[0015] Furthermore, based on the result of comparing the evaluation values of the good images and the defective images among the multiple verification images, it is possible to automatically determine whether to extract a good image with a relatively high evaluation value or a defective image with a relatively low evaluation value as an image to be retrained into the machine learning model. This allows the image processing device to automatically determine which of the good and defective images has a higher learning effect, thereby further reducing the burden on the user.
[0016] In addition, in the classification process, a second evaluation value indicating the degree to which each of the multiple verification images belongs to the second class may be further calculated. In this case, if it is evaluated that re-learning of the machine learning model is necessary, the first class image having a relatively high second evaluation value or the second class image having a relatively low second evaluation value may be extracted and automatically re-learned by the machine learning model. Then, a degree of separation between the distributions of the first class image and the second class image on the second evaluation value axis is obtained, and until it is evaluated based on the degree of separation that re-learning of the machine learning model is unnecessary, the classification process, evaluation of the accuracy of the classification process, evaluation of whether or not re-learning of the machine learning model is necessary, and re-learning process are repeatedly performed, thereby enabling efficient learning.
[0017] In addition, the processor can automatically calculate the number of verification images to be used for re-learning based on the evaluation result of the accuracy of the classification process, and automatically re-learn the calculated number of verification images to the machine learning model. In other words, the image processing device automatically determines the number of images to be added when re-learning according to the accuracy of the classification process, thereby reducing the workload of the user.
[0018] The processor may also extract the calculated number of verification images in descending order of the relative likelihood that the classification result is incorrect, and automatically retrain the machine learning model. In other words, the number of verification images to be used for retraining is not only automatically calculated, but also the criteria for selecting the calculated number of images can be left to the image processing device, thereby reducing the workload of the user.
[0019] The processor can also generate a display screen including a separation graph showing the degree of separation of the distribution of the first class image and the second class image on the first evaluation value axis and display it on the display unit, or update the separation graph to the separation graph obtained by the machine learning model after re-learning, generate a display screen that displays the latest separation graph obtained by the update so as to be comparable with past separation graphs, and display it on the display unit. In this way, if re-learning is required, the progress of the learning process can be shown to the user on the display screen. In addition, if re-learning is not required, the display screen can be presented to the user as the final evaluation result.
[0020] The processor may be configured to generate a display screen that displays a most recent separation graph obtained by repeatedly executing re-learning of the machine learning model and a past separation graph in a comparative manner, and display the display screen on the display unit, and to accept, from a user, a selection of a past machine learning model corresponding to the past separation graph as a machine learning model to be used during operation. In this case, when the selection of the past machine learning model is accepted, all learning images that have been trained in the selected past machine learning model are identified, and all the identified learning images are trained in a machine learning model in an initial state before the start of training, so that the selected past machine learning model can be reproduced. In other words, a past machine learning model in an earlier learning stage than the most recent machine learning model that has been repeatedly re-learned may have a higher accuracy of classification processing, but it is generally difficult to return from the most recent machine learning model to the past machine learning model. In contrast, in this configuration, the past machine learning model can be easily reproduced by training all learning images trained in the past machine learning model selected by the user in a machine learning model in an initial state.
[0021] In addition, the re-learning of the machine learning model may be resumed by a user instruction. In this case, a new verification image different from the existing verification image is input to the machine learning model, and a process of classifying the new verification image into the multiple classes is executed. The accuracy of the classification process is evaluated based on the degree of separation of the multiple classes obtained by the classification process for the new verification image. If it is evaluated that the machine learning model needs to be re-learned, a verification image that is likely to be erroneously classified can be extracted from the new verification images and automatically re-learned by the machine learning model. As a result, even if a new image is acquired after the learning process has been completed, the existing machine learning model can be re-learned by a user instruction, so that the accuracy of the machine learning model can be continuously improved.
[0022] In addition, the system may be configured to select between a process of adding learning images by retaining each label related to the classification of existing learning images and validation images used in training a machine learning model in operation and adding new images acquired after the start of operation to the existing learning images, and a process of initializing each label related to the classification of existing learning images and validation images used in training a machine learning model in operation and training the machine learning model with all images including new images acquired after the start of operation. In other words, if the accuracy of the classification process of the machine learning model in operation is high, new images can be added without initialization, but if the accuracy of the classification process of the machine learning model in operation is low, the accuracy of the classification process may be improved by initializing and training the machine learning model with all images, and the user can select either one depending on the situation. Effect of the Invention
[0023] As described above, the learning, verification, and re-learning of the machine learning model can be automatically performed until the accuracy of the classification process is sufficient, thereby reducing the burden on the user. [Brief description of the drawings]
[0024] [Figure 1] 1 is a schematic diagram illustrating a configuration of an image processing device according to an embodiment of the present invention. [Diagram 2] FIG. 2 is a block diagram showing a hardware configuration of the image processing device. [Diagram 3] FIG. 13 is a diagram illustrating an example of processing a work image using a machine learning model. [Figure 4] 13 is a flowchart showing a first example of step 1 of the automatic learning process. [Diagram 5] FIG. 13 is a diagram showing an example of a user interface screen for displaying an image. [Figure 6] FIG. 13 is a diagram showing an example of a user interface screen for displaying a learning result after a first learning session has been completed. [Figure 7] FIG. 7 is a diagram equivalent to FIG. 6 and showing the state after the second learning has been completed. [Figure 8]FIG. 7 is a diagram equivalent to FIG. 6 and showing the state after the third learning has been completed. [Figure 9] 13 is a flowchart showing a first example of step 2 of the automatic learning process. [Figure 10] 13 is a flowchart showing a second example of step 1 of the automatic learning process. [Figure 11] 13 is a flowchart showing a second example of step 2 of the automatic learning process. [Figure 12] 13 is a flowchart showing an example of defective product learning. [Figure 13] FIG. 13 is a diagram showing an example of an annotation screen. [Figure 14] FIG. 13 is a diagram showing an example of a learning progress display screen. [Figure 15] FIG. 13 is a diagram showing an example of a learning result display area in the case of three-class classification. [Figure 16] 13 is a flowchart showing an example of automatic learning in the case of three-class classification. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0025] Hereinafter, the embodiments of the present invention will be described in detail with reference to the drawings. Note that the following description of the preferred embodiments is merely illustrative in nature and is not intended to limit the present invention, its applications, or its uses.
[0026] 1 is a schematic diagram showing the configuration of an image processing device 1 according to an embodiment of the present invention. The image processing device 1 is a device for determining the quality of a work image acquired by imaging a workpiece to be inspected, such as various parts or products, and can be used in production sites such as factories. Specifically, a machine learning model is constructed inside the image processing device 1, and this machine learning model is generated by learning a plurality of learning images.
[0027] 2, the image processing device 1 includes a control unit 2 which is the main body of the device, an imaging unit 3, a display device (display section) 4, and a personal computer 5. The personal computer 5 is not essential and can be omitted. The personal computer 5 can be used instead of the display device 4 to display various information and images, and the functions of the personal computer 5 can be incorporated into the control unit 2 or the display device 4.
[0028] In Fig. 1, the control unit 2, the imaging unit 3, the display device 4, and the personal computer 5 are described as an example of the configuration of the image processing device 1, but any two or more of these can be combined and integrated. For example, the control unit 2 and the imaging unit 3 can be integrated, or the control unit 2 and the display device 4 can be integrated. In addition, the control unit 2 can be divided into a plurality of units and some of them can be incorporated into the imaging unit 3 or the display device 4, or the imaging unit 3 can be divided into a plurality of units and some of them can be incorporated into the other units. By using the image processing device 1, all the steps of the image processing method according to the present invention can be executed.
[0029] (Configuration of imaging unit 3) As shown in FIG. 2, the imaging unit 3 includes a camera module (imaging section) 14 and an illumination module (illumination section) 15, and is a unit that performs acquisition of a workpiece image. The camera module 14 includes an AF motor 14a that drives the imaging optical system, and an imaging board 14b. The AF motor 14a is a part that performs automatic focus adjustment by driving the lens of the imaging optical system, and can perform focus adjustment by a method such as contrast autofocus that has been well known in the past. The imaging board 14b includes a CMOS sensor 14c as a light receiving element that receives light incident from the imaging optical system. The CMOS sensor 14c is an imaging sensor configured to be able to acquire a color image. Instead of the CMOS sensor 14c, a light receiving element such as a CCD sensor can be used.
[0030] The lighting module 15 includes an LED (light-emitting diode) 15a as a light-emitting body that illuminates an imaging area including a workpiece, and an LED driver 15b that controls the LED 15a. The timing, duration, and amount of light emitted by the LED 15a can be arbitrarily controlled by the LED driver 15b. The LED 15a may be provided integrally with the imaging unit 3, or may be provided separately from the imaging unit 3 as an external lighting unit.
[0031] (Configuration of display device 4) The display device 4 has a display panel formed of, for example, a liquid crystal panel or an organic EL panel, and is controlled by a processor 13c of the control unit 2 described later. A work image, a user interface image, and the like output from the control unit 2 are displayed on the display device 4. In addition, if the personal computer 5 has a display panel, the display panel of the personal computer 5 can be used in place of the display device 4.
[0032] (operation equipment) Examples of operation devices for a user to operate the image processing device 1 include, but are not limited to, the keyboard 51 and mouse 52 of the personal computer 5, and may be any device configured to be able to accept various operations by the user. For example, a pointing device such as the touch panel 41 of the display device 4 is also included in the operation devices.
[0033] User operations on the keyboard 51 and mouse 52 can be detected by the control unit 2. The touch panel 41 is a conventionally known touch-type operation panel equipped with, for example, a pressure sensor, and user touch operations can be detected by the control unit 2. The same applies when other pointing devices are used.
[0034] (Configuration of control unit 2) The control unit 2 includes a main board 13, a connector board 16, a communication board 17, and a power supply board 18. The main board 13 is provided with a display control unit 13a, an input unit 13b, and a processor 13c. The display control unit 13a and the input unit 13b can be configured, for example, by a processing device mounted on the main board 13. The display control unit 13a, the input unit 13b, and the processor 13c may be configured by one processing device, or the display control unit 13a, the input unit 13b, and the processor 13c may be configured by separate processing devices.
[0035] The display control unit 13a, the input unit 13b, and the processor 13c control the operation of each connected board and module. For example, the processor 13c outputs a lighting control signal that controls turning on / off the LED 15a to the LED driver 15b of the lighting module 15. The LED driver 15b switches the LED 15a on / off and adjusts the lighting time according to the lighting control signal from the processor 13c, and adjusts the light amount of the LED 15a.
[0036] Moreover, the processor 13c outputs an imaging control signal to control the CMOS sensor 14c to the imaging board 14b of the camera module 14. The CMOS sensor 14c starts imaging in response to the imaging control signal from the processor 13c, and adjusts the exposure time to an arbitrary time to perform imaging. That is, the imaging unit 3 images the field of view of the CMOS sensor 14c in response to the imaging control signal output from the processor 13c, and if a workpiece is present within the field of view, the workpiece is imaged. However, if an object other than the workpiece is present within the field of view, the object can also be imaged. For example, the image processing device 1 can capture a good product image corresponding to a good product and a defective product image corresponding to a defective product by the imaging unit 3 as learning images for a machine learning model. The learning images do not have to be images captured by the imaging unit 3, and may be images captured by other cameras or the like.
[0037] On the other hand, when the image processing device 1 is in operation, the workpiece can be imaged by the imaging unit 3. The CMOS sensor 14c is configured to be able to output a live image, that is, a currently captured image, at any time at a short frame rate.
[0038] When the CMOS sensor 14c finishes capturing an image, the image signal output from the imaging unit 3 is input to the processor 13c of the main board 13 for processing, and is stored in the memory 13d of the main board 13. Specific details of the processing by the processor 13c of the main board 13 will be described later. The main board 13 may be provided with a processing device such as an FPGA or a DSP. Alternatively, the processor 13c may be an integrated device such as an FPGA or a DSP.
[0039] The connector board 16 is a part that receives power from the outside via a power connector (not shown) provided on the power interface 161. The power supply board 18 is a part that distributes the power received by the connector board 16 to each board and module, and specifically distributes power to the lighting module 15, the camera module 14, the main board 13, and the communication board 17. The power supply board 18 includes an AF motor driver 181. The AF motor driver 181 supplies driving power to the AF motor 14a of the camera module 14 to realize autofocus. The AF motor driver 181 adjusts the power supplied to the AF motor 14a in response to an AF control signal from the processor 13c of the main board 13.
[0040] The communication board 17 is a part that executes communication between the main board 13 and the display device 4 and the personal computer 5, and communication between the main board 13 and an external control device (not shown). An example of the external control device is a programmable logic controller. The communication may be wired or wireless, and either form of communication can be realized by a conventionally known communication module.
[0041] The control unit 2 is provided with a storage device (storage unit) 19 consisting of, for example, a solid state drive, a hard disk drive, or the like. The storage device 19 stores a program file 80, a setting file, and the like (software) for enabling the hardware to execute each control and process described below. The program file 80 and the setting file can be stored in a storage medium 90 such as an optical disk, and the program file 80 and the setting file stored in the storage medium 90 can be installed in the control unit 2. The program file 80 may be downloaded from an external server using a communication line. In addition, the storage device 19 can also store, for example, the image data and parameters for constructing a machine learning model of the image processing device 1.
[0042] (When image processing device 1 is in operation) When the image processing device 1 is operated, the processor 13c reads the parameters stored in the storage device 19, and constructs a trained machine learning model. As shown in FIG. 3, the machine learning model includes a neural network, an autoencoder, an SVM (support vector machine), and the like. The processor 13c inputs a workpiece image obtained by capturing an image of a workpiece to be inspected to the neural network constructed as described above. This is a pre-stage process. When the workpiece image is input to the neural network, the neural network performs feature extraction, and the extracted feature amount is input to an autoencoder and / or a support vector machine that executes a post-stage process. The neural network that performs feature extraction in the pre-stage process may be a convolutional neural network that has been trained in advance, or may be a convolutional neural network that is configured to be able to additionally learn using automatic learning, which will be described later. In addition, in the machine learning model shown in FIG. 3, a configuration may be adopted in which a plurality of feature amounts (feature maps) with different scales are extracted from a plurality of layers of the convolutional neural network, and the plurality of feature amounts are each input to an autoencoder and / or a support vector machine.
[0043] The autoencoder generates and outputs an anomaly map (heat map) based on the input feature amount. The processor 13c executes a determination process to determine whether the workpiece image belongs to the first class or the second class based on the anomaly map output from the autoencoder. For example, the first class can be a good product class, and an image belonging to the first class can be a good product image obtained by capturing an image of a good product, and the second class can be a defective product class, and an image belonging to the second class can be a defective product image obtained by capturing an image of a defective product.
[0044] On the other hand, the support vector machine executes a classification process for classifying the workpiece image into a plurality of classes based on the input feature amount. The plurality of classes includes the first class and the second class, and this enables the processor 13c to classify the workpiece image into a non-defective class and a defective class. The plurality of classes may include a third class, a fourth class, etc., and the number of classes is not particularly limited.
[0045] The machine learning model according to this embodiment is not limited to an autoencoder or an SVM, and other machine learning models may be used.
[0046] The processor 13c of the image processing device 1 executes the above judgment process and classification process, thereby making it possible to determine whether the workpiece is a good or defective product. The image processing device 1 having such functions can also be called an appearance inspection device or the like, since it can inspect the appearance of the workpiece. The workpiece to be inspected by the image processing device 1 may be the entire workpiece, or only a part of the workpiece. Furthermore, one workpiece may include multiple inspection objects. Furthermore, a workpiece image may include multiple workpieces.
[0047] (Automatic learning) In order to train a machine learning model, multiple learning images are input to the machine learning model. Although a user can prepare learning images, it is difficult for the user to accurately determine which images should be input to the machine learning model for training, and this often results in trial and error. In addition, it is difficult to determine the appropriate number of learning images used to generate a machine learning model that classifies good and defective products, because too many learning images are undesirable in terms of long learning time and overlearning, while too few images result in reduced generalization performance. Furthermore, it is desirable not only to classify good and defective products, but also to have a large difference between the evaluation value when judging a product as good and the evaluation value when judging a product as defective. In short, when selecting learning images, various requirements must be met, and so far, experts with abundant know-how have selected learning images based on that know-how, or, in the absence of know-how, a large number of images have been used for training to improve performance, despite the risk of overlearning. For this reason, it has been difficult for an inexperienced person to generate a machine learning model with high classification and judgment accuracy. In addition, in the past, the person who generates the machine learning model selected the training image, so there was a problem that the accuracy of the generated machine learning model differed depending on the person who selected the training image. The image processing device 1 of the present embodiment can execute an automatic learning process that enables even an inexperienced person to automatically generate a machine learning model with high accuracy of classification processing and judgment processing, similar to that of an expert, while reducing the burden. An example of the automatic learning process will be described below.
[0048] The automatic learning process can be roughly divided into two steps, and is composed of step 1 and step 2. In step 1, a machine learning model is generated that classifies a good product and a defective product, or judges whether the product belongs to a good product class or a defective product class, by only good product learning. In this specification, the classification of an input image into a good product class or a defective product class can also be called a pass / fail judgment. In step 2, when a good product and a defective product can be classified or judged in step 1, the difference between an evaluation value when judging the product as a good product and an evaluation value when judging the product as a defective product is enlarged by defective product learning. In addition, in step 2, when a good product and a defective product cannot be classified or judged in step 1, a machine learning model is generated that classifies or judges a good product and a defective product by defective product learning, and the difference between an evaluation value when judging the product as a good product and an evaluation value when judging the product as a defective product is enlarged. In addition, in the case of supervised learning, step 1 is omitted and only step 2 is executed.
[0049] (First example of step 1) FIG. 4 is a flowchart showing an example of step 1 of the automatic learning process. Before starting the automatic learning process, a user prepares a plurality of learning images. The learning images include good product images that have been identified as good products and defective product images that have been identified as defective products. Since the first class is a good product class and the second class is a defective product class, the good product images can be called first class images to which a label indicating the first class has been added, and the defective product images can be called second class images to which a label indicating the second class has been added.
[0050] A plurality of images of both good and defective products are prepared. Although only good images may be used as learning images, both good and defective images are required as verification images for verifying the accuracy of the machine learning model, so the user needs to prepare both images. In addition, in order to evaluate the generalization performance of the machine learning model generated by the automatic learning process, a plurality of evaluation images different from the learning images and the verification images may be prepared. The evaluation images are images for testing whether the machine learning model generated using the learning images and the verification images can correctly perform classification processing on the evaluation images, which are unknown images. If the machine learning model erroneously classifies the evaluation images, the user can determine that the reliability of the machine learning model is low.
[0051] A good product label is assigned to the good product image, and a bad product label is assigned to the bad product image. The user assigns the good product label and the bad product label to each image. The user saves the learning images, the verification images, and the evaluation images in a specified folder. The verification images may or may not include the learning images.
[0052] In step SA1, a non-defective image is registered as a learning image for training the machine learning model. The number of learning images to be registered may be one or more. In step SA1, the processor 13c generates an image display user interface screen 100 shown in FIG. 5 and displays it on the display device 4. The image display user interface screen 100 is provided with an image addition button 101, a learning image display area 102 in which learning images are displayed in thumbnail format, and a verification image display area 103 in which verification images are displayed in thumbnail format. When the user operates the mouse 52 to press the image addition button 101, the processor 13c generates a folder selection window (not shown) and displays it on the display device 4. When the user selects the above-mentioned predetermined folder in the folder selection window, all learning images in the folder are read as learning images and displayed in the learning image display area 102. If the read learning images include a non-defective image belonging to a non-defective class and a defective image belonging to a defective class, only the non-defective image is selected as an image to be used for learning in step SA1. This selection operation can be performed, for example, by the user operating the mouse 52, and the selected learning image is registered as an image to be input to the machine learning model. When registering multiple learning images, it is preferable to select images with low similarity to each other. The learning image may be registered by the user as described above, or may be automatically registered by the processor 13c. For example, the processor 13c may automatically select and register the image displayed first in the file, or may automatically select and register based on the update date. Note that a defective product image can also be registered as a learning image in step SA1. In this case, the process proceeds to automatic learning in step 2 described later.
[0053] After the learning images are registered, the process proceeds to step SA2. An automatic learning button 113 for starting automatic learning is provided on the image display user interface screen 100, and when the user operates the mouse 52 to press the automatic learning button 113, the processor 13c starts automatic learning. Specifically, the processor 13c inputs the learning images registered in step SA1 into a machine learning model to execute learning. This is a learning step in which the machine learning model learns the learning images. By performing the learning step using the non-defective images, a machine learning model is generated that determines an image having characteristics different from that of a non-defective image belonging to a non-defective class as a defective image belonging to a defective class.
[0054] After the learning step, the processor 13c inputs a plurality of verification images to the machine learning model trained in the learning step, and executes a classification process to classify the plurality of verification images into a good product class and a defective product class. At this time, the processor 13c also inputs a plurality of verification images to the machine learning model trained in the learning step, and executes a determination process to determine whether the plurality of verification images belong to a good product class or a defective product class. This is the verification step. In the verification step, the processor 13c can obtain a degree of separation between the good product class and the defective product class by the classification process of the plurality of verification images.
[0055] In the verification step, the processor 13c generates a user interface screen 150 for displaying a learning result as shown in FIG. 6 and displays it on the display device 4. The user interface screen 150 for displaying a learning result is provided with a first learning result display area 151 for displaying the learning result of the machine learning model obtained in the first verification step, and a verification in progress display area 152 for displaying the fact that verification is in progress together with the elapsed time from the start of learning. The user interface screen 150 for displaying a learning stop button 153 is also provided, and when the user operates the learning stop button 153, the processor 13c forcibly ends the learning of the machine learning model even if it is in the middle. Furthermore, the user interface screen 150 for displaying a learning result of the machine learning model obtained in the second verification step and a region 154B for displaying the learning result of the machine learning model obtained in the third verification step are shown.
[0056] The first learning result display area 151 is provided with an image number display area 151a that displays the number of learning images used in the first learning and the number of verification images used in the verification step, a Pareto chart display area 151b, and an inference result display area 151c.
[0057] The Pareto chart display area 151b displays a Pareto chart generated by the processor 13c. The Pareto chart is a separation graph showing the degree of separation between a good class and a defective class, and is also a graph showing the accuracy of the judgment process of the machine learning model. The horizontal axis of this graph is the score (first evaluation axis), and the vertical axis is the cumulative number of images. The larger the score, the higher the degree of belonging to the defective class, and conversely, the smaller the score, the higher the degree of belonging to the good class. The score can also be called a first evaluation value indicating the degree of belonging to the good class. That is, in the classification process of classifying a plurality of verification images into a good class and a defective class, the processor 13c calculates a first evaluation value indicating the degree of belonging to the good class for each of the plurality of verification images. In addition, since the score is also an evaluation value indicating the degree of defect as described above, the processor 13c can also calculate an evaluation value indicating the degree of defect for each of the plurality of verification images, and this evaluation value can also be called a second evaluation value indicating the degree of belonging to the defective class.
[0058] In the inference result display area 151c, the inference result by the machine learning model verified in the verification step is displayed in a table format. The table displayed in the inference result display area 151c is also called a confusion matrix, and displays the number of good images and the number of defective images of the verification images, as well as the number of good images and the number of defective images inferred by the machine learning model. The processor 13c calculates an erroneous determination rate indicating the ratio of good images detected as defective images and an oversight rate indicating the ratio of defective images determined as good images, and displays them in the inference result display area 151c. The processor 13c also calculates the difference between the scores of good and defective products, and displays them in the inference result display area 151c. In the examples shown in FIG. 6 to FIG. 8, the verification images for each round also include learning images used for learning the machine learning model.
[0059] Next, the process proceeds to step SA3 in the flow chart shown in FIG. 4. Step SA3 is a step for judging whether or not the good-quality image and the defective-quality image have been separated in the verification step of step SA2 according to a predetermined criterion, and evaluates the accuracy of the classification process of the verification image and the judgment process of the verification image. That is, the score calculated in step SA2 is a numerical value indicating the degree of defect in the verification image, for example, the size of a defect. In step SA3, the processor 13c calculates the difference between the maximum score (degree of defect: high) when the product is judged to be good and the minimum score (degree of defect: low) when the product is judged to be defective, and judges whether or not this difference is equal to or greater than a predetermined numerical value. If the difference is equal to or greater than the predetermined numerical value, it is judged that the good-quality image and the defective-quality image have been separated, whereas if the difference is less than the predetermined numerical value, it is judged that the good-quality image and the defective-quality image have not been separated.
[0060] If it is determined in step SA3 that the good-quality images and the defective-quality images have been separated, the process proceeds to step SA7, where it is determined whether or not the setting is set to execute only step 1. That is, the user can set whether to execute automatic learning in a first mode in which automatic learning ends only at step 1, or in a second mode in which both step 1 and step 2 are executed. This user setting is accepted by the input unit 13b. If the setting is set to execute only step 1, automatic learning ends. On the other hand, if the setting is set to execute both step 1 and step 2, the process proceeds to the flowchart of step 2 shown in FIG. 9.
[0061] If it is determined in step SA3 that the good images and the bad images have not been separated, the process proceeds to step SA4. In step SA4, the processor 13c determines whether or not there is one or more good images remaining in the images for verification. If there is one or more good images remaining in the images for verification, the process proceeds to step SA5. In step SA5, it is determined whether or not there is a good image that has been erroneously detected in the images for verification.
[0062] If there is no erroneously detected good image in the verification image in step SA5, proceed to step SA6. In step SA6, the processor 13c judges whether there is a good image with a higher score than the erroneously determined defective image in the verification image. If there is no good image with a higher score than the erroneously determined defective image in step SA6, proceed to step SA7.
[0063] If there is a non-defective image that has been erroneously detected in the verification images in step SA5, the process proceeds to step SA8. In step SA8, the processor 13c extracts n non-defective images that have been erroneously detected from the verification images in order of the highest score. n is an integer equal to or greater than 1, and therefore the number of non-defective images extracted in step SA8 may be one, or two or more. The number of images extracted in step SA8 may be the number described in a second example below.
[0064] After extracting n quality images in descending order of score in step SA8, the process proceeds to step SA2, where the n quality images extracted in step SA8 are input to the machine learning model for automatic re-learning. At this time, the processor 13c may perform so-called data augmentation, such as rotating the image or changing the brightness of the image. For example, the processor 13c automatically generates an image in which the brightness of the image extracted in step SA8 is changed by 5%, and inputs the image to the machine learning model for learning. If the learning effect is low, the processor 13c also generates an image in which the brightness is changed by 10% stepwise or dynamically, and inputs the image to the machine learning model for learning.
[0065] If there is a good product image with a higher score than the defective product image erroneously determined in step SA6, the process proceeds to step SA9. In step SA9, n good product images with a higher score than the defective product image erroneously determined are extracted in ascending order of score. n is an integer equal to or greater than 1, and therefore the good product images extracted in step SA9 may be one or two or more. In this way, the processor 13c compares the scores, which are the evaluation values of the good product images of the multiple verification images, with the scores, which are the evaluation values of the defective product images, and automatically determines, based on the comparison result, whether to extract a good product image with a relatively high evaluation value or a defective product image with a relatively low evaluation value as an image to be re-learned by the machine learning model.
[0066] Although there is an idea of extracting defective product images with low scores from among the images of defective products that have been erroneously judged to be defective, since the purpose of image inspection is to detect non-defective products, learning of good products is continued as long as possible in order to clarify the range of good products. If defective product learning were to be performed, a large number of defective product images would be required to clarify the boundary between good products and defective products, but since there are few defective products in the first place, there is also the problem that it is difficult to prepare a large number of defective product images.
[0067] After extracting n quality images in ascending order of score in step SA9, the process proceeds to step SA2, where the n quality images extracted in step SA9 are input to a machine learning model for automatic re-learning. At this time, the processor 13c may perform so-called data augmentation, such as rotating the image or changing the brightness of the image.
[0068] In step SA2, a plurality of verification images are input to the re-learned machine learning model, and a classification process is performed to classify the plurality of verification images into the plurality of classes. Then, steps SA3 to SA7, and steps SA8 and SA9 as necessary are performed.
[0069] FIG. 7 shows a user interface screen 150 for displaying a learning result in which a second learning result display area 154 for displaying the learning result of the machine learning model obtained in the second verification step is displayed after the second learning (first re-learning) is completed. The second learning result display area 154 is generated and displayed by the processor 13c, similar to the first learning result display area 151. The second learning result display area 154 includes an image number display area 154a for displaying the number of learning images used in the second learning and the number of verification images used in the verification step, a Pareto chart display area 154b showing the degree of separation obtained in the second verification step, and an inference result display area 154c obtained in the second verification step. As shown in FIG. 7, an area 154B for displaying the learning result of the machine learning model obtained in the third verification step is shown.
[0070] FIG. 8 shows a user interface screen 150 for displaying a learning result in which a third learning result display area 155 for displaying the learning result of the machine learning model obtained in the third verification step is displayed after the third learning (second re-learning) is completed. The third learning result display area 155 is generated and displayed by the processor 13c in the same manner as the first learning result display area 151. The third learning result display area 155 includes an image number display area 155a for displaying the number of learning images used in the third learning and the number of verification images used in the verification step, a Pareto chart display area 155b for displaying the degree of separation obtained in the third verification step, and an inference result display area 155c obtained in the third verification step. Each time the processor 13c repeatedly executes re-learning of the machine learning model, the processor 13c updates the separation graph shown as the Pareto chart to the separation graph obtained by the machine learning model after re-learning. As shown in FIG. 7 and FIG. 8, the processor 13c can generate a user interface screen 150 for displaying a learning result on the display device 4 as a display screen for displaying the latest separation graph obtained by updating so as to be comparable with past separation graphs.
[0071] The training images are duplicated each time. For example, if the number of training images for the second time is four, those four training images are included in the five training images for the third time. In other words, training images are added each time the number of training times increases.
[0072] As shown in FIG. 8, as the number of learning times increases, the difference between the scores of good and defective products increases, and the separation between good and defective images becomes clear. In the machine learning model that has completed the third learning, the separation between good and defective images and the determination of whether the image belongs to a good class or a defective class can be clearly performed, so the automatic learning is terminated at the time of completion of the third learning. In this way, until it is determined that the re-learning of the machine learning model is unnecessary, the processor 13c automatically repeats the following steps: a classification process for classifying multiple validation images using the learned machine learning model; an evaluation of the accuracy of the classification process; an evaluation of whether the re-learning of the machine learning model is necessary; and, when it is determined that the re-learning of the machine learning model is necessary, a process for extracting validation images that are relatively likely to have an incorrect classification result from among the multiple validation images and automatically re-learning the validation images to the machine learning model. As a result, the accuracy of the machine learning model is improved, and the progress is presented to the user as shown in FIG. 8.
[0073] In addition, after obtaining the degree of separation between the good class and the defective class by the verification step of step SA2, by going through steps SA3 to SA6, processor 13c evaluates the accuracy of the classification process of the multiple verification images based on the degree of separation between the good class and the defective class obtained in step SA2, and further evaluates whether or not re-learning of the machine learning model is necessary based on the evaluation result of the accuracy of the classification process of the multiple verification images. If processor 13c evaluates that re-learning of the machine learning model is necessary, it extracts verification images that are relatively likely to have erroneous classification results from the multiple verification images and automatically causes the machine learning model to re-learn them, whereas if it evaluates that re-learning of the machine learning model is unnecessary, it completes the learning process of the machine learning model.
[0074] When the processor 13c evaluates that the machine learning model needs to be retrained, the processor 13c extracts defective images with a relatively high first evaluation value or non-defective images with a relatively low first evaluation value, and automatically causes the machine learning model to retrain the defective images. The processor 13c also extracts non-defective images with a relatively high evaluation value indicating the degree of defect, or non-defective images with a relatively low evaluation value indicating the degree of defect, and automatically causes the machine learning model to retrain the defective images. Then, as shown in FIG. 8, the processor 13c obtains a degree of separation between the distribution of non-defective images and defective images on the horizontal axis (first evaluation value) of the Pareto diagram. The processor 13c automatically repeats a classification process of classifying a plurality of validation images using the trained machine learning model, an evaluation of the accuracy of the classification process, an evaluation of whether or not the machine learning model needs to be retrained, and a process of extracting validation images with a relatively high possibility of being erroneous from the plurality of validation images when it is evaluated that the machine learning model needs to be retrained, and automatically causing the machine learning model to retrain the validation images. The processor 13c executes this repetitive process until the degree of separation between the distribution of non-defective images and defective images on the horizontal axis of the Pareto chart becomes equal to or greater than a predetermined value. The criteria for evaluating that relearning of the machine learning model is unnecessary are not limited to the specifications determined by the degree of separation described above. In other words, assuming a case where the degree of separation does not become equal to or greater than a predetermined value, it may be evaluated that relearning of the machine learning model is unnecessary when the number of times or the time required to repeatedly execute the above process reaches a number or time specified in advance by the user, or a number or time specified in advance on the device side. It may be evaluated whether or not relearning is unnecessary based on a criterion that appropriately combines the above-mentioned degree of separation and the number or time.
[0075] Furthermore, when multiple evaluation images are prepared, the processor 13c may evaluate that relearning of the machine learning model is unnecessary, and after completing the learning process of the machine learning model, input multiple evaluation images different from the multiple learning images and the multiple verification images to the machine learning model, execute a classification process to classify the multiple evaluation images into multiple classes (non-defective class or defective class), and evaluate the accuracy of the classification process. The processor 13c may display the accuracy rate on the display device 4 as the accuracy of the classification process of the multiple evaluation images.
[0076] Furthermore, when the processor 13c calculates a second evaluation value indicating the degree of belonging to the defective class for each of the multiple verification images, when the processor 13c evaluates that re-learning of the machine learning model is necessary, the processor 13c extracts a non-defective image having a relatively high second evaluation value or a defective image having a relatively low second evaluation value, and automatically causes the machine learning model to re-learn the non-defective image or the defective image having a relatively low second evaluation value. The processor 13c then calculates the degree of separation between the distributions of the non-defective images and the defective images on the second evaluation value axis, and automatically repeats the following steps until the processor 13c evaluates that re-learning of the machine learning model is unnecessary based on the degree of separation: a classification process of classifying the multiple verification images using the trained machine learning model; an evaluation of the accuracy of the classification process; an evaluation of whether or not re-learning of the machine learning model is necessary; and a process of extracting a verification image having a relatively high possibility of being erroneously classified from the multiple verification images when it is evaluated that re-learning of the machine learning model is necessary, and automatically causing the machine learning model to re-learn the non-defective image or the defective image.
[0077] (First example of step 2) Next, the process of step 2 will be described with reference to the flowchart shown in FIG. 9. In step SB1, the good class and the defective class are compared in the Pareto diagram, and the image with the gentler gradient is added. For example, the processor 13c calculates the difference in score between the highest-scoring image and the second-highest-scoring image among the images classified in the good class, and calculates the difference in score between the lowest-scoring image and the second-lowest-scoring image among the images classified in the defective class. If the difference between these two scores is the same, the processor 13c calculates the difference in score between the highest-scoring image and the third-highest-scoring image among the images classified in the good class, and calculates the difference in score between the lowest-scoring image and the third-lowest-scoring image among the images classified in the defective class.
[0078] In step SB2, processor 13c determines which of the two scores calculated in step SB1 is larger. If the difference in the scores of the images classified as the non-defective class is larger, the process proceeds to step SB3. If the difference in the scores of the images classified as the defective class is larger, the process proceeds to step SB4.
[0079] In step SB3, the processor 13c adds up to n good images in the verification images in order from the image with the highest score. In step SB4, the processor 13c adds up to n defective images in the verification images in order from the image with the lowest score. After steps SB3 and SB4, the process proceeds to step SB5.
[0080] In step SB5, the processor 13c judges whether the number of sheets added in step SB3 or step SB4 is greater than 0. If the judgment in step SB5 is YES, the process proceeds to step SB6, where the processor 13c executes re-learning in the same manner as in step SA2 of the flowchart shown in FIG. 4, performs verification using verification images, and generates a Pareto diagram. Note that, if the process proceeds to step SB6 via step SB4, the processor 13c inputs an image belonging to a defective class to the machine learning model for re-learning, and generates a machine learning model so as to determine an image having similar characteristics to an image belonging to the defective class as an image belonging to the defective class. Thereafter, the process proceeds to step SB7, where it is judged whether a termination condition is satisfied. The termination condition will be described in a second example of step 2 to be described later.
[0081] (Step 1, second example) FIG. 10 is a flowchart showing a second example of step 1 of the automatic learning process. In step SC1, the processor 13c sets the count number to 0. In step SC2, the processor 13c determines whether additional learning is ON. For example, when the image processing device 1 starts operating and an image of a workpiece is captured, a new workpiece image can be collected. When a new workpiece image is collected, a process of adding a learning image by retaining each label related to the classification of the existing learning image and verification image used for learning the machine learning model in operation and adding a new image acquired after the start of operation to the existing learning image (additional learning process) and a process of initializing each label related to the classification of the existing learning image and verification image used for learning the machine learning model in operation and learning the machine learning model with all images including the new image acquired after the start of operation (all image learning process) can be selected. There are good product labels attached to good product images and defective product labels attached to defective product images. If the accuracy of the machine learning model in operation is high, you can add work images without initializing it. If the accuracy is low, however, initializing it and letting it learn from scratch may result in higher accuracy. It is possible to use either method depending on the situation.
[0082] The image display user interface screen 100 shown in Fig. 5 is provided with a selection area 104 for selecting whether or not to enable additional learning processing. When the user operates the mouse 52 to check the selection area 104, the processor 13c executes the additional learning processing. On the other hand, when the selection area 104 is not checked, the processor 13c executes all-image learning processing. Whether to select additional learning processing or all-image learning processing is determined by the input unit 13b accepting the operation of the mouse 52 by the user, and the processor 13c determines this. In other words, the image processing device 1 is configured to be capable of accepting the user's selection of additional learning processing or all-image learning processing.
[0083] If step SC2 is determined as NO and additional learning processing is not selected, the process proceeds to step SC3. In step SC3, the processor 13c initializes each label related to the classification of the existing learning images and verification images. In step SC4, the processor 13c registers only one good image as a learning image. At this time, the good image located at the top may be selected and registered, or another good image may be registered.
[0084] In steps SC5 and SC6, the processes of steps SA2 and SA3 in the flowchart shown in Fig. 4 are executed, respectively. If it is determined in step SC6 that the non-defective product images and the defective product images can be separated, the accuracy of the determination process is sufficiently high and a predetermined accuracy is obtained, and in this case, this flow is terminated. That is, when it is evaluated that the accuracy of the determination process of the machine learning model has obtained a predetermined accuracy, the processor 13c automatically determines to terminate the learning process of the machine learning model.
[0085] When the processor 13c determines to end the learning process of the machine learning model, the processor 13c automatically generates a Pareto chart graph in the learning result display user interface screen 150 shown in Fig. 6 to Fig. 8 and displays it on the display device 4. When the processor 13c determines to end the learning process of the machine learning model, the processor 13c automatically generates a numerical value indicating the accuracy of the judgment process of the machine learning model, for example, the difference in scores between a good product and a defective product, and displays it on the display device 4. This makes it possible to present to the user the accuracy of the judgment process that has been acquired when the learning process is ended.
[0086] 6 to 8, the learning result display user interface screen 150 includes image number display areas 151a, 154a, and 155a that display the number of good images and the number of defective images trained by the machine learning model, and inference result display areas 151c, 154c, and 155c that display the number of erroneous judgments for a plurality of verification images. This makes it possible to present the number of learning images and the number of erroneous judgments to the user.
[0087] If it is determined in step SC6 that the good-quality images and the defective-quality images have not been separated, the process proceeds to step SC7. In step SC7, the processor 13c registers the good-quality image with the highest score among the verification images as a learning image. Then, the process proceeds to step SC8, where the same process as in step SC5 is executed.
[0088] In step SC9, the processor 13c judges whether the total number of non-defective images is a predetermined number (e.g., 20) or less, or whether the setting is set to execute only step 1. If the total number of non-defective images exceeds the predetermined number, the process proceeds to step SC10, and if the setting is set to execute steps 1 and 2, the process proceeds to step SC10. On the other hand, if the total number of non-defective images is a predetermined number or less, the process proceeds to step SC11, and if the setting is set to execute only step 1, the process proceeds to step SC11.
[0089] In step SC10, the processor 13c judges whether the total number of learning images is equal to or greater than half of the non-defective images. If the total number of learning images is equal to or greater than half of the non-defective images, the process proceeds to step SC12. In step SC12, similar to step SA7 in the flowchart shown in FIG. 4, the process judges whether or not the process is set to execute only step 1. If the process is set to execute only step 1, the automatic learning is terminated. On the other hand, if the process is set to execute both step 1 and step 2, the process proceeds to the flowchart of step 2 shown in FIG. 11.
[0090] If it is determined in step SC10 that the total number of learning images is less than half the number of non-defective images, the process proceeds to step SC11. In step SC11, it is determined whether or not the non-defective images and the defective images have been separated according to a predetermined criterion, similar to step SA3 in the flowchart shown in Fig. 4. If it is determined in step SA3 that the non-defective images and the defective images have been separated, the automatic learning is automatically terminated.
[0091] If it is determined in step SC11 that the good-quality images and the defective-quality images have not been separated, the process proceeds to step SC13. In step SC13, the processor 13c determines whether the count number is smaller than a predetermined value (e.g., 5). If the count number is equal to or greater than the predetermined value, the process proceeds to step SC12, whereas if the count number is smaller than the predetermined value, the process proceeds to step SC14.
[0092] In steps SC14 and SC15, the same judgment is made as in steps SA4 and SA5 in the flowchart shown in Fig. 4. If the judgment in step SC14 is NO, proceed to step SC12. If the judgment in step SC15 is NO, proceed to step SC16. If the judgment in step SC15 is YES and there is a good image among the verification images that has been erroneously detected, proceed to step SC17. In step SC17, the erroneous judgment rate is calculated. The erroneous judgment rate is the erroneous judgment rate for good images of multiple verification images, and can be calculated using the following formula.
[0093] False positive rate = (number of good images judged as defective among the validation and learning images / total number of good images) x 100
[0094] After calculating the misjudgment rate in step SC17, the process proceeds to step SC18. In step SC18, n good images that have been erroneously detected are extracted from the verification images in the order of the scores, similar to step SA8 in the flowchart shown in FIG. 4. The number of images to be extracted may be changed according to the misjudgment rate. For example, the number of images to be extracted in step SC18 can be set to increase as the misjudgment rate increases. The number of images to be extracted in step SC18 can also be determined by a ratio, such as a number equivalent to 5%, 10%, or 15% of all good images. In this way, the processor 13c determines the number of good images to be used for re-learning the machine learning model based on the misjudgment rates of good images for a plurality of verification images.
[0095] In step SC18, n quality images are extracted in descending order of score, and then the process proceeds to step SC8, where the n quality images extracted in step SC18 are input to a machine learning model for automatic re-learning.
[0096] If the determination in step SC16 is YES, the process proceeds to step SC19, where the oversight rate is calculated. The oversight rate is the rate of erroneous determination of defective product images among a plurality of verification images, and can be calculated by the following formula.
[0097] Missing rate = (number of defective images judged as good images among the verification images and learning images / total number of defective images) x 100
[0098] After calculating the oversight rate in step SC19, the process proceeds to step SC20. In step SC20, n images of good images having higher scores than the erroneously determined defective images are extracted in ascending order of scores, similar to step SA9 in the flowchart shown in FIG. 4. The number of images to be extracted may be changed according to the oversight rate. For example, the number of images to be extracted in step SC20 may be set to increase as the oversight rate increases. The number of images to be extracted in step SC20 may also be determined by a ratio, such as a number of images corresponding to 5%, 10%, or 15% of all good images. In this way, the processor 13c determines the number of defective images to be used for re-learning the machine learning model based on the oversight rate, which is the erroneous determination rate for defective images of a plurality of verification images. The number of images to be extracted in step SC20 may be set to be greater than the number of images to be extracted in step SC18.
[0099] After step SC20, the process proceeds to step SC21, where the processor 13c adds 1 to the count number. This count number is used in the judgment of the next step SC13. If re-learning is performed multiple times by going through steps SC16 to SC20 multiple times, the judgment in step SC13 is NO, the process proceeds to step SC12, and the above step 2 is started. In other words, if the processor 13c evaluates that further re-learning of the machine learning model is necessary after repeating re-learning using non-defective images multiple times, the above step 2 is automatically executed. Note that the processor 13c may end the learning at only step 1, or the user may be allowed to move to the above step 2 at any timing.
[0100] After step SC21, the process proceeds to step SC8, where the n defective product images extracted in step SC20 are input to the machine learning model for automatic re-learning.
[0101] In this way, when the processor 13c evaluates in step SC15 that re-learning of the machine learning model is necessary, in steps SC18 and SC20, the processor 13c automatically calculates the number of verification images to be used for re-learning based on the evaluation result of the accuracy of the classification process, and extracts the calculated number of verification images that are relatively likely to be erroneous from among the multiple verification images. After extracting the verification images that are relatively likely to be erroneous, the processor 13c can automatically re-learn the machine learning model with that number of verification images. This reduces the burden on the user.
[0102] (Second example of step 2) FIG. 11 is a flowchart showing a second example of step 2 of the automatic learning process. In steps SD1 and SD2, the same processes as in steps SB1 and SB2 in the flowchart shown in FIG. 9 are executed. If the difference in scores of the images classified into the non-defective class is larger, the process proceeds to step SD3. In step SD3, non-defective images are extracted according to a predetermined criterion. Specifically, the processor 13c first identifies the image with the highest score among the non-defective images in the verification images. Then, the processor 13c calculates a score by subtracting 10% of the score of the identified image. Thereafter, the processor 13c adds non-defective images having scores equal to or higher than the calculated score up to the maximum number that can be added (for example, 5 images).
[0103] In step SD4, the processor 13c determines whether or not the number of non-defective images added in step SD3 is one or more. If the number of non-defective images added in step SD3 is one or more, the process proceeds to step SD5, where the processor 13c executes re-learning in the same manner as in step SB6 of the flowchart shown in Fig. 9, performs verification using verification images, and generates a Pareto chart. On the other hand, if the number of non-defective images added in step SD3 is zero, re-learning cannot be performed, and the process proceeds to step SD6 without passing through step SD5.
[0104] In step SD6, processor 13c determines whether the number of defective images in the verification images is 1 or whether the number of good images in the verification images is 0. If the result of the determination in step SD6 is that the number of defective images in the verification images is 1, learning is automatically terminated, and if the number of good images in the verification images is 0, learning is automatically terminated. On the other hand, if the result of the determination in step SD6 is that the number of defective images in the verification images is other than 1, the process proceeds to step SD7, and if the number of good images in the verification images is 1 or more, the process proceeds to step SD7.
[0105] In step SD7, the process of step SA3 in the flowchart shown in Fig. 4 is executed. If it is determined in step SD7 that the good product images and the defective product images have been separated, learning is automatically terminated. If it is determined in step SD7 that the good product images and the defective product images have not been separated, the process proceeds to step SD8. In step SD8, the processor 13c extracts one image with the lowest score from among the defective product images in the verification images.
[0106] In step SD9, it is determined whether or not the number of defective product images added in step SD8 is one or more. If the number of defective product images added in step SD8 is one or more, the process proceeds to step SD10, where defective product learning, which will be described later, is executed.
[0107] If the number of defective images added in step SD8 is 0, the process proceeds to step SD11, where a judgment similar to that in step SD6 is made. If the result of the judgment in step SD11 is that the number of defective images in the verification images is 1, learning is automatically terminated, and if the number of good images in the verification images is 0, learning is automatically terminated. On the other hand, if the result of the judgment in step SD11 is that the number of defective images in the verification images is a number other than 1, the process proceeds to step SD12, and if the number of good images in the verification images is 1 or more, the process proceeds to step SD12. In step SD12, the same process as in step SD7 is performed.
[0108] If the result of the determination in step SD2 is that the difference in the scores of the images classified into the defective class is greater, the process proceeds to step SD13. In step SD13, defective images are extracted according to a predetermined criterion. Specifically, the processor 13c first identifies the image with the lowest score among the defective images in the verification images. Next, the processor 13c calculates a score by adding 10% of the score of the identified image. Thereafter, the processor 13c extracts defective images having scores equal to or lower than the calculated score up to the maximum number of addable images (e.g., 5 images). However, if there are 5 or fewer defective images in the verification images, not all of them are used for defective learning, and only one is left.
[0109] In step SD14, the processor 13c judges whether or not the number of defective product images extracted in step SD13 is one or more. If the number of defective product images extracted in step SD13 is one or more, the process proceeds to step SD15 and executes defective product learning, which will be described later. On the other hand, if the number of defective product images extracted in step SD13 is zero, the process proceeds to step SD16 without going through step SD15.
[0110] In steps SD16 and SD17, the same determinations as in steps SD6 and SD7 are made, respectively. In the subsequent step SD18, the processor 13c adds one image having the highest score among the non-defective images of the verification images.
[0111] In step SD19, it is determined whether or not the number of non-defective images added in step SD18 is one or more. If the number of non-defective images added in step SD18 is one or more, the process proceeds to step SD20, where the same process as in step SD5 is executed.
[0112] If the number of non-defective images added in step SD18 is 0, the process proceeds to step SD20, where the same process as in step SD5 is executed, and then the process proceeds to steps SD11 and SD12.
[0113] 11, when the processor 13c evaluates that re-learning of the machine learning model is necessary, the processor 13c not only causes the machine learning model to learn defective product images in steps SD10 and SD15, but also causes the machine learning model to re-learn non-defective product images in steps SD5 and SD20. This makes it possible to generate a machine learning model that determines, as defective parts, features similar to the defective product images learned in the machine learning model in steps SD10 and SD15 and features different from the non-defective product images learned in steps SD5 and SD20.
[0114] Furthermore, by following the flowchart shown in FIG. 11, when the processor 13c judges in the judgment process of determining which class the image belongs to that the machine learning model needs to be re-learned, the processor 13c automatically judges whether the machine learning model should learn a good / bad image or a defective image by comparing the evaluation value of the good product image with the evaluation value of the defective product image, and allows the machine learning model to learn the image with the better learning effect.
[0115] (Defective product learning) Fig. 12 is a flowchart showing an example of defective product learning. This flow is executed in steps SD10 and SD15 of the flowchart shown in Fig. 11, and steps SE1 to SE3 are repeated the number of times corresponding to the number of extracted defective product images.
[0116] In step SE1, it is determined whether or not the user has selected area designation for the defective product image in step 2, that is, whether or not the user is to designate a defective portion for the defective product image (whether or not to annotate). If the user has selected area designation, the process proceeds to step SE2, where the input unit 13b accepts the annotation operation by the user.
[0117] Specifically, the processor 13c extracts a defective product image from among the multiple verification images as an image to be retrained by the machine learning model, and then generates an annotation screen 200 shown in Fig. 13 as a display screen for accepting designation of defective parts in the defective product image from a user, and displays the annotation screen 200 on the display device 4. The display of the annotation screen 200 is automatically executed when the process proceeds to step SE2.
[0118] The annotation screen 200 is provided with an input image display area 201 in which an input image input to a machine learning model is displayed, a heat map display area 202 in which a heat map output from the machine learning model is displayed, and an area designation unit 203. The input image displayed in the input image display area 201 corresponds to the heat map displayed in the heat map display area 202, and the scale of the input image and the heat map are the same, and the same area is displayed. As shown in the figure, a user interface that can display the input image and the heat map side by side makes it easier to grasp the corresponding parts of the two. Note that the heat map display area 202 may be omitted, and may be displayed as needed.
[0119] A heat map is an image in which characteristic parts different from a good product image are emphasized more than other parts by differences in color and brightness. That is, the processor 13c can identify characteristic parts of a defective product image extracted from a plurality of verification images for re-learning the machine learning model that are different from the good product image that has already been trained, and then generate an annotation screen 200 including a heat map as an image in which the identified different characteristic parts of the extracted defective product image are emphasized, and display the annotation screen 200 on the display device 4.
[0120] The input image displayed in the input image display area 201 is a defective product image extracted from a plurality of verification images for re-learning the machine learning model. However, it may not be possible to grasp which area the machine learning model is reacting to only with the input image displayed in the input image display area 201. In this example, a heat map that highlights the identified different characteristic parts is also displayed at the same time, so that the user can grasp the area that the machine learning model is reacting to as a defective part and the strength of the reaction by looking at the heat map.
[0121] In the area designation unit 203, it is possible to designate a plurality of areas, for example, "area 0", "area 1", "area 2", "area 3", etc. When designating the mask area as "area 0", it is possible to select the shape of the area to be designated. The shape can be, for example, a rectangle, a circle, a polygon, etc., and the user can select it by operating the mouse 52 or the like. The selected shape is accepted by the input unit 13b, and the processor 13c superimposes and displays a frame 204 of the same shape as the selected shape on the input image and the heat map, respectively.
[0122] The frame 204 is for specifying a defective portion. The position, size, angle, aspect ratio, etc. of the frame 204 can be changed by the user by operating the mouse 52 or the like. The user can specify the area surrounded by the frame 204 as the defective portion by moving the frame 204 so as to surround the defective portion or by changing the size of the frame 204. Both the frame 204 on the input image and the frame 204 on the heat map can be operated, and when the frame 204 on the input image is operated, the operation is reflected in the frame 204 on the heat map, so that the two frames 204 have the same size and are arranged at the same position. When the frame 204 on the heat map is operated, the operation is reflected in the frame 204 on the input image.
[0123] In order to increase the score difference between good and defective products, multiple defective product images may be required. If multiple defective product images are required, they can be displayed in order and annotations can be made for each defective product image in turn. For example, when annotation is performed with the first defective product image displayed and is completed, the second defective product image is automatically displayed and is ready to accept annotations.
[0124] The designation of the defective portion is accepted by the input unit 13b. When the designation of the defective portion is accepted by the input unit 13b, the processor 13c identifies the area surrounded by the frame 204 as the defective portion, and stores it in, for example, the storage device 19. In step SE3, the processor 13c adds the defective product image in which the defective portion has been identified via the annotation screen 200 to the learning images. In step SE4, the machine learning model is retrained to generate a machine learning model so as to determine an image having characteristics similar to the defective portion as an image belonging to a defective class.
[0125] The processor 13c is configured to be able to resume re-learning of the machine learning model in response to a user instruction even after the learning process of the machine learning model is completed. For example, a learning execution button 105 is provided on the user interface screen 150 for displaying learning results shown in Fig. 5. The operation of the learning execution button 105 by the user is a user instruction to resume re-learning of the machine learning model, and this user instruction is accepted by the processor 13c.
[0126] When the processor 13c receives an instruction to retrain the machine learning model, the processor 13c inputs a new verification image, which is different from the existing verification image, into the machine learning model and executes a process of classifying the new verification image into multiple classes. For example, after the image processing device 1 starts operating, multiple work images can be acquired, and these work images can become new verification images. The processor 13c evaluates the accuracy of the classification process based on the degree of separation of multiple classes obtained by the classification process for the new verification image, and when it is evaluated that retraining of the machine learning model is necessary based on the evaluation result of the accuracy of the classification process, it extracts verification images that are likely to be erroneous from the new verification images and automatically retrains them in the machine learning model, while when it is evaluated that retraining of the machine learning model is unnecessary, it completes the learning process of the machine learning model. As a result, even if a new image is acquired after the learning process has been completed, the existing machine learning model can be retrained by a user instruction, so that the accuracy of the machine learning model can be continuously improved.
[0127] (Learning model selection function) The accuracy of the machine learning model changes by repeatedly executing re-learning of the machine learning model. FIG. 6 shows the accuracy of the machine learning model after the first learning, and as the number of learning times increases to the second and third times, the accuracy of the machine learning model improves as shown in FIG. 8. Taking the time when the third learning is completed as a reference, the third learning is the most recent re-learning, and the separation graph obtained in the most recent re-learning is displayed in the Pareto chart display area 155b in FIG. 8. The learning stages before the learning stage in which the most recent separation graph was obtained are the first learning stage and the second learning stage, and the separation graph obtained in the first learning stage and the separation graph obtained in the second learning stage are past separation graphs when the separation graph obtained in the third learning is taken as a reference. That is, the processor 13c generates a learning result display user interface screen 150 shown in FIG. 7 or FIG. 8 as a display screen that displays the most recent separation graph obtained by repeatedly executing re-learning of the machine learning model and the past separation graph obtained in the learning stage before the learning stage in which the most recent separation graph was obtained in a comparative manner, and displays it on the display device 4. Although FIG. 8 shows only the first three learning rounds, the number of learning rounds is not particularly limited, and learning can be repeated until a desired accuracy is obtained.
[0128] 14 shows an example of a learning progress display screen 250 for presenting the progress of the accuracy of a machine learning model. The learning progress display screen 250 can be incorporated into the learning result display user interface screen 150 shown in FIGS. 6 to 8 and displayed together with a Pareto chart or the like. Since the learning progress graph shows the progress of the learning of the machine learning model, the user can predict how many times of learning it will take to obtain a machine learning model with the desired accuracy by looking at the learning progress graph.
[0129] The learning progress display screen 250 is provided with a graph display area 251 in which a learning progress graph is displayed. The horizontal axis of the learning progress graph is the number of learning times, and in this example, the number of learning times is shown up to 15 times. The vertical axis on the left side is the number of images learned, and the vertical axis on the right side is the number of images misjudged by the machine learning model. As shown in the learning progress graph, the accuracy of the machine learning model is significantly improved from the first to fourth learning times, but the degree of improvement in accuracy decreases from the fifth learning time onwards, and the number of misjudgments in the 12th learning time machine learning model is significantly higher than those in the 11th and 13th learning times. In this way, increasing the number of learning times does not necessarily improve the accuracy, and depending on the image used for learning, the accuracy may suddenly decrease. By displaying the learning progress graph, the user can grasp the sudden decrease in accuracy, and can avoid the machine learning model of that time and select a machine learning model with high accuracy in other times to use during operation. This function is called a learning model selection function.
[0130] Specifically, the processor 13c is configured to be able to accept from the user a selection of a past machine learning model corresponding to a past separation graph, in addition to a most recent machine learning model corresponding to a most recent separation graph, as a machine learning model to be used during operation. For example, when a numerical value (number of learning times) on the horizontal axis of the learning progress graph shown in FIG. 14 is designated with the mouse 52 or the like, the selection of the machine learning model corresponding to the separation graph of the designated number of learning times is accepted by the processor 13c. The "machine learning model corresponding to the separation graph of the designated number of learning times" refers to the machine learning model when the separation graph of the designated number of learning times is obtained.
[0131] When the processor 13c receives the selection of the past machine learning model, it identifies all learning images that have been trained by the selected past machine learning model. Which learning images have been trained by the past machine learning model can be stored in the storage device 19 or the like as learning information, and by reading the learning information, the processor 13c can obtain which learning images have been trained by the machine learning model at which time.
[0132] The processor 13c identifies all learning images that have been trained by the selected past machine learning model, and then reproduces the selected past machine learning model by training all the identified learning images in the machine learning model in an initial state before the start of learning. This allows the past machine learning model to be easily reproduced and used for operation when a past machine learning model in an earlier learning stage has higher classification accuracy than the most recent machine learning model that has been repeatedly retrained.
[0133] When reproducing a past machine learning model, there is a method of not inheriting the machine learning model trained so far, and a method of inheriting the machine learning model trained so far, and either method may be used. When not inheriting the machine learning model trained so far, all the identified learning images are trained in the machine learning model in the initial state. For example, when reproducing the third machine learning model shown in FIG. 8, the machine learning model obtained in the second learning is not inherited, and a cumulative five learning images are input to the machine learning model in the initial state and trained.
[0134] On the other hand, when inheriting a previously trained machine learning model, only the images newly added since the previous time are trained on the model obtained in the previous training. For example, if you want to reproduce the third machine learning model shown in Figure 8, only one training image added between the second and third trainings is trained on the machine learning model obtained in the second training. When inheriting a previously trained machine learning model, training is not performed from the initial state, so the total training time until automatic training is completed can be shortened.
[0135] (3-class classification) 15 is a diagram showing an example of a learning result display area when performing three-class classification using a machine learning model. The number of images to which label 1 is assigned, the number of images to which label 2 is assigned, and the number of images to which label 3 is assigned are displayed in the image number display area 151a. The inference result display area 151c has columns for label 1, label 2, and label 3 for actual and predicted results, respectively. This allows the learning results to be presented to the user when performing three-class classification.
[0136] Specifically, the flowchart in FIG. 16 shows the process. In step SF1, the first image (in file name order) of each class is added to the learning images. After repeating the process for the number of classes, in step SF2, the added image is input to the machine learning model to learn and then verified. If the verification result shows that separation is possible, step SF3 is judged as YES and the process ends. If separation is not possible, step SF3 is judged as NO and the process proceeds to step SF4. In step SF4, it is judged whether or not one or more images for verification remain. If one or more images for verification do not remain, the process ends, and if one or more images for verification remain, the process proceeds to step SF5. In step SF5, it is judged for all classes whether or not there is an image that has been misjudged. If there is a class that has been misjudged, only one image with the highest score in that class is added to the learning images. If there are multiple classes that have been misjudged, only one image with the highest score in each class is added to the learning images (step SF6). It is not added to classes that have not been misjudged. Thereafter, the process proceeds to step SF2, where the added image is input to the machine learning model to learn and then verified.
[0137] The above-described embodiment is merely illustrative in all respects and should not be construed as limiting. Furthermore, all modifications and variations within the scope of the claims are within the scope of the present invention. [Industrial Applicability]
[0138] As described above, the image processing device and image processing method according to the present disclosure can be used, for example, when performing visual inspection of industrial products. [Explanation of symbols]
[0139] 1 Image processing device 2. Control unit 3 Imaging unit 4 Display device (display section) 13c processor
Claims
1. An image processing device including a processor that inputs an image into a machine learning model and executes a classification process to classify the image into a plurality of classes, The processor, (1) training the machine learning model on a plurality of training images; (2) inputting a plurality of validation images into the machine learning model trained with a plurality of training images, and performing a classification process to classify the plurality of validation images into the plurality of classes; (3) obtaining a degree of separation of the plurality of classes by a classification process of the plurality of verification images, and evaluating accuracy of the classification process of the plurality of verification images based on the obtained degree of separation of the plurality of classes; (4) Based on the evaluation result of the accuracy of the classification process of the plurality of verification images, evaluate whether or not re-learning of the machine learning model is necessary. If it is determined that re-learning of the machine learning model is necessary, extract verification images from the plurality of verification images that are relatively likely to have incorrect classification results, and automatically re-learn the machine learning model. On the other hand, if it is determined that re-learning of the machine learning model is not necessary, complete the learning process of the machine learning model. Image processing device.
2. 2. The image processing device according to claim 1, The processor, The steps (2) to (4) are automatically and repeatedly executed until it is determined that re-learning of the machine learning model is unnecessary. Image processing device.
3. 3. The image processing device according to claim 2, the plurality of classes includes a first class and a second class; the plurality of verification images include a first class image to which a label indicating the first class is assigned and a second class image to which a label indicating the second class is assigned, The processor, In a classification process of classifying the plurality of verification images into the first class and the second class, a first evaluation value indicating a degree to which each of the plurality of verification images belongs to the first class is calculated, When it is evaluated that re-learning of the machine learning model is necessary, the second class image having the relatively high first evaluation value or the first class image having the relatively low first evaluation value is extracted, and the machine learning model is automatically re-learned; A degree of separation between the distributions of the first class image and the second class image on the first evaluation value axis is calculated, and the processes from (2) to (4) are repeatedly performed until it is determined that re-learning of the machine learning model is unnecessary based on the degree of separation. Image processing device.
4. 4. The image processing device according to claim 3, The processor, repeating the steps (2) to (4) until a degree of separation between the distributions of the first class image and the second class image on the first evaluation value axis becomes equal to or greater than a predetermined value; Image processing device.
5. 3. The image processing device according to claim 2, The plurality of verification images include a non-defective product image to which a non-defective product label is attached and a defective product image to which a defective product label is attached, The processor, In the classification process, an evaluation value indicating a degree of defect is calculated for each of the plurality of verification images; If it is evaluated that re-learning of the machine learning model is necessary, extracting a good product image having a relatively high evaluation value or a defective product image having a relatively low evaluation value, and automatically re-learning the machine learning model; calculating a degree of separation between the distributions of the non-defective product images and the defective product images on the evaluation value axis, and repeatedly executing the processes from (2) to (4) until the degree of separation becomes equal to or greater than a predetermined value; Image processing device.
6. 6. The image processing device according to claim 5, The processor, automatically determining whether to extract a good-quality image having a relatively high evaluation value or a defective image having a relatively low evaluation value as an image to be retrained by the machine learning model based on a result of comparing the evaluation values of the good-quality images of the plurality of verification images with the evaluation values of the defective images; Image processing device.
7. 4. The image processing device according to claim 3, The processor, In the classification process, a second evaluation value indicating a degree of belonging to the second class is further calculated for each of the plurality of verification images; When it is evaluated that re-learning of the machine learning model is necessary, the first class image having a relatively high second evaluation value or the second class image having a relatively low second evaluation value is extracted, and the machine learning model is automatically re-learned; A degree of separation between the distributions of the first class image and the second class image on the second evaluation value axis is calculated, and the processes from (2) to (4) are repeatedly performed until it is determined that re-learning of the machine learning model is unnecessary based on the degree of separation. Image processing device.
8. 2. The image processing device according to claim 1, The processor, If it is evaluated that re-learning of the machine learning model is necessary, the number of verification images to be used for re-learning is automatically calculated based on the evaluation result of the accuracy of the classification process; extracting the calculated number of validation images that are relatively likely to be classified incorrectly from the plurality of validation images, and automatically retraining the machine learning model with the validation images; Image processing device.
9. 9. The image processing device according to claim 8, The processor, If it is evaluated that re-learning of the machine learning model is necessary, the calculated number of verification images are extracted from the plurality of verification images in order of relatively high probability of an erroneous classification result, and the machine learning model is automatically re-learned from the verification images in that number. Image processing device.
10. 4. The image processing device according to claim 3, The processor, After the classification process is performed, a display screen including a separation graph showing a degree of separation between the distributions of the first class image and the second class image on the first evaluation value axis is generated and displayed on a display unit; each time re-learning of the machine learning model is repeatedly performed, the separation graph is updated to the separation graph obtained by the machine learning model after re-learning, and a display screen is generated that displays the latest separation graph obtained by the update in a manner that allows comparison with past separation graphs, and the display screen is displayed on the display unit. Image processing device.
11. 11. The image processing device according to claim 10, The processor, a display screen is generated on the display unit, which displays a most recent separation graph obtained by repeatedly executing re-learning of the machine learning model and a past separation graph obtained in a learning stage prior to the learning stage in which the most recent separation graph was obtained, in a comparative manner; and the display screen is configured to accept, as a machine learning model to be used during operation, a selection from a user of a past machine learning model corresponding to the past separation graph; When the selection of the past machine learning model is accepted, all learning images trained by the selected past machine learning model are identified, and all the identified learning images are trained by a machine learning model in an initial state before the start of learning, thereby reproducing the selected past machine learning model. Image processing device.
12. 2. The image processing device according to claim 1, The processor, Even after the learning process of the machine learning model is completed, re-learning of the machine learning model can be resumed by a user instruction, inputting a new verification image, which is different from existing verification images, into the machine learning model, and executing a process of classifying the new verification image into the plurality of classes; evaluating accuracy of the classification process based on the degree of separation of the plurality of classes obtained by the classification process for the new verification image; If it is evaluated that re-learning of the machine learning model is necessary based on the evaluation result of the accuracy of the classification process, verification images that are likely to have incorrect classification results are extracted from the new verification images, and the verification images are automatically re-learned by the machine learning model; on the other hand, if it is evaluated that re-learning of the machine learning model is not necessary, the learning process of the machine learning model is completed. Image processing device.
13. 2. The image processing device according to claim 1, The processor, The system is configured to select between a process of adding learning images by retaining labels relating to the classification of existing learning images and validation images used in training a machine learning model currently in operation and adding new images acquired after the start of operation to the existing learning images, and a process of initializing labels relating to the classification of existing learning images and validation images used in training a machine learning model currently in operation and training the machine learning model with all images including new images acquired after the start of operation. Image processing device.
14. 2. The image processing device according to claim 1, The processor, evaluating that re-learning of the machine learning model is unnecessary, and after completing the learning process of the machine learning model, inputting a plurality of evaluation images different from the plurality of learning images and the plurality of verification images into the machine learning model, executing a classification process in which the plurality of evaluation images are classified into the plurality of classes, and evaluating the accuracy of the classification process; Image processing device.
15. An image processing method for inputting an image into a machine learning model and classifying the image into a plurality of classes, comprising: (1) training the machine learning model on a plurality of training images; (2) inputting a plurality of validation images into the machine learning model trained with a plurality of training images, and executing a classification process for classifying the plurality of validation images into the plurality of classes; (3) obtaining a degree of separation of the plurality of classes by a classification process of the plurality of verification images, and evaluating accuracy of the classification process of the plurality of verification images based on the obtained degree of separation of the plurality of classes; (4) evaluating whether or not re-learning of the machine learning model is necessary based on the evaluation result of the accuracy of the classification process of the plurality of verification images, and if it is evaluated that re-learning of the machine learning model is necessary, extracting verification images from the plurality of verification images that are relatively likely to have incorrect classification results and automatically re-learning them into the machine learning model, while if it is evaluated that re-learning of the machine learning model is not necessary, completing the learning process of the machine learning model; An image processing method comprising:
Citation Information
Patent Citations
Appearance inspection device, appearance inspection method, and program for causing computer to function as appearance inspection device
JP2006293820A
Information processing apparatus, information processing method, and program
JP2019192009A
Learning apparatus, detection apparatus, learning method, and learning program
JP2021086382A
Learning image determination device, program and learning image determination method
JP2021152691A
Distance-Based Learning Trust Model
JP2022549006A
