Image processing apparatus and image processing method
Through the automated processing of the image processing device, the user's burden in selecting and verifying images for machine learning model learning is solved, efficient learning of the machine learning model and automatic optimization of accuracy are achieved, ensuring that the accuracy of classification processing reaches the limit.
Patent Information
- Application Number
- CN202410229501.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-03-07
- Filing Date
- 2024-02-29
- Publication Date
- 2024-09-10
AI Technical Summary
In the existing technology, the learning process of the machine learning model requires the user to manually select and input multiple learning images, which results in a heavy burden on the user and difficulty in judging whether the accuracy of the classification processing is sufficient, leading to problems of over-learning or insufficient learning.
An image processing device is designed that automatically performs the learning, verification and re-learning of the machine learning model through the processor, uses multiple verification images for classification processing, evaluates the accuracy of the classification processing, and automatically determines whether re-learning is needed based on the accuracy. until sufficient accuracy is achieved.
It reduces the user's burden, improves learning efficiency and accuracy, and ensures that the classification processing of the machine learning model reaches sufficient accuracy without user manual intervention.
Smart Images

Figure CN118628786A
Abstract
Description
Technical Field
[0001] The present disclosure relates to an image processing device and an image processing method having a processor that performs image processing based on a machine learning model. Background Art
[0002] For example, as an inspection device for performing appearance inspection of industrial products, there is known an inspection device for performing classification processing, which inputs an object image acquired by a camera unit into a machine learning model to determine which group of qualified products and unqualified products it belongs to (for example, see Patent Document 1). The inspection device of Patent Document 1 uses learning images belonging to the qualified product group and learning images belonging to the unqualified product group to allow the machine learning model to learn, and recommends to the user that images that are unclear as to which group they belong to are used as additional learning images.
[0003] In addition, Patent Document 2 discloses that based on the performance accuracy of a defect detection unit, the number of defect images required to be added in order to further improve the performance is presented to the user.
[0004] However, multiple learning images are required to learn the machine learning model, but it is difficult for the user to know which of the multiple images to use as the learning image. Therefore, the learning of the machine learning model becomes trial and error, which may increase the burden on the user and increase the number of learning images and learning time. In addition, the user's judgment may also lead to over-learning.
[0005] In the case of the inspection device of Patent Document 1, a learning image can be suggested to the user, but the user must determine whether to input the suggested learning image into the machine learning model for learning, which places a heavy burden on the user. In addition, it is difficult for the user to confirm whether the accuracy of the classification processing based on the machine learning model is sufficient, and the user has a heavy burden to perform the confirmation operation. Moreover, if the result of the confirmation determines that the accuracy of the classification processing is insufficient and additional learning is required, the user must perform learning using the learning image again, which is also a factor that increases the burden on the user.
[0006] In addition, in the case of the defect detection system of Patent Document 2, the user can be prompted with the number of defect images required to further improve performance based on the performance accuracy of the defect detection unit, but the user must determine which learning images should be added, which places a heavy burden on the user.
[0007] Prior art literature
[0008] Patent Literature
[0009] Patent Document 1: Japanese Patent No. 6643856
[0010] Patent Document 2: Japanese Patent Application Publication No. 2021-196363 Summary of the invention
[0011] The present disclosure is completed in view of this point, and its purpose is to automatically perform learning, verification, and re-learning of machine learning models until the accuracy of classification processing is sufficient, thereby reducing the burden on users.
[0012] In order to achieve the above-mentioned purpose, the present method can be based on an image processing device having a processor, and the processor is used to perform a classification process of inputting an image into a machine learning model and classifying the image into a plurality of classes. The processor is configured to: cause the machine learning model to learn a plurality of learning images; input a plurality of verification images into the machine learning model that has learned a plurality of learning images, and perform a classification process of classifying the plurality of verification images into the plurality of classes; obtain the separation degree of the plurality of classes through the classification process of the plurality of verification images, and evaluate the accuracy of the classification process of the plurality of verification images based on the obtained separation degree of the plurality of classes; based on the evaluation result of the accuracy of the classification process of the plurality of verification images, evaluate whether the machine learning model needs to be relearned, and if it is evaluated that the machine learning model needs to be relearned, extract the verification images with a relatively high possibility of classification error from the plurality of verification images and automatically relearn the machine learning model; on the other hand, if it is evaluated that the machine learning model does not need to be relearned, complete the learning process of the machine learning model.
[0013] According to this structure, after the machine learning model is made to learn through a plurality of learning images, a plurality of verification images are input into the machine learning model and classification processing is performed, thereby enabling verification of the machine learning model. In the case where the accuracy of the classification processing based on the separation evaluation obtained through verification is insufficient, a verification image with a relatively high possibility of a classification result error is input into the machine learning model to automatically relearn it. On the other hand, in the case where the accuracy of the classification processing based on the separation evaluation obtained through verification is sufficient and relearning of the machine learning model is not required, the learning processing of the machine learning model is completed. In short, according to this structure, the learning, verification, and relearning of the machine learning model are automatically performed, thereby reducing the burden on the user, and verification images with a relatively high possibility of a classification result error are used during relearning, thereby enabling efficient learning.
[0014] The processor can automatically and repeatedly perform the classification process, the evaluation of the accuracy of the classification process, the evaluation of whether the re-learning of the machine learning model is needed, and the re-learning process until it is evaluated that the re-learning of the machine learning model is not needed. That is, the cases where re-learning is not needed include, for example, the case where sufficient accuracy of the classification process is obtained, the case where the accuracy of the classification process cannot be improved even by adding input learning images and reaches the limit, the case where there are insufficient learning images, etc. However, for example, it is difficult for the user to judge whether sufficient accuracy of the classification process has been obtained, and it is difficult to judge when the accuracy of the classification process cannot be improved and reaches the limit. Therefore, the image processing device of this method can further reduce the burden on the user by automatically repeating the above-mentioned re-learning process, so that the user does not need to make the above-mentioned judgments.
[0015] In addition, the image processing device can perform a classification process of classifying a plurality of verification images into a first category and a second category. In this case, it is possible to: calculate a first evaluation value for each of the plurality of verification images, the first evaluation value indicating the degree of belonging to the first category; when it is evaluated that the re-learning of the machine learning model is required, extract the second category images with a relatively high first evaluation value or the first category images with a relatively low first evaluation value, and automatically re-learn the machine learning model. In addition, the degree of separation of the distribution of the first category images and the second category images can be obtained, and the classification process, the evaluation of the accuracy of the classification process, the evaluation of whether the re-learning of the machine learning model is required, and the re-learning process are repeatedly performed until it is evaluated based on the degree of separation that the re-learning of the machine learning model is not required. That is, by using the first evaluation value indicating the degree of belonging to the first category as the basis for evaluating whether re-learning is required, the accuracy of the classification process can be further improved.
[0016] When performing a classification process of classifying multiple verification images into a first category and a second category, the image processing device can repeatedly perform the classification process, the evaluation of the accuracy of the classification process, the evaluation of whether the machine learning model needs to be re-learned, and the re-learning process until the separation degree of the distribution of the first category images and the second category images reaches a specified value or above.
[0017] In addition, the multiple verification images may include images of qualified products with qualified product labels and images of unqualified products with unqualified product labels. In this case, it is possible to: calculate evaluation values indicating the degree of unqualifiedness for the multiple verification images respectively during the classification process; if re-learning is required, extract qualified product images with relatively high evaluation values or unqualified product images with relatively low evaluation values, and automatically re-learn the machine learning model. In addition, the separation degree of the distribution of the qualified product images and the unqualified product images on the evaluation value axis can be obtained, and the classification process, the evaluation of the accuracy of the classification process, the evaluation of whether the machine learning model needs to be re-learned, and the re-learning process are repeatedly performed until the separation degree reaches or exceeds the specified value.
[0018] In addition, based on the result of comparing the evaluation values of the qualified product images of the plurality of verification images with the evaluation values of the unqualified product images, it can be automatically determined which one of the qualified product images with a relatively high evaluation value or the unqualified product images with a relatively low evaluation value is to be extracted as the image for relearning the machine learning model. Thus, the image processing device automatically determines which of the qualified product images and the unqualified product images has a high learning effect, thereby further reducing the burden on the user.
[0019] In addition, in the classification process, a second evaluation value indicating the degree of belonging to the second category can be calculated for each of the multiple verification images. In this case, when it is evaluated that the machine learning model needs to be re-learned, the first category image with a relatively high second evaluation value or the second category image with a relatively low second evaluation value can be extracted and the machine learning model can be automatically re-learned. In addition, the separation degree of the distribution of the first category image and the second category image on the second evaluation value axis can be obtained, and the classification process, the evaluation of the accuracy of the classification process, the evaluation of whether the machine learning model needs to be re-learned, and the re-learning process are repeatedly performed until it is evaluated based on the separation degree that the machine learning model does not need to be re-learned. In this way, efficient learning can be achieved.
[0020] Furthermore, the processor may: automatically calculate the number of verification images used in relearning based on the evaluation result of the accuracy of the classification process; and cause the machine learning model to automatically relearn the calculated number of verification images. That is, the image processing device also automatically determines the number of images to be added during relearning based on the accuracy of the classification process, thereby reducing the workload of the user.
[0021] In addition, the processor can extract the calculated number of verification images in descending order of the possibility of the classification result being wrong and automatically relearn the machine learning model. That is, not only can the number of verification images for relearning be automatically calculated, but the basis for selecting the calculated number of images can also be entrusted to the image processing device to decide, thereby reducing the user's workload.
[0022] In addition, the processor can: generate and cause the display unit to display a display screen including a separation curve graph, which represents the degree of separation of the distribution of the first type of image and the second type of image on the first evaluation value axis; update the separation curve graph to the separation curve graph obtained by the re-learned machine learning model, and generate and cause the display unit to display the latest separation curve graph obtained by the update in a manner that can be compared with the past separation curve graph. Thus, if re-learning is required, the user can see the progress of the learning process on the display screen. In addition, if re-learning is not required, the display screen can be prompted to the user as the final evaluation result.
[0023] In addition, the processor can be configured to generate and cause the display unit to display a display screen that displays the most recent separation curve graph and the past separation curve graph in a manner that allows comparison, and accept the user's selection of a past machine learning model corresponding to the past separation curve graph, as the machine learning model used during operation, the most recent separation curve graph is obtained by repeatedly performing re-learning of the machine learning model. In this case, when the selection of the past machine learning model is accepted, all learning images that have been learned by the selected past machine learning model can be determined, and the machine learning model in the initial state before the start of learning can learn all the determined learning images, thereby reproducing the selected past machine learning model. That is, sometimes the classification processing accuracy of the past machine learning model in the previous learning stage is higher than that of the most recent machine learning model that has been repeatedly re-learned, but it is generally difficult to restore the past machine learning model from the most recent machine learning model. In response to this, in this structure, the past machine learning model can be simply reproduced by causing the machine learning model in the initial state to learn all the learning images that have been learned by the past machine learning model selected by the user.
[0024] Furthermore, it is possible to configure the machine learning model to be able to start relearning again according to user instructions. In this case, it is possible to: input a new verification image that is different from the existing verification image into the machine learning model, and perform a process of classifying the new verification image into the plurality of classes; evaluate the accuracy of the classification process based on the degree of separation of the plurality of classes obtained by the classification process of the new verification image; and, if it is evaluated that relearning of the machine learning model is required, extract verification images with a high probability of incorrect classification results from the new verification images, and automatically relearn the machine learning model. Thus, even if a new image is acquired after the learning process is temporarily completed, the existing machine learning model can be relearned according to user instructions, thereby enabling continuous improvement in the accuracy of the machine learning model.
[0025] In addition, the processor may be configured to be able to select the following two processes: pre-maintaining various labels related to the classification of existing learning images and verification images used in the learning of the machine learning model in use, and adding learning images by adding new images acquired after the start of the application to the existing learning images; and initializing various labels related to the classification of existing learning images and verification images used in the learning of the machine learning model in use, and causing the machine learning model to learn all images including new images acquired after the start of the application. That is, if the accuracy of the classification processing of the machine learning model in use is high, it is sufficient to add new images without initialization, and if the accuracy of the classification processing of the machine learning model in use is low, sometimes the accuracy of the classification processing can be improved by initializing the machine learning model to learn all images, and the user can choose whichever one to deal with according to the situation.
[0026] As described above, the learning, verification, and re-learning of the machine learning model can be automatically performed until the accuracy of the classification processing is sufficient, thereby reducing the burden on the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a schematic diagram showing the structure of the image processing device according to the embodiment of the present invention.
[0028] Figure 2 This is a block diagram showing the hardware configuration of the image processing device.
[0029] Figure 3 This figure illustrates an example of processing a workpiece image using a machine learning model.
[0030] Figure 4 This is a flowchart showing a first example of step 1 of the automatic learning process.
[0031] Figure 5 A diagram showing an example of a user interface screen for image display.
[0032] Figure 6 This is a diagram showing an example of a user interface screen for displaying learning results after the first learning is completed.
[0033] Figure 7 It is equivalent to the state that indicates the end of the second learning. Figure 6 .
[0034] Figure 8 It is equivalent to the state that indicates the end of the third learning. Figure 6 .
[0035] Fig. 9 This is a flowchart showing a first example of step 2 of the automatic learning process.
[0036] Fig.10 This is a flowchart showing a second example of step 1 of the automatic learning process.
[0037] Fig.11 This is a flowchart showing a second example of step 2 of the automatic learning process.
[0038] Fig.12 This is a flowchart showing an example of defective product learning.
[0039] Fig.13 It is a figure which shows an example of an annotation screen.
[0040] Fig.14 It is a diagram showing an example of a learning transition display screen.
[0041] Fig.15 FIG. 1 is a diagram showing an example of a learning result display area in the case of three-class classification.
[0042] Fig.16 This is a flowchart showing an example of automatic learning in the case of three-class classification.
[0043] Description of Reference Numerals
[0044] 1. Image processing device,
[0045] 2 control unit,
[0046] 3 camera units,
[0047] 4 Display device (display unit),
[0048] 13c processor. DETAILED DESCRIPTION
[0049] Hereinafter, embodiments of the present invention will be described in detail based on 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.
[0050] Figure 1 1 is a schematic diagram showing the structure of an image processing device 1 according to an embodiment of the present invention. The image processing device 1 is used to determine whether a workpiece image obtained by photographing a workpiece such as various parts or products as an inspection object is acceptable or not, and can be used in a production site such as a factory. Specifically, a machine learning model is constructed inside the image processing device 1, and the machine learning model is generated by learning a plurality of learning images.
[0051] like Figure 2 As shown, the image processing device 1 includes a control unit 2, a camera unit 3, a display device (display unit) 4, and a personal computer 5, which are the main bodies of the device. The personal computer 5 is not essential and can be omitted. The personal computer 5 can also be used to display various information and images instead of the display device 4, and the function of the personal computer 5 can also be incorporated into the control unit 2 or the display device 4.
[0052] exist Figure 1 , as an example of a structure of the image processing device 1, a control unit 2, an imaging unit 3, a display device 4, and a personal computer 5 are described, but any plurality of them may be combined into one. For example, the control unit 2 and the imaging unit 3 may be integrated, or the control unit 2 and the display device 4 may be integrated. In addition, the control unit 2 may be divided into a plurality of units and a part may be incorporated into the imaging unit 3 and the display device 4, or the imaging unit 3 may be divided into a plurality of units and a part may be incorporated into other units. By using the image processing device 1, all steps of the image processing method of the present invention may be performed.
[0053] (Structure of the Image Capture Unit 3)
[0054] like Figure 2 As shown, the imaging unit 3 includes a camera module (imaging unit) 14 and an illumination module (illumination unit) 15, which acquire the workpiece image. The camera module 14 includes an AF motor 14a and an imaging substrate 14b for driving the imaging optical system. The AF motor 14a is used to automatically perform focus adjustment by driving the lens of the imaging optical system, and the focus adjustment can be performed by a conventionally known method such as contrast autofocus. The imaging substrate 14b includes a CMOS sensor 14c as a light receiving element for receiving light incident from the imaging optical system. The CMOS sensor 14c is an imaging sensor configured to acquire a color image. A light receiving element such as a CCD sensor may be used instead of the CMOS sensor 14c.
[0055] The lighting module 15 includes: an LED (light emitting diode) 15a, which is a light emitting body for illuminating the imaging area including the workpiece; and an LED driver 15b, which is used to control the LED 15a. The light emission timing, light emission time, and light emission amount of the LED 15a can be arbitrarily controlled by the LED driver 15b. The LED 15a can be provided integrally with the imaging unit 3, or can be provided separately from the imaging unit 3 as an external lighting unit.
[0056] (Structure of Display Device 4)
[0057] The display device 4 has a display panel composed of, for example, a liquid crystal panel, an organic EL panel, etc., and is controlled by a processor 13c of the control unit 2 described later. The workpiece image, the user interface image, etc. output from the control unit 2 are displayed on the display device 4. In addition, when the personal computer 5 has a display panel, the display panel of the personal computer 5 can be used instead of the display device 4.
[0058] (Operating equipment)
[0059] The operating device for the user to operate the image processing device 1 includes, for example, the keyboard 51 and the mouse 52 of the personal computer 5, but is not limited thereto, and any device that can accept various operations of the user may be used. For example, a pointing device such as the touch panel 41 of the display device 4 is also included in the operating device.
[0060] The control unit 2 can detect the user's operation on the keyboard 51 and the mouse 52. The touch panel 41 is a conventionally known touch operation panel equipped with a pressure-sensitive sensor, and the control unit 2 can detect the user's touch operation. The same applies to other pointing devices.
[0061] (Structure of Control Unit 2)
[0062] The control unit 2 includes a main substrate 13, a connector substrate 16, a communication substrate 17, and a power substrate 18. A display control unit 13a, an input unit 13b, and a processor 13c are provided on the main substrate 13. The display control unit 13a and the input unit 13b can be configured by, for example, a calculation processing device mounted on the main substrate 13. In addition, the display control unit 13a, the input unit 13b, and the processor 13c can be configured by one calculation processing device, or by different calculation processing devices.
[0063] The display control unit 13a, the input unit 13b, and the processor 13c control the operation of each connected substrate and module. For example, the processor 13c outputs a lighting control signal for controlling the lighting / extinguishing of the LED 15a to the LED driver 15b of the lighting module 15. The LED driver 15b switches the lighting / extinguishing of the LED 15a and adjusts the lighting time, and adjusts the light amount of the LED 15a, etc. according to the lighting control signal from the processor 13c.
[0064] In addition, the processor 13c outputs a camera control signal for controlling the CMOS sensor 14c to the camera substrate 14b of the camera module 14. The CMOS sensor 14c starts shooting according to the camera control signal from the processor 13c, and adjusts the exposure time to an arbitrary time to shoot. That is, the camera unit 3 shoots within the field of view of the CMOS sensor 14c according to the camera control signal output from the processor 13c. If there is a workpiece within the field of view, the workpiece is photographed, but if there are objects other than the workpiece within the field of view, it can also be photographed. For example, the image processing device 1 can capture images of qualified products corresponding to qualified products and images of unqualified products corresponding to unqualified products as learning images for a machine learning model through the camera unit 3. The learning image may not be an image captured by the camera unit 3, but may be an image captured by other cameras, etc.
[0065] On the other hand, when the image processing device 1 is in operation, the workpiece can be photographed by the imaging unit 3. The CMOS sensor 14c is configured to output a real-time image, that is, a currently photographed image, at any time at a relatively short frame rate.
[0066] When the CMOS sensor 14c finishes capturing images, the image signal output from the image capturing unit 3 is input to the processor 13c of the main substrate 13 for processing and stored in the memory 13d of the main substrate 13. The specific processing contents of the processor 13c of the main substrate 13 will be described in detail later. In addition, the main substrate 13 may also be provided with a processing device such as an FPGA or a DSP. In addition, the processor 13c may also be integrated with a processing device such as an FPGA or a DSP.
[0067] The connector substrate 16 receives power supply from the outside via a power connector (not shown) provided on the power interface 161. The power substrate 18 distributes the power received by the connector substrate 16 to each substrate and module, and specifically, distributes the power to the lighting module 15, the camera module 14, the main substrate 13, and the communication substrate 17. The power substrate 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 achieve automatic focusing. The AF motor driver 181 adjusts the power supplied to the AF motor 14a according to the AF control signal from the processor 13c of the main substrate 13.
[0068] The communication substrate 17 is used to perform communication between the main substrate 13 and the display device 4 and the personal computer 5, and communication between the main substrate 13 and an external control device (not shown). The external control device includes, for example, a programmable logic controller, etc. The communication can be either wired or wireless, and any communication method can be implemented by a conventionally known communication module.
[0069] The control unit 2 is provided with a storage device (storage unit) 19, such as a solid state drive, a hard disk drive, etc. The storage device 19 stores program files 80, setting files, etc. (software) for enabling the above-mentioned hardware to perform various controls and processes described later. The program files 80 and setting files can be pre-stored in a storage medium 90 such as an optical disk, for example, and the program files 80 and setting files stored in the storage medium 90 are installed in the control unit 2. The program file 80 can also be downloaded from an external server using a communication line. In addition, the storage device 19 can also pre-store the above-mentioned image data, parameters for constructing a machine learning model of the image processing device 1, etc., for example.
[0070] (When using the image processing device 1)
[0071] When the image processing device 1 is used, the processor 13c reads the parameters stored in the storage device 19, and the processor 13c constructs a machine learning model that has been learned. Figure 3 As shown, the machine learning model includes a neural network, an autoencoder, an SVM (support vector machine), etc. The processor 13c inputs a workpiece image obtained by photographing the workpiece to be inspected to the neural network constructed as described above. This is the front-end processing. When the workpiece image is input to the neural network, the neural network extracts features, and the extracted feature quantities are input to the autoencoder and / or support vector machine that performs the back-end processing. The neural network that performs feature extraction in the front-end processing can be a convolutional neural network that has been learned in advance, or it can be a convolutional neural network that is configured to be able to perform additional learning using the automatic learning described later. In addition, in Figure 3In the machine learning model shown, it is also possible to construct a system that extracts multiple feature quantities (feature maps) of different scales from multiple levels of a convolutional neural network, and inputs the multiple feature quantities into an autoencoder and / or a support vector machine, respectively.
[0072] In the auto encoder, an abnormality map (heat map) is generated and output based on the input feature quantity. The processor 13c performs a determination process to determine whether the workpiece image belongs to the first category or the second category based on the abnormality map output from the auto encoder. For example, the first category is regarded as a qualified product category, and the image belonging to the first category can be regarded as a qualified product image obtained by photographing a qualified product. In addition, the second category is regarded as a defective product category, and the image belonging to the second category can be regarded as a defective product image obtained by photographing a defective product.
[0073] On the other hand, the support vector machine performs classification processing to classify the workpiece image into multiple classes based on the input feature quantity. The multiple classes include the first class and the second class, thereby, the processor 13c can classify the workpiece image into a qualified class and a non-qualified class. The multiple classes may include a third class, a fourth class, etc., and the number of classes is not particularly limited.
[0074] The machine learning model according to this embodiment is not limited to autoencoders or SVMs, and other machine learning models may also be used.
[0075] By executing the above-mentioned determination processing and the above-mentioned classification processing by the processor 13c of the image processing device 1, it is possible to determine whether the workpiece is a qualified product or a defective product. The image processing device 1 having such a function can inspect the appearance of the workpiece, and therefore can also be called an appearance inspection device, etc. The workpiece as the inspection object of the image processing device 1 can be the inspection object as a whole, or only a part of the workpiece can be the inspection object. In addition, a plurality of inspection objects can also be included in one workpiece. In addition, a plurality of workpieces can also be included in the workpiece image.
[0076] (Automatic learning)
[0077] In order to make the machine learning model learn, multiple learning images are input into the machine learning model. Although the user can prepare learning images, it is difficult for the user to accurately determine which images should be input into the machine learning model to make it learn, and it is often a trial and error situation. In addition, regarding the learning images used to generate the machine learning model for classifying qualified products and unqualified products, too many sheets are not preferred from the perspective of too long learning time and over-learning. On the other hand, too few sheets will reduce the generalization performance, so it is difficult to judge the appropriate number of sheets. In addition, it is expected that not only qualified products and unqualified products are classified, but also the difference between the evaluation value when it is judged as a qualified product and the evaluation value when it is judged as a unqualified product is large. In short, when selecting learning images, various requirements need to be met. So far, experts with rich technical know-how have selected learning images based on the technical know-how, or in the absence of technical know-how, although there is a risk of over-learning, a large number of images are used for learning to improve performance. Therefore, it is difficult for people with little experience to generate a machine learning model with high accuracy in classification processing and judgment processing. In addition, since the learning images have been selected by the person who generated the machine learning model so far, there is also a problem that the accuracy of the generated machine learning model varies depending on the person who selects the learning image. According to the image processing device 1 of this embodiment, even a person with little experience can perform automatic learning processing that can automatically generate a machine learning model with high classification processing accuracy and judgment processing accuracy like an expert while reducing the burden. An example of automatic learning processing is described below.
[0078] The automatic learning process can be roughly divided into two steps, consisting of step 1 and step 2. In step 1, a machine learning model is generated that classifies qualified products and unqualified products only through qualified product learning, or determines which category of qualified products and unqualified products it belongs to. In this specification, the classification of input images between qualified categories or unqualified categories can also be referred to as qualified or unqualified judgment. In step 2, in the case where it has been classified or determined as a qualified product or an unqualified product in step 1, the difference between the evaluation value when it is determined as a qualified product and the evaluation value when it is determined as an unqualified product is enlarged through unqualified product learning. In addition, in step 2, in the case where qualified products and unqualified products cannot be classified or determined in step 1, a machine learning model for classifying or determining qualified products and unqualified products is generated through unqualified product learning, thereby enlarging the difference between the evaluation value when it is determined as a qualified product and the evaluation value when it is determined as an unqualified product. In addition, in the case of supervised learning, step 1 is omitted and only step 2 is performed.
[0079] (First example of step 1)
[0080] Figure 41 is a flowchart showing an example of step 1 of the automatic learning process. Before starting the automatic learning process, the user prepares a plurality of learning images. The learning images include images of qualified products that have been determined as qualified products and images of unqualified products that have been determined as unqualified products. The first category is the qualified product category, and the second category is the unqualified product category, so the qualified product image can be called a first category image with a label representing the first category, and the unqualified product image can be called a second category image with a label representing the second category.
[0081] Multiple images of qualified products and images of unqualified products are prepared in advance. The learning images can be only images of qualified products, but as verification images for verifying the accuracy of the machine learning model, both images of qualified products and images of unqualified products are required, so the user needs to prepare these two types of images in advance. In addition, in order to evaluate the generalization performance of the machine learning model generated in the automatic learning process, multiple evaluation images that are different from the learning images and verification images can also be prepared in advance. Evaluation images refer to images used to test whether the machine learning model generated using the learning images and verification images can also correctly perform classification processing on the evaluation images that are unknown images. In the case where the machine learning model makes a mistake in the classification processing of the evaluation images, the user can judge that the reliability of the machine learning model is low.
[0082] The qualified product image is assigned a qualified product label, and the unqualified product image is assigned an unqualified product label. The qualified product label and the unqualified product label are assigned to each image by the user. The learning images, verification images, and evaluation images are pre-saved by the user in a specified folder. The verification images may or may not include the learning images.
[0083] In step SA1, the image of the qualified product is registered as a learning image for learning the machine learning model. The number of learning images to be registered may be one or more. In step SA1, the processor 13c generates and displays the image on the display device 4. Figure 5The user interface screen 100 for image display is shown. The user interface screen 100 for image display is provided with an image addition button 101, a learning image display area 102 for displaying learning images in thumbnail form, and a verification image display area 103 for displaying verification images in thumbnail form. When the user operates the mouse 52 and presses the image addition button 101, the processor 13c generates and causes the display device 4 to display a folder selection window (not shown). 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. In the case where the read learning images include images of qualified products belonging to the qualified category and images of unqualified products belonging to the unqualified category, only the qualified product images are selected as images for learning in step SA1. This selection operation can be performed, for example, by the user operating the mouse 52, and the selected learning images are registered as images input to the machine learning model. In the case of registering multiple learning images, it is preferred to select images with low mutual similarity. The registration of the learning image may be performed 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 initially displayed in the file, or may automatically select and register according to the update date. In addition, the defective product image may be registered as the learning image in step SA1. In this case, the process proceeds to the automatic learning of step 2 described later.
[0084] After the learning image is registered, step SA2 is entered. An automatic learning button 113 for starting automatic learning is provided in the user interface screen 100 for image display. When the user operates the mouse 52 and presses the automatic learning button 113, the processor 13c starts automatic learning. Specifically, the processor 13c inputs the learning image registered in step SA1 into the machine learning model to perform learning. This is a learning step for making the machine learning model learn the learning image. By performing the learning step using the qualified product image, a machine learning model is generated that judges an image having features different from the qualified product image belonging to the qualified product category as a defective product image belonging to the defective product category.
[0085] After the learning step, the processor 13c inputs a plurality of verification images to the machine learning model learned in the learning step, and performs a classification process of classifying the plurality of verification images into qualified categories and unqualified categories. At this time, the processor 13c also inputs a plurality of verification images to the machine learning model learned in the learning step, and performs a determination process of determining which of the qualified categories and unqualified categories the plurality of verification images belong to. This is a verification step. In the verification step, the processor 13c can obtain the separation degree of the qualified category and the unqualified category through the classification process of the plurality of verification images.
[0086] In the verification step, the processor 13c generates and causes the display device 4 to display the following Figure 6 The user interface screen 150 for displaying learning results is shown. The user interface screen 150 for displaying learning results 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 display area 152 for indicating that verification is in progress and the time elapsed from the start of learning. In addition, a learning stop button 153 is also provided in the user interface screen 150 for displaying learning results. When the user operates the learning stop button 153, the processor 13c will force the end of the learning of the machine learning model even if the learning is in progress. Moreover, the user interface screen 150 for displaying learning results shows: an area 154A for displaying the learning result of the machine learning model obtained in the second verification step; and an area 154B for displaying the learning result of the machine learning model obtained in the third verification step.
[0087] The first learning result display area 151 includes: an image number display area 151 a for displaying 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 151 b; and an inference result display area 151 c.
[0088] The Pareto chart generated by the processor 13c is displayed in the Pareto chart display area 151b. The Pareto chart is a separation curve diagram indicating the degree of separation between qualified categories and unqualified categories, and is also a curve diagram indicating the accuracy of the determination processing of the machine learning model. The horizontal axis of the curve diagram is the score (first evaluation axis), and the vertical axis is the accumulation of the number of images. The higher the score, the higher the degree of belonging to the unqualified category, and conversely, the lower the score, the higher the degree of belonging to the qualified category. The score can also be referred to as the first evaluation value indicating the degree of belonging to the qualified category. That is, the processor 13c calculates the first evaluation value indicating the degree of belonging to the qualified category for each of the multiple verification images in the classification process of dividing the multiple verification images into qualified categories and unqualified categories. In addition, as described above, the score is also an evaluation value indicating the degree of unqualified, so the processor 13c can also calculate the evaluation value indicating the degree of unqualified for each of the multiple verification images, and the evaluation value can also be referred to as the second evaluation value indicating the degree of belonging to the unqualified category.
[0089] In the inference result display area 151c, the inference result of the machine learning model verified in the verification step is displayed in the form of a table. The table displayed in the inference result display area 151c is also called a fusion matrix, which displays the number of qualified product images and the number of unqualified product images of the verification images, and displays the number of qualified product images and the number of unqualified product images inferred by the machine learning model. The processor 13c calculates and causes the inference result display area 151c to display: the false positive rate, which indicates the proportion of qualified product images detected as unqualified product images; and the missed detection rate, which indicates the proportion of unqualified product images judged as qualified product images. In addition, the processor 13c also calculates and causes the inference result display area 151c to display the difference in scores between qualified products and unqualified products. In addition, in Figures 6 to 8 In the example shown, each verification image also includes a learning image used for learning the machine learning model.
[0090] Next, enter Figure 4 Step SA3 of the flowchart shown. In step SA3, it is determined whether the qualified product image and the unqualified product image have been separated in the verification step of step SA2 according to the prescribed benchmark, the accuracy of the classification processing of the verification image is evaluated, and the accuracy of the determination processing of the verification image is evaluated. That is, the score calculated in step SA2 is a numerical value representing the degree of unqualifiedness in the verification image, such as the size of the defect. In step SA3, the processor 13c obtains the difference between the highest score (unqualified degree: high) when it is determined to be a qualified product and the lowest score (unqualified degree: low) when it is determined to be a unqualified product, and determines whether the difference is greater than a prescribed value. If the difference is greater than a prescribed value, it is determined that the qualified product image and the unqualified product image have been separated; on the other hand, if the difference is less than a prescribed value, it is determined that the qualified product image and the unqualified product image are not separated.
[0091] If it is determined in step SA3 that the qualified product image and the unqualified product image have been separated, the process proceeds to step SA7 to determine whether it is set to execute only step 1. That is, the user can set whether to perform automatic learning in a first mode in which automatic learning ends only after step 1 or in a second mode in which step 1 and step 2 are executed. The user's setting is accepted by the input unit 13b. If it is set to execute only step 1, the automatic learning ends. On the other hand, if it is set to execute both step 1 and step 2, the process proceeds to step SA8. Fig. 9 Flow chart of step 2 is shown.
[0092] If it is determined in step SA3 that the qualified product image and the unqualified product image are not separated, the process proceeds to step SA4. In step SA4, the processor 13c determines whether one or more qualified product images remain in the verification image. If one or more qualified product images remain in the verification image, the process proceeds to step SA5. In step SA5, it is determined whether there is a misdetected qualified product image in the verification image.
[0093] If there is no erroneously detected qualified product image in the verification image in step SA5, the process proceeds to step SA6. In step SA6, the processor 13c determines whether there is a qualified product image with a higher score than the erroneously detected unqualified product image in the verification image. If there is no qualified product image with a higher score than the erroneously detected unqualified product image in step SA6, the process proceeds to step SA7.
[0094] If there is a misdetected qualified product image in the verification image in step SA5, the process proceeds to step SA8. In step SA8, the processor 13c extracts n misdetected qualified product images from the verification image in descending order of scores. n is an integer greater than 1, and therefore, the qualified product images extracted in step SA8 may be one or more than two. In addition, the number of images extracted in step SA8 may be the number described in the second example described later.
[0095] After extracting n qualified product images in descending order of scores in step SA8, step SA2 is entered to input the n qualified product images extracted in step SA8 into the machine learning model and automatically relearn. At this time, the processor 13c can also perform so-called data augmentation (augmentation) of rotating the image or changing the image brightness. For example, the processor 13c automatically generates an image with a 5% change in brightness relative to the image extracted in step SA8, and inputs it into the machine learning model for learning. If the learning effect is low, the processor 13c also generates an image with a phased or dynamic change in brightness of 10% and inputs it into the machine learning model for learning.
[0096] In the case where there are qualified product images with higher scores than the falsely judged defective product images in step SA6, the process proceeds to step SA9. In step SA9, n qualified product images with higher scores than the falsely judged defective product images are extracted in ascending order of scores. n is an integer greater than 1, and therefore, the qualified product images extracted in step SA9 may be one or more than two. In this way, the processor 13c compares the scores of the evaluation values of the qualified product images of the plurality of verification images with the scores of the evaluation values of the defective product images, and based on the comparison result, automatically determines which of the qualified product images with relatively higher evaluation values or the defective product images with relatively lower evaluation values are to be extracted as images for re-learning the machine learning model.
[0097] In addition, it is also possible to consider extracting defective product images with low scores from the misjudged defective product images, but since the purpose of image inspection is to detect products other than qualified products, qualified product learning should be continued as much as possible in order to clarify the range of qualified products. Assuming that defective product learning is performed, a large number of defective product images are required to clarify the boundary between qualified and defective products, but since there are originally few defective products, it is difficult to prepare a large number of defective product images.
[0098] After extracting n qualified product images in ascending order of scores in step SA9, the process proceeds to step SA2, where the n qualified product images extracted in step SA9 are input into the machine learning model and automatically relearned. At this time, the processor 13c may also perform so-called data augmentation, which is to rotate the image or change the image brightness.
[0099] In step SA2, a plurality of verification images are input to the relearned machine learning model, and a classification process is performed to classify the plurality of verification images into the plurality of classes. Thereafter, steps SA3 to SA7 are performed, and steps SA8 and SA9 are performed as necessary.
[0100] Figure 7 A user interface screen 150 for displaying learning results is shown, which displays a second learning result display area 154 after the second learning (first re-learning) is completed. The second learning result display area 154 is used to display the learning results of the machine learning model obtained in the second verification step. The second learning result display area 154 is generated and displayed by the processor 13c in the same manner as the first learning result display area 151. The second learning result display area 154 is provided with: 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 for indicating the degree of separation obtained in the second verification step; and an inference result display area 154c for displaying the inference results obtained in the second verification step. As shown in FIG. Figure 7 As shown, area 154B is shown, which is used to display the learning results of the machine learning model obtained in the third verification step.
[0101] Figure 8A user interface screen 150 for displaying learning results is shown, which displays a third learning result display area 155 after the third learning (second re-learning) is completed. The third learning result display area 155 is used to display the learning results of the machine learning model obtained in the third verification step. 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 is provided with: 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 indicating the degree of separation obtained in the third verification step; and an inference result display area 155c for displaying the inference result obtained in the third verification step. Each time the processor 13c repeatedly performs re-learning of the machine learning model, it updates the separation curve diagram displayed as a Pareto chart to a separation curve diagram obtained by the re-learned machine learning model. Figure 7 as well as Figure 8 As shown, the processor 13 c can generate and cause the display device 4 to display a learning result display user interface screen 150 as a display screen that displays the latest separation curve graph obtained by updating so that it can be compared with the past separation curve graph.
[0102] There are duplications in each learning image. For example, when there are four learning images in the second time, the four learning images are included in the five learning images in the third time. That is, learning images are added each time the number of learning increases.
[0103] like Figure 8 As shown, as the number of learning times increases, the difference in scores between qualified products and unqualified products becomes larger, and the separation of qualified product images and unqualified product images becomes clear. The machine learning model that has completed the third learning can clearly separate qualified product images from unqualified product images, and determine which category a qualified product category and an unqualified product category belong to, so the automatic learning ends at the time point when the third learning is completed. In this way, the processor 13c automatically and repeatedly performs the following processing until it is evaluated that re-learning of the machine learning model is not required: classification processing of classifying multiple verification images through the learned machine learning model; evaluation of the accuracy of the classification processing; evaluation of whether re-learning of the machine learning model is required; and when it is evaluated that re-learning of the machine learning model is required, extracting verification images with a relatively high possibility of incorrect classification results from multiple verification images and automatically re-learning the machine learning model. As a result, the accuracy of the machine learning model is improved, and its progress is as follows. Figure 8 Prompt the user as shown.
[0104] In addition, after obtaining the separation degree of qualified categories and unqualified categories through the verification step of step SA2, the processor 13c evaluates the accuracy of the classification processing of multiple verification images based on the separation degree of qualified categories and unqualified categories obtained in step SA2 through steps SA3 to SA6, and then evaluates whether the machine learning model needs to be re-learned based on the evaluation results of the accuracy of the classification processing of multiple verification images. If the processor 13c evaluates that the machine learning model needs to be re-learned, the processor 13c extracts the verification images with a relatively high possibility of classification errors from the multiple verification images and automatically re-learns the machine learning model; on the other hand, if the processor 13c evaluates that the machine learning model does not need to be re-learned, the learning process of the machine learning model is completed.
[0105] When the processor 13c determines that the machine learning model needs to be relearned, it extracts a defective product image with a relatively high first evaluation value or a qualified product image with a relatively low first evaluation value and causes the machine learning model to automatically relearn. In addition, the processor 13c extracts a qualified product image with a relatively high evaluation value indicating the degree of defect or a defective product image with a relatively low evaluation value indicating the degree of defect and causes the machine learning model to automatically relearn. Then, as Figure 8 As shown, the processor 13c obtains the separation degree of the distribution of the qualified product image and the unqualified product image on the horizontal axis (first evaluation value) of the Pareto chart. The processor 13c automatically and repeatedly performs the following processing until it is evaluated that the relearning of the machine learning model is not required based on the obtained separation degree: classification processing of classifying multiple verification images by the learned machine learning model; evaluation of the accuracy of the classification processing; evaluation of whether the relearning of the machine learning model is required; and, if it is evaluated that the relearning of the machine learning model is required, extracting the verification image with a relatively high possibility of classification error from the multiple verification images and automatically relearning the machine learning model. The processor 13c performs this repeated processing until the separation degree of the distribution of the qualified product image and the unqualified product image on the horizontal axis of the Pareto chart reaches a specified value or more. In addition, the criterion for evaluating that the relearning of the machine learning model is not required is not limited to the specification determined by the above-mentioned separation degree. That is, assuming that the separation degree does not reach a specified value or more, when the number of times or the required time of repeatedly performing the above-mentioned processing reaches the number or time pre-specified by the user, or the number or time pre-specified on the device side, it is evaluated that the relearning of the machine learning model is not required. Whether or not relearning is unnecessary may be evaluated by using a criterion that appropriately combines the aforementioned separation degree with the number of times or time.
[0106] In addition, when a plurality of evaluation images are prepared, the processor 13c may also evaluate that the re-learning of the machine learning model is not necessary, and after the learning process of the machine learning model is completed, a plurality of evaluation images different from the plurality of learning images and the plurality of verification images are input into the machine learning model, and a classification process is performed to classify the plurality of evaluation images into a plurality of categories (qualified categories or unqualified categories), and the accuracy of the classification process is evaluated. The processor 13c may also cause the display device 4 to display the accuracy as the classification process accuracy of the plurality of evaluation images.
[0107] In addition, when the second evaluation value indicating the degree of belonging to the defective category is calculated for each of the plurality of verification images, the processor 13c extracts a qualified product image with a relatively high second evaluation value or a defective product image with a relatively low second evaluation value when it is evaluated that the machine learning model needs to be relearned, and causes the machine learning model to be automatically relearned. Then, the processor 13c obtains the separation degree of the distribution of the qualified product image and the defective product image on the second evaluation value axis, and automatically and repeatedly performs the following processing until it is evaluated that the machine learning model does not need to be relearned based on the separation degree: a classification process of classifying the plurality of verification images by the learned machine learning model; an evaluation of the accuracy of the classification process; an evaluation of whether the machine learning model needs to be relearned; and, when it is evaluated that the machine learning model needs to be relearned, a verification image with a relatively high possibility of a classification result error is extracted from the plurality of verification images and causes the machine learning model to be automatically relearned.
[0108] (First example of step 2)
[0109] Next, based on Fig. 9 The flowchart shown illustrates the processing of the above step 2. In step SB1, the qualified category and the unqualified category are compared in the Pareto chart, and the image with a gentler slope is added. The processor 13c, for example, calculates the difference between the highest-scoring image and the second-highest-scoring image among the images classified as qualified categories, and calculates the difference between the lowest-scoring image and the second-lowest-scoring image among the images classified as unqualified categories. In the case where the difference between these two scores is the same, the difference between the highest-scoring image and the third-highest-scoring image among the images classified as qualified categories is calculated, and the difference between the lowest-scoring image and the third-lowest-scoring image among the images classified as unqualified categories is calculated.
[0110] In step SB2, the processor 13c determines which of the two score differences calculated in step SB1 is larger. If the score difference of the image classified as a qualified product is larger, the process proceeds to step SB3, and on the other hand, if the score difference of the image classified as a failed product is larger, the process proceeds to step SB4.
[0111] In step SB3, the processor 13c adds n images of qualified products from the qualified product images in the verification images in descending order of scores. In step SB4, the processor 13c adds n images of unqualified products from the unqualified product images in the verification images in ascending order of scores. After step SB3 and step SB4, the process proceeds to step SB5.
[0112] In step SB5, the processor 13c determines whether the number of sheets added in step SB3 or step SB4 is greater than 0. If the determination in step SB5 is "yes", the process proceeds to step SB6, and the processor 13c and Figure 4 Step SA2 of the flowchart shown in the figure also performs re-learning, performs verification based on the verification image, and generates a Pareto chart. In addition, when entering step SB6 via step SB4, the processor 13c inputs the image belonging to the unqualified category into the machine learning model and re-learns it, so as to generate a machine learning model in a manner that determines an image having features similar to those of the image belonging to the unqualified category as an image belonging to the unqualified category. After that, it enters step SB7 to determine whether the end condition is met. The end condition will be explained in the second example of step 2 described later.
[0113] (Second example of step 1)
[0114] Fig.10 It is a flowchart of the second example of step 1 of the automatic learning process. In step SC1, the processor 13c sets the count to 0. In step SC2, the processor 13c determines whether additional learning is turned on. For example, when the image processing device 1 starts to be used to photograph the workpiece, a new workpiece image can be collected. It is configured so that when a new workpiece image is collected, the following processing can be selected: pre-maintaining various labels related to the classification of existing learning images and verification images used in the learning of the machine learning model in use, and adding the new images acquired after the start of the application to the existing learning images to perform additional learning image processing (additional learning processing); and initializing various labels related to the classification of existing learning images and verification images used in the learning of the machine learning model in use, and making the machine learning model learn all images including the new images acquired after the start of the application (all image learning processing). Labels include qualified product labels assigned to qualified product images and unqualified product labels assigned to unqualified product images. If the accuracy of the machine learning model in use is high, the workpiece image is processed additionally without initialization. If the accuracy is low, it may be initialized and learning from the beginning can obtain higher accuracy. It can be used according to the situation.
[0115] exist Figure 5In the user interface screen 100 for image display shown, a selection area 104 for selecting whether to enable the additional learning process is provided. When the user operates the mouse 52 and selects the selection area 104, the processor 13c executes the additional learning process. On the other hand, when the selection area 104 is not selected, the processor 13c executes all image learning processes. The processor 13c receives the user's operation of the mouse 52 through the input unit 13b, and determines whether to select the additional learning process or to select all image learning processes. That is, the image processing device 1 is configured to be able to accept the user's selection of the additional learning process or the user's selection of all image learning processes.
[0116] If the determination in step SC2 is "No" and the additional learning process 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 image and verification image. In step SC4, the processor 13c registers only one qualified product image as a learning image. At this time, the qualified product image at the beginning can be selected and registered, or other qualified product images can be registered.
[0117] In step SC5 and step SC6, respectively execute Figure 4 The processing of step SA2 and step SA3 of the flowchart shown in FIG. 1 is performed. If it is determined in step SC6 that the qualified product image and the unqualified product image have been separated, it means that the accuracy of the determination process is high enough and the specified accuracy has been obtained. In this case, this process is terminated. That is, when the processor 13c evaluates that the accuracy of the determination process of the machine learning model has obtained the specified accuracy, it automatically determines to terminate the learning process of the machine learning model.
[0118] When the processor 13c determines that the learning process of the machine learning model is finished, it automatically generates and causes the display device 4 to display Figures 6 to 8 The graph of the Pareto chart in the user interface screen 150 for displaying learning results is shown. In addition, when the processor 13c determines that the learning process of the machine learning model is to be terminated, it automatically generates a numerical value indicating the accuracy of the determination process of the machine learning model, such as the difference between the scores of qualified products and unqualified products, and displays it on the display device 4. In this way, the accuracy of the determination process obtained when the learning process is terminated can be prompted to the user.
[0119] In addition, if Figures 6 to 8As shown, the learning result display user interface screen 150 includes image number display areas 151a, 154a, and 155a for displaying the number of qualified product images and the number of unqualified product images that have been learned by the machine learning model, and includes inference result display areas 151c, 154c, and 155c for displaying the number of misjudged images of the plurality of verification images. Thus, the number of learned images and the number of misjudged images can be prompted to the user.
[0120] If it is determined in step SC6 that the conforming product images and the defective product images are not separated, the process proceeds to step SC7. In step SC7, the processor 13c registers the conforming product image with the highest score among the verification images as the learning image. Thereafter, the process proceeds to step SC8 and the same process as step SC5 is performed.
[0121] In step SC9, the processor 13c determines whether the number of all qualified product images is less than a specified number (e.g., 20) or whether it is set to execute only the above step 1. If the number of all qualified product images exceeds the specified number, the process proceeds to step SC10. In addition, if it is set to execute the above steps 1 and 2, the process proceeds to step SC10. On the other hand, if the number of all qualified product images is less than the specified number, the process proceeds to step SC11. In addition, if it is set to execute only the above step 1, the process proceeds to step SC11.
[0122] In step SC10, the processor 13c determines whether the total number of learning images is more than half of the number of qualified product images. If the total number of learning images is more than half of the number of qualified product images, the process proceeds to step SC12. Figure 4 Similarly, step SA7 of the flowchart shown in FIG. 1 determines whether it is set to execute only step 1. If it is set to execute only step 1, the automatic learning is terminated. On the other hand, if it is set to execute both step 1 and step 2, the automatic learning is entered. Fig.11 Flow chart of step 2 is shown.
[0123] If it is determined in step SC10 that the total number of learning images is less than half of the number of conforming product images, the process proceeds to step SC11. Figure 4 Similarly, step SA3 of the flowchart shown in the figure determines whether the conforming product image and the defective product image are separated according to a predetermined criterion. If it is determined in step SA3 that the conforming product image and the defective product image are separated, the automatic learning automatically ends.
[0124] If it is determined in step SC11 that the qualified product image and the unqualified product image are not separated, the process proceeds to step SC13. In step SC13, the processor 13c determines whether the count is less than a specified value (e.g., 5). If the count is greater than the specified value, the process proceeds to step SC12. On the other hand, if the count is less than the specified value, the process proceeds to step SC14.
[0125] In step SC14 and step SC15, Figure 4 The same judgment is made in step SA4 and step SA5 of the flowchart shown. If the judgment is "No" in step SC14, the process proceeds to step SC12. In addition, if the judgment is "No" in step SC15, the process proceeds to step SC16. If the judgment is "Yes" in step SC15 and there is a misdetected qualified product image in the verification image, the process proceeds to step SC17. In step SC17, the error rate is calculated. The error rate is the error rate of qualified product images for multiple verification images, and can be calculated by the following formula.
[0126] False positive rate = (number of good product images judged as bad product images in the verification images and learning images / total number of good product images) × 100
[0127] After calculating the error rate in step SC17, the process proceeds to step SC18. Figure 4 Similarly, step SA8 of the flowchart shown extracts n images of qualified products that are incorrectly detected from the verification images in descending order of scores. The number of images extracted can also be changed according to the error rate. For example, it can be set so that the greater the error rate, the greater the number of images extracted in step SC18. The number of images extracted in step SC18 can also be determined, for example, based on a ratio, such as a number equivalent to, for example, 5%, 10%, or 15% relative to all qualified product images. In this way, the processor 13c determines the number of qualified product images used for re-learning the machine learning model based on the error rates of multiple verification images relative to qualified product images.
[0128] After extracting n images of qualified products in descending order of scores in step SC18, the process proceeds to step SC8, where the n images of qualified products extracted in step SC18 are input into the machine learning model and automatically re-learned.
[0129] In step SC19 entered when the determination in step SC16 is "yes", the missed detection rate is calculated. The missed detection rate is the misjudgment rate of defective product images among a plurality of verification images, and can be calculated by the following formula.
[0130] Missed detection rate = (number of defective images judged as defective images in the verification images and learning images / total number of defective images) × 100
[0131] After calculating the missed detection rate in step SC19, the process proceeds to step SC20. Figure 4 Similarly, step SA9 of the flowchart shown extracts n images of qualified products with scores higher than the images of misjudged defective products in ascending order of scores. The number of images extracted can also be changed according to the missed detection rate. For example, it can be set so that the greater the missed detection rate, the greater the number of images extracted in step SC20. The number of images extracted in step SC20 can also be determined, for example, based on a ratio, such as a number equivalent to, for example, 5%, 10%, or 15% relative to all qualified product images. In this way, the processor 13c determines the number of defective product images used for re-learning of the machine learning model based on the misjudgment rate, i.e., the missed detection rate, of multiple verification images relative to defective product images. In addition, it can also be set so that the number of images extracted in step SC20 is greater than the number of images extracted in step SC18.
[0132] After step SC20, the process proceeds to step SC21, and the processor 13c performs a process of adding 1 to the count. The count is used in the judgment of the next step SC13. When multiple re-learning is performed after multiple steps SC16 to SC20, it is judged as "No" in step SC13 and the process proceeds to step SC12 to start the above step 2. That is, after repeating the re-learning based on the qualified product image multiple times, if the processor 13c evaluates that the re-learning of the machine learning model is still needed, the above step 2 is automatically executed. In addition, the processor 13c can end the learning only after step 1, and the user can also transfer to the above step 2 at any time.
[0133] After step SC21, the process proceeds to step SC8, where the n defective product images extracted in step SC20 are input into the machine learning model and re-learning is automatically performed.
[0134] In this way, when the processor 13c evaluates that the relearning of the machine learning model is necessary in step SC15, in steps SC18 and SC20, the number of verification images used for relearning is automatically calculated based on the evaluation result of the accuracy of the classification processing, and verification images with a relatively high possibility of classification results being wrong are extracted from the plurality of verification images. After extracting the verification images with a relatively high possibility of classification results being wrong, the processor 13c can cause the machine learning model to automatically relearn the verification images with the number of verification images. Therefore, the burden on the user can be reduced.
[0135] (Second example of step 2)
[0136] Fig.11 is a flowchart showing a second example of step 2 of the automatic learning process. In steps SD1 and SD2, the Fig. 9The same processing as steps SB1 and SB2 of the flowchart shown. If the difference in the scores of the images classified as qualified products is large, proceed to step SD3. In step SD3, qualified product images are extracted according to a specified benchmark. Specifically, the processor 13c first determines the image with the highest score among the qualified product images in the verification image. Next, the processor 13c calculates the score obtained by subtracting 10% of the score from the score of the determined image. Then, the processor 13c adds qualified product images with scores above the calculated score to the maximum number of sheets that can be added (for example, 5 sheets).
[0137] In step SD4, the processor 13c determines whether the number of images of qualified products added in step SD3 is one or more. If the number of images of qualified products added in step SD3 is one or more, the process proceeds to step SD5, and the processor 13c and Fig. 9 In step SB6 of the flowchart shown in the figure, re-learning is similarly performed, verification is performed based on the verification image, and a Pareto chart is generated. On the other hand, if the number of qualified product images added in step SD3 is 0, re-learning cannot be performed, so step SD5 is not passed and step SD6 is entered.
[0138] In step SD6, the processor 13c determines whether the number of defective product images of the verification image is 1 or whether the number of qualified product images of the verification image is 0. If the result of the determination in step SD6 is that the number of defective product images of the verification image is 1, the learning is automatically terminated, and if the number of qualified product images of the verification image is 0, the learning is automatically terminated. On the other hand, if the result of the determination in step SD6 is that the number of defective product images of the verification image is a number other than one, the process proceeds to step SD7, and if the number of qualified product images of the verification image is more than one, the process proceeds to step SD7.
[0139] In step SD7, execute Figure 4 The processing of step SA3 of the flowchart shown in the figure. If it is determined in step SD7 that the qualified product image and the unqualified product image are not separated, the learning is automatically terminated. If it is determined in step SD7 that the qualified product image and the unqualified product image are not separated, the process proceeds to step SD8. In step SD8, the processor 13c extracts the image with the lowest score from the unqualified product images in one verification image.
[0140] In step SD9, it is determined whether 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 to perform defective product learning described later.
[0141] If the number of defective product images added in step SD8 is 0, the process proceeds to step SD11 and the same determination as step SD6 is performed. If the determination result of step SD11 is that the number of defective product images of the verification image is 1, the learning is automatically terminated. If the number of qualified product images of the verification image is 0, the learning is automatically terminated. On the other hand, if the determination result of step SD11 is that the number of defective product images of the verification image is a number other than one, the process proceeds to step SD12. If the number of qualified product images of the verification image is more than one, the process proceeds to step SD12. In step SD12, the same processing as step SD7 is performed.
[0142] If the judgment result of step SD2 is that the difference in the scores of the images classified as defective products is large, then step SD13 is entered. In step SD13, defective product images are extracted according to the prescribed benchmark. Specifically, the processor 13c first determines the image with the lowest score among the defective product images in the verification image. Next, the processor 13c calculates the score obtained by adding 10% of the score to the score of the determined image. Then, the processor 13c extracts defective product images with scores below the calculated score to the maximum number of additional sheets (for example, 5 sheets). However, in the case where the number of defective product images in the verification image is less than 5, not all of them are used for defective product learning, but only one is retained.
[0143] In step SD14, the processor 13c determines whether 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 to perform defective product learning described later. On the other hand, if the number of defective product images extracted in step SD13 is 0, the process proceeds to step SD16 without going through step SD15.
[0144] In steps SD16 and SD17, the same determination as in steps SD6 and SD7 is performed, respectively. In the subsequent step SD18, the processor 13c adds one image having the highest score among the images of conforming products to be used as the verification image.
[0145] In step SD19, it is determined whether the number of conforming product images added in step SD18 is one or more. If the number of conforming product images added in step SD18 is one or more, the process proceeds to step SD20, and the same processing as step SD5 is performed.
[0146] If the number of added conforming product images in step SD18 is 0, the process proceeds to step SD20 and the same process as step SD5 is performed. Thereafter, the process proceeds to steps SD11 and SD12.
[0147] according to Fig.11 According to the flowchart shown in the figure, when the processor 13c determines that the machine learning model needs to be relearned, the processor 13c causes the machine learning model to learn not only the defective product images in steps SD10 and SD15, but also the qualified product images in steps SD5 and SD20. Thus, the machine learning model can be generated in such a manner that features similar to the defective product images that the machine learning model has learned in steps SD10 and SD15 and features different from the qualified product images that the machine learning model has learned in steps SD5 and SD20 are determined as defective parts.
[0148] In addition, according to Fig.11 As shown in the flowchart, when the processor 13c is determining which class a product belongs to, if it is determined that the machine learning model needs to be re-learned, the processor 13c can automatically determine which image, the qualified image or the unqualified image, the machine learning model should learn by comparing the evaluation value of the qualified image with the evaluation value of the unqualified image, so that the machine learning model can learn the image with a higher learning effect.
[0149] (Defective product learning)
[0150] Fig.12 This is a flowchart showing an example of defective product learning. Fig.11 The steps SD10 and SD15 of the flowchart shown in the figure are executed, and the steps SE1 to SE3 are repeated a number of times corresponding to the number of defective product images extracted.
[0151] In step SE1, it is determined whether the user has selected area designation for the defective product image in step 2, that is, whether the user wants to designate defective parts (annotate) for the defective product image. If the user has selected area designation, the process proceeds to step SE2, and the input unit 13b accepts the user's operation for annotation.
[0152] Specifically, the processor 13c extracts a defective product image from a plurality of verification images as an image for relearning the machine learning model, and generates and displays the image on the display device 4. Fig.13 The annotation screen 200 shown is a display screen for accepting the user's designation of a defective portion in the defective product image. When the process proceeds to step SE2, the annotation screen 200 is automatically displayed.
[0153] The annotation screen 200 is provided with: an input image display area 201 for displaying an input image input to the machine learning model; a heat map display area 202 for displaying a heat map output from the machine learning model; 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 input image and the heat map have the same ratio and display the same area. As shown in the figure, by setting a user interface capable of displaying the input image and the heat map side by side, it is easy to grasp the corresponding parts of the two. In addition, the heat map display area 202 can be displayed as needed or omitted.
[0154] The heat map emphasizes the characteristic parts that are different from the qualified product image compared with other parts by using the difference in color and brightness. That is, after the processor 13c determines the characteristic parts that are different from the qualified product images that have been learned for the unqualified product image extracted for relearning the machine learning model from the plurality of verification images, it can generate and display the annotation screen 200 including the heat map on the display device 4 as an image that emphasizes the determined different characteristic parts in the extracted unqualified product image.
[0155] The input image displayed in the input image display area 201 is a defective product image extracted from a plurality of verification images in order to re-learn the machine learning model. However, it is sometimes impossible to understand which area the machine learning model reacts to by only using the input image displayed in the input image display area 201. In this example, a heat map that emphasizes the different feature parts determined is also displayed at the same time, so that the user can understand the area that reacts when the machine learning model is a defective part and the intensity of its reaction by observing the heat map.
[0156] In the area designation unit 203, for example, "area 0", "area 1", "area 2", "area 3", etc. can be designated as a plurality of areas. When the mask area is designated as "area 0", the shape of the area to be designated can be selected. The shape includes, for example, a rectangle, a circle, a polygon, etc., and the user can select it by operating the mouse 52, etc. The selected shape is received by the input unit 13b, and the processor 13c causes the frame 204 having the same shape as the selected shape to be displayed on the input image and the heat map in an overlapping manner.
[0157] The frame 204 is used to designate an unqualified part. The position, size, angle, aspect ratio, etc. of the frame 204 can be changed by the user operating the mouse 52, etc. The user can designate the area surrounded by the frame 204 as an unqualified part by moving the frame 204 in a manner to surround the unqualified part, or 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. If the frame 204 on the input image is operated, the operation is also reflected in the frame 204 on the heat map, and the two frames 204 become the same size and are arranged at the same position. In the case where the frame 204 on the heat map is operated, the operation is reflected in the frame 204 on the input image.
[0158] In order to increase the difference between the scores of qualified products and unqualified products, multiple unqualified product images are sometimes required. If multiple unqualified product images are required, these unqualified product images can be displayed in sequence, and each unqualified product image can be annotated in sequence. For example, when the annotation is performed in the state where the first unqualified product image is displayed, when it is completed, the second unqualified product image is automatically displayed and becomes a state where annotations can be accepted.
[0159] The designation of the defective part is accepted by the input unit 13b. When the designation of the defective part is accepted by the input unit 13b, the processor 13c determines the area surrounded by the frame 204 as the defective part, and stores it in the storage device 19, for example. In step SE3, the processor 13c adds the defective product image whose defective part is determined via the annotation screen 200 to the learning image. In step SE4, the machine learning model is relearned to generate a machine learning model in a manner that determines an image having features similar to the defective part as an image belonging to the defective product category.
[0160] The processor 13c is configured to be able to restart the relearning of the machine learning model according to the user's instruction after the learning process of the machine learning model is completed. Figure 5 The illustrated learning result display user interface screen 150 includes an execution learning button 105. The user's operation of the execution learning button 105 is a user instruction to restart the re-learning of the machine learning model, and the processor 13c accepts the user instruction.
[0161] When receiving an instruction to relearn the machine learning model, the processor 13c inputs a new verification image different from the existing verification image into the machine learning model, and performs processing to classify the new verification image into a plurality of classes. For example, after the image processing device 1 is started, a plurality of workpiece images can be acquired, and these workpiece images can become new verification images. The processor 13c: evaluates the accuracy of the classification processing based on the separation degree of a plurality of classes obtained by the classification processing of the new verification image; if the evaluation result based on the accuracy of the classification processing is evaluated as requiring the relearning of the machine learning model, the verification image with a high possibility of classification error is extracted from the new verification image and the machine learning model is automatically relearned; on the other hand, if it is evaluated as not requiring the relearning of the machine learning model, the learning processing of the machine learning model is completed. Thus, even if a new image is acquired after the learning processing is temporarily completed, the existing machine learning model can be relearned according to the user's instructions, so that the accuracy of the machine learning model can be continuously improved.
[0162] (Selection function of learning model)
[0163] By repeatedly performing relearning of the machine learning model, the accuracy of the machine learning model changes. Figure 6 The figure shows the accuracy of the machine learning model after the first learning. As the number of learning increases to the second and third times, Figure 8 As shown in , the accuracy of the machine learning model has been improved. If the time when the third learning is completed is taken as the benchmark, the third learning is the most recent relearning, and the separation curve obtained in the most recent relearning is shown in Figure 8 The learning stages before the learning stage in which the most recent separation curve graph is obtained are the first learning stage and the second learning stage. If the separation curve graph obtained in the third learning is used as a reference, the separation curve graph obtained in the first learning stage and the separation curve graph obtained in the second learning stage are past separation curve graphs. That is, the processor 13c generates and causes the display device 4 to display Figure 7 , Figure 8 The learning result display user interface screen 150 is a display screen that displays the most recent separation curve graph and the past separation curve graph in a manner that allows comparison. The most recent separation curve graph is obtained by repeatedly performing relearning of the machine learning model, and the past separation curve graph was obtained in a learning stage before the learning stage in which the most recent separation curve graph was obtained. Figure 8 Only the third learning is shown, but there is no particular limit to the number of learning times, as long as the learning is repeated until the desired accuracy is achieved.
[0164] Fig.14FIG. 2 shows an example of a learning progress display screen 250 for displaying the progress of the accuracy of the machine learning model. The learning progress display screen 250 may also be incorporated into Figures 6 to 8 The learning result display user interface screen 150 is shown together with a Pareto chart, etc. Since the learning progress of the machine learning model is shown in the learning progress graph, the user can predict at which learning the machine learning model with the desired accuracy can be obtained by viewing the learning progress graph.
[0165] A graph display area 251 for displaying a learning progress graph is provided on the learning progress display screen 250. The horizontal axis of the learning progress graph represents the number of learning times, and in this example, the number of learning times is represented as 15 times. The vertical axis on the left is the number of images that have been learned, and the vertical axis on the right is the number of images that are misjudged by the machine learning model. As shown in the learning progress graph, the accuracy of the machine learning model is significantly improved in the first to fourth learning times, but the degree of improvement in accuracy decreases after the fifth time, and the number of misjudgments of the twelfth machine learning model is significantly increased compared with the eleventh and thirteenth times. In this way, if the number of learning times is increased, the accuracy may not necessarily improve, and sometimes it may suddenly decrease depending on the image used for learning. By displaying the learning progress graph, the user can grasp the sudden decrease in accuracy, and can avoid the machine learning model of this time, and select and use the machine learning model with higher accuracy in other times when applying. This function is called the learning model selection function.
[0166] Specifically, the processor 13c is configured to accept the user's selection of a past machine learning model corresponding to a past separation curve graph in addition to the most recent machine learning model corresponding to the most recent separation curve graph as the machine learning model used during operation. Fig.14 When the numerical value (number of learning times) on the horizontal axis of the learning transition curve graph shown is displayed, the processor 13c accepts the selection of the machine learning model corresponding to the separation curve graph of the specified number of learning times. "The machine learning model corresponding to the separation curve graph of the specified number of learning times" refers to the machine learning model when the separation curve graph of the specified number of learning times is obtained.
[0167] When the processor 13c receives the selection of the past machine learning model, it determines all the learning images that have been learned by the selected past machine learning model. The learning images that have been learned by the past machine learning model can be stored as learning information in the storage device 19, etc. By reading the learning information, the processor 13c can obtain which learning images were learned by the machine learning model at which time.
[0168] After determining all the learning images that the selected past machine learning model has learned, the processor 13c causes the machine learning model in the initial state before learning to learn all the determined learning images, thereby reproducing the selected past machine learning model. Thus, if the classification processing accuracy of the past machine learning model in the previous learning stage is higher than that of the latest machine learning model that has repeatedly performed relearning, the past machine learning model can be easily reproduced and used.
[0169] In the case of reproducing the past machine learning model, there are a method of not inheriting the machine learning model learned previously and a method of inheriting the machine learning model learned previously, and either method may be used. In the case of not inheriting the machine learning model learned previously, the machine learning model in the initial state is made to learn all the determined learning images. For example, in the case of wanting to reproduce Figure 8 In the case of the third machine learning model shown, the machine learning model obtained through the second learning is not inherited, and the accumulated 5 learning images are input into the machine learning model in the initial state to make it learn.
[0170] On the other hand, when inheriting the machine learning model learned previously, the model obtained in the last learning is made to learn only the newly added images since the last learning. Figure 8 In the case of the third machine learning model shown, the machine learning model obtained through the second learning only learns one learning image added from the second to the third time. In the case of inheriting the previously learned machine learning model, learning is not performed from the initial state, so the total learning time until the automatic learning is completed can be shortened.
[0171] (Three categories)
[0172] Fig.15 This is a diagram showing an example of a learning result display area when three-classification is performed using a machine learning model. The number of images assigned with label 1, the number of images assigned with label 2, and the number of images assigned with label 3 are displayed in the image number display area 151a. In the inference result display area 151c, columns for label 1, label 2, and label 3 are provided for actual and predicted results, respectively. In this way, the learning result when three-classification is performed can also be presented to the user.
[0173] Specifically, if Fig.16As shown in the flowchart. In step SF1, the first image (file name order) of each class is added to the learning image. After repeating the number of times corresponding to the number of classes, in step SF2, the added image is input into the machine learning model for learning and verification. If the verification result is that it has been separated, it is judged as "yes" in step SF3 and ends. If it is not separated, it is judged as "no" in step SF3 and enters step SF4. In step SF4, it is determined whether there is more than one verification image left. It ends when there is not more than one verification image left, and enters step SF5 when there is more than one verification image left. In step SF5, it is determined whether there are misjudged images for all classes. If there is a misjudged class, only one image with the highest score is added to the learning image in that class. If there are multiple misjudged classes, only one image with the highest score is added to the learning image in each class (step SF6). Classes that are not misjudged are not added. After that, step SF2 is entered, and the added image is input into the machine learning model for learning and verification.
[0174] The above-described embodiments are merely illustrative in all respects and should not be interpreted as limiting. Moreover, all modifications and changes within the scope of equivalence of the claims are within the scope of the present invention.
[0175] Industrial Applicability
[0176] As described above, the image processing device and the image processing method according to the present disclosure can be used, for example, when performing appearance inspection of industrial products.
Claims
1. An image processing device, comprising a processor, the processor being configured to perform a classification process of inputting an image into a machine learning model and classifying the image into a plurality of classes, wherein: The processor is configured to: (1) causing the machine learning model to learn a plurality of learning images; (2) inputting a plurality of verification images into the machine learning model that has learned a plurality of learning images, and performing classification processing to classify the plurality of verification images into the plurality of classes; (3) obtaining the separation degrees of the plurality of classes through classification processing of the plurality of verification images, and evaluating the accuracy of the classification processing of the plurality of verification images based on the obtained separation degrees of the plurality of classes; (4) Based on the evaluation results of the accuracy of the classification processing of the multiple verification images, evaluate whether the machine learning model needs to be relearned. If it is evaluated that the machine learning model needs to be relearned, extract verification images with a relatively high possibility of incorrect classification results from the multiple verification images and automatically relearn the machine learning model. On the other hand, if it is evaluated that the machine learning model does not need to be relearned, complete the learning process of the machine learning model.
2. The image processing device according to claim 1, wherein: The processor automatically and repeatedly executes the processes (2) to (4) until it is evaluated that re-learning of the machine learning model is not necessary.
3. The image processing device according to claim 2, wherein: The plurality of classes include a first class and a second class, The plurality of verification images include first-category images to which labels indicating the first category are assigned and second-category images to which labels indicating the second category are assigned, The processor is configured to: In the classification process of classifying the plurality of verification images into the first category and the second category, a first evaluation value indicating the degree to which the plurality of verification images belong to the first category is calculated for each of the plurality of verification images; In a case where it is evaluated that the machine learning model needs to be relearned, extracting the second category images with relatively high first evaluation values or the first category images with relatively low first evaluation values, and causing the machine learning model to automatically relearn; Obtain the degree of separation between the distribution of the first type of image and the second type of image on the first evaluation value axis, and repeatedly perform the processes (2) to (4) until it is evaluated based on the degree of separation that re-learning of the machine learning model is not necessary.
4. The image processing device according to claim 3, wherein: The processor repeatedly executes the processes (2) to (4) until the degree of separation between the distributions of the first type of images and the second type of images on the first evaluation value axis reaches a predetermined value or more.
5. The image processing device according to claim 2, wherein: The plurality of verification images include images of good products to which good product labels are assigned and images of bad products to which bad product labels are assigned, The processor is configured to: In the classification process, an evaluation value indicating a degree of failure is calculated for each of the plurality of verification images; When it is evaluated that the machine learning model needs to be relearned, extracting images of qualified products with relatively high evaluation values or images of unqualified products with relatively low evaluation values, so that the machine learning model is automatically relearned; The degree of separation of the distribution of the conforming product image and the defective product image on the evaluation value axis is obtained, and the processes (2) to (4) are repeatedly performed until the degree of separation reaches a predetermined value or more.
6. The image processing device according to claim 5, wherein: The processor automatically determines, based on the result of comparing the evaluation value of the qualified product image of the multiple verification images with the evaluation value of the unqualified product image, which one of the qualified product image with a relatively higher evaluation value or the unqualified product image with a relatively lower evaluation value is to be extracted as the image for re-learning the machine learning model.
7. The image processing device according to claim 3, wherein: The processor is configured to: In the classification process, a second evaluation value indicating the degree to which each of the plurality of verification images belongs to the second category is further calculated for each of the plurality of verification images; When it is evaluated that re-learning of the machine learning model is required, extracting the first category of images with relatively high second evaluation values or the second category of images with relatively low second evaluation values and causing the machine learning model to automatically re-learn; Obtain the degree of separation between the distribution of the first type of image and the second type of image on the second evaluation value axis, and repeatedly perform the processes (2) to (4) until it is evaluated based on the degree of separation that re-learning of the machine learning model is not necessary.
8. The image processing device according to claim 1, wherein: The processor is configured to: When it is evaluated that re-learning of the machine learning model is necessary, automatically calculating the number of verification images used in the re-learning based on the evaluation result of the accuracy of the classification process; The verification images having the calculated number of images and a relatively high possibility of incorrect classification results are extracted from the plurality of verification images, and the machine learning model is automatically re-learned for the verification images of the calculated number of images.
9. The image processing apparatus according to claim 8, wherein: When the processor evaluates that re-learning of the machine learning model is necessary, it extracts the calculated number of verification images from the multiple verification images in descending order of possibility of incorrect classification results, and causes the machine learning model to automatically re-learn the verification images of the number.
10. The image processing apparatus according to claim 3, wherein: The processor is configured to: After executing the classification process, generating and causing a display unit to display a display screen including a separation curve graph indicating the degree of separation of the distribution of the first category image and the second category image on the first evaluation value axis; Whenever the relearning of the machine learning model is repeatedly performed, the separation curve graph is updated to the separation curve graph obtained by the relearned machine learning model, and a display screen is generated and displayed on the display unit in a manner that allows the latest separation curve graph obtained by the update to be compared with the past separation curve graphs.
11. The image processing apparatus according to claim 10, wherein: The processor: A configuration is provided in which a display screen showing a recent separation curve graph and a past separation curve graph in a manner that allows comparison is made between the display unit and the user is accepted to select a past machine learning model corresponding to the past separation curve graph, the recent separation curve graph being obtained by repeatedly performing re-learning of the machine learning model, and the past separation curve graph being obtained in a learning stage before the learning stage in which the recent separation curve graph is obtained, as the machine learning model used in operation; When the selection of the past machine learning model is accepted, all learning images that have been learned by the selected past machine learning model are determined, and the machine learning model in the initial state before the learning starts is made to learn all the determined learning images, thereby reproducing the selected past machine learning model.
12. The image processing apparatus according to claim 1, wherein: The processor: After the learning process of the machine learning model is completed, the machine learning model can be re-learned according to the user's instructions; Inputting a new verification image different from an existing verification image into the machine learning model, and performing a process of classifying the new verification image into the plurality of classes; evaluating the accuracy of the classification process based on the separation degrees of the plurality of classes obtained by the classification process on the new verification image; If the evaluation result based on the accuracy of the classification processing determines that the machine learning model needs to be relearned, a verification image with a higher possibility of incorrect classification results is extracted from the new verification images, and the machine learning model is automatically relearned. On the other hand, if it is evaluated that the machine learning model does not need to be relearned, the learning process of the machine learning model is completed.
13. The image processing apparatus according to claim 1, wherein: The processor is configured to be able to select the following two processes: Preserving labels related to classification of existing learning images and verification images used in learning the machine learning model in use, and adding new images acquired after the start of use to the existing learning images to process additional learning images; and Each label related to the classification of existing learning images and verification images used in the learning of the machine learning model in use is initialized, and the machine learning model is made to learn the processing of all images including new images acquired after the start of the use.
14. The image processing apparatus according to claim 1, wherein: After evaluating that re-learning of the machine learning model is not necessary and completing the learning process of the machine learning model, the processor inputs a plurality of evaluation images different from the plurality of learning images and the plurality of verification images into the machine learning model, performs classification processing for dividing the plurality of evaluation images into the plurality of classes, and evaluates the accuracy of the classification processing.
15. An image processing method for inputting an image into a machine learning model and classifying the image into a plurality of classes, the image processing method comprising the following steps: (1) causing the machine learning model to learn a plurality of learning images; (2) inputting a plurality of verification images into the machine learning model that has learned a plurality of learning images, and performing classification processing to classify the plurality of verification images into the plurality of classes; (3) obtaining the separation degrees of the plurality of classes through classification processing of the plurality of verification images, and evaluating the accuracy of the classification processing of the plurality of verification images based on the obtained separation degrees of the plurality of classes; (4) Based on the evaluation results of the accuracy of the classification processing of the multiple verification images, evaluate whether the machine learning model needs to be relearned. If it is evaluated that the machine learning model needs to be relearned, extract verification images with a relatively high possibility of incorrect classification results from the multiple verification images and automatically relearn the machine learning model. On the other hand, if it is evaluated that the machine learning model does not need to be relearned, complete the learning process of the machine learning model.
