The present invention relates to an image processing method, image processing apparatus, and program.
Creating a model by machine-learning a great amount of data and automatically determining various phenomena using this model has become a practice in various fields in recent years. For example, such a model is used to determine at the production side whether a product is normal or defective, based on an image of the product. As a more specific example, such a model is used to check whether a “flaw,” “dent,” “bubble crack,” or the like is present on the coated surface of the product.
On the other hand, creating an accurate model by machine learning requires causing the model to learn a great amount of teacher data. However, creating a great amount of teacher data disadvantageously requires high cost. Moreover, the quality of teacher data influences the accuracy of machine learning and therefore high-quality teacher data has to be created even if the amount of teacher data is small. Creating high-quality teacher data also disadvantageously requires high cost.
Patent document 1: Japanese Patent No. 6059486
Patent Document 1 describes a technology related to facilitation of creation of teacher data used to classify a single image. However, unlike creating teacher data used to classify a single image, creating teacher data used to specify the category of the shape of a specific area in an image requires very high cost. That is, even if the shape of an object in an image is complicated, an operator who creates teacher data has to specify an accurate area, disadvantageously resulting in very high work cost. Not only creation of teacher data as described above but also image creation involving work, such as specification of a certain area in an image evaluated using a model, disadvantageously requires high work cost.
Accordingly, an object of the present invention is to solve the above disadvantage, that is, the disadvantage that image creation involving work, such as specification of an area in an image, requires high cost.
An image processing method according to an aspect of the present invention includes evaluating a confidence level of each of categories in an evaluation area of an input image using a model for evaluating categories in a predetermined area of a predetermined image, extracting a confidence level of a selection category in a selection area including the evaluation area of the input image, the selection category being a selected category, the selection area being a selected area, and setting an area corresponding to the selection category in the input image based on the confidence level of the selection category.
An image processing apparatus according to another aspect of the present invention includes an evaluator configured to evaluate a confidence level of each of categories in an evaluation area of an input image using a model for evaluating categories in a predetermined area of a predetermined image and an area setting unit configured to extract a confidence level of a selection category in a selection area including the evaluation area of the input image, the selection category being a selected category, the selection area being a selected area, and to set an area corresponding to the selection category in the input image based on the confidence level of the selection category.
A program according to yet another aspect of the present invention is a program for implementing, in an information processing apparatus, an evaluator configured to evaluate a confidence level of each of categories in an evaluation area of an input image using a model for evaluating categories in a predetermined area of a predetermined image and an area setting unit configured to extract a confidence level of a selection category in a selection area including the evaluation area of the input image, the selection category being a selected category, the selection area being a selected area, and to set an area corresponding to the selection category in the input image based on the confidence level of the selection category.
The present invention thus configured is able to suppress the cost of image creation involving work of specifying an area in an image.
A first example embodiment of the present invention will be described with reference to
An image processing apparatus 10 according to the present invention is an apparatus for creating a learning model (model) that detects defective portions in an image by performing machine learning using teacher data consisting of an image, which are previously prepared learning data. The image processing apparatus 10 is also an apparatus for assisting in creating teacher data used to create such a learning model.
In the present embodiment, it is assumed that a learning model is created that when visually checking a product, detects defective portions, such as “flaws,” “dents” or “bubble cracks,” from an image of the coated surface of the product. It is also assumed that teacher data is created that includes the areas of defective portions, such as “flaws,” “dents,” or “bubble cracks,” present in the image of the coated surface of the product and categories representing the types of the defective portions.
Note that the image processing apparatus 10 need not necessarily create the above-mentioned type of learning model and may create any type of learning model. Also, the image processing apparatus 10 need not have the function of creating a learning model and may have only the function of assisting in creating teacher data. Also, the image processing apparatus 10 need not be used to assist in creating the above-mentioned type of teacher data and may be used to assist in creating any type of image.
The image processing apparatus 10 includes one or more information processing apparatuses each including an arithmetic logic unit and a storage unit. As shown in
The teacher data storage unit 16 is storing teacher data, which is learning data used to create a learning model. The “teacher data” consists of information obtained by combining “teacher image” (input image) and “teaching data” prepared by the operator. For example, the “teacher image” include a photographic image of the coated surface of a product as shown in
The teacher data storage unit 16 is storing one or more pieces of “teacher data” previously created by the operator. Also, as will be described later, the teacher data storage unit 16 will store “teacher data” newly created later with the assistance of the image processing apparatus 10.
The learning unit 11 creates a learning model by learning the above “teacher data” stored in the teacher data storage unit 16 using a machine learning technique. In the present embodiment, the learning unit 11 uses the teacher image of the teacher data as input image and learns what category of defective portion is present in what area of the input image, in accordance with the teaching data. Thus, the learning unit 11 creates a learning model that when receiving an input image provided with no teaching data, outputs the categories and areas of defective portions present in the input image. The learning unit 11 then stores the created model in the model storage unit 17. Note that it is assumed that the learning unit 11 has previously created a learning model by learning “teacher data” prepared by the operator and stored the created learning model in the model storage unit 17.
Also, as will be described later, the learning unit 11 will update the learning model by further learning “teacher data” newly created later with the assistance of the image processing apparatus 10 and then store the updated learning model in the model storage unit 17.
The evaluator 12 evaluates teacher data stored in the teacher data storage unit 16 using a learning model stored in the model storage unit 17. Specifically, the evaluator 12 first inputs the teacher image of teacher data selected by the operator to a learning model and predicts the categories of defective portions present in the teacher image. At this time, the evaluator 12 outputs the confidence level at which each of pixels in the teacher image is determined to be each category. For example, as shown in
When the teaching data editor 13 (area setting unit) receives the teacher data edit assistance request from the operator, it receives selection of an area to be edited in the teacher image and selection of the category in this area from the operator. For example, the teaching data editor 13 receives, as a selection area, an area shown by reference sign R100 in the teacher image inputted by the operator using the input unit 20 as shown in
The area calculator 14 (area setting unit) extracts the selection area and the confidence level of the selection category selected by the teaching data editor 13 from the confidence level graph outputted by the evaluator 12. That is, as shown in
The area calculator 14 then calculates and sets an area corresponding to the category “flaw,” which is the selection category, in the teacher image based on the extracted confidence level graph of the category “flaw” C101. Specifically, as shown in
Each time the threshold value is controlled and changed by the threshold controller 15, the area calculator 14 calculates and sets a teaching area. Then, as shown in
The threshold controller 15 (threshold operation unit) provides an operation unit that when operated by the operator, changes the threshold. In the present embodiment, the threshold controller 15 provides a slider U100 displayed on the display screen along with the teacher image having the teaching areas R101 and 102 set thereon, as shown in
Next, operations of the image processing apparatus 10 will be described mainly with reference to the flowcharts of
First, referring to
A process S200 shown in
A process S300 shown in
A process S400 shown in
A process S500 shown in
The processes in the above-mentioned steps S501 to S504 will be described with reference to
First, in step S501, the image processing apparatus 10 evaluates the teacher image. Here, it is assumed that the confidence level graph shown in
At this time, the operator selects the category “flaw,” sets the processing mode to the assistance mode, and selects the selection area R100 surrounding the periphery of the “flaw” A100 on the teacher image shown in
As described above, the confidence levels shown in
Then, by operating the slider U100 displayed on the display screen, the operator changes and controls the threshold so that the teaching area of the category “flaw” becomes an area having confidence levels equal to or greater than the predetermined threshold T101. Specifically, in step S504, when the operator moves the control of the slider U100, the image processing apparatus 10 changes the threshold in accordance with the position of the control. Then, as shown in
As seen above, the present invention evaluates the confidence level of the category of each of the pixels in the input image, extracts only the confidence level of the selection category in the selection area from these confidence levels, and sets the area based on the extracted confidence level. Thus, the present invention is able to obtain image data in which a proper area corresponding to a certain category is set and to create teacher data used to create a model, at low cost. The present invention is also able to perform image data creation involving work of specifying an area with respect to an image, at low cost. The present invention is also able to input image data to the learning model and to modify the category and area with respect to the output result.
While the example in which the image processing apparatus according to the present invention is used to perform inspection or visual check of a product in the industrial field has been described, the image processing apparatus can also be used to identify or diagnose a symptom or case using images in the medical field, as well as to extract or divide an area in an image in meaningful units, for example, in units of objects.
Next, a second example embodiment of the present invention will be described with reference to
First, a hardware configuration of an image processing apparatus 100 according to the present example embodiment will be described with reference to
When the CPU 101 acquires and executes the programs 104, an evaluator 121 and an area setting unit 122 shown in
The hardware configuration of the information processing apparatus serving as the image processing apparatus 100 shown in
The image processing apparatus 100 performs an image processing method shown in the flowchart of
As shown in
evaluates the confidence levels of categories in the evaluation area of an input image using a model for evaluating categories in a predetermined area of a predetermined image (step S1);
evaluates the confidence level of the selection category, which is a selected category in the selection area, which is a selected area including the evaluation area of the input image (step S2); and
sets an area corresponding to the selection category in the input image based on the confidence level of the selection category (step S3).
The present invention thus configured evaluates the confidence level of the category of each of the pixels in the input image, extracts only the confidence level of the selection category in the selection area from the confidence levels, and sets the area based on the extracted confidence level. Thus, the present invention is able to obtain image data in which a proper area corresponding to a certain category is set and to create an image at low cost.
The above programs may be stored in various types of non-transitory computer-readable media and provided to a computer. The non-transitory computer-readable media include various types of tangible storage media. The non-transitory computer-readable media include, for example, a magnetic recording medium (for example, a flexible disk, a magnetic tape, a hard disk drive), a magneto-optical recording medium (for example, a magneto-optical disk), a CD-ROM (read-only memory), a CD-R, a CD-R/W, and a semiconductor memory (for example, a mask ROM, a PROM (programmable ROM), an EPROM (erasable PROM), a flash ROM, a RAM (random-access memory)). The programs may be provided to a computer by using various types of transitory computer-readable media. The transitory computer-readable media include, for example, an electric signal, an optical signal, and an electromagnetic wave. The transitory computer-readable media can provide the programs to a computer via a wired communication channel such as an electric wire or optical fiber, or via a wireless communication channel.
While the present invention has been described with reference to the example embodiments and so on, the present invention is not limited to the example embodiments described above. The configuration or details of the present invention can be changed in various manners that can be understood by one skilled in the art within the scope of the present invention.
The present invention is based upon and claims the benefit of priority from Japanese Patent Application 2019-051168 filed on Mar. 19, 2019 in Japan, the disclosure of which is incorporated herein in its entirety by reference.
Some or all of the example embodiments can be described as in Supplementary Notes below. While the configurations of the image processing method, image processing apparatus, and program according to the present invention are outlined below, the present invention is not limited thereto.
An image processing method comprising:
evaluating a confidence level of each of categories in an evaluation area of an input image using a model for evaluating categories in a predetermined area of a predetermined image;
extracting a confidence level of a selection category in a selection area including the evaluation area of the input image, the selection category being a selected category, the selection area being a selected area; and
setting an area corresponding to the selection category in the input image based on the confidence level of the selection category.
The image processing method of Supplementary Note 1, wherein
the evaluating the confidence levels comprises evaluating a confidence level of each of categories of each of pixels in the evaluation area of the input image using the model,
the extracting the confidence level comprises extracting the confidence level of the selection category in the selection area of the input image for each of pixels in the selection area, and
the setting the area comprises setting the area in the input image based on the confidence level of the selection category of each of the pixels in the selection area.
The image processing method of Supplementary Note 2, wherein pixel having confidence level of the selection category equal to or greater than a threshold among the pixels in the selection area are set as the area in the input image.
The image processing method of Supplementary Note 3, wherein
the threshold is changed in accordance with an operation from outside, and
a pixels having confidence level of the selection category of equal to or greater than the changed threshold among he pixels in the selection area is set as the area in the input image.
The image processing method of Supplementary Note 3 or 4, further comprising display-outputting area information indicating the area set in the input image to a display screen along with an input screen.
The image processing method of Supplementary Note 5, further comprising display-outputting, to the display screen, an operation device operable to change the threshold, wherein
a pixel having confidence levels of the selection category equal to or greater than the threshold changed by operating the operation device among the pixels in the selection area is set as the area in the input image and the area information indicating the area is display-outputted to the display screen along with the input screen.
The image processing method of any one of Supplementary Notes 1 to 6, further comprising updating the model by inputting the input image, area information indicating the area set in the input image, and the selection category corresponding to the area to the model as teacher data and performing machine learning.
An image processing apparatus of Supplementary Note 8:
an evaluator configured to evaluate a confidence level of each of categories in an evaluation area of an input image using a model for evaluating categories in a predetermined area of a predetermined image; and
an area setting unit configured to extract a confidence level of a selection category in a selection area including the evaluation area of the input image, the selection category being a selected category, the selection area being a selected area, and to set an area corresponding to the selection category in the input image based on the confidence level of the selection category.
The image processing apparatus of Supplementary Note 8, wherein
the evaluator evaluates a confidence level of each of categories of each of pixels in the evaluation area of the input image using the model, and
the area setting unit extracts the confidence level of the selection category in the selection area of the input image for each of pixels in the selection area and sets the area in the input image based on the confidence level of the selection category of each of the pixels in the selection area.
The image processing apparatus of Supplementary Note 8.1, wherein the area setting unit sets, as the area in the input image, a pixel having confidence levels of the selection category equal to or greater than a threshold among the pixels in the selection area.
The image processing apparatus of Supplementary Note 8.2, further comprising a threshold operation unit configured to change the threshold in accordance with an operation from outside, wherein the area setting unit sets, as the area in the input image, a pixel having confidence levels of the selection category equal to or greater than the changed threshold among the pixels in the selection area.
The image processing apparatus of Supplementary Note 8.2 or 8.3, further comprising a display controller configured to display-output, to a display screen, area information indicating the area set in the input image along with an input screen.
The image processing apparatus of Supplementary Note 8.4, further comprising a threshold operation unit configured to display-output, to the display screen, an operation device operable to change the threshold, wherein
the area setting unit sets, as the area in the input image, a pixel having confidence levels of the selection category equal to or greater than the threshold changed by operating the operation device among the pixels in the selection area, and
the display controller display-outputs, to the display screen, the area information indicating the area set in the input image along with the input screen.
The image processing apparatus of any one of Supplementary Notes 8 to 8.6, further comprising a learning unit configured to update the model by inputting the input image, area information indicating the area set in the input image, and the selection category corresponding to the area to the model as teacher data and performing machine learning.
A non-transitory computer-readable storage medium storing a program for implementing, in an information processing apparatus:
an evaluator configured to evaluate a confidence level of each of categories in an evaluation area of an input image using a model for evaluating categories in a predetermined area of a predetermined image; and
an area setting unit configured to extract a confidence level of a selection category in a selection area including the evaluation area of the input image, the selection category being a selected category, the selection area being a selected area, and to set an area corresponding to the selection category in the input image based on the confidence level of the selection category.
Number | Date | Country | Kind |
---|---|---|---|
2019-051168 | Mar 2019 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2020/009055 | 3/4/2020 | WO | 00 |