JP7404817B2 - Learning device, detection device, learning method, and learning program - Google Patents

Learning device, detection device, learning method, and learning program Download PDF

Info

Publication number
JP7404817B2
JP7404817B2 JP2019214618A JP2019214618A JP7404817B2 JP 7404817 B2 JP7404817 B2 JP 7404817B2 JP 2019214618 A JP2019214618 A JP 2019214618A JP 2019214618 A JP2019214618 A JP 2019214618A JP 7404817 B2 JP7404817 B2 JP 7404817B2
Authority
JP
Japan
Prior art keywords
image
images
additional
learning
evaluation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2019214618A
Other languages
Japanese (ja)
Other versions
JP2021086382A (en
Inventor
博幸 枦山
泰之 池田
健利 松田
紫朗 藤枝
真嗣 栗田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Corp filed Critical Omron Corp
Priority to JP2019214618A priority Critical patent/JP7404817B2/en
Publication of JP2021086382A publication Critical patent/JP2021086382A/en
Application granted granted Critical
Publication of JP7404817B2 publication Critical patent/JP7404817B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本開示は、学習装置、検出装置、学習方法、及び学習プログラムに関する。 The present disclosure relates to a learning device, a detection device, a learning method, and a learning program.

近年、製造ライン等の製品を製造する場面では、製造される製品を撮影装置により撮影し、得られた観測画像に基づいて製品の良否を自動的に検査する技術の開発が進んでいる。良品および不良品の両方のサンプルが複数存在する場合、良品の写る画像(以下、良品画像と記載する。)および不良品の写る画像(以下、不良品画像と記載する。)を用いた機械学習を行なうことにより得られた識別器によって、製品の良否を判定できる。しかしながら、通常、良品に比べ不良品を多く集めることが困難である。そのため、複数の良品画像を用いた機械学習により得られた生成モデルによって良否を判定する技術が開発されている(非特許文献1~3)。 2. Description of the Related Art In recent years, in production scenes such as production lines, technology has been developed to photograph the manufactured products using a photographing device and automatically inspect the quality of the products based on the obtained observation images. When there are multiple samples of both non-defective products and defective products, machine learning using images of non-defective products (hereinafter referred to as non-defective product images) and images of defective products (hereinafter referred to as defective product images) The quality of the product can be determined using the discriminator obtained by performing this process. However, it is usually difficult to collect more defective products than good products. For this reason, techniques have been developed for determining quality using a generative model obtained by machine learning using a plurality of images of non-defective products (Non-Patent Documents 1 to 3).

Bergmann、他4名、“Improving Unsupervised Defect Segmentation by Applying Structural Similarity To Autoencoders”、arXiv:1807.02011v3、2019年2月1日Bergmann, et al., “Improving Unsupervised Defect Segmentation by Applying Structural Similarity To Autoencoders”, arXiv:1807.02011v3, February 1, 2019. Schlegl、他4名、“Unsupervised Anomaly Detection with Generative Adversarial Networks to Guide Marker Discovery”、arXiv:1703.05921v1、2017年3月17日Schlegl, et al., “Unsupervised Anomaly Detection with Generative Adversarial Networks to Guide Marker Discovery”, arXiv:1703.05921v1, March 17, 2017. 豊田健太、堀田一弘、「部分空間法とロバスト統計を用いた不良箇所の自動特定」、SSII2016、IS3-22、2016年6月10日Kenta Toyota, Kazuhiro Hotta, "Automatic identification of defective locations using subspace method and robust statistics", SSII2016, IS3-22, June 10, 2016

非特許文献1~3の検出方法では、与えられた画像を特徴量に変換し、変換により得られた特徴量から与えられた画像を復元した画像を生成する生成モデルが利用される。この生成モデルには、ニューラルネットワーク、主成分分析により導出される固有ベクトル等の機械学習モデルを用いることができる。生成モデルは、機械学習により、学習画像が与えられると、与えられた学習画像に適合する復元画像を生成するように訓練される。この訓練の結果として、生成モデルは、学習画像に写る特徴については再現性が高く、学習画像に写る可能性の低い(例えば、可能性のない)他の特徴については再現性の低い復元画像を生成する能力を獲得する。 The detection methods in Non-Patent Documents 1 to 3 use a generation model that converts a given image into a feature amount and generates an image that is a restored image of the given image from the feature amount obtained by the conversion. As this generation model, a machine learning model such as a neural network or an eigenvector derived by principal component analysis can be used. A generative model is trained by machine learning to generate a restored image that matches the given training image when it is given a training image. As a result of this training, the generative model produces reconstructed images that have high reproducibility for features that appear in the training images and less reproducibility for other features that are unlikely to appear in the training images (e.g., have no chance). Acquire the ability to generate.

そのため、欠陥のない製品の写る良品画像を学習画像として使用して、上記のとおりに生成モデルを訓練することで、生成モデルは、欠陥の有無を問わず、製品の写る画像が与えられると、与えられた画像に写る製品の欠陥のない状態を再現した(又は、欠陥については再現性の低い)復元画像を生成する能力を獲得することができる。この能力を獲得した結果、観測画像に写る製品に欠陥が含まれている場合に、訓練された生成モデルにより生成された復元画像と観測画像との間において、その欠陥の存在する領域に差異が生じる。よって、訓練された生成モデルにより生成された復元画像と観測画像との間の差分に基づいて、欠陥の有無を検出することができる。 Therefore, by training a generative model as described above using images of non-defective products as training images, the generative model will be able to: It is possible to obtain the ability to generate a restored image that reproduces the defect-free state of the product depicted in a given image (or with less reproducibility in terms of defects). As a result of acquiring this ability, when a defect is included in a product shown in an observed image, there will be a difference in the area where the defect exists between the restored image generated by the trained generative model and the observed image. arise. Therefore, the presence or absence of a defect can be detected based on the difference between the restored image generated by the trained generative model and the observed image.

本件発明者らは、このような従来の検出方法では、次のような問題点があることを見出した。すなわち、生成モデルの機械学習に使用する学習画像の数が少ないと、生成モデルの獲得する、与えられた画像に写る製品を再現した(又は、欠陥については再現性の低い)復元画像を生成する能力が不十分になってしまう可能性がある。当該能力の不十分な生成モデルに欠陥のない製品の写る観測画像が与えられると、当該生成モデルにより生成された復元画像において、当該観測画像に写る製品の状態が正しく再現されない領域が生じ得る。そのため、観測画像と復元画像との間において、この製品の状態が正しく再現されていない領域に差異が生じてしまい、観測画像に写る製品に欠陥が存在しないにも関わらず、当該製品に欠陥が存在すると誤検出してしまう可能性がある。また、欠陥のある製品の写る観測画像が与えられた場合でも、観測画像と復元画像との間において、その欠陥の写る領域(真の不良箇所)以外の領域に差異が生じてしまい、不良箇所を誤検出してしまう可能性がある。 The inventors of the present invention have discovered that such conventional detection methods have the following problems. In other words, if the number of training images used for machine learning of the generative model is small, the generative model will generate a restored image that reproduces the product in the given image (or has low reproducibility for defects). There is a possibility that the ability will be insufficient. If a generative model with insufficient ability is given an observed image of a product without defects, there may be areas in the restored image generated by the generative model where the state of the product shown in the observed image is not correctly reproduced. As a result, there are differences between the observed image and the restored image in areas where the state of the product is not correctly reproduced, and even though there is no defect in the product shown in the observed image, the product may be defective. If it exists, there is a possibility of false detection. Furthermore, even if an observation image showing a product with a defect is given, there will be a difference between the observed image and the restored image in areas other than the area where the defect is shown (the true defect location), resulting in the defect location being may be falsely detected.

一方で、生成モデルの機械学習に使用する学習画像の数が過剰であると、当該機械学習の処理時間及び機械学習に使用されるマシン資源(例えば、CPU、メモリ)が膨大になってしまう。そのため、機械学習の処理コストが増大してしまうという問題点が生じる。加えて、生成モデルの獲得する、与えられた画像に写る製品の状態を再現する能力が過剰になってしまう、すなわち、生成モデルにより生成される復元画像において、欠陥(不良箇所)の再現性が高くなってしまう。例えば、ランダムなパターンの写る大量の学習画像を生成モデルの機械学習に使用した場面を想定する。この場合、生成モデルは、ランダムなパターンの復元を学習することで、どのようなパターンが与えられても、そのパターンを忠実に再現する能力を獲得してしまう。このように与えられた画像に写る製品の状態を再現する能力が過剰になってしまうと、観測画像に写る製品に欠陥が存在する場合に、生成モデルにより生成される復元画像にその欠陥の不良箇所が高精度に再現されてしまう。その結果、観測画像と復元画像との間に差異が生じなくなってしまい(すなわち、不良箇所が打ち消しあってしまい)、当該不良箇所を検出するのが困難になってしまうという問題点が生じる。 On the other hand, if the number of training images used for machine learning of the generative model is excessive, the processing time for the machine learning and the machine resources (for example, CPU, memory) used for the machine learning will become enormous. Therefore, a problem arises in that the processing cost of machine learning increases. In addition, the ability of the generative model to reproduce the state of the product that appears in the given image becomes excessive.In other words, the reproducibility of defects (defective parts) in the restored image generated by the generative model becomes excessive. It gets expensive. For example, assume that a large number of training images containing random patterns are used for machine learning of a generative model. In this case, by learning how to reconstruct random patterns, the generative model acquires the ability to faithfully reproduce any given pattern. If the ability to reproduce the state of the product shown in a given image becomes excessive, if there is a defect in the product shown in the observed image, the restored image generated by the generative model will show that defect. The location is reproduced with high precision. As a result, there arises a problem in that there is no difference between the observed image and the restored image (that is, the defective locations cancel each other out), making it difficult to detect the defective locations.

したがって、観測画像と復元画像との差分に基づいて不良箇所を検出する精度を高めるためには、与えられた画像に写る製品を再現した(又は、欠陥については再現性の低い)復元画像を生成する能力を生成モデルが獲得するように、学習に用いる画像を適切に選択することが望まれる。しかしながら、従来の方法では、この学習に用いる画像は、人手による試行錯誤の結果に基づいて決定されている。そのため、欠陥の検出に利用する生成モデルの機械学習に使用する学習画像の選択にコストがかかるという問題点がある。なお、この問題点は、製品の欠陥を検出する場面にだけではなく、対象の画像から何らかの特徴を検出するあらゆる場面で生じ得る。例えば、所定の対象物が観測画像に写っているか否かを検出する場面において、上記生成モデルを利用する場合に、人手による試行錯誤では、所定の対象物を適切に検出可能なように、生成モデルの機械学習に使用する画像の選択にコストがかかるという問題点が生じ得る。 Therefore, in order to improve the accuracy of detecting defective parts based on the difference between the observed image and the restored image, it is necessary to generate a restored image that reproduces the product shown in the given image (or with low reproducibility for defects). It is desirable to appropriately select images used for learning so that the generative model acquires the ability to However, in conventional methods, the images used for this learning are determined based on the results of manual trial and error. Therefore, there is a problem in that it is costly to select learning images used for machine learning of a generative model used for detecting defects. Note that this problem may occur not only when detecting defects in a product, but also in any situation where some feature is detected from an image of an object. For example, when using the above-mentioned generative model to detect whether or not a predetermined object appears in an observation image, manual trial and error cannot be used to generate A problem may arise in that selecting images to be used for machine learning of a model is costly.

本開示は、このような実情を鑑みてなされたものであり、その目的は、学習に用いる画像を適切に選択することで生成モデルの性能を高める技術を提供することである。 The present disclosure has been made in view of these circumstances, and its purpose is to provide a technique for improving the performance of a generative model by appropriately selecting images used for learning.

本開示の一例によれば、学習装置は、第1取得部と、学習部と、第2取得部と、生成部と、評価部と、抽出部と、追加学習部とを備える。第1取得部は、所定の特徴の写る1つ以上の第1学習画像を取得する。学習部は、1つ以上の第1学習画像を使用して、生成モデルの機械学習を実施する。生成モデルは、画像が与えられると、与えられた画像を特徴量に変換し、特徴量から与えられた画像を復元した画像を生成するように構成される。学習部は、機械学習により、1つ以上の第1学習画像それぞれが与えられると、与えられた1つ以上の第1学習画像それぞれに適合する復元画像を生成するように生成モデルを訓練する。第2取得部は、所定の特徴の写る複数の追加用画像を取得する。生成部は、複数の追加用画像それぞれを生成モデルに与えることで、複数の画像それぞれを復元した複数の復元画像それぞれを生成する。評価部は、各追加用画像及び生成された各復元追加用画像の間の差分に応じて、各追加用画像の評価値であって、各復元追加用画像における各追加用画像の復元の程度に対する評価値を算出する。抽出部は、算出された評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像を複数の追加用画像から抽出する。追加学習部は、機械学習により、抽出された1つ以上の追加用画像に含まれる1つ以上の第2学習画像それぞれが与えられると、与えられた1つ以上の第2学習画像それぞれに適合する復元画像を生成するように生成モデルを更に訓練する。 According to an example of the present disclosure, a learning device includes a first acquisition unit, a learning unit, a second acquisition unit, a generation unit, an evaluation unit, an extraction unit, and an additional learning unit. The first acquisition unit acquires one or more first learning images showing predetermined features. The learning unit performs machine learning of the generative model using one or more first learning images. The generative model is configured to, when an image is given, convert the given image into a feature amount, and generate an image in which the given image is restored from the feature amount. The learning unit trains the generative model by machine learning so that when each of the one or more first learning images is given, it generates a restored image that matches each of the one or more given first learning images. The second acquisition unit acquires a plurality of additional images showing predetermined characteristics. The generation unit generates each of the plurality of restored images by restoring each of the plurality of images by supplying each of the plurality of additional images to the generation model. The evaluation unit calculates an evaluation value of each additional image according to the difference between each additional image and each generated restored additional image, and determines the degree of restoration of each additional image in each restored additional image. Calculate the evaluation value for. The extraction unit extracts one or more additional images that are evaluated as having a low degree of restoration from the plurality of additional images based on the calculated evaluation value. By machine learning, when each of the one or more second learning images included in the one or more extracted additional images is given, the additional learning unit adapts to each of the one or more given second learning images. The generative model is further trained to generate a restored image.

まず、学習装置は、所定の特徴の写る1つ以上の第1学習画像を使用して、生成モデルの機械学習を実施する。第1学習画像の件数は、例えば、1件~数件等のように、機械学習の処理コストが膨大にならない(すなわち、過剰ではない)程度に適宜選択されてよい。これにより、生成モデルは、第1学習画像を特徴量に変換し、変換により得られた特徴量から第1学習画像に適合する復元画像を生成するように訓練される。つまり、所定の特徴の写る入力画像が与えられたときに、学習画像に写る可能性の低い又は写っていない所定の特徴以外の他の特徴が入力画像に写っているか否かに関わらず、与えられた入力画像に対して所定の特徴の写る復元画像を生成する能力を獲得した学習済みの学習モデルが暫定的に構築される。 First, the learning device performs machine learning of a generative model using one or more first learning images in which predetermined features are captured. The number of first learning images may be selected as appropriate, such as from one to several, to the extent that the processing cost of machine learning does not become enormous (that is, not excessive). Thereby, the generative model is trained to convert the first learning image into a feature amount and generate a restored image that matches the first learning image from the feature amount obtained by the conversion. In other words, when an input image containing a predetermined feature is given, regardless of whether or not other features other than the predetermined feature that are unlikely to appear in the training image or are not included in the training image appear in the input image, A trained learning model that has acquired the ability to generate a restored image with predetermined features from the input image is provisionally constructed.

次に、学習装置は、それぞれ所定の特徴の写る複数の追加用画像を取得する。取得された各追加用画像は、生成モデルの更なる機械学習(追加学習)に使用される学習画像の候補である。学習済みの生成モデルの有する、所定の特徴の写る画像を再現する能力が十分であれば、追加用画像が与えられたときに、学習済みの生成モデルは、与えられた追加用画像に適合する復元画像を生成するはずである。一方で、所定の特徴の写る画像を再現する能力が不十分であれば、学習済みの生成モデルは、与えられた追加用画像に不適合な(すなわち、不一致な)復元画像を生成するはずである。 Next, the learning device acquires a plurality of additional images each showing a predetermined feature. Each acquired additional image is a training image candidate used for further machine learning (additional learning) of the generative model. If the trained generative model has sufficient ability to reproduce images with predetermined features, then when an additional image is given, the trained generative model will adapt to the given additional image. It should generate a restored image. On the other hand, if the ability to reproduce images with predetermined features is insufficient, the trained generative model should generate restored images that are unsuitable (i.e., incongruent) with the given additional image. .

そこで、学習装置は、取得された各追加用画像を生成モデルに与えることで、各追加用画像を復元した各復元追加用画像を生成する。そして、学習装置は、各追加用画像と各復元追加用画像との間の差分に応じて、各復元追加用画像における各追加用画像の復元の程度に対する評価値を各追加用画像について算出する。 Therefore, the learning device generates each restored additional image by restoring each additional image by giving each acquired additional image to the generation model. Then, the learning device calculates, for each additional image, an evaluation value for the degree of restoration of each additional image in each restored additional image, according to the difference between each additional image and each restored additional image. .

追加用画像と復元追加用画像との差分が大きいほど、復元追加用画像における追加用画像の復元の程度が低い、すなわち、このような追加用画像に対する生成モデルの機械学習が不十分であることを示す。そのため、復元追加用画像との差分が大きい、換言すると、復元の程度の低い追加用画像は、所定の特徴の写る画像を再現する生成モデルの能力の適切な向上に貢献する可能性が高い。 The larger the difference between the additional image and the restored additional image, the lower the degree of restoration of the additional image in the restored additional image, that is, the machine learning of the generative model for such an additional image is insufficient. shows. Therefore, an additional image that has a large difference from the restored additional image, in other words, an additional image that has been restored to a low degree, is highly likely to contribute to appropriately improving the ability of the generative model to reproduce an image with predetermined characteristics.

一方で、追加用画像と復元追加用画像との差分が小さいほど、復元追加用画像における追加用画像の復元の程度が高い、すなわち、当該追加用画像に対する生成モデルの機械学習は十分であることを示す。そのため、復元追加用画像との差分が小さい、換言すると、復元の程度の高い追加用画像は、生成モデルの能力の適切な向上に貢献する可能性が低い。つまり、このような復元の程度の高い追加用画像では、所定の特徴の写る画像を復元する能力の向上に寄与する程度が低い。そのため、復元の程度の高い追加用画像に含まれる1つ以上の第2学習画像を機械学習に使用する学習画像に追加することで、生成モデルの能力の向上を図ると、第2学習画像の過剰な追加により、機械学習に使用する学習画像の件数の膨大化を招き、当該機械学習の処理コストを増大させてしまう可能性がある。更には、所定の特徴以外の部分についてのパターンを復元させる能力を向上させてしまうことで、あらゆるパターンを忠実に再現する能力を生成モデルに獲得させてしまう可能性がある。この場合には、学習済みの生成モデルにより、所定の特徴以外の他の特徴を検出することができなくなってしまう。 On the other hand, the smaller the difference between the additional image and the restored additional image, the higher the degree of restoration of the additional image in the restored additional image, that is, the machine learning of the generative model for the additional restored image is sufficient. shows. Therefore, an additional image with a small difference from the restored additional image, in other words, a highly restored additional image is unlikely to contribute to an appropriate improvement in the ability of the generative model. In other words, such an additional image with a high degree of restoration has a low degree of contribution to improving the ability to restore an image showing predetermined characteristics. Therefore, if you try to improve the ability of the generative model by adding one or more second learning images included in the additional images with a high degree of restoration to the learning images used for machine learning, it is possible to improve the ability of the generative model. Excessive addition may lead to an enormous increase in the number of learning images used for machine learning, which may increase the processing cost of the machine learning. Furthermore, by improving the ability to restore patterns for parts other than predetermined features, there is a possibility that the generative model will acquire the ability to faithfully reproduce any pattern. In this case, the trained generative model makes it impossible to detect features other than the predetermined features.

これらの点を考慮して、学習装置は、算出された評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像を複数の追加用画像から抽出する。復元の程度が低いと評価する方法は、実施の形態に応じて適宜選択されてよい。例えば、学習装置は、最も評価の低い追加用画像を抽出してもよい。また、例えば、学習装置は、評価の低い方から順に所定数の追加用画像を抽出してもよい。抽出する追加用画像の数は、適宜決定されてよい。また、例えば、当該構成に係る学習装置は、閾値より評価の低い追加用画像を抽出してもよい。判定の基準となる閾値は適宜決定されてよい。そして、学習装置は、機械学習により、抽出された1つ以上の追加用画像に含まれる1つ以上の第2学習画像それぞれが与えられると、与えられた1つ以上の第2学習画像それぞれに適合する復元画像を生成するように生成モデルを更に訓練する。学習済みの生成モデルは、学習画像に写る可能性の低い又は写っていない他の特徴が入力画像に写っているか否かに関わらず、与えられた入力画像に対して所定の特徴の写る復元画像を生成する能力を習得する。そのため、学習済みの生成モデルは、当該他の特徴の検出に利用することができる。 Taking these points into consideration, the learning device extracts one or more additional images that are evaluated to have a low degree of restoration from the plurality of additional images based on the calculated evaluation value. A method for evaluating that the degree of restoration is low may be selected as appropriate depending on the embodiment. For example, the learning device may extract the additional image with the lowest evaluation. Further, for example, the learning device may extract a predetermined number of additional images in order from the one with the lowest evaluation. The number of additional images to be extracted may be determined as appropriate. Further, for example, the learning device according to the configuration may extract an additional image with a lower evaluation than a threshold value. The threshold value serving as the criterion for determination may be determined as appropriate. Then, by machine learning, when each of the one or more second learning images included in the one or more extracted additional images is given, the learning device The generative model is further trained to generate matching reconstructed images. A trained generative model is a reconstructed image that shows a predetermined feature for a given input image, regardless of whether the input image contains other features that are unlikely to appear or are not seen in the training image. Acquire the ability to generate. Therefore, the trained generative model can be used to detect the other features.

したがって、上記の開示によれば、暫定的に構築された学習済みの生成モデルが各候補に対して能力を発揮した結果に基づいて、機械学習に使用する学習画像の候補から、能力の適切な向上に貢献する可能性の高い1つ以上の候補を自動的に抽出することができる。よって、機械学習に使用する画像(学習画像)を適切に選択できる。加えて、適切に選択された学習画像を用いて構築された学習済みの生成モデルによれば、所定の特徴以外の他の特徴が入力画像(観測画像)に写っているか否かを精度よく検出することができる。すなわち、生成モデルの性能を高めることができる。 Therefore, according to the above disclosure, based on the results of the tentatively constructed trained generative model demonstrating the ability for each candidate, from the training image candidates used for machine learning, the appropriate ability is determined. One or more candidates that are highly likely to contribute to improvement can be automatically extracted. Therefore, images used for machine learning (learning images) can be appropriately selected. In addition, a trained generative model built using appropriately selected training images can accurately detect whether or not features other than the predetermined features appear in the input image (observed image). can do. In other words, the performance of the generative model can be improved.

なお、生成モデルは、入力画像を特徴量に変換し、変換により得られた特徴量から入力画像を復元した画像を生成する演算処理に使用される演算パラメータを備えるモジュールにより構成される。生成モデルは、画像を変換可能であれば、その種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、生成モデルは、ニューラルネットワークにより構成されてよい。この場合、ニューラルネットワークを構成する各ニューロン(ノード)に関するパラメータ(例えば、各ニューロン間の結合の重み、各ニューロンの閾値等)が演算パラメータの一例である。また、例えば、生成モデルは、主成分分析により導出された固有ベクトル(正規直交ベクトル)行列により構成されてよい。この場合、固有ベクトル行列の各成分(項)が演算パラメータの一例である。以下、「固有ベクトル行列」を単に「固有ベクトル」とも記載する。なお、「特徴量」は、「特徴ベクトル」と称してもよい。特徴量は、基本的には、入力画像よりも低次元である。この特徴量のデータ形式及び特徴量により示される情報はそれぞれ、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。 Note that the generation model is constituted by a module that includes calculation parameters used in calculation processing to convert an input image into a feature amount and generate an image obtained by restoring the input image from the feature amount obtained by the conversion. The type of generation model is not particularly limited as long as it can convert images, and may be selected as appropriate depending on the embodiment. For example, the generative model may be constructed by a neural network. In this case, parameters regarding each neuron (node) constituting the neural network (for example, the weight of the connection between each neuron, the threshold value of each neuron, etc.) are examples of calculation parameters. Further, for example, the generative model may be configured by an eigenvector (orthonormal vector) matrix derived by principal component analysis. In this case, each component (term) of the eigenvector matrix is an example of a calculation parameter. Hereinafter, the "eigenvector matrix" will also be simply referred to as "eigenvector." Note that the "feature amount" may also be referred to as a "feature vector." The feature amount basically has lower dimensions than the input image. The data format of the feature amount and the information indicated by the feature amount are not particularly limited, and may be determined as appropriate depending on the embodiment.

所定の特徴は、画像に写り得るものであれば、その種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。所定の特徴は、それ自身が抽出の対象となり得るもの、抽出の対象とならない背景、及びこれらの組み合わせであってよい。同様に、他の特徴も、画像に写り得るものであれば、その種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。所定の特徴は、他の特徴を含む状態及び他の特徴を含まない状態の2つの状態を取り得るものであってもよい。所定の特徴と他の特徴とがこのような関係にある場合、各状態の取り得る確率が偏っているのが望ましい。各状態の取り得る確率が偏っているとは、いずれかの状態の取り得る確率が、他の状態の取り得る確率に比べて、生成モデルの再現性に影響を与える程度に高いことである。加えて、所定の特徴の発生確率の高い状態に含まれておらず、発生確率の低い状態に含まれている特徴が当該他の特徴に選択されるのが望ましい。更には、機械学習に使用される各学習画像に写る所定の特徴には、当該他の特徴が含まれていないのが望ましい。これにより、他の特徴を含まない所定の特徴が写る学習画像を生成モデルの機械学習に使用することで、生成モデルは、入力画像に写る所定の特徴に他の特徴が含まれるか否かに関わらず、当該他の特徴を含まない所定の特徴の写る復元画像を生成するように訓練される。そのため、生成モデルにより生成される復元画像と入力画像との差分に基づいて、入力画像に写る所定の特徴に他の特徴が含まれるか否かを検出することができる。一例として、所定の特徴は、製品であってよく、他の特徴は、当該製品の欠陥であってよい。すなわち、各学習画像には、欠陥を含む状態及び欠陥の含まない状態の2つの状態を取り得る製品が写っていてよい。画像の種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。画像は、例えば、白黒画像等の二値画像、RGB画像、深度画像、赤外線画像等であってよい。 The type of the predetermined feature is not particularly limited as long as it can be seen in an image, and may be selected as appropriate depending on the embodiment. The predetermined feature may be a feature that itself can be extracted, a background that is not extracted, or a combination thereof. Similarly, the types of other features do not need to be particularly limited as long as they can be seen in the image, and may be selected as appropriate depending on the embodiment. A predetermined feature may be capable of taking two states: a state in which it includes other features and a state in which it does not include other features. When a predetermined feature and other features have such a relationship, it is desirable that the probabilities of each state be biased. When the possible probabilities of each state are biased, it means that the possible probabilities of any state are higher than the possible probabilities of other states to the extent that it affects the reproducibility of the generative model. In addition, it is desirable that a feature not included in a state with a high probability of occurrence of a predetermined feature but included in a state with a low probability of occurrence is selected as the other feature. Furthermore, it is desirable that the predetermined features appearing in each learning image used for machine learning do not include the other features. As a result, by using a training image that shows a predetermined feature that does not include other features for machine learning of a generative model, the generative model can determine whether or not the predetermined feature that appears in the input image contains other features. Regardless, it is trained to generate a restored image that shows a predetermined feature that does not include the other features. Therefore, based on the difference between the restored image generated by the generative model and the input image, it is possible to detect whether a predetermined feature appearing in the input image includes another feature. As an example, the predetermined feature may be a product and the other feature may be a defect in the product. That is, each learning image may include a product that can take two states: a state containing a defect and a state containing no defect. The type of image does not need to be particularly limited, and may be selected as appropriate depending on the embodiment. The image may be, for example, a binary image such as a black and white image, an RGB image, a depth image, an infrared image, or the like.

製品の外観検査を実施する場合、所定の特徴は、例えば、電子機器、電子部品、自動車部品、薬品、食品等の製造ラインで搬送される製品であってよい。電子部品は、例えば、基盤、チップコンデンサ、液晶、リレーの巻線等であってよい。自動車部品は、例えば、コンロッド、シャフト、エンジンブロック、パワーウィンドウスイッチ、パネル等であってよい。薬品は、例えば、包装済みの錠剤、未包装の錠剤等であってよい。製品は、製造過程完了後に生成される最終品であってもよいし、製造過程の途中で生成される中間品であってもよいし、製造過程を経過する前に用意される初期品であってもよい。これに応じて、所定の特徴以外の他の特徴は、例えば、傷、汚れ、クラック、打痕、バリ、色ムラ、異物混入等の欠陥であってよい。その他、所定の特徴は、例えば、人物、車両(例えば、自動車)等の移動し得る物体であってよい。所定の特徴以外の他の特徴は、例えば、当該移動により変化し得る物体の三次元形状、オプティカルフロー(移動方向)等であってよい。なお、「所定の特徴」を「所定の被写体」又は「背景特徴」と読み替え、「他の特徴」を「所定の特徴」又は「前景特徴」と読み替えてもよい。また、「学習装置」は、「訓練装置」又は「モデル生成装置」と読み替えられてもよい。 When performing a visual inspection of a product, the predetermined feature may be, for example, a product transported on a production line of electronic equipment, electronic parts, automobile parts, medicine, food, and the like. The electronic component may be, for example, a board, a chip capacitor, a liquid crystal, a relay winding, or the like. Automotive parts may be, for example, connecting rods, shafts, engine blocks, power window switches, panels, etc. The drug may be, for example, a packaged tablet, an unpackaged tablet, or the like. A product may be a final product produced after the manufacturing process is completed, an intermediate product produced during the manufacturing process, or an initial product prepared before the manufacturing process. It's okay. Accordingly, other features than the predetermined features may be, for example, defects such as scratches, dirt, cracks, dents, burrs, color unevenness, and foreign matter contamination. In addition, the predetermined feature may be, for example, a movable object such as a person or a vehicle (eg, a car). Features other than the predetermined features may be, for example, the three-dimensional shape of the object, optical flow (direction of movement), etc. that can change due to the movement. Note that the "predetermined feature" may be replaced with "predetermined subject" or "background feature," and the "other feature" may be replaced with "predetermined feature" or "foreground feature." Further, the "learning device" may be read as a "training device" or a "model generating device."

上述の開示において、差分に応じて評価値を算出することは、複数の追加用画像それぞれと複数の復元追加用画像それぞれとの間の差分を示す複数の差分画像それぞれを生成し、各差分画像において、各画素の画素値が大きいほど評価値が高くなり、かつ、基準画素値以上の画素の前記評価値に与える寄与度が基準画素値未満の画素の評価値に与える寄与度よりも大きくなるように、評価値を算出すること、により構成されてよい。各追加用画像と各復元追加用画像との間で差分の大きい画素ほど、各差分画像における当該画素の画素値は大きい。そのため、当該構成によれば、追加用画像の復元の程度に応じた評価値を適切に算出することができる。具体的には、得られる評価値が大きいほど、対応する追加用画像の復元の程度が低いことを示す。そのため、抽出部の処理では、所定の基準に従って、評価値の高いと判定される追加用画像が抽出される。 In the above disclosure, calculating the evaluation value according to the difference means generating each of the plurality of difference images indicating the difference between each of the plurality of additional images and each of the plurality of restored and additional images, and calculating the evaluation value according to the difference. , the larger the pixel value of each pixel, the higher the evaluation value, and the contribution of pixels having a reference pixel value or more to the evaluation value is greater than the contribution of pixels less than the reference pixel value to the evaluation value. The evaluation value may be calculated as follows. The larger the difference between a pixel between each additional image and each restored additional image, the larger the pixel value of that pixel in each difference image. Therefore, according to the configuration, it is possible to appropriately calculate the evaluation value according to the degree of restoration of the additional image. Specifically, the larger the obtained evaluation value, the lower the degree of restoration of the corresponding additional image. Therefore, in the process of the extraction unit, an additional image that is determined to have a high evaluation value is extracted according to a predetermined criterion.

上述の開示において、学習装置は、抽出された1つ以上の追加用画像それぞれを表示装置に表示させる表示制御部を更に備えてもよい。例えば、所定の特徴以外に、生成モデルに再現させることを所望しない他の特徴の写る画像が追加用画像として取得される場合がある。上記の評価では、当該所定の特徴以外に当該他の特徴が追加用画像に写る場合にも、追加用画像の復元の程度が低くなり得る。当該構成によれば、機械学習(追加学習)に使用する学習画像として学習装置により自動的に抽出された追加用画像が表示装置に表示される。この表示に基づいて、オペレータは、生成モデルに再現させることを所望しない他の特徴が当該追加用画像に写っているか否かを目視により確認することができる。 In the above disclosure, the learning device may further include a display control unit that causes a display device to display each of the extracted one or more additional images. For example, in addition to predetermined features, an image that includes other features that are not desired to be reproduced in the generative model may be acquired as an additional image. In the above evaluation, the degree of restoration of the additional image may be low even when other features appear in the additional image in addition to the predetermined feature. According to this configuration, the additional image automatically extracted by the learning device as a learning image used for machine learning (additional learning) is displayed on the display device. Based on this display, the operator can visually confirm whether the additional image includes other features that are not desired to be reproduced in the generated model.

上述の開示において、学習装置は、表示装置に表示された1つ以上の追加用画像それぞれについて、当該1つ以上の追加用画像それぞれを機械学習に使用するか否かの選択を受け付ける選択受付部を更に備えてもよい。そして、追加学習部は、機械学習に使用すると選択された追加用画像を1つ以上の第2学習画像として決定してもよい。当該構成によれば、オペレータによる目視の結果を反映することで、上記のような他の特徴の写る追加用画像を生成モデルの機械学習の対象から除外することができる。これにより、他の特徴については再現性が低く、所定の特徴については再現性の高い復元画像を入力画像に対して生成する能力を獲得した学習済みの生成モデルを適切に構築することができる。よって、構築された学習済みの生成モデルによれば、所定の特徴以外の他の特徴が入力画像(観測画像)に写っているか否かを精度よく検出することができる。 In the above disclosure, the learning device includes a selection reception unit that receives, for each of the one or more additional images displayed on the display device, a selection as to whether or not to use each of the one or more additional images for machine learning. It may further include. Then, the additional learning unit may determine the additional images selected to be used for machine learning as one or more second learning images. According to this configuration, by reflecting the result of visual inspection by the operator, it is possible to exclude additional images that include other features as described above from the targets of machine learning of the generative model. As a result, it is possible to appropriately construct a trained generative model that has acquired the ability to generate a restored image for an input image that has low reproducibility for other features and high reproducibility for a predetermined feature. Therefore, according to the constructed trained generative model, it is possible to accurately detect whether features other than the predetermined features appear in the input image (observed image).

上述の開示において、学習装置は、所定の特徴及び所定の特徴以外の他の特徴の写る複数の評価画像を取得する第3取得部を更に備えてもよい。複数の追加用画像には他の特徴が写っていない。生成部は、取得された複数の評価画像それぞれを訓練された生成モデルに与えることで、複数の評価画像それぞれを復元した複数の復元評価画像それぞれを更に生成してもよい。評価部は、更に、各追加用画像と生成された各復元追加用画像との差分の程度に基づいて、他の特徴が各追加用画像に写っているか否かを判定してもよく、及び各評価画像と生成された各復元評価画像との差分の程度に基づいて、他の特徴が各評価画像に写っているか否かを判定してもよい。評価部は、他の特徴が写っていると判定された追加用画像の数又は割合が第1の閾値以上である、又は他の特徴が写っていないと判定された評価画像の数又は割合が第2の閾値以上である場合に、他の特徴が写っていると判定された1又は複数の追加用画像について、評価値を算出してもよい。抽出部は、算出された評価値に基づいて、他の特徴が写っていると判定された1又は複数の追加用画像のうち、復元の程度が低いと評価される画像を1つ以上の追加用画像を抽出してもよい。 In the above disclosure, the learning device may further include a third acquisition unit that acquires a plurality of evaluation images showing a predetermined feature and features other than the predetermined feature. No other features are shown in the multiple additional images. The generation unit may further generate each of a plurality of restored evaluation images obtained by restoring each of the plurality of evaluation images by supplying each of the plurality of acquired evaluation images to a trained generation model. The evaluation unit may further determine whether or not other features are reflected in each additional image based on the degree of difference between each additional image and each generated restored additional image, and Based on the degree of difference between each evaluation image and each generated restored evaluation image, it may be determined whether other features are included in each evaluation image. The evaluation unit determines whether the number or percentage of additional images determined to include other features is equal to or higher than a first threshold, or the number or percentage of evaluation images determined to include no other features. An evaluation value may be calculated for one or more additional images that are determined to include other features when the second threshold value or more is equal to or higher than the second threshold. The extraction unit adds one or more images that are evaluated to have a low degree of restoration from among the one or more additional images that are determined to include other features based on the calculated evaluation value. You may also extract images for

当該構成において、他の特徴は、学習済みの生成モデルにより生成される復元画像を利用した検出処理の対象となるものであり、基本的には、訓練に使用される学習画像には写っていない特徴である。各追加用画像に写る所定の特徴には、他の特徴は含まれていない。上記外観検査の例では、所定の特徴は、製品であり、他の特徴は、製品に生じ得る欠陥である。よって、当該構成において、他の特徴が写っていると判定された追加用画像の数又は割合は、他の特徴が写っていないにも関わらず、他の特徴が写っていると誤判定された画像の数又は割合に相当する。また、他の特徴が写っていないと判定された評価画像の数又は割合は、他の特徴が写っているにも関わらず、他の特徴が写っていないと誤判定された画像の数又は割合に相当する。 In this configuration, other features are subject to detection processing using restored images generated by trained generative models, and are basically not included in the learning images used for training. It is a characteristic. The predetermined features shown in each additional image do not include other features. In the above visual inspection example, the predetermined feature is the product, and the other features are defects that may occur in the product. Therefore, in this configuration, the number or percentage of additional images that were determined to include other features was incorrectly determined to include other features even though the other features were not included. Corresponds to the number or proportion of images. In addition, the number or percentage of evaluation images that were determined to not contain other features is the number or percentage of images that were incorrectly determined to not contain other features even though they did contain other features. corresponds to

したがって、学習装置は、他の特徴が写っていると判定された追加用画像の数又は割合、及び他の特徴が写っていないと判定された評価画像の数又は割合に基づいて、学習済みの生成モデルにより生成される復元画像を利用した検出処理の性能を評価する。そして、検出処理の性能が低い場合に、当該構成に係る学習装置は、判定を誤った追加用画像のうちから、復元の程度が低いと評価される画像を1つ以上の追加用画像を抽出し、抽出された1つ以上の追加用画像に含まれる1つ以上の第2学習画像を使用して、生成モデルの機械学習(追加学習)を実施する。これにより、当該構成によれば、生成モデルを利用した検出処理の性能を評価すると共に、所定の特徴の写る画像を復元する生成モデルの能力の向上を図ることで、他の特徴の検出処理に適した学習済みの生成モデルを構築することができる。なお、第1の閾値及び第2の閾値は、同じ値であってもよいし、互いに異なる値であってもよい。また、第1の閾値及び第2の閾値は、オペレータの入力により指定されてもよいし、プログラムにより指定された固定の値であってもよい。 Therefore, the learning device uses the number or percentage of additional images that are determined to include other features and the number or percentage of evaluation images that are determined to not include other features. We evaluate the performance of detection processing using restored images generated by a generative model. Then, when the performance of the detection process is low, the learning device according to the configuration extracts one or more additional images that are evaluated to have a low degree of restoration from among the additional images that have been incorrectly determined. Then, machine learning (additional learning) of the generative model is performed using one or more second learning images included in the extracted one or more additional images. As a result, according to the configuration, the performance of the detection process using the generative model is evaluated, and by improving the ability of the generative model to restore an image containing a predetermined feature, it is possible to improve the performance of the detection process using the generative model. A suitable trained generative model can be constructed. Note that the first threshold value and the second threshold value may be the same value or may be different values. Further, the first threshold value and the second threshold value may be specified by an operator's input, or may be fixed values specified by a program.

上述の開示において、学習装置には、他の特徴が各追加用画像に写っているか否か、及び他の特徴が各評価画像に写っているか否かを判定するための複数のパラメータ候補が与えられてよい。評価部は、複数のパラメータ候補それぞれを利用して、他の特徴が各追加用画像に写っているか否かの判定、及び他の特徴が各評価画像に写っているか否かの判定を実行してもよく、各判定の結果に基づいて、他の特徴が画像に写っているか否かを判定するためのパラメータの最適化を実行する。例えば、評価部は、複数のパラメータ候補のうち、他の特徴が写っていると判定される追加用画像及び他の特徴が写っていないと判定される評価画像の数の最も少ない1つのパラメータ候補を特定する。評価部は、最適化されたパラメータを利用した各判定の結果において、他の特徴が写っていると判定された追加用画像の数又は割合が第1の閾値以上である、又は他の特徴が写っていないと判定された評価画像の数又は割合が第2の閾値以上である場合に、他の特徴が写っていると判定された1又は複数の追加用画像について、評価値を算出してもよい。 In the above disclosure, the learning device is provided with a plurality of parameter candidates for determining whether or not other features appear in each additional image and whether or not other features appear in each evaluation image. It's okay to be rejected. The evaluation unit uses each of the plurality of parameter candidates to determine whether or not other features appear in each additional image, and to determine whether or not other features appear in each evaluation image. Based on the results of each determination, optimization of parameters for determining whether other features are included in the image is performed. For example, the evaluation unit selects one parameter candidate that has the smallest number of additional images that are determined to include other features and evaluation images that are determined to not include other features among the plurality of parameter candidates. Identify. The evaluation unit determines whether, in the results of each determination using the optimized parameters, the number or proportion of additional images determined to include other features is greater than or equal to a first threshold, or the other features are When the number or proportion of evaluation images that are determined not to be captured is equal to or higher than a second threshold, an evaluation value is calculated for one or more additional images that are determined to include other features. Good too.

入力画像と復元画像との間に生じた差分に基づいて他の特徴が入力画像に写っているか否かを検出する場合、どのような差分が生じていれば、入力画像に他の特徴が写っていることと認定するかを規定する基準が設けられることになる。この基準が、上記検出のためのパラメータ(以下、検出パラメータとも記載する)である。他の特徴を検出するのに最適な検出パラメータは、生成モデルの復元能力に応じて変動し得る。検出パラメータの値を人手により調整すると、生成モデルの機械学習を実施する度に、検出パラメータを調整するための人的コストが生じてしまう。更には、検出パラメータの値の人手による調整は、人的要因によるミスが生じる原因と成り得る。これに対して、当該構成によれば、生成モデルの復元能力に応じて検出パラメータを自動的に最適化して、生成モデルを利用した検出処理の性能を評価することができる。そのため、人的要因による問題点の発生を招くことなく、他の特徴の検出処理に更に適した学習済みの生成モデルを構築することができる。 When detecting whether or not other features appear in the input image based on the differences that occur between the input image and the restored image, what kind of difference occurs to determine whether the other features appear in the input image? Standards will be established to determine what is recognized as being accredited. This standard is the parameter for the detection (hereinafter also referred to as detection parameter). The optimal detection parameters for detecting other features may vary depending on the restoration ability of the generative model. If the values of the detection parameters are adjusted manually, human costs for adjusting the detection parameters will be incurred each time machine learning of the generative model is performed. Moreover, manual adjustment of the values of detection parameters can lead to errors due to human factors. In contrast, with this configuration, the detection parameters can be automatically optimized according to the restoration ability of the generative model, and the performance of the detection process using the generative model can be evaluated. Therefore, it is possible to construct a trained generative model that is more suitable for detection processing of other features without causing problems due to human factors.

上述の開示において、学習装置は、複数の第1評価画像と複数の第2評価画像とを取得する第3取得部を更に備える。複数の第1評価画像には、所定の特徴及び所定の特徴以外の他の特徴が写る。複数の第2評価画像には、所定の特徴が写り、他の特徴が写っていない。評価部には、他の特徴が画像に写っているか否かを判定するための複数のパラメータ候補が与えられる。評価部は、複数のパラメータ候補それぞれを利用して、他の特徴が各第1評価画像に写っているか否かの判定、及び他の特徴が各第2評価画像に写っているか否かの判定を実行する。評価部は、各判定の結果に基づいて、他の特徴が画像に写っているか否かを判定するためのパラメータの最適化を実行する。選択受付部は、表示装置に表示された1つ以上の追加用画像それぞれについて、他の特徴が写っているか否かの選択を更に受け付ける。第3取得部は、他の特徴が写っていると選択された各追加用画像を複数の第1評価画像の1つとして取得し、他の特徴が写っていないと選択された各追加用画像を複数の第2評価画像の1つとして取得する。 In the above disclosure, the learning device further includes a third acquisition unit that acquires a plurality of first evaluation images and a plurality of second evaluation images. The plurality of first evaluation images include a predetermined feature and features other than the predetermined feature. The plurality of second evaluation images show predetermined features and do not show other features. The evaluation unit is given a plurality of parameter candidates for determining whether or not other features appear in the image. The evaluation unit uses each of the plurality of parameter candidates to determine whether or not other features are shown in each first evaluation image, and to determine whether or not other features are shown in each second evaluation image. Execute. The evaluation unit optimizes parameters for determining whether other features are included in the image based on the results of each determination. The selection accepting unit further accepts a selection as to whether or not other features are included in each of the one or more additional images displayed on the display device. The third acquisition unit acquires each additional image selected as showing other features as one of the plurality of first evaluation images, and acquiring each additional image selected as not showing other features. is acquired as one of the plurality of second evaluation images.

上記構成によれば、オペレータは、第1評価画像および第2評価画像を準備する手間を省略できる。 According to the above configuration, the operator can omit the effort of preparing the first evaluation image and the second evaluation image.

上述の開示において、第2取得部は、検出装置と通信する。検出装置は、所定の特徴を観測することで得られた観測画像を取得し、生成モデルに観測画像を入力することで、観測画像に対応する復元観測画像を生成する。検出装置は、生成された復元観測画像及び観測画像の間の差分に基づいて、所定の特徴以外の他の特徴が観測画像に写っているか否かを検出する。第2取得部は、検出装置によって取得された観測画像を複数の追加用画像の1つとして取得する。 In the above disclosure, the second acquisition unit communicates with the detection device. The detection device acquires an observed image obtained by observing a predetermined feature, and inputs the observed image to a generation model to generate a restored observed image corresponding to the observed image. The detection device detects whether features other than the predetermined features are included in the observed image based on the difference between the generated restored observed image and the observed image. The second acquisition unit acquires the observed image acquired by the detection device as one of the plurality of additional images.

上記構成によれば、観測画像が追加用画像として取得される。そのため、オペレータは、追加用画像を準備する手間を省略できる。 According to the above configuration, the observed image is acquired as an additional image. Therefore, the operator can omit the effort of preparing additional images.

上述の開示において、学習装置は、複数の追加用画像のうち、抽出部によって抽出された1つ以上の追加用画像を記憶部に保存する保存処理部を更に備える。 In the above disclosure, the learning device further includes a storage processing unit that stores one or more additional images extracted by the extraction unit among the plurality of additional images in the storage unit.

一般に、検出装置によって取得される観測画像の数は、短時間で膨大となる。しかしながら、上記構成によれば、観測画像が追加用画像として取得されるものの、評価値に基づいて抽出された1つ以上の追加用画像のみが記憶部に保存される。そのため、記憶部における空き領域が不足する事態を避けることができる。 Generally, the number of observation images acquired by a detection device becomes enormous in a short period of time. However, according to the above configuration, although the observed image is acquired as an additional image, only one or more additional images extracted based on the evaluation value are stored in the storage unit. Therefore, it is possible to avoid a situation where the free space in the storage unit becomes insufficient.

上述の開示において、第1学習画像及び追加用画像はそれぞれ、複数のパッチ画像に分割されてよい。生成モデルは、パッチ画像毎に与えられてよい。学習部は、パッチ画像毎に、機械学習により、1つ以上の第1学習画像それぞれが与えられると、与えられた1つ以上の第1学習画像それぞれに適合する復元画像を生成するように生成モデルを訓練してもよい。生成部は、パッチ画像毎に、各追加用画像に対応する各復元追加用画像を生成してもよい。評価部は、パッチ画像毎に、各追加用画像の評価値を算出してもよい。抽出部は、パッチ画像毎に、算出された評価値に基づいて、1つ以上の追加用画像を複数の追加用画像から抽出してもよい。追加学習部は、パッチ画像毎に、機械学習により、1つ以上の第2学習画像それぞれが与えられると、与えられた1つ以上の第2学習画像それぞれに適合する復元画像を生成するように生成モデルを更に訓練してもよい。 In the above disclosure, each of the first learning image and the additional image may be divided into a plurality of patch images. A generative model may be provided for each patch image. The learning unit performs machine learning for each patch image so that, when each of the one or more first learning images is given, it generates a restored image that matches each of the one or more given first learning images. You can also train the model. The generation unit may generate each restored additional image corresponding to each additional image for each patch image. The evaluation unit may calculate the evaluation value of each additional image for each patch image. The extraction unit may extract one or more additional images from the plurality of additional images based on the calculated evaluation value for each patch image. The additional learning unit generates a restored image that matches each of the given one or more second learning images by machine learning for each patch image, when each of the one or more second learning images is given. The generative model may be further trained.

複数のパッチ画像に各学習画像が分割され、パッチ画像毎に生成モデルを用意する場合、所定の特徴以外の他の特徴の検出に利用する生成モデルの機械学習に使用する学習画像の選択にかかるコストは更に増大する。当該構成によれば、生成モデルの機械学習に適切な学習画像の選択を少なくとも部分的に自動化することができるため、機械学習に使用する学習画像の選択にかかるコストを大幅に低減することができる。また、当該構成によれば、生成モデルの能力をパッチ画像毎に最適化することができるため、所定の特徴以外の他の特徴を検出する精度を高めることができる。 When each training image is divided into multiple patch images and a generative model is prepared for each patch image, it is necessary to select the learning image to be used for machine learning of the generative model used to detect features other than the predetermined features. Costs will further increase. According to this configuration, it is possible to at least partially automate the selection of training images suitable for machine learning of the generative model, and therefore it is possible to significantly reduce the cost of selecting training images used for machine learning. . Further, according to the configuration, the ability of the generative model can be optimized for each patch image, so it is possible to improve the accuracy of detecting features other than the predetermined features.

上述の開示において、生成モデルは、ニューラルネットワークにより構成されてよい。当該構成によれば、学習済みの生成モデルを容易に構築することができる。あるいは、上述の開示において、機械学習は、主成分分析を含んでもよく、生成モデルは、主成分分析により導出された固有ベクトルにより構成されてよい。 In the above disclosure, the generative model may be configured by a neural network. According to this configuration, a trained generative model can be easily constructed. Alternatively, in the above disclosure, machine learning may include principal component analysis, and the generative model may be constructed from eigenvectors derived by principal component analysis.

上述の開示において、所定の特徴は、製造ラインで搬送される製品であって、欠陥を含まない製品であってよい。当該構成によれば、製品の外観検査に利用可能な生成モデルの機械学習に使用する画像を適切に選択でき、生成モデルの性能を高めることができる。 In the above disclosure, the predetermined characteristic may be a product conveyed on a manufacturing line that is defect-free. According to this configuration, images used for machine learning of a generative model that can be used for product appearance inspection can be appropriately selected, and the performance of the generative model can be improved.

上述の開示において、学習部が、第1学習画像を使用した機械学習により、暫定的な学習済みの生成モデルを構築している。しかしながら、本発明の学習装置の形態は、このような例に限定されなくてもよい。上記一側面に係る学習装置において、この学習部の処理は、省略されてよい。この場合、学習装置は、他のコンピュータにより構築された暫定的な学習済みの生成モデルを取得してもよい。 In the above disclosure, the learning unit constructs a provisional trained generative model by machine learning using the first learning image. However, the form of the learning device of the present invention does not have to be limited to such an example. In the learning device according to the above aspect, the process of the learning unit may be omitted. In this case, the learning device may acquire a provisional trained generative model constructed by another computer.

例えば、本開示の一例によれば、学習装置は、モデル取得部と、生成部と、評価部と、抽出部と、追加学習部とを備える。モデル取得部は、所定の特徴の写る1つ以上の第1学習画像を使用した機械学習により訓練された生成モデルを取得する。生成モデルは、画像が与えられると、与えられた画像を特徴量に変換し、特徴量から与えられた画像を復元した画像を生成するように構成される。機械学習により、生成モデルは、1つ以上の第1学習画像それぞれが与えられると、与えられた1つ以上の第1学習画像それぞれに適合する復元画像を生成するように訓練されている。画像取得部は、所定の特徴の写る複数の追加用画像を取得する。生成部は、複数の追加用画像それぞれを生成モデルに与えることで、複数の追加用画像それぞれを復元した複数の復元追加用画像それぞれを生成する。評価部は、各追加用画像及び生成された各復元追加用画像の間の差分に応じて、各追加用画像の評価値であって、各復元追加用画像における各追加用画像の復元の程度に対する評価値を算出する。抽出部は、評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像を複数の追加用画像から抽出する。追加学習部は、機械学習により、抽出された1つ以上の追加用画像に含まれる1つ以上の第2学習画像それぞれが与えられると、与えられた1つ以上の第2学習画像それぞれに適合する復元画像を生成するように生成モデルを更に訓練する。 For example, according to an example of the present disclosure, a learning device includes a model acquisition section, a generation section, an evaluation section, an extraction section, and an additional learning section. The model acquisition unit acquires a generative model trained by machine learning using one or more first learning images showing predetermined features. The generative model is configured to, when an image is given, convert the given image into a feature amount, and generate an image in which the given image is restored from the feature amount. Through machine learning, the generative model is trained to, given each of the one or more first training images, generate a restored image that matches each of the one or more given first training images. The image acquisition unit acquires a plurality of additional images showing predetermined characteristics. The generation unit generates each of the plurality of restored additional images by restoring each of the plurality of additional images by supplying each of the plurality of additional images to the generation model. The evaluation unit calculates an evaluation value of each additional image according to the difference between each additional image and each generated restored additional image, and determines the degree of restoration of each additional image in each restored additional image. Calculate the evaluation value for. The extraction unit extracts one or more additional images that are evaluated as having a low degree of restoration from the plurality of additional images based on the evaluation value. By machine learning, when each of the one or more second learning images included in the one or more extracted additional images is given, the additional learning unit adapts to each of the one or more given second learning images. The generative model is further trained to generate a restored image.

本開示の形態は、学習装置に限られなくてもよい。本開示の一例によれば、検出装置は、所定の特徴を観測することで得られた観測画像を取得する取得部と、上記いずれかの形態に係る学習装置により訓練された生成モデルに観測画像を入力することで、観測画像に対応する復元観測画像を生成する生成部と、生成された復元観測画像及び観測画像の間の差分に基づいて、所定の特徴以外の他の特徴が観測画像に写っているか否かを検出する検出部と、を備える。当該構成によれば、所定の特徴以外の他の特徴が観測画像に写っているか否かを精度よく検出することができる。 The embodiments of the present disclosure do not need to be limited to learning devices. According to an example of the present disclosure, the detection device includes an acquisition unit that acquires an observed image obtained by observing a predetermined feature, and a generative model trained by the learning device according to any of the above forms. By inputting , the generator generates a restored observation image corresponding to the observed image, and other features other than the predetermined features are added to the observed image based on the difference between the generated restored observation image and the observed image. A detection unit that detects whether or not the image is captured. According to the configuration, it is possible to accurately detect whether features other than the predetermined features appear in the observed image.

上記各形態に係る学習装置及び検出装置それぞれの別の態様として、本開示の一側面は、以上の各構成を実現する情報処理方法であってもよいし、プログラムであってもよいし、このようなプログラムを記憶した、コンピュータ等が読み取り可能な記憶媒体であってもよい。ここで、コンピュータ等が読み取り可能な記憶媒体とは、プログラム等の情報を、電気的、磁気的、光学的、機械的、又は、化学的作用によって蓄積する媒体である。また、本開示の一側面に係る検出システムは、上記いずれかの形態に係る学習装置及び検出装置により構成されてよい。 As another aspect of each of the learning device and the detection device according to each of the above embodiments, one aspect of the present disclosure may be an information processing method that realizes each of the above configurations, a program, or the like. It may also be a computer-readable storage medium that stores such a program. Here, a computer-readable storage medium is a medium that stores information such as programs through electrical, magnetic, optical, mechanical, or chemical action. Further, a detection system according to one aspect of the present disclosure may be configured by a learning device and a detection device according to any of the above embodiments.

例えば、本開示の一側面に係る学習方法は、コンピュータが、所定の特徴の写る1つ以上の第1学習画像を取得するステップと、1つ以上の第1学習画像を使用して、生成モデルの機械学習を実施するステップであって、生成モデルは、画像が与えられると、与えられた画像を特徴量に変換し、特徴量から与えられた画像を復元した画像を生成するように構成され、機械学習により、1つ以上の第1学習画像それぞれが与えられると、与えられた1つ以上の第1学習画像それぞれに適合する復元画像を生成するように生成モデルを訓練する、ステップと、所定の特徴の写る複数の追加用画像を取得するステップと、複数の追加用画像それぞれを生成モデルに与えることで、複数の追加用画像それぞれを復元した複数の復元追加用画像それぞれを生成するステップと、各追加用画像及び生成された各復元追加用画像の間の差分に応じて、各追加用画像の評価値であって、各復元追加用画像における各追加用画像の復元の程度に対する評価値を算出するステップと、評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像を複数の追加用画像から抽出するステップと、機械学習により、抽出された1つ以上の追加用画像に含まれる1つ以上の第2学習画像それぞれが与えられると、与えられた1つ以上の第2学習画像それぞれに適合する復元画像を生成するように生成モデルを更に訓練するステップと、を実行する、情報処理方法である。 For example, a learning method according to one aspect of the present disclosure includes the steps of a computer acquiring one or more first learning images in which predetermined features are captured, and using the one or more first learning images to create a generative model. The generative model is configured to, when an image is given, convert the given image into a feature amount and generate an image that restores the given image from the feature amount. , training a generative model to generate restored images that match each of the given one or more first learning images when each of the one or more first learning images is given by machine learning; a step of acquiring a plurality of additional images showing predetermined characteristics, and a step of generating each of a plurality of restored additional images by restoring each of the plurality of additional images by giving each of the plurality of additional images to a generation model. and an evaluation value of each additional image according to the difference between each additional image and each generated restored additional image, and an evaluation of the degree of restoration of each additional image in each restored additional image. a step of calculating a value, a step of extracting one or more additional images that are evaluated as having a low degree of restoration based on the evaluation value from a plurality of additional images, and one or more images extracted by machine learning. When each of the one or more second learning images included in the above additional images is given, the generative model is further trained to generate a restored image that matches each of the given one or more second learning images. An information processing method that executes steps.

また、例えば、本開示の一側面に係る学習プログラムは、コンピュータに、所定の特徴の写る1つ以上の第1学習画像を取得するステップと、1つ以上の第1学習画像を使用して、生成モデルの機械学習を実施するステップであって、生成モデルは、画像が与えられると、与えられた画像を特徴量に変換し、特徴量から与えられた画像を復元した画像を生成するように構成され、機械学習により、1つ以上の第1学習画像それぞれが与えられると、与えられた1つ以上の第1学習画像それぞれに適合する復元画像を生成するように生成モデルを訓練する、ステップと、所定の特徴の写る複数の追加用画像を取得するステップと、複数の追加用画像それぞれを生成モデルに与えることで、複数の追加用画像それぞれを復元した複数の復元追加用画像それぞれを生成するステップと、各追加用画像及び生成された各復元追加用画像の間の差分に応じて、各追加用画像の評価値であって、各復元追加用画像における各追加用画像の復元の程度に対する評価値を算出するステップと、評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像を複数の追加用画像から抽出するステップと、機械学習により、抽出された1つ以上の追加用画像に含まれる1つ以上の第2学習画像それぞれが与えられると、与えられた1つ以上の第2学習画像それぞれに適合する復元画像を生成するように生成モデルを更に訓練するステップと、を実行させるための、プログラムである。 Further, for example, a learning program according to one aspect of the present disclosure includes the steps of acquiring, in a computer, one or more first learning images in which a predetermined feature is captured, and using the one or more first learning images, A step of implementing machine learning of a generative model, the generative model converts the given image into features when an image is given, and generates an image that restores the given image from the features. training the generative model to generate a restored image that matches each of the given one or more first learning images, using machine learning; and a step of obtaining a plurality of additional images showing predetermined characteristics, and providing each of the plurality of additional images to a generation model to generate each of a plurality of restored additional images by restoring each of the plurality of additional images. and the evaluation value of each additional image according to the difference between each additional image and each generated restored additional image, and the degree of restoration of each additional image in each restored additional image. a step of calculating an evaluation value for the image; a step of extracting one or more additional images that are evaluated as having a low degree of restoration from the plurality of additional images based on the evaluation value; When each of one or more second learning images included in one or more additional images is given, the generative model is further modified to generate a restored image that matches each of the given one or more second learning images. This is a program for executing training steps.

本開示によれば、学習に用いる画像を適切に選択することで生成モデルの性能を高めることができる。 According to the present disclosure, the performance of a generative model can be improved by appropriately selecting images used for learning.

実施形態に係る検出システムの適用画面の一例を模式的に例示する図である。FIG. 3 is a diagram schematically illustrating an example of an application screen of the detection system according to the embodiment. 本実施形態に係る学習装置1のハードウェア構成の一例を模式的に例示する図である。FIG. 1 is a diagram schematically illustrating an example of the hardware configuration of a learning device 1 according to the present embodiment. 本実施形態に係る検出装置2のハードウェア構成の一例を模式的に例示する図である。FIG. 2 is a diagram schematically illustrating an example of the hardware configuration of a detection device 2 according to the present embodiment. 本実施形態に係る学習装置1のソフトウェア構成の一例を模式的に例示する図である。FIG. 1 is a diagram schematically illustrating an example of the software configuration of the learning device 1 according to the present embodiment. 本実施形態に係る学習装置1のソフトウェア構成の一例を模式的に例示する図である。FIG. 1 is a diagram schematically illustrating an example of the software configuration of the learning device 1 according to the present embodiment. 本実施形態に係る検出装置2のソフトウェア構成の一例を模式的に例示する図である。FIG. 2 is a diagram schematically illustrating an example of the software configuration of the detection device 2 according to the present embodiment. 本実施形態に係る学習装置1の処理手順の一例を示すフローチャートである。It is a flowchart showing an example of a processing procedure of the learning device 1 according to the present embodiment. 本実施形態に係る学習装置1の処理手順の一例を示すフローチャートである。It is a flowchart showing an example of a processing procedure of the learning device 1 according to the present embodiment. ニューラルネットワークにより構成される生成モデル5の一例を模式的に例示する図である。3 is a diagram schematically illustrating an example of a generative model 5 configured by a neural network. FIG. 欠陥Lを検出する処理過程の一例を模式的に例示する図である。3 is a diagram schematically illustrating an example of a process for detecting a defect L. FIG. ステップS107及びS108の仮想的な判定結果の一例を示す図である。It is a figure which shows an example of a hypothetical determination result of step S107 and S108. 評価値125を算出する処理過程の一例を模式的に例示する図である。FIG. 3 is a diagram schematically illustrating an example of a processing process for calculating an evaluation value 125. 本実施形態に係る表示画面の一例を模式的に例示する図である。FIG. 3 is a diagram schematically illustrating an example of a display screen according to the present embodiment. 本実施形態に係る表示画面の一例を模式的に例示する図である。FIG. 3 is a diagram schematically illustrating an example of a display screen according to the present embodiment. 本実施形態に係る検出装置2の処理手順の一例を示すフローチャートである。It is a flowchart which shows an example of the processing procedure of the detection device 2 concerning this embodiment. 当該実験例により機械学習の処理を繰り返す過程で構築された学習済みの生成モデルの性能を評価した結果を示す。The results of evaluating the performance of a trained generative model constructed in the process of repeating machine learning processing using this experimental example are shown. 変形例5に係る学習装置1Bのソフトウェア構成の一例を模式的に例示する図である。12 is a diagram schematically illustrating an example of the software configuration of a learning device 1B according to modification 5. FIG. 変形例8に係る学習装置のソフトウェア構成の一例を模式的に例示する図である。12 is a diagram schematically illustrating an example of the software configuration of a learning device according to Modification 8. FIG. 変形例9に係る学習装置における追加用画像の抽出処理の手順の一例を示すフローチャートである。12 is a flowchart illustrating an example of a procedure for extracting an additional image in a learning device according to Modification 9. FIG. 変形例9に係る学習装置における追加用画像の抽出処理の手順の一例を示すフローチャートである。12 is a flowchart illustrating an example of a procedure for extracting an additional image in a learning device according to Modification 9. FIG. 変形例9に係る学習装置における追加学習処理の手順の一例を示すフローチャートである。12 is a flowchart illustrating an example of the procedure of additional learning processing in the learning device according to Modification 9. FIG. 変形例9に係る学習装置における追加学習処理の手順の一例を示すフローチャートである。12 is a flowchart illustrating an example of the procedure of additional learning processing in the learning device according to Modification 9. FIG. ステップS502において表示される表示画面の一例を示す図である。5 is a diagram showing an example of a display screen displayed in step S502. FIG.

以下、本発明の一側面に係る実施の形態(以下、「本実施形態」とも表記する)を、図面に基づいて説明する。ただし、以下で説明する本実施形態は、あらゆる点において本発明の例示に過ぎない。本発明の範囲を逸脱することなく種々の改良や変形を行うことができることは言うまでもない。つまり、本発明の実施にあたって、実施形態に応じた具体的構成が適宜採用されてもよい。なお、本実施形態において登場するデータを自然言語により説明しているが、より具体的には、コンピュータが認識可能な疑似言語、コマンド、パラメータ、マシン語等で指定される。 DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment (hereinafter also referred to as "this embodiment") according to one aspect of the present invention will be described below based on the drawings. However, this embodiment described below is merely an illustration of the present invention in all respects. It goes without saying that various improvements and modifications can be made without departing from the scope of the invention. That is, in implementing the present invention, specific configurations depending on the embodiments may be adopted as appropriate. Although the data that appears in this embodiment is explained using natural language, more specifically, it is specified using pseudo language, commands, parameters, machine language, etc. that can be recognized by a computer.

§1 適用例
まず、図1を用いて、本発明が適用される場面の一例について説明する。図1は、実施形態に係る検出システムの適用画面の一例を模式的に例示する図である。図1の例では、所定の特徴の写る画像に所定の特徴以外の他の特徴が写っているか否かを検出する場面の一例として、製品Rの写る画像を利用して、製品Rに欠陥が存在するか否かを検出する場面を想定する。良品である製品Rが所定の特徴の一例であり、欠陥が他の特徴の一例である。ただし、所定の特徴及び他の特徴の種類は、このような例に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。本開示は、画像に写る何らかの特徴を検出するあらゆる場面に適用可能である。
§1 Application Example First, an example of a situation where the present invention is applied will be described using FIG. 1. FIG. 1 is a diagram schematically illustrating an example of an application screen of a detection system according to an embodiment. In the example of FIG. 1, an image of product R is used as an example of a situation in which it is detected whether or not an image of a predetermined feature includes features other than the predetermined feature. Let's assume a situation where we want to detect whether something exists. Product R, which is a good product, is an example of the predetermined feature, and a defect is an example of another feature. However, the types of the predetermined feature and other features do not need to be limited to such examples, and may be appropriately selected depending on the embodiment. The present disclosure is applicable to any situation where some feature in an image is detected.

図1に示されるとおり、本実施形態に係る検出システム100は、学習装置1及び検出装置2を備えている。学習装置1は、機械学習により、学習済みの生成モデル5を構築するように構成されたコンピュータである。検出装置2は、学習済みの生成モデル5を利用して、所定の特徴以外の他の特徴(本実施形態では、欠陥)を検出するように構成されたコンピュータである。本実施形態では、学習装置1及び検出装置2は、ネットワークを介して互いに接続されている。ネットワークの種類は、例えば、インターネット、無線通信網、移動通信網、電話網、専用網等から適宜選択されてよい。 As shown in FIG. 1, a detection system 100 according to this embodiment includes a learning device 1 and a detection device 2. The learning device 1 is a computer configured to construct a learned generative model 5 by machine learning. The detection device 2 is a computer configured to detect features other than the predetermined features (in this embodiment, defects) using the trained generative model 5. In this embodiment, the learning device 1 and the detection device 2 are connected to each other via a network. The type of network may be appropriately selected from, for example, the Internet, a wireless communication network, a mobile communication network, a telephone network, a dedicated network, and the like.

ただし、学習装置1及び検出装置2の間でデータをやりとりする方法は、このような例に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、学習装置1及び検出装置2の間では、記憶媒体を利用して、データがやりとりされてよい。また、本実施形態では、学習装置1及び検出装置2は互いに別個のコンピュータである。しかしながら、検出システム100の構成は、このような例に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、学習装置1及び検出装置2は一体のコンピュータであってもよい。また、例えば、学習装置1及び検出装置2の少なくとも一方は、複数台のコンピュータにより構成されてよい。 However, the method of exchanging data between the learning device 1 and the detection device 2 does not need to be limited to this example, and may be selected as appropriate depending on the embodiment. For example, data may be exchanged between the learning device 1 and the detection device 2 using a storage medium. Moreover, in this embodiment, the learning device 1 and the detection device 2 are mutually separate computers. However, the configuration of the detection system 100 does not need to be limited to such an example, and may be determined as appropriate depending on the embodiment. For example, the learning device 1 and the detection device 2 may be an integrated computer. Further, for example, at least one of the learning device 1 and the detection device 2 may be configured by a plurality of computers.

本実施形態に係る学習装置1は、所定の特徴の一例として良品である製品Rの写る1つ以上の第1学習画像121を取得する。製品Rは、例えば、電子機器、電子部品、自動車部品、薬品、食品等の製造ラインで搬送される製品であってよい。電子部品は、例えば、基盤、チップコンデンサ、液晶、リレーの巻線等であってよい。自動車部品は、例えば、コンロッド、シャフト、エンジンブロック、パワーウィンドウスイッチ、パネル等であってよい。薬品は、例えば、包装済みの錠剤、未包装の錠剤等であってよい。製品Rは、製造過程完了後に生成される最終品であってもよいし、製造過程の途中で生成される中間品であってもよいし、製造過程を経過する前に用意される初期品であってもよい。 The learning device 1 according to the present embodiment acquires one or more first learning images 121 in which a good product R is captured as an example of a predetermined feature. The product R may be, for example, a product transported on a manufacturing line for electronic equipment, electronic parts, automobile parts, medicine, food, and the like. The electronic component may be, for example, a board, a chip capacitor, a liquid crystal, a relay winding, or the like. Automotive parts may be, for example, connecting rods, shafts, engine blocks, power window switches, panels, etc. The drug may be, for example, a packaged tablet, an unpackaged tablet, or the like. Product R may be a final product produced after the manufacturing process is completed, an intermediate product produced during the manufacturing process, or an initial product prepared before the manufacturing process. There may be.

学習装置1は、取得された1つ以上の第1学習画像121を使用して、生成モデル5の機械学習を実施する。生成モデル5は、入力画像が与えられると、与えられた入力画像を特徴量に変換し、変換により得られた特徴量から与えられた入力画像を復元した画像を生成するように構成されている。学習装置1は、機械学習により、1つ以上の第1学習画像121それぞれが与えられると、与えられた1つ以上の第1学習画像121それぞれに適合する復元画像を生成するように生成モデル5を訓練する。これにより、生成モデル5は、第1学習画像121に表れる範囲において、良品である製品Rの写る画像を復元する能力を獲得する。 The learning device 1 performs machine learning of the generative model 5 using the acquired one or more first learning images 121. The generative model 5 is configured to, when an input image is given, convert the given input image into a feature amount, and generate an image in which the given input image is restored from the feature amount obtained by the conversion. . Through machine learning, the learning device 1 uses a generative model 5 to generate a restored image that matches each of the given one or more first learning images 121 when each of the one or more first learning images 121 is given. train. As a result, the generative model 5 acquires the ability to restore the image of the product R, which is a good product, within the range that appears in the first learning image 121.

ただし、製品Rは、常に同じ様子で画像に写るとは限らない。例えば、製品Rには、個体差が生じ得る。また、例えば、撮影のタイミング等の撮影条件が変動し得る(一例として、製品Rの位置がずれたり、傾いたりすることがある)。これらの要因により、得られる画像内に表れる製品Rの様子は異なり得る。第1学習画像121を使用した機械学習が完了した段階では、学習済みの生成モデル5が、第1学習画像121に表れる範囲以外の範囲について、良品である製品Rの写る画像を復元する能力を獲得しているか否かは不明である。 However, product R does not always appear in the same way in the image. For example, individual differences may occur in the product R. Furthermore, for example, photographing conditions such as the timing of photographing may change (for example, the position of the product R may shift or be tilted). Depending on these factors, the appearance of the product R in the obtained image may differ. At the stage where machine learning using the first learning image 121 is completed, the trained generative model 5 has the ability to restore the image of the good product R for a range other than the range that appears in the first learning image 121. It is unknown whether they have been acquired or not.

そこで、学習装置1は、それぞれ製品Rの写る複数の追加用画像123を取得する。学習装置1は、取得された複数の追加用画像123それぞれを訓練された生成モデル5に与えることで、複数の追加用画像123それぞれを復元した複数の復元追加用画像124それぞれを生成する。そして、学習装置1は、各追加用画像123及び生成された各復元追加用画像124の間の差分に応じて、各追加用画像123の評価値125であって、各復元追加用画像124における各追加用画像123の復元の程度に対する評価値125を算出する。 Therefore, the learning device 1 acquires a plurality of additional images 123 each showing the product R. The learning device 1 generates each of the plurality of restored additional images 124 by restoring each of the plurality of additional images 123 by giving each of the acquired plural additional images 123 to the trained generation model 5. Then, the learning device 1 calculates the evaluation value 125 of each additional image 123 according to the difference between each additional image 123 and each generated restored additional image 124, and calculates the evaluation value 125 for each additional restored image 124. An evaluation value 125 for the degree of restoration of each additional image 123 is calculated.

追加用画像123と復元追加用画像124との間の差分が大きいほど、復元追加用画像124における追加用画像123の復元の程度が低い、すなわち、この追加用画像123に表れる製品Rの様子を再現する生成モデル5の能力が不十分であることを示す。そのため、復元追加用画像124との差分が大きい、換言すると、復元の程度の低い追加用画像123は、製品Rの写る画像を再現する生成モデル5の能力の適切な向上に貢献する可能性が高い。 The larger the difference between the additional image 123 and the restored additional image 124, the lower the degree of restoration of the additional image 123 in the restored additional image 124. In other words, the state of the product R appearing in this additional image 123 is This indicates that the ability of the generative model 5 to reproduce is insufficient. Therefore, the additional image 123 that has a large difference from the restored additional image 124, in other words, the additional image 123 that has been restored to a low degree, may contribute to an appropriate improvement in the ability of the generative model 5 to reproduce the image of the product R. expensive.

反対に、復元の程度が高い追加用画像123は、生成モデル5の能力の適切な向上に貢献する可能性が低い。加えて、復元の程度が高い追加用画像123を機械学習に使用する学習画像に追加することで、生成モデル5の能力の向上を図ると、追加用画像123の過剰な追加により、機械学習に使用する学習画像の件数の膨大化を招き、当該機械学習の処理コストを増大させてしまう可能性がある。更には、製品R以外のパターンを復元する能力を向上させてしまうことで、あらゆるパターンを忠実に再現する能力を生成モデル5に獲得させてしまう可能性がある。 On the contrary, the additional image 123 with a high degree of restoration is unlikely to contribute to appropriately improving the ability of the generative model 5. In addition, if you try to improve the ability of the generative model 5 by adding additional images 123 with a high degree of restoration to the learning images used for machine learning, the excessive addition of additional images 123 will cause problems in machine learning. This may lead to an enormous increase in the number of learning images used, increasing the processing cost of the machine learning. Furthermore, by improving the ability to restore patterns other than product R, there is a possibility that the generative model 5 acquires the ability to faithfully reproduce any pattern.

これらの点を考慮して、学習装置1は、算出された評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像126を複数の追加用画像123から抽出する。復元の程度が低いと評価するための所定の基準は、特に限定されなくてもよく、実施の形態に応じて適宜設定されてよい。例えば、学習装置1は、最も評価の低い追加用画像123を追加用画像126として抽出してもよい。また、例えば、学習装置1は、評価の低い方から順に所定数の追加用画像123を追加用画像126として抽出してもよい。抽出する追加用画像126の数は、オペレータの入力、設定値等により適宜決定されてよい。また、例えば、学習装置1は、閾値よりも評価の低い追加用画像123を追加用画像126として抽出してもよい。判定の基準となる閾値は、オペレータの入力、設定値等により適宜決定されてよい。そして、学習装置1は、抽出された1つ以上の追加用画像126に含まれる1つ以上の画像を第2学習画像126Aとして選択する。学習装置1は、1つ以上の追加用画像126の全てを第2学習画像126Aとして決定してもよい。あるいは、学習装置1は、1つ以上の追加用画像126のうちの一部を第2学習画像126Aとして決定してもよい。学習装置1は、機械学習により、1つ以上の第2学習画像126Aそれぞれが与えられると、与えられた1つ以上の第2学習画像126Aそれぞれに適合する復元画像を生成するように生成モデル5を更に訓練する。 Taking these points into consideration, the learning device 1 extracts one or more additional images 126 that are evaluated to have a low degree of restoration from the plurality of additional images 123 based on the calculated evaluation value. The predetermined criteria for evaluating that the degree of restoration is low does not need to be particularly limited, and may be set as appropriate depending on the embodiment. For example, the learning device 1 may extract the additional image 123 with the lowest evaluation as the additional image 126. Further, for example, the learning device 1 may extract a predetermined number of additional images 123 as additional images 126 in order from the one with the lowest evaluation. The number of additional images 126 to be extracted may be determined as appropriate based on operator input, setting values, and the like. Further, for example, the learning device 1 may extract the additional image 123 with a lower evaluation than the threshold value as the additional image 126. The threshold value that serves as the criterion for determination may be determined as appropriate based on operator input, set values, and the like. Then, the learning device 1 selects one or more images included in the one or more extracted additional images 126 as the second learning image 126A. The learning device 1 may determine all of the one or more additional images 126 as the second learning images 126A. Alternatively, the learning device 1 may determine a part of the one or more additional images 126 as the second learning image 126A. Through machine learning, the learning device 1 uses a generative model 5 to generate restored images that match each of the given one or more second learning images 126A, when each of the one or more second learning images 126A is given. further training.

本実施形態に係る検出装置2は、製品Rを観測することで得られた観測画像221を取得する。本実施形態では、検出装置2は、製品Rを観測するように配置されたカメラCAに接続されている。検出装置2は、カメラCAから観測画像221を取得する。なお、各画像(121、123、221)の種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。各画像(121、123、221)は、例えば、白黒画像等の二値画像、RGB画像、深度画像、赤外線画像等であってよい。これに応じて、カメラCAは、例えば、一般的なデジタルカメラ、深度カメラ、赤外線カメラ等であってよい。 The detection device 2 according to this embodiment acquires an observation image 221 obtained by observing the product R. In this embodiment, the detection device 2 is connected to a camera CA arranged to observe the product R. The detection device 2 acquires an observation image 221 from the camera CA. Note that the type of each image (121, 123, 221) does not need to be particularly limited, and may be appropriately selected depending on the embodiment. Each image (121, 123, 221) may be, for example, a binary image such as a black and white image, an RGB image, a depth image, an infrared image, or the like. Accordingly, the camera CA may be, for example, a general digital camera, a depth camera, an infrared camera, etc.

次に、検出装置2は、学習装置1により訓練された生成モデル5に観測画像221を入力することで、観測画像221に対応する復元観測画像223を生成する。そして、検出装置2は、生成された復元観測画像223及び観測画像221の間の差分に基づいて、所定の特徴以外の他の特徴の一例として欠陥が観測画像221に写っているか否か、換言すると、製品Rに欠陥が含まれるか否かを検出する。欠陥は、例えば、傷、汚れ、クラック、打痕、バリ、色ムラ、異物混入等であってよい。これにより、検出装置2は、学習済みの生成モデル5を利用して、製品Rの外観検査を実施する(すなわち、製品Rの良否を判定する)。 Next, the detection device 2 generates a restored observed image 223 corresponding to the observed image 221 by inputting the observed image 221 to the generative model 5 trained by the learning device 1. Then, based on the difference between the generated restored observation image 223 and observation image 221, the detection device 2 determines whether or not a defect is shown in the observation image 221 as an example of a feature other than the predetermined feature. Then, it is detected whether or not product R includes a defect. The defects may be, for example, scratches, dirt, cracks, dents, burrs, color unevenness, foreign matter contamination, and the like. Thereby, the detection device 2 uses the learned generative model 5 to perform an external appearance inspection of the product R (that is, determines whether the product R is good or bad).

以上のとおり、本実施形態では、第1学習画像121を使用した機械学習により、学習済みの生成モデル5が暫定的に構築される。上記学習装置1の一連の処理では、この暫定的に構築された学習済みの生成モデル5が各追加用画像123に対して復元能力を発揮した結果に基づいて、複数の追加用画像123から、当該復元能力の適切な向上に貢献する可能性の高い1つ以上の追加用画像126を自動的に抽出することができる。したがって、機械学習に使用する画像(学習画像)を適切に選択できる。加えて、適切に選択された学習画像を用いて構築された学習済みの生成モデル5によれば、観測画像221に欠陥が写っているか否か、すなわち、製品Rに欠陥が存在するか否かを精度よく検出することができる。 As described above, in this embodiment, the learned generative model 5 is provisionally constructed by machine learning using the first learning image 121. In the series of processes of the learning device 1, based on the results of the provisionally constructed learned generation model 5 demonstrating the restoration ability for each additional image 123, from a plurality of additional images 123, One or more additional images 126 that are likely to contribute to appropriate improvement of the restoration ability can be automatically extracted. Therefore, images used for machine learning (learning images) can be appropriately selected. In addition, according to the trained generative model 5 constructed using appropriately selected learning images, it is possible to determine whether or not a defect is captured in the observed image 221, that is, whether or not there is a defect in the product R. can be detected with high accuracy.

§2 具体例
[ハードウェア構成]
<学習装置>
次に、図2を用いて、本実施形態に係る学習装置1のハードウェア構成の一例について説明する。図2は、本実施形態に係る学習装置1のハードウェア構成の一例を模式的に例示する図である。
§2 Specific example [Hardware configuration]
<Learning device>
Next, an example of the hardware configuration of the learning device 1 according to this embodiment will be described using FIG. 2. FIG. 2 is a diagram schematically illustrating an example of the hardware configuration of the learning device 1 according to the present embodiment.

図2に示されるとおり、本実施形態に係る学習装置1は、制御部11、記憶部12、通信インタフェース13、入力装置14、表示装置15、及びドライブ16が電気的に接続されたコンピュータである。なお、図2では、通信インタフェースを「通信I/F」と記載している。 As shown in FIG. 2, the learning device 1 according to the present embodiment is a computer to which a control section 11, a storage section 12, a communication interface 13, an input device 14, a display device 15, and a drive 16 are electrically connected. . In addition, in FIG. 2, the communication interface is described as "communication I/F."

制御部11は、ハードウェアプロセッサであるCPU(Central Processing Unit)、RAM(Random Access Memory)、ROM(Read Only Memory)等を含み、プログラム及び各種データに基づいて情報処理を実行するように構成される。記憶部12は、メモリの一例であり、例えば、ハードディスクドライブ、ソリッドステートドライブ等で構成される。本実施形態では、記憶部12は、学習プログラム120、1つ以上の第1学習画像121、複数の追加用画像123、複数の評価画像127、学習結果データ129等の各種情報を記憶する。 The control unit 11 includes a CPU (Central Processing Unit), which is a hardware processor, a RAM (Random Access Memory), a ROM (Read Only Memory), etc., and is configured to execute information processing based on programs and various data. Ru. The storage unit 12 is an example of a memory, and includes, for example, a hard disk drive, a solid state drive, or the like. In this embodiment, the storage unit 12 stores various information such as a learning program 120, one or more first learning images 121, a plurality of additional images 123, a plurality of evaluation images 127, and learning result data 129.

学習プログラム120は、学習済みの生成モデル5を構築するための後述の機械学習の処理(図7及び図8)を学習装置1に実行させるためのプログラムである。学習プログラム120は、当該情報処理の一連の命令を含む。1つ以上の第1学習画像121は、生成モデル5の機械学習に使用される。各追加用画像123は、第1学習画像121以外で生成モデル5の機械学習に使用される学習画像の候補である。各評価画像127には、製品R及び欠陥が写る。各評価画像127は、生成モデル5により生成される復元画像を利用した欠陥の検出処理の性能を評価するのに使用される。学習結果データ129は、機械学習により構築された学習済みの生成モデル5に関する情報を示す。学習結果データ129は、学習プログラム120の実行結果として得られる。詳細は後述する。 The learning program 120 is a program for causing the learning device 1 to execute machine learning processing (FIGS. 7 and 8), which will be described later, for constructing the trained generative model 5. The learning program 120 includes a series of instructions for the information processing. One or more first learning images 121 are used for machine learning of the generative model 5. Each additional image 123 is a learning image candidate other than the first learning image 121 that is used for machine learning of the generative model 5. Each evaluation image 127 shows the product R and defects. Each evaluation image 127 is used to evaluate the performance of defect detection processing using the restored image generated by the generative model 5. The learning result data 129 indicates information regarding the learned generative model 5 constructed by machine learning. Learning result data 129 is obtained as an execution result of learning program 120. Details will be described later.

通信インタフェース13は、例えば、有線LAN(Local Area Network)モジュール、無線LANモジュール等であり、ネットワークを介した有線又は無線通信を行うためのインタフェースである。学習装置1は、この通信インタフェース13を利用することで、ネットワークを介したデータ通信を他の情報処理装置(例えば、検出装置2)と行うことができる。学習装置1は、通信インタフェース13を介して、複数の追加用画像123を取得してもよい。 The communication interface 13 is, for example, a wired LAN (Local Area Network) module, a wireless LAN module, or the like, and is an interface for performing wired or wireless communication via a network. By using this communication interface 13, the learning device 1 can perform data communication with other information processing devices (for example, the detection device 2) via the network. The learning device 1 may acquire a plurality of additional images 123 via the communication interface 13.

入力装置14は、例えば、マウス、キーボード等の入力を行うための装置である。また、表示装置15は、出力装置の一例であり、例えば、ディスプレイである。オペレータは、入力装置14及び表示装置15を介して、学習装置1を操作することができる。なお、表示装置15は、タッチパネルディスプレイであってもよい。この場合、入力装置14は省略されてもよい。 The input device 14 is, for example, a device for performing input such as a mouse or a keyboard. Further, the display device 15 is an example of an output device, and is, for example, a display. An operator can operate the learning device 1 via the input device 14 and the display device 15. Note that the display device 15 may be a touch panel display. In this case, the input device 14 may be omitted.

ドライブ16は、例えば、CDドライブ、DVDドライブ等であり、記憶媒体91に記憶されたプログラムを読み込むためのドライブ装置である。ドライブ16の種類は、記憶媒体91の種類に応じて適宜選択されてよい。上記学習プログラム120、1つ以上の第1学習画像121、複数の追加用画像123、及び複数の評価画像127の少なくともいずれかは、この記憶媒体91に記憶されていてもよい。 The drive 16 is, for example, a CD drive, a DVD drive, or the like, and is a drive device for reading a program stored in the storage medium 91. The type of drive 16 may be selected as appropriate depending on the type of storage medium 91. At least one of the learning program 120, one or more first learning images 121, a plurality of additional images 123, and a plurality of evaluation images 127 may be stored in this storage medium 91.

記憶媒体91は、コンピュータその他装置、機械等が記録されたプログラム等の情報を読み取り可能なように、当該プログラム等の情報を、電気的、磁気的、光学的、機械的又は化学的作用によって蓄積する媒体である。学習装置1は、この記憶媒体91から、上記学習プログラム120、1つ以上の第1学習画像121、複数の追加用画像123、及び複数の評価画像127の少なくともいずれかを取得してもよい。 The storage medium 91 stores information such as a recorded program by electrical, magnetic, optical, mechanical, or chemical action so that a computer, other device, machine, etc. can read the recorded program information. It is a medium for The learning device 1 may acquire at least one of the learning program 120, one or more first learning images 121, a plurality of additional images 123, and a plurality of evaluation images 127 from this storage medium 91.

ここで、図2では、記憶媒体91の一例として、CD、DVD等のディスク型の記憶媒体を例示している。しかしながら、記憶媒体91の種類は、ディスク型に限定される訳ではなく、ディスク型以外であってもよい。ディスク型以外の記憶媒体として、例えば、フラッシュメモリ等の半導体メモリを挙げることができる。 Here, in FIG. 2, a disk-type storage medium such as a CD or a DVD is illustrated as an example of the storage medium 91. However, the type of storage medium 91 is not limited to the disk type, and may be other than the disk type. An example of a storage medium other than a disk type is a semiconductor memory such as a flash memory.

なお、学習装置1の具体的なハードウェア構成に関して、実施形態に応じて、適宜、構成要素の省略、置換及び追加が可能である。例えば、制御部11は、複数のハードウェアプロセッサを含んでもよい。ハードウェアプロセッサは、マイクロプロセッサ、FPGA(field-programmable gate array)、DSP(digital signal processor)等で構成されてよい。記憶部12は、制御部11に含まれるRAM及びROMにより構成されてもよい。通信インタフェース13、入力装置14、表示装置15及びドライブ16の少なくともいずれかは省略されてもよい。学習装置1は、例えば、スピーカ等の表示装置15以外の出力装置を備えてもよい。学習装置1は、複数台のコンピュータで構成されてもよい。この場合、各コンピュータのハードウェア構成は、一致していてもよいし、一致していなくてもよい。また、学習装置1は、提供されるサービス専用に設計された情報処理装置の他、汎用のサーバ装置、汎用のPC(Personal Computer)等であってもよい。 Note that regarding the specific hardware configuration of the learning device 1, components may be omitted, replaced, or added as appropriate depending on the embodiment. For example, the control unit 11 may include multiple hardware processors. The hardware processor may be configured with a microprocessor, FPGA (field-programmable gate array), DSP (digital signal processor), or the like. The storage unit 12 may be configured by a RAM and a ROM included in the control unit 11. At least one of the communication interface 13, input device 14, display device 15, and drive 16 may be omitted. The learning device 1 may include an output device other than the display device 15, such as a speaker. The learning device 1 may be composed of multiple computers. In this case, the hardware configurations of the computers may or may not match. Further, the learning device 1 may be an information processing device designed exclusively for the provided service, or may be a general-purpose server device, a general-purpose PC (Personal Computer), or the like.

<検出装置>
次に、図3を用いて、本実施形態に係る検出装置2のハードウェア構成の一例について説明する。図3は、本実施形態に係る検出装置2のハードウェア構成の一例を模式的に例示する図である。
<Detection device>
Next, an example of the hardware configuration of the detection device 2 according to this embodiment will be described using FIG. 3. FIG. 3 is a diagram schematically illustrating an example of the hardware configuration of the detection device 2 according to the present embodiment.

図3に示されるとおり、本実施形態に係る検出装置2は、制御部21、記憶部22、通信インタフェース23、入力装置24、表示装置25、ドライブ26、及び外部インタフェース27が電気的に接続されたコンピュータである。なお、図3では、外部インタフェースを「外部I/F」と記載している。検出装置2の制御部21~ドライブ26はそれぞれ、上記学習装置1の制御部11~ドライブ16それぞれと同様に構成されてよい。 As shown in FIG. 3, in the detection device 2 according to the present embodiment, a control section 21, a storage section 22, a communication interface 23, an input device 24, a display device 25, a drive 26, and an external interface 27 are electrically connected. It is a computer. In addition, in FIG. 3, the external interface is described as "external I/F." The control unit 21 to drive 26 of the detection device 2 may be configured similarly to the control unit 11 to drive 16 of the learning device 1, respectively.

すなわち、制御部21は、ハードウェアプロセッサであるCPU、RAM、ROM等を含み、プログラム及びデータに基づいて各種情報処理を実行するように構成される。記憶部22は、例えば、ハードディスクドライブ、ソリッドステートドライブ等で構成される。記憶部22は、検出プログラム220、学習結果データ129等の各種情報を記憶する。 That is, the control unit 21 includes a CPU, RAM, ROM, etc., which are hardware processors, and is configured to execute various information processing based on programs and data. The storage unit 22 includes, for example, a hard disk drive, a solid state drive, or the like. The storage unit 22 stores various information such as a detection program 220 and learning result data 129.

検出プログラム220は、学習装置1により訓練された学習済みの生成モデル5を利用して、観測画像221に写る製品Rの良否を判定する後述の情報処理(図15)を検出装置2に実行させるためのプログラムである。検出プログラム220は、当該情報処理の一連の命令を含む。詳細は後述する。 The detection program 220 uses the learned generative model 5 trained by the learning device 1 to cause the detection device 2 to perform information processing (FIG. 15), which will be described later, to determine the quality of the product R shown in the observed image 221. This is a program for The detection program 220 includes a series of instructions for processing the information. Details will be described later.

通信インタフェース23は、例えば、有線LANモジュール、無線LANモジュール等であり、ネットワークを介した有線又は無線通信を行うためのインタフェースである。検出装置2は、この通信インタフェース23を利用することで、ネットワークを介したデータ通信を他の情報処理装置(例えば、学習装置1)と行うことができる。 The communication interface 23 is, for example, a wired LAN module, a wireless LAN module, or the like, and is an interface for performing wired or wireless communication via a network. By using this communication interface 23, the detection device 2 can perform data communication with another information processing device (for example, the learning device 1) via the network.

入力装置24は、例えば、マウス、キーボード等の入力を行うための装置である。表示装置25は、出力装置の一例であり、例えば、ディスプレイである。オペレータは、入力装置24及び表示装置25を介して、検出装置2を操作することができる。入力装置24及び表示装置25はタッチパネルディスプレイに置き換えられてもよい。 The input device 24 is, for example, a device for performing input such as a mouse or a keyboard. The display device 25 is an example of an output device, and is, for example, a display. An operator can operate the detection device 2 via the input device 24 and the display device 25. The input device 24 and the display device 25 may be replaced with touch panel displays.

ドライブ26は、例えば、CDドライブ、DVDドライブ等であり、記憶媒体92に記憶されたプログラムを読み込むためのドライブ装置である。上記検出プログラム220及び学習結果データ129のうちの少なくともいずれかは、記憶媒体92に記憶されていてもよい。また、検出装置2は、記憶媒体92から、上記検出プログラム220及び学習結果データ129のうちの少なくともいずれかを取得してもよい。記憶媒体92の種類は、ディスク型であってもよいし、ディスク型以外であってもよい。 The drive 26 is, for example, a CD drive, a DVD drive, etc., and is a drive device for reading a program stored in the storage medium 92. At least one of the detection program 220 and the learning result data 129 may be stored in the storage medium 92. Further, the detection device 2 may acquire at least one of the detection program 220 and the learning result data 129 from the storage medium 92. The type of storage medium 92 may be a disk type or a type other than a disk type.

外部インタフェース27は、例えば、USB(Universal Serial Bus)ポート、専用ポート等であり、外部装置と接続するためのインタフェースである。外部インタフェース27の種類及び数は、接続される外部装置の種類及び数に応じて適宜選択されてよい。本実施形態では、検出装置2は、外部インタフェース27を介して、カメラCAに接続される。 The external interface 27 is, for example, a USB (Universal Serial Bus) port, a dedicated port, or the like, and is an interface for connecting to an external device. The type and number of external interfaces 27 may be selected as appropriate depending on the type and number of external devices to be connected. In this embodiment, the detection device 2 is connected to the camera CA via an external interface 27.

カメラCAは、外観検査の対象となる製品Rを写した観測画像221を取得するのに利用される。カメラCAの種類及び配置場所は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。カメラCAには、例えば、一般的なデジタルカメラ、深度カメラ、赤外線カメラ等が用いられてよい。また、カメラCAは、製造ラインにより搬送される製品Rを観測可能なように適宜配置されてよい。カメラCAは、例えば、製品Rを搬送する製造ラインの近傍に配置されてよい。なお、カメラCAが通信インタフェースを備える場合、検出装置2は、外部インタフェース27ではなく、通信インタフェース23を介して、カメラCAに接続されてもよい。 The camera CA is used to obtain an observation image 221 of the product R to be subjected to visual inspection. The type and location of camera CA do not need to be particularly limited, and may be determined as appropriate depending on the embodiment. For example, a general digital camera, depth camera, infrared camera, etc. may be used as the camera CA. Further, the camera CA may be appropriately placed so as to be able to observe the product R being transported through the production line. Camera CA may be placed, for example, near a production line that transports products R. Note that when the camera CA includes a communication interface, the detection device 2 may be connected to the camera CA via the communication interface 23 instead of the external interface 27.

なお、検出装置2の具体的なハードウェア構成に関して、実施形態に応じて、適宜、構成要素の省略、置換及び追加が可能である。例えば、制御部21は、複数のハードウェアプロセッサを含んでもよい。ハードウェアプロセッサは、マイクロプロセッサ、FPGA、DSP等で構成されてよい。記憶部22は、制御部21に含まれるRAM及びROMにより構成されてもよい。通信インタフェース23、入力装置24、表示装置25、ドライブ26及び外部インタフェース27の少なくともいずれかは省略されてもよい。検出装置2は、例えば、スピーカ等の表示装置25以外の出力装置を備えてもよい。検出装置2は、複数台のコンピュータで構成されてもよい。この場合、各コンピュータのハードウェア構成は、一致していてもよいし、一致していなくてもよい。また、検出装置2は、提供されるサービス専用に設計された情報処理装置の他、汎用のサーバ装置、汎用のPC等であってもよい。 Note that regarding the specific hardware configuration of the detection device 2, components may be omitted, replaced, or added as appropriate depending on the embodiment. For example, the control unit 21 may include multiple hardware processors. The hardware processor may be comprised of a microprocessor, FPGA, DSP, etc. The storage unit 22 may be configured by a RAM and a ROM included in the control unit 21. At least one of the communication interface 23, the input device 24, the display device 25, the drive 26, and the external interface 27 may be omitted. The detection device 2 may include an output device other than the display device 25, such as a speaker. The detection device 2 may be composed of multiple computers. In this case, the hardware configurations of the computers may or may not match. Further, the detection device 2 may be an information processing device designed exclusively for the provided service, or may be a general-purpose server device, a general-purpose PC, or the like.

[ソフトウェア構成]
<学習装置>
次に、図4及び図5を用いて、本実施形態に係る学習装置1のソフトウェア構成の一例について説明する。図4及び図5は、本実施形態に係る学習装置1のソフトウェア構成の一例を模式的に例示する図である。
[Software configuration]
<Learning device>
Next, an example of the software configuration of the learning device 1 according to this embodiment will be described using FIGS. 4 and 5. 4 and 5 are diagrams schematically illustrating an example of the software configuration of the learning device 1 according to the present embodiment.

学習装置1の制御部11は、記憶部12に記憶された学習プログラム120をRAMに展開する。そして、制御部11は、RAMに展開された学習プログラム120に含まれる命令をCPUにより解釈及び実行して、各構成要素を制御する。これによって、図4及び図5に示されるとおり、本実施形態に係る学習装置1は、第1取得部110、学習部111、第2取得部112、生成部113、評価部114、抽出部115、追加学習部116、第3取得部117、表示制御部118、選択受付部119及び保存処理部1110をソフトウェアモジュールとして備えるコンピュータとして動作する。すなわち、本実施形態では、学習装置1の各ソフトウェアモジュールは、制御部11(CPU)により実現される。 The control unit 11 of the learning device 1 loads the learning program 120 stored in the storage unit 12 into the RAM. The control unit 11 then uses the CPU to interpret and execute instructions included in the learning program 120 developed in the RAM, thereby controlling each component. As a result, as shown in FIGS. 4 and 5, the learning device 1 according to the present embodiment includes a first acquisition unit 110, a learning unit 111, a second acquisition unit 112, a generation unit 113, an evaluation unit 114, an extraction unit 115 , an additional learning section 116, a third acquisition section 117, a display control section 118, a selection reception section 119, and a storage processing section 1110 as software modules. That is, in this embodiment, each software module of the learning device 1 is realized by the control unit 11 (CPU).

図4に示されるとおり、第1取得部110は、製品Rの写る1つ以上の第1学習画像121を取得する。学習部111は、取得された1つ以上の第1学習画像121を使用して、生成モデル5の機械学習を実施する。生成モデル5は、入力画像が与えられると、与えられた入力画像を特徴量に変換し、変換により得られた特徴量から与えられた入力画像を復元した画像を生成するように構成される。学習部111は、機械学習により、1つ以上の第1学習画像121それぞれが与えられると、与えられた1つ以上の第1学習画像121それぞれに適合する復元画像を生成するように生成モデル5を訓練する。 As shown in FIG. 4, the first acquisition unit 110 acquires one or more first learning images 121 in which the product R appears. The learning unit 111 performs machine learning of the generative model 5 using the acquired one or more first learning images 121. The generative model 5 is configured to, when an input image is given, convert the given input image into a feature amount, and generate an image that is a restoration of the given input image from the feature amount obtained by the conversion. By machine learning, when one or more first learning images 121 are given, the learning unit 111 uses a generative model 5 to generate a restored image that matches each of the given one or more first learning images 121. train.

詳細には、生成モデル5は、入力画像を特徴量に変換し、変換により得られた特徴量から入力画像を復元した画像を生成する演算処理に使用される演算パラメータMを備えるモジュール(学習モデル)により構成される。この生成モデル5の構成は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、生成モデル5には、ニューラルネットワーク(例えば、オートエンコーダ等)、主成分分析により導出される固有ベクトル等の公知の学習モデルを用いることができる。機械学習では、第1学習画像121が与えられると、与えられた第1学習画像121に適合する復元画像を生成するように、この演算パラメータMの値が調整される。本実施形態では、生成モデル5は、オートエンコーダ等のニューラルネットワークにより構成される。 In detail, the generative model 5 is a module (learning model ). The configuration of the generative model 5 does not need to be particularly limited, and may be appropriately selected depending on the embodiment. For example, as the generation model 5, a known learning model such as a neural network (for example, an autoencoder, etc.) or an eigenvector derived by principal component analysis can be used. In machine learning, when a first learning image 121 is given, the value of this calculation parameter M is adjusted so as to generate a restored image that matches the given first learning image 121. In this embodiment, the generation model 5 is configured by a neural network such as an autoencoder.

第2取得部112は、製品Rの写る複数の追加用画像123を取得する。本実施の形態では、各追加用画像123には、欠陥の含まれていない製品R(すなわち、良品)が写っている。すなわち、各追加用画像123には欠陥が写っていない。生成部113は、取得された複数の追加用画像123それぞれを訓練された生成モデル5に与えることで、複数の追加用画像123それぞれを復元した複数の復元追加用画像124それぞれを生成する。評価部114は、各追加用画像123及び生成された各復元追加用画像124の間の差分に応じて、各追加用画像123の評価値125であって、各復元追加用画像124における各追加用画像123の復元の程度に対する評価値125を算出する。 The second acquisition unit 112 acquires a plurality of additional images 123 in which the product R appears. In this embodiment, each additional image 123 depicts a product R that does not include defects (that is, a non-defective product). That is, each additional image 123 does not include any defects. The generation unit 113 generates each of the plurality of restored additional images 124 by restoring each of the plurality of additional images 123 by giving each of the plurality of acquired additional images 123 to the trained generation model 5. The evaluation unit 114 calculates the evaluation value 125 of each additional image 123 according to the difference between each additional image 123 and each generated restored additional image 124, and calculates the evaluation value 125 of each additional restored image 124. An evaluation value 125 for the degree of restoration of the original image 123 is calculated.

本実施形態では、評価部114は、各追加用画像123と各復元追加用画像124との差分を算出する。これにより、評価部114は、複数の追加用画像123それぞれと複数の復元追加用画像124それぞれとの間の差分を示す複数の差分画像182それぞれを生成する。追加用画像123と復元追加用画像124との間で差異が生じている画素ほど、差分画像182においてその画素値が大きい。つまり、差分画像182内で画素値の大きい画素が多いほど、復元追加用画像124における追加用画像123の復元の程度が低いことを示す。反対に、差分画像182内で画素値の大きい画素が少ないほど、復元追加用画像124における追加用画像123の復元の程度が高いことを示す。この観点に基づいて、評価部114は、生成された各差分画像182を利用して、各追加用画像123の復元の程度に対する各評価値125を算出する。 In this embodiment, the evaluation unit 114 calculates the difference between each additional image 123 and each restored additional image 124. Thereby, the evaluation unit 114 generates each of a plurality of difference images 182 indicating the difference between each of the plurality of additional images 123 and each of the plurality of restored and additional images 124. The more different a pixel is between the additional image 123 and the restored additional image 124, the larger the pixel value is in the difference image 182. In other words, the more pixels with large pixel values in the difference image 182, the lower the degree of restoration of the additional image 123 in the additional restoration image 124. On the contrary, the fewer pixels with large pixel values in the difference image 182, the higher the degree of restoration of the additional image 123 in the restored additional image 124. Based on this viewpoint, the evaluation unit 114 uses each generated difference image 182 to calculate each evaluation value 125 for the degree of restoration of each additional image 123.

抽出部115は、算出された各評価値125に基づいて、復元の程度が低いと評価される1つ以上の追加用画像126を複数の追加用画像123から抽出する。復元の程度が低いと評価するための基準は、特に限定されなくてもよく、実施の形態に応じて適宜設定されてよい。 The extraction unit 115 extracts one or more additional images 126 that are evaluated as having a low degree of restoration from the plurality of additional images 123 based on each calculated evaluation value 125 . The criteria for evaluating that the degree of restoration is low does not need to be particularly limited, and may be set as appropriate depending on the embodiment.

本実施形態に係る学習装置1は、抽出された1つ以上の追加用画像126が追加学習に用いる画像として適切か否かをチェックするための処理を実行するように構成される。具体的には、表示制御部118は、抽出された1つ以上の追加用画像126それぞれを表示装置15に表示させる。選択受付部119は、表示装置15に表示された1つ以上の追加用画像126それぞれについて、当該1つ以上の追加用画像126それぞれを機械学習に使用するか否かの選択を受け付ける。 The learning device 1 according to the present embodiment is configured to execute processing for checking whether the one or more extracted additional images 126 are appropriate as images to be used for additional learning. Specifically, the display control unit 118 causes the display device 15 to display each of the one or more extracted additional images 126. The selection accepting unit 119 accepts, for each of the one or more additional images 126 displayed on the display device 15, a selection as to whether to use each of the one or more additional images 126 for machine learning.

追加学習部116は、選択受付部119が受け付けた選択結果に応じて、抽出された1つ以上の追加用画像126に含まれる1つ以上の画像を第2学習画像126Aとして決定する。すなわち、追加学習部116は、機械学習に使用すると選択された追加用画像126を上記訓練の対象となる第2学習画像126Aとして決定する。追加学習部116は、機械学習に使用しないと選択された追加用画像126を上記訓練の対象から除外する。 The additional learning unit 116 determines one or more images included in the one or more extracted additional images 126 as the second learning image 126A according to the selection result received by the selection receiving unit 119. That is, the additional learning unit 116 determines the additional image 126 selected to be used for machine learning as the second learning image 126A to be the training target. The additional learning unit 116 excludes the additional image 126 selected not to be used for machine learning from the training target.

追加学習部116は、機械学習により、決定された1つ以上の第2学習画像126Aそれぞれが与えられると、与えられた1つ以上の第2学習画像126Aそれぞれに適合する復元画像を生成するように生成モデル5を更に訓練する。 The additional learning unit 116 uses machine learning to generate restored images that match each of the one or more second learning images 126A, when each of the determined one or more second learning images 126A is given. Then, generative model 5 is further trained.

更に、本実施形態では、図5に示されるとおり、学習装置1は、追加用画像126の抽出を実行する前に、構築された生成モデル5により生成される復元画像を利用した欠陥の検出処理の性能を評価するように構成される。具体的に、第3取得部117は、製品R及び欠陥Lがそれぞれ写る複数の評価画像127を取得する。すなわち、各評価画像127には、欠陥Lを含む製品R(すなわち、不良品)が写っている。生成部113は、取得された複数の評価画像127それぞれを訓練された生成モデル5に与えることで、複数の評価画像127それぞれを復元した複数の復元評価画像128それぞれを更に生成する。 Furthermore, in the present embodiment, as shown in FIG. 5, before extracting the additional image 126, the learning device 1 performs defect detection processing using the restored image generated by the constructed generative model 5. configured to evaluate the performance of. Specifically, the third acquisition unit 117 acquires a plurality of evaluation images 127 in which the product R and the defect L are respectively captured. That is, each evaluation image 127 shows a product R including a defect L (that is, a defective product). The generation unit 113 further generates each of the plurality of restored evaluation images 128 by restoring each of the plurality of evaluation images 127 by giving each of the plurality of acquired evaluation images 127 to the trained generation model 5.

評価部114は、更に、各追加用画像123と各復元追加用画像124との差分の程度に基づいて、各追加用画像123に欠陥Lが写っているか否か(すなわち、各追加用画像123に写る製品Rに欠陥Lが存在するか否か)を判定する。また、評価部114は、各評価画像127と各復元評価画像128との差分の程度に基づいて、各評価画像127に欠陥Lが写っているか否か(すなわち、各評価画像127に写る製品Rに欠陥Lが存在するか否か)を判定する。 The evaluation unit 114 further determines whether or not the defect L is reflected in each additional image 123 based on the degree of difference between each additional image 123 and each restored additional image 124 (that is, whether or not each additional image 123 includes a defect L). It is determined whether the defect L exists in the product R shown in the image. Furthermore, the evaluation unit 114 determines whether or not the defect L is reflected in each evaluation image 127 based on the degree of difference between each evaluation image 127 and each restored evaluation image 128 (that is, the product R (Whether or not the defect L exists) is determined.

本実施形態では、評価部114は、各差分画像182を利用して、各追加用画像123に欠陥Lが写っているか否かを判定する。同様に、評価部114は、各評価画像127と各復元評価画像128との差分を算出することで、複数の評価画像127それぞれと複数の復元評価画像128それぞれとの間の差分を示す複数の差分画像183それぞれを生成する。評価部114は、各差分画像183を利用して、各評価画像127に欠陥Lが写っているか否かを判定する。 In this embodiment, the evaluation unit 114 uses each difference image 182 to determine whether the defect L is included in each additional image 123. Similarly, by calculating the difference between each evaluation image 127 and each restoration evaluation image 128, the evaluation unit 114 calculates a plurality of images indicating the difference between each of the plurality of evaluation images 127 and each of the restoration evaluation images 128. Each difference image 183 is generated. The evaluation unit 114 uses each difference image 183 to determine whether the defect L is included in each evaluation image 127.

各画像(123、127)に欠陥Lが写っているか否かを判定するための検出パラメータは適宜与えられてよい。例えば、検出パラメータの値は、オペレータの入力により指定されてもよいし、プログラム内の設定値として与えられてよい。本実施形態では、複数の検出パラメータ候補60が与えられる。検出パラメータ候補60は、本発明の「パラメータ候補」の一例である。各検出パラメータ候補60は、検出パラメータの候補の値を示す。各検出パラメータ候補60の値は適宜与えられてよい。 Detection parameters for determining whether the defect L is included in each image (123, 127) may be given as appropriate. For example, the value of the detection parameter may be specified by operator input or may be given as a set value within the program. In this embodiment, a plurality of detection parameter candidates 60 are provided. The detection parameter candidate 60 is an example of a "parameter candidate" of the present invention. Each detected parameter candidate 60 indicates a value of a detected parameter candidate. The value of each detection parameter candidate 60 may be given as appropriate.

評価部114は、各検出パラメータ候補60を利用して、各追加用画像123に欠陥Lが写っているか否かの判定、及び各評価画像127に欠陥Lが写っているか否かの判定を実行する。評価部114は、各判定の結果に基づいて、複数の検出パラメータ候補60のうち、欠陥Lが写っていると判定される追加用画像123及び欠陥Lが写っていないと判定される評価画像127の数が最も少ない1つの検出パラメータ候補61を特定する。これにより、評価部114は、欠陥Lの検出に利用する検出パラメータを自動的に最適化する。 The evaluation unit 114 uses each detection parameter candidate 60 to determine whether the defect L is shown in each additional image 123 and to determine whether the defect L is shown in each evaluation image 127. do. Based on the results of each determination, the evaluation unit 114 selects an additional image 123 that is determined to include the defect L and an evaluation image 127 that is determined to not include the defect L from among the plurality of detection parameter candidates 60. One detection parameter candidate 61 with the smallest number of is identified. Thereby, the evaluation unit 114 automatically optimizes the detection parameters used for detecting the defect L.

そして、評価部114は、特定された1つの検出パラメータ候補61を利用した判定において、欠陥Lが写っていると判定された追加用画像123の数(以下、誤判定の追加用画像123の数とも記載する)が第1の閾値以上であるか否かを判定する。また、評価部114は、特定された1つの検出パラメータ候補61を利用した判定において、欠陥Lが写っていないと判定された評価画像127の数(以下、誤判定の評価画像127の数とも記載する)が第2の閾値以上であるか否かを判定する。第1の閾値及び第2の閾値はそれぞれ、適宜決定されてよい。 Then, the evaluation unit 114 determines the number of additional images 123 that are determined to include the defect L (hereinafter, the number of additional images 123 that are erroneously determined) in the determination using the one identified detection parameter candidate 61. ) is greater than or equal to a first threshold value. In addition, the evaluation unit 114 determines the number of evaluation images 127 that are determined to not include the defect L (hereinafter also referred to as the number of erroneously determined evaluation images 127 in the determination using the one identified detection parameter candidate 61). ) is greater than or equal to a second threshold. The first threshold value and the second threshold value may each be determined as appropriate.

あるいは、評価部114は、特定された1つの検出パラメータ候補61を利用した判定において、複数の追加用画像123のうち欠陥Lが写っていると判定された追加用画像123の割合(以下、誤判定の追加用画像123の割合とも記載する)が第1の閾値以上であるか否かを判定してもよい。また、評価部114は、特定された1つの検出パラメータ候補61を利用した判定において、複数の評価画像127のうち欠陥Lが写っていないと判定された評価画像127の割合(以下、誤判定の評価画像127の割合とも記載する)が第2の閾値以上であるか否かを判定してもよい。 Alternatively, the evaluation unit 114 determines the percentage of additional images 123 that are determined to include the defect L (hereinafter referred to as erroneous It may also be determined whether the ratio of the additional image 123 for determination) is greater than or equal to a first threshold value. In addition, the evaluation unit 114 determines the percentage of evaluation images 127 that are determined to not include the defect L (hereinafter referred to as erroneous determination) among the plurality of evaluation images 127 in the determination using the one identified detection parameter candidate 61. It may be determined whether the ratio of the evaluation image 127 (also referred to as the ratio of the evaluation image 127) is greater than or equal to a second threshold value.

学習装置1は、誤判定の追加用画像123の数又は割合が第1の閾値以上である、又は誤判定の評価画像127の数又は割合が第2の閾値以上である場合に、追加用画像126による追加学習に関する上記一連の処理を実行する。すなわち、評価部114は、特定された1つの検出パラメータ候補61を利用した各判定の結果において、誤判定の追加用画像123の数又は割合が第1の閾値以上である、又は誤判定の評価画像127の数又は割合が第2の閾値以上である場合に、誤判定された1又は複数の追加用画像123について、評価値125を算出する。 The learning device 1 adds images for addition when the number or proportion of additional images 123 of false determination is equal to or greater than a first threshold, or when the number or proportion of evaluation images 127 of false determination is equal to or greater than a second threshold. 126 is executed. That is, the evaluation unit 114 evaluates whether the number or proportion of additional images 123 of false determinations is equal to or greater than the first threshold in the results of each determination using one identified detection parameter candidate 61, or the evaluation of false determinations. When the number or proportion of images 127 is equal to or greater than the second threshold, an evaluation value 125 is calculated for one or more additional images 123 that have been incorrectly determined.

抽出部115は、算出された評価値125に基づいて、欠陥Lが写っていると判定された1又は複数の追加用画像123のうち、復元の程度が低いと評価される1つ以上の追加用画像126を抽出する。追加学習部116は、選択受付部119の受け付けた選択結果に応じて、抽出された1つ以上の追加用画像126に含まれる1つ以上の画像を第2学習画像126Aとして決定する。追加学習部116は、機械学習により、決定された1つ以上の第2学習画像126Aそれぞれが与えられると、与えられた1つ以上の第2学習画像126Aそれぞれに適合する復元画像を生成するように生成モデル5を更に訓練する。 Based on the calculated evaluation value 125, the extraction unit 115 extracts one or more additional images 123 that are evaluated to have a low degree of restoration from among the one or more additional images 123 that are determined to include the defect L. image 126 is extracted. The additional learning unit 116 determines one or more images included in the one or more extracted additional images 126 as the second learning image 126A according to the selection result received by the selection receiving unit 119. The additional learning unit 116 uses machine learning to generate restored images that match each of the one or more second learning images 126A, when each of the determined one or more second learning images 126A is given. Then, generative model 5 is further trained.

更に、本実施形態では、図4及び図5に示されるとおり、各画像(121、123)は、複数のパッチ画像(P1、P2)に分割される。生成モデル5は、パッチ画像(P1、P2)毎に与えられる。学習部111は、パッチ画像P1毎に、機械学習により、1つ以上の第1学習画像121それぞれが与えられると、与えられた1つ以上の第1学習画像121それぞれに適合する復元画像を生成するように各生成モデル5を訓練する。 Furthermore, in this embodiment, each image (121, 123) is divided into a plurality of patch images (P1, P2) as shown in FIGS. 4 and 5. The generative model 5 is given for each patch image (P1, P2). For each patch image P1, when one or more first learning images 121 are given, the learning unit 111 generates a restored image that matches each of the given one or more first learning images 121 by machine learning. Each generative model 5 is trained as follows.

生成部113は、パッチ画像P2毎に、対応する生成モデル5を利用して、各追加用画像123に対応する各復元追加用画像124を生成する。同様に、各評価画像127も、複数のパッチ画像P3に分割される。生成部113は、パッチ画像P3毎に、対応する生成モデル5を利用して、各評価画像127に対応する各復元評価画像128を生成する。 The generation unit 113 generates each restored additional image 124 corresponding to each additional image 123 for each patch image P2, using the corresponding generation model 5. Similarly, each evaluation image 127 is also divided into a plurality of patch images P3. The generation unit 113 generates each restored evaluation image 128 corresponding to each evaluation image 127 for each patch image P3 using the corresponding generation model 5.

評価部114は、パッチ画像P2毎に、各差分画像182を利用して、各追加用画像123に欠陥Lが写っているか否かを判定する。同様に、評価部114は、パッチ画像P3毎に、各差分画像183を利用して、各評価画像127に欠陥Lが写っているか否かを判定する。更に、評価部114は、パッチ画像P2毎に、各追加用画像123の評価値125を算出する。本実施形態では、評価部114は、誤判定の追加用画像123の数又は割合が第1の閾値以上である、又は誤判定の評価画像127の数又は割合が第2の閾値以上であるパッチ画像P2に関して、各追加用画像123の評価値125を算出する。 For each patch image P2, the evaluation unit 114 uses each difference image 182 to determine whether the defect L is included in each additional image 123. Similarly, for each patch image P3, the evaluation unit 114 uses each difference image 183 to determine whether the defect L is included in each evaluation image 127. Furthermore, the evaluation unit 114 calculates the evaluation value 125 of each additional image 123 for each patch image P2. In the present embodiment, the evaluation unit 114 evaluates patches for which the number or proportion of additional images 123 of false determination is equal to or greater than a first threshold, or the number or proportion of evaluation images 127 of false determination is equal to or greater than a second threshold. Regarding the image P2, an evaluation value 125 of each additional image 123 is calculated.

抽出部115は、パッチ画像P2毎に、算出された評価値125に基づいて、1つ以上の追加用画像126を複数の追加用画像123から抽出する。パッチ画像P2毎に、抽出される追加用画像126の件数は異なっていてもよい。追加学習部116は、抽出された1つ以上の追加用画像126に含まれる1つ以上の画像を第2学習画像126Aとして決定する。追加学習部116は、パッチ画像P2毎に、機械学習により、決定された1つ以上の第2学習画像126Aそれぞれが与えられると、与えられた1つ以上の第2学習画像126Aそれぞれに適合する復元画像を生成するように各生成モデル5を更に訓練する。 The extraction unit 115 extracts one or more additional images 126 from the plurality of additional images 123 for each patch image P2 based on the calculated evaluation value 125. The number of additional images 126 extracted may be different for each patch image P2. The additional learning unit 116 determines one or more images included in the one or more extracted additional images 126 as the second learning image 126A. When given each of the one or more second learning images 126A determined by machine learning for each patch image P2, the additional learning unit 116 adapts to each of the one or more given second learning images 126A. Each generative model 5 is further trained to generate a restored image.

なお、図4及び図5では、各画像(121、123、127)は、16個のパッチ画像(P1、P2、P3)に等分に分割されている。このように、各画像(121、123、127)を等分に分割することで、寸法の統一された複数のパッチ画像(P1、P2、P3)が生成されてよい。ただし、画像を分割する方法は、各画像(121、123、127)の間で統一されていれば、このような例に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。複数のパッチ画像(P1、P2、P3)のうちの少なくとも一部の寸法が他の寸法と異なっていてもよい。また、1つの画像(121、123、127)におけるパッチ画像(P1、P2、P3)の数は、16個に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。 Note that in FIGS. 4 and 5, each image (121, 123, 127) is equally divided into 16 patch images (P1, P2, P3). In this way, by dividing each image (121, 123, 127) into equal parts, a plurality of patch images (P1, P2, P3) with uniform dimensions may be generated. However, the method of dividing the image is not limited to this example as long as it is unified among the images (121, 123, 127), and may be determined as appropriate depending on the embodiment. . At least some dimensions of the plurality of patch images (P1, P2, P3) may be different from other dimensions. Further, the number of patch images (P1, P2, P3) in one image (121, 123, 127) does not need to be limited to 16, and may be appropriately selected depending on the embodiment.

保存処理部1110は、記憶部12へのデータの保存処理を行なう。本実施の形態では、保存処理部1110は、最終的に構築された学習済みの生成モデル5に関する情報を学習結果データ129として生成する。そして、保存処理部1110は、生成された学習結果データ129を所定の記憶領域に保存する。所定の記憶領域は、例えば、制御部11内のRAM、記憶部12、記憶媒体91、外部記憶装置又はこれらの組み合わせであってよい。 The storage processing unit 1110 performs a process of storing data in the storage unit 12. In this embodiment, the storage processing unit 1110 generates information regarding the finally constructed trained generative model 5 as the learning result data 129. The storage processing unit 1110 then stores the generated learning result data 129 in a predetermined storage area. The predetermined storage area may be, for example, the RAM in the control unit 11, the storage unit 12, the storage medium 91, an external storage device, or a combination thereof.

<検出装置>
次に、図6を用いて、本実施形態に係る検出装置2のソフトウェア構成の一例について説明する。図6は、本実施形態に係る検出装置2のソフトウェア構成の一例を模式的に例示する図である。
<Detection device>
Next, an example of the software configuration of the detection device 2 according to this embodiment will be described using FIG. 6. FIG. 6 is a diagram schematically illustrating an example of the software configuration of the detection device 2 according to the present embodiment.

検出装置2の制御部21は、記憶部22に記憶された検出プログラム220をRAMに展開する。そして、制御部21は、RAMに展開された検出プログラム220に含まれる命令をCPUにより解釈及び実行して、各構成要素を制御する。これによって、図6に示されるとおり、本実施形態に係る検出装置2は、取得部211、生成部212、検出部213及び出力部214をソフトウェアモジュールとして備えるコンピュータとして構成される。すなわち、本実施形態では、検出装置2の各ソフトウェアモジュールも、上記学習装置1と同様に、制御部21(CPU)により実現される。 The control unit 21 of the detection device 2 loads the detection program 220 stored in the storage unit 22 into the RAM. The control unit 21 then uses the CPU to interpret and execute instructions included in the detection program 220 loaded in the RAM, thereby controlling each component. As a result, as shown in FIG. 6, the detection device 2 according to the present embodiment is configured as a computer including an acquisition section 211, a generation section 212, a detection section 213, and an output section 214 as software modules. That is, in this embodiment, each software module of the detection device 2 is also realized by the control unit 21 (CPU), similarly to the learning device 1 described above.

取得部211は、製品Rを観測することで得られた観測画像221を取得する。生成部212は、学習結果データ129を保持することで、学習済みの生成モデル5を備えている。生成部212は、学習結果データ129を参照して、学習済みの生成モデル5の設定を行う。そして、生成部212は、取得された観測画像221を学習済みの生成モデル5に入力することで、観測画像221を復元した復元観測画像223を生成する。 The acquisition unit 211 acquires an observation image 221 obtained by observing the product R. The generation unit 212 is equipped with a trained generation model 5 by holding learning result data 129. The generation unit 212 refers to the learning result data 129 and sets the learned generation model 5. Then, the generation unit 212 generates a restored observation image 223 by restoring the observation image 221 by inputting the acquired observation image 221 into the learned generation model 5.

検出部213は、生成された復元観測画像223及び観測画像221の間の差分に基づいて、製品Rと共に欠陥が観測画像221に写っているか否か(すなわち、観測画像221に写る製品Rに欠陥が存在するか否か)を検出する。本実施形態では、検出部213は、上記学習装置1と同様に、観測画像221と復元観測画像223との差分を算出することで、観測画像221と復元観測画像223との間の差分を示す差分画像225を生成する。検出部213は、差分画像225を利用して、観測画像221に写る製品Rに欠陥が存在するか否かを判定する。 Based on the difference between the generated restored observation image 223 and the observation image 221, the detection unit 213 determines whether or not the defect is shown in the observation image 221 together with the product R (that is, whether the product R shown in the observation image 221 is defective). ) is detected. In this embodiment, the detection unit 213 indicates the difference between the observed image 221 and the restored observed image 223 by calculating the difference between the observed image 221 and the restored observed image 223, as in the learning device 1 described above. A difference image 225 is generated. The detection unit 213 uses the difference image 225 to determine whether a defect exists in the product R shown in the observed image 221.

本実施形態では、観測画像221は、各画像(121、123)の分割に応じて、複数のパッチ画像P4に分割される。生成部212は、パッチ画像P4毎に生成モデル5を設定する。そして、生成部212は、観測画像221の各パッチ画像P4を対応する生成モデルに入力することで、観測画像221を復元した復元観測画像223をパッチ画像P4毎に生成する。検出部213は、パッチ画像P4毎に、観測画像221及び復元観測画像223の間の差分に基づいて、観測画像221に写る製品Rに欠陥Lが存在するか否かを判定する。出力部214は、当該検出の結果、すなわち、製品Rの良否を判定した結果に関する情報を出力する。 In this embodiment, the observed image 221 is divided into a plurality of patch images P4 according to the division of each image (121, 123). The generation unit 212 sets the generation model 5 for each patch image P4. Then, the generation unit 212 inputs each patch image P4 of the observed image 221 to the corresponding generation model, thereby generating a restored observed image 223, which is the restored observed image 221, for each patch image P4. The detection unit 213 determines, for each patch image P4, whether a defect L exists in the product R shown in the observed image 221, based on the difference between the observed image 221 and the restored observed image 223. The output unit 214 outputs information regarding the result of the detection, that is, the result of determining whether the product R is good or bad.

<その他>
学習装置1及び検出装置2の各ソフトウェアモジュールに関しては後述する動作例で詳細に説明する。なお、本実施形態では、学習装置1及び検出装置2の各ソフトウェアモジュールがいずれも汎用のCPUによって実現される例について説明している。しかしながら、以上のソフトウェアモジュールの一部又は全部が、1又は複数の専用のプロセッサにより実現されてもよい。また、学習装置1及び検出装置2それぞれのソフトウェア構成に関して、実施形態に応じて、適宜、ソフトウェアモジュールの省略、置換及び追加が行われてもよい。
<Others>
Each software module of the learning device 1 and the detection device 2 will be explained in detail in the operation example described later. In this embodiment, an example is described in which each software module of the learning device 1 and the detection device 2 is both implemented by a general-purpose CPU. However, some or all of the software modules described above may be implemented by one or more dedicated processors. Further, regarding the software configurations of the learning device 1 and the detection device 2, software modules may be omitted, replaced, or added as appropriate depending on the embodiment.

§3 動作例
[学習装置]
次に、図7及び図8を用いて、学習装置1の動作例について説明する。図7及び図8は、本実施形態に係る学習装置1の処理手順の一例を示すフローチャートである。以下で説明する処理手順は、学習方法の一例である。ただし、以下で説明する処理手順は一例に過ぎず、各処理は可能な限り変更されてよい。また、以下で説明する処理手順について、実施の形態に応じて、適宜、ステップの省略、置換、及び追加が可能である。
§3 Operation example [Learning device]
Next, an example of the operation of the learning device 1 will be described using FIGS. 7 and 8. 7 and 8 are flowcharts showing an example of the processing procedure of the learning device 1 according to the present embodiment. The processing procedure described below is an example of a learning method. However, the processing procedure described below is only an example, and each process may be changed as much as possible. Further, regarding the processing procedure described below, steps can be omitted, replaced, or added as appropriate depending on the embodiment.

(ステップS101)
ステップS101では、制御部11は、第1取得部110として動作し、製品Rの写る1つ以上の第1学習画像121を取得する。
(Step S101)
In step S101, the control unit 11 operates as the first acquisition unit 110 and acquires one or more first learning images 121 in which the product R is captured.

本実施形態では、基本的には、製品Rが写る一方で欠陥の写っていない画像、換言すると、欠陥の存在しない製品R(良品)の写る画像が第1学習画像121として利用される。ただし、欠陥の検出に利用可能な復元画像を生成する学習済みの生成モデル5を構築可能であれば、第1学習画像121の一部に、欠陥を含む製品Rの写る画像が利用されてよい。 In the present embodiment, basically, an image in which the product R is shown but no defects are shown, in other words, an image in which the product R (good product) with no defects is shown is used as the first learning image 121. However, as long as it is possible to construct a trained generative model 5 that generates a restored image that can be used to detect defects, an image in which the product R including the defect appears may be used as a part of the first learning image 121. .

第1学習画像121を生成する方法は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、カメラCAと同種のカメラ及び欠陥のない製品Rを用意し、製品Rの検査を行う環境に応じた様々な条件で、用意したカメラにより製品Rを撮影する。これにより、製品Rの写る第1学習画像121を生成することができる。 The method of generating the first learning image 121 does not need to be particularly limited, and may be selected as appropriate depending on the embodiment. For example, a camera of the same type as camera CA and a defect-free product R are prepared, and the product R is photographed using the prepared camera under various conditions depending on the environment in which the product R is inspected. Thereby, the first learning image 121 in which the product R appears can be generated.

第1学習画像121は、コンピュータの動作により自動的に生成されてもよいし、オペレータの操作により手動的に生成されてもよい。また、第1学習画像121の生成は、学習装置1により行われてもよいし、学習装置1以外の他のコンピュータにより行われてもよい。第1学習画像121を学習装置1が生成する場合、制御部11は、自動的に又は入力装置14を介したオペレータの操作により手動的に上記一連の処理を実行することで、1つ以上の第1学習画像121を取得する。一方、第1学習画像121を他のコンピュータが生成する場合、制御部11は、例えば、ネットワーク、記憶媒体91等を介して、他のコンピュータにより生成された1つ以上の第1学習画像121を取得する。複数の第1学習画像121を取得する場合、そのうちの一部が学習装置1により生成され、残りが他のコンピュータにより生成されてもよい。 The first learning image 121 may be automatically generated by a computer operation, or may be manually generated by an operator operation. Further, the first learning image 121 may be generated by the learning device 1 or by another computer other than the learning device 1. When the learning device 1 generates the first learning image 121, the control unit 11 automatically or manually performs the above series of processes through the input device 14 to generate one or more images. A first learning image 121 is acquired. On the other hand, when the first learning image 121 is generated by another computer, the control unit 11 generates one or more first learning images 121 generated by the other computer, for example, via the network, the storage medium 91, etc. get. When acquiring a plurality of first learning images 121, some of them may be generated by the learning device 1, and the rest may be generated by another computer.

取得する第1学習画像121の件数は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、取得する第1学習画像121の件数は、暫定的な学習済みの生成モデル5を構築可能な程度に決定されてよい。1つ以上の第1学習画像121を取得すると、制御部11は、次のステップS102に処理を進める。 The number of first learning images 121 to be acquired does not need to be particularly limited, and may be determined as appropriate depending on the embodiment. For example, the number of first learning images 121 to be acquired may be determined to the extent that a provisional trained generative model 5 can be constructed. After acquiring one or more first learning images 121, the control unit 11 advances the process to the next step S102.

(ステップS102)
ステップS102では、制御部11は、学習部111として動作し、取得された1つ以上の第1学習画像121を使用して、生成モデル5の機械学習を実施する。この機械学習の処理では、制御部11は、1つ以上の第1学習画像121それぞれが与えられると、与えられた1つ以上の第1学習画像121それぞれに適合する復元画像を生成するように生成モデル5を訓練する。
(Step S102)
In step S102, the control unit 11 operates as the learning unit 111 and performs machine learning of the generative model 5 using the acquired one or more first learning images 121. In this machine learning process, when each of the one or more first learning images 121 is given, the control unit 11 generates a restored image that matches each of the one or more given first learning images 121. Train generative model 5.

生成モデル5は、入力画像を特徴量に変換し、変換により得られた特徴量から入力画像を復元した画像を生成する演算処理に使用される演算パラメータMを備える学習モデルにより構成される。機械学習の方法は、生成モデル5として利用する学習モデルの種類に応じて、適宜選択されてよい。本実施形態では、ニューラルネットワークにより構成される生成モデル5を生成するための機械学習の方法が採用される。機械学習の一例として、制御部11は、以下の処理手順により、学習済みの生成モデル5を構築する。 The generation model 5 is constituted by a learning model including a calculation parameter M used for calculation processing to convert an input image into a feature amount and generate an image obtained by restoring the input image from the feature amount obtained by the conversion. The machine learning method may be selected as appropriate depending on the type of learning model used as the generative model 5. In this embodiment, a machine learning method is employed to generate the generative model 5 configured by a neural network. As an example of machine learning, the control unit 11 constructs a learned generative model 5 using the following processing procedure.

図9は、ニューラルネットワークにより構成される生成モデル5の一例を模式的に例示する図である。ニューラルネットワークの代表例としてオートエンコーダが挙げられる。オートエンコーダは、次元圧縮を目的としたニューラルネットワークである。 FIG. 9 is a diagram schematically illustrating an example of the generative model 5 configured by a neural network. An autoencoder is a typical example of a neural network. An autoencoder is a neural network intended for dimensionality reduction.

図9に例示される生成モデル5を備えるニューラルネットワークは、入力層51、中間(隠れ)層52、出力層53を備えている。ただし、ニューラルネットワークの構造は、このような例に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、中間層の数は、1つに限定されなくてもよく、2つ以上であってもよい。 The neural network including the generative model 5 illustrated in FIG. 9 includes an input layer 51, an intermediate (hidden) layer 52, and an output layer 53. However, the structure of the neural network does not need to be limited to such an example, and may be determined as appropriate depending on the embodiment. For example, the number of intermediate layers is not limited to one, and may be two or more.

入力層51に含まれるニューロン(ノード)の数は入力画像の画素数に対応する。中間層52に含まれるニューロンの数は特徴量の次元数に対応する。出力層53に含まれるニューロンの数は復元画像の画素数に対応する。中間層52に含まれるニューロンの数は、入力層51及び出力層53それぞれに含まれるニューロンの数よりも少なく設定されてよい。次元圧縮を目的としたオートエンコーダの場合、中間層52に含まれるニューロンの数は、入力層51及び出力層53それぞれに含まれるニューロンの数よりも少なく設定される。これに応じて、特徴量の次元数が、入力画像及び復元画像の次元数よりも小さく設定される。 The number of neurons (nodes) included in the input layer 51 corresponds to the number of pixels of the input image. The number of neurons included in the intermediate layer 52 corresponds to the number of dimensions of the feature amount. The number of neurons included in the output layer 53 corresponds to the number of pixels of the restored image. The number of neurons included in the intermediate layer 52 may be set smaller than the number of neurons included in each of the input layer 51 and the output layer 53. In the case of an autoencoder aimed at dimensional compression, the number of neurons included in the intermediate layer 52 is set to be smaller than the number of neurons included in each of the input layer 51 and the output layer 53. Accordingly, the number of dimensions of the feature amount is set smaller than the number of dimensions of the input image and restored image.

ニューラルネットワークでは、隣接する層のニューロン同士は適宜結合され、各結合には重み(結合荷重)が設定される。図9に例示される生成モデル5では、各ニューロンは、隣接する層の全てのニューロンと結合されている。しかしながら、ニューロンの結合は、このような例に限定されなくてもよく、実施の形態に応じて適宜設定されてよい。各ニューロンには閾値が設定されており、基本的には、各入力と各重みとの積の和が閾値を超えているか否かによって各ニューロンの出力が決定される。各層51~53に含まれる各ニューロン間の結合の重み及び各ニューロンの閾値は、生成モデルの演算パラメータMの一例である。 In a neural network, neurons in adjacent layers are appropriately connected, and a weight (connection weight) is set for each connection. In the generative model 5 illustrated in FIG. 9, each neuron is connected to all neurons in adjacent layers. However, the connection of neurons does not need to be limited to this example, and may be set as appropriate depending on the embodiment. A threshold value is set for each neuron, and basically, the output of each neuron is determined depending on whether the sum of the products of each input and each weight exceeds the threshold value. The weight of the connection between each neuron included in each layer 51 to 53 and the threshold value of each neuron are examples of the calculation parameter M of the generative model.

制御部11は、生成モデル5を構成するニューラルネットワークを用意する。ニューラルネットワークの構造(例えば、層の数、各層に含まれるニューロンの数、隣接する層のニューロン同士の結合関係等)、パラメータの初期値(例えば、各ニューロン間の結合の重みの初期値、各ニューロンの閾値の初期値)は、テンプレートにより与えられてもよいし、オペレータの入力により与えられてもよい。 The control unit 11 prepares a neural network that constitutes the generative model 5. Neural network structure (e.g., number of layers, number of neurons included in each layer, connection relationship between neurons in adjacent layers, etc.), initial values of parameters (e.g., initial values of connection weights between each neuron, each The initial value of the neuron threshold value may be given by a template or may be given by an operator's input.

次に、制御部11は、各学習画像を訓練データ及び教師データとして利用し、各ニューラルネットワークの学習処理を実行する。この学習処理には、バッチ勾配降下法、確率的勾配降下法、ミニバッチ勾配降下法等が用いられてよい。例えば、第1のステップでは、制御部11は、各ニューラルネットワークの入力層51に各学習画像を入力し、各ニューラルネットワークの演算処理を実行する。すなわち、制御部11は、各ニューラルネットワークの入力層51に各学習画像を入力し、入力側から順に各層51~53に含まれる各ニューロンの発火判定を行う。この演算処理により、制御部11は、各学習画像を特徴量に変換し、変換により得られた特徴量から各学習画像を復元した画像を生成した結果に対応する出力値を出力層53から取得する。この演算処理の過程で、中間層52から得られる出力は、入力画像を特徴量に変換した結果に対応する。 Next, the control unit 11 uses each learning image as training data and teacher data to execute learning processing for each neural network. This learning process may use a batch gradient descent method, a stochastic gradient descent method, a mini-batch gradient descent method, or the like. For example, in the first step, the control unit 11 inputs each learning image to the input layer 51 of each neural network, and executes the arithmetic processing of each neural network. That is, the control unit 11 inputs each learning image to the input layer 51 of each neural network, and determines firing of each neuron included in each layer 51 to 53 in order from the input side. Through this calculation process, the control unit 11 converts each learning image into a feature amount, and obtains from the output layer 53 an output value corresponding to the result of generating an image in which each learning image is restored from the feature amount obtained by the conversion. do. In the process of this calculation process, the output obtained from the intermediate layer 52 corresponds to the result of converting the input image into a feature amount.

第2のステップでは、制御部11は、出力層53から得られた出力値と各学習画像との誤差を損失関数に基づいて算出する。損失関数の種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。損失関数には、公知のものが採用されてよい。第3のステップでは、制御部11は、誤差逆伝播(Back propagation)法により、算出された出力値の誤差を用いて、各ニューラルネットワークの演算パラメータM、すなわち、各層51~53における各ニューロン間の結合の重み及び各ニューロンの閾値それぞれの誤差を算出する。第4のステップでは、制御部11は、算出された各誤差に基づいて、各層51~53における各ニューロン間の結合の重み及び各ニューロンの閾値それぞれの値を更新する。 In the second step, the control unit 11 calculates the error between the output value obtained from the output layer 53 and each learning image based on the loss function. The type of loss function does not need to be particularly limited, and may be selected as appropriate depending on the embodiment. A known loss function may be used as the loss function. In the third step, the control unit 11 uses the error of the calculated output value by the error back propagation method to calculate the calculation parameter M of each neural network, that is, between each neuron in each layer 51 to 53. The connection weights and the errors of the thresholds of each neuron are calculated. In the fourth step, the control unit 11 updates the weights of connections between neurons in each layer 51 to 53 and the threshold values of each neuron, based on each calculated error.

制御部11は、上記第1~第4のステップを繰り返すことで、出力層53から出力される出力値(復元画像)と各学習画像との誤差の和が小さくなるように、演算パラメータMの値を調整する。例えば、制御部11は、出力層53から出力される出力値と各学習画像との誤差の和が閾値以下になるまで、上記第1~第4のステップによる演算パラメータMの調整を繰り返してもよい。閾値は、実施の形態に応じて適宜設定されてよい。 By repeating the first to fourth steps above, the control unit 11 adjusts the calculation parameter M so that the sum of the errors between the output value (restored image) output from the output layer 53 and each learning image becomes small. Adjust values. For example, the control unit 11 may repeat the adjustment of the calculation parameter M in the first to fourth steps until the sum of the errors between the output value output from the output layer 53 and each learning image becomes equal to or less than the threshold value. good. The threshold value may be set as appropriate depending on the embodiment.

これにより、制御部11は、各学習画像を入力層51に入力すると、各学習画像に適合する復元画像を出力層53から出力するように訓練されたニューラルネットワークを学習済みの生成モデル5として構築することができる。ニューラルネットワークでは、入力された各学習画像は、入力層51から中間層52までの演算の過程で特徴量に変換される。そして、中間層52から出力層53までの演算の過程により、得られた特徴量から復元画像が生成される。学習済みの生成モデル5を構築すると、制御部11は、次のステップS103に処理を進める。 Thereby, the control unit 11 constructs a trained neural network as a trained generative model 5 so that when each learning image is input to the input layer 51, a restored image matching each learning image is output from the output layer 53. can do. In the neural network, each input learning image is converted into a feature amount during the calculation process from the input layer 51 to the intermediate layer 52. Then, a restored image is generated from the obtained feature amounts through the calculation process from the intermediate layer 52 to the output layer 53. After constructing the trained generative model 5, the control unit 11 advances the process to the next step S103.

なお、本実施形態では、制御部11は、ステップS102を実行する前に、取得された1つ以上の第1学習画像121それぞれを複数のパッチ画像P1に分割する。分割方法及びパッチ画像P1の件数は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、制御部11は、縦方向及び横方向それぞれに指定された数で等分に第1学習画像121を分割してもよい。これにより、第1学習画像121は、複数のパッチ画像P1にグリッド状に分割されてよい。分割数は、オペレータの入力により指定されてもよいし、プログラム内で予め与えられてもよい。また、グリッド状に分割する場合、複数のパッチ画像P1の一部の寸法がその他の寸法と相違してもよい。なお、第1学習画像121が既にパッチ画像P1に分割されている場合には、本分割処理は省略されてよい。 Note that in this embodiment, the control unit 11 divides each of the acquired one or more first learning images 121 into a plurality of patch images P1 before executing step S102. The division method and the number of patch images P1 do not need to be particularly limited, and may be determined as appropriate depending on the embodiment. For example, the control unit 11 may divide the first learning image 121 into equal parts by a specified number in each of the vertical and horizontal directions. Thereby, the first learning image 121 may be divided into a plurality of patch images P1 in a grid pattern. The number of divisions may be specified by operator input, or may be given in advance within the program. Furthermore, when dividing into a grid, some dimensions of the plurality of patch images P1 may be different from other dimensions. Note that if the first learning image 121 has already been divided into patch images P1, this division process may be omitted.

そして、ステップS102において、制御部11は、上記機械学習の処理により、パッチ画像P1毎に学習済みの生成モデル5を構築する。すなわち、本実施形態では、制御部11は、第1学習画像121の対応するパッチ画像P1を与えると、与えられたパッチ画像P1を特徴量に変換し、変換により得られた特徴量から対応するパッチ画像P1に適合する画像を復元するように訓練された生成モデル5をパッチ画像P1毎に構築する。これにより、学習済みの生成モデル5が、パッチ画像P1毎に与えられる。 Then, in step S102, the control unit 11 constructs a learned generation model 5 for each patch image P1 through the machine learning process described above. That is, in this embodiment, when the control unit 11 is given the corresponding patch image P1 of the first learning image 121, it converts the given patch image P1 into a feature amount, and calculates the corresponding feature amount from the feature amount obtained by the conversion. A generative model 5 trained to restore an image matching the patch image P1 is constructed for each patch image P1. As a result, a trained generative model 5 is provided for each patch image P1.

ただし、複数のパッチ画像に各画像が分割される場合に、ニューラルネットワークが必ずしもパッチ画像毎に用意されなければならない訳ではない。例えば、パッチ画像のクラスを入力するニューロンをニューラルネットワークの入力層に加えることで、異なるパッチ画像に対応する画像を復元するニューラルネットワークを構成することができる。そのため、複数のパッチ画像のうちの少なくとも2つ以上のパッチ画像で、共通のニューラルネットワークが生成モデルとして利用されてよい。 However, when each image is divided into a plurality of patch images, a neural network does not necessarily have to be prepared for each patch image. For example, by adding a neuron that inputs the class of patch images to the input layer of the neural network, it is possible to configure a neural network that restores images corresponding to different patch images. Therefore, a common neural network may be used as a generation model for at least two of the plurality of patch images.

生成モデル5を構成するニューラルネットワークの種類は、このような多層構造の全結合型ニューラルネットワークに限定されなくてもよい。生成モデル5には、畳み込み層及びプーリング層を備える畳み込みニューラルネットワークが用いられてもよい。また、生成モデル5には、自己符号化器又はこれに類似する構造を有するニューラルネットワークが用いられてよい。 The type of neural network constituting the generative model 5 does not have to be limited to such a fully connected neural network with a multilayer structure. The generative model 5 may use a convolutional neural network including a convolution layer and a pooling layer. Further, as the generative model 5, an autoencoder or a neural network having a similar structure may be used.

(ステップS103)
ステップS103では、制御部11は、第2取得部112として動作し、それぞれ製品Rの写る複数の追加用画像123を取得する。
(Step S103)
In step S103, the control unit 11 operates as the second acquisition unit 112 and acquires a plurality of additional images 123, each of which shows the product R.

本実施の形態において、各追加用画像123には、上記第1学習画像121と同様に、基本的には、欠陥の存在しない製品R(良品)の写る画像が利用される。各追加用画像123は、上記第1学習画像121と同様に生成されてよい。また、上記処理により生成された画像であって、欠陥の存在しない製品Rの写る画像の一部が上記第1学習画像121として利用されてよく、その他が追加用画像123として利用されてよい。例えば、制御部11は、欠陥の存在しない製品Rの写る複数の画像を取得してもよい。そして、上記ステップS101では、取得された複数の画像の一部を第1学習画像121として取得し、本ステップS103では、取得された複数の画像の残りを追加用画像123として取得してもよい。 In this embodiment, each additional image 123 is basically an image showing a product R (good product) with no defects, similarly to the first learning image 121 described above. Each additional image 123 may be generated in the same manner as the first learning image 121 described above. Furthermore, a part of the image generated by the above processing and showing the product R without defects may be used as the first learning image 121, and the rest may be used as the additional image 123. For example, the control unit 11 may acquire a plurality of images showing the product R without defects. Then, in step S101, a part of the acquired images may be acquired as the first learning image 121, and in step S103, the remaining of the acquired images may be acquired as the additional image 123. .

また、第1学習画像121と同様に、追加用画像123の生成は、学習装置1により行われてもよいし、学習装置1以外の他のコンピュータにより行われてもよい。制御部11は、自動的に又は入力装置14を介したオペレータの操作により手動的に上記一連の処理を実行することで、複数の追加用画像123を取得してもよい。或いは、制御部11は、例えば、ネットワーク、記憶媒体91等を介して、他のコンピュータにより生成された複数の追加用画像123を取得してもよい。複数の追加用画像123のうちの一部が学習装置1により生成され、残りが他のコンピュータにより生成されてもよい。 Furthermore, similarly to the first learning image 121, the additional image 123 may be generated by the learning device 1 or by another computer other than the learning device 1. The control unit 11 may acquire the plurality of additional images 123 by automatically or manually executing the series of processes described above through an operator's operation via the input device 14. Alternatively, the control unit 11 may acquire a plurality of additional images 123 generated by another computer, for example, via a network, the storage medium 91, or the like. Some of the plurality of additional images 123 may be generated by the learning device 1, and the rest may be generated by another computer.

取得する追加用画像123の件数は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。複数の追加用画像123を取得すると、制御部11は、次のステップS104に処理を進める。 The number of additional images 123 to be acquired does not need to be particularly limited, and may be determined as appropriate depending on the embodiment. After acquiring the plurality of additional images 123, the control unit 11 advances the process to the next step S104.

(ステップS104)
ステップS104では、制御部11は、第3取得部117として動作し、欠陥Lを含む製品Rがそれぞれ写る複数の評価画像127を取得する。
(Step S104)
In step S104, the control unit 11 operates as the third acquisition unit 117 and acquires a plurality of evaluation images 127, each of which shows the product R including the defect L.

各評価画像127を生成する方法は、欠陥Lを含む製品Rを用意する点を除き、上記各画像(121、123)を生成する方法であってよい。すなわち、カメラCAと同種のカメラ及び欠陥Lを含む製品Rを用意し、製品Rの検査を行う環境に応じた様々な条件で、用意したカメラにより製品Rを撮影する。これにより、欠陥Lを含む製品Rの写る各評価画像127を生成することができる。或いは、欠陥Lは画像処理により追加されてもよい。すなわち、欠陥のない製品Rの写る画像に画像処理により欠陥Lを追加することで、各評価画像127を生成してもよい。この場合、欠陥のない製品Rの写る画像は、各画像(121、123)から選択されてもよい。 The method for generating each evaluation image 127 may be the method for generating each image (121, 123) described above, except that a product R including a defect L is prepared. That is, a camera of the same type as camera CA and a product R including the defect L are prepared, and the product R is photographed using the prepared camera under various conditions depending on the environment in which the product R is inspected. Thereby, each evaluation image 127 in which the product R including the defect L is captured can be generated. Alternatively, the defect L may be added by image processing. That is, each evaluation image 127 may be generated by adding the defect L to an image of the product R without defects through image processing. In this case, the image showing the defect-free product R may be selected from each image (121, 123).

各評価画像127は、各画像(121、123)と同様に、コンピュータの動作により自動的に生成されてもよいし、オペレータの操作により手動的に生成されてもよい。また、各評価画像127の生成は、学習装置1により行われてもよいし、学習装置1以外の他のコンピュータにより行われてもよい。制御部11は、自動的に又は入力装置14を介したオペレータの操作により手動的に上記一連の処理を実行することで、複数の評価画像127を取得してもよい。或いは、制御部11は、例えば、ネットワーク、記憶媒体91等を介して、他のコンピュータにより生成された複数の評価画像127を取得してもよい。複数の評価画像127のうちの一部が学習装置1により生成され、残りが他のコンピュータにより生成されてもよい。 Like each image (121, 123), each evaluation image 127 may be automatically generated by a computer operation, or may be manually generated by an operator's operation. Further, the generation of each evaluation image 127 may be performed by the learning device 1 or by another computer other than the learning device 1. The control unit 11 may acquire the plurality of evaluation images 127 by automatically or manually performing the above series of processes through an operator's operation via the input device 14. Alternatively, the control unit 11 may acquire a plurality of evaluation images 127 generated by another computer, for example, via a network, the storage medium 91, or the like. Some of the plurality of evaluation images 127 may be generated by the learning device 1, and the rest may be generated by another computer.

取得する評価画像127の件数は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。複数の評価画像127を取得すると、制御部11は、次のステップS105に処理を進める。 The number of evaluation images 127 to be acquired does not need to be particularly limited, and may be determined as appropriate depending on the embodiment. After acquiring the plurality of evaluation images 127, the control unit 11 advances the process to the next step S105.

(ステップS105及びステップS106)
ステップS105では、制御部11は、生成部113として動作し、取得された複数の追加用画像123それぞれを、ステップS102により訓練された生成モデル5に与えることで、複数の追加用画像123それぞれを復元した複数の復元追加用画像124それぞれを生成する。ステップS106では、制御部11は、生成部113として動作し、取得された複数の評価画像127それぞれを、ステップS102により訓練された生成モデル5に与えることで、複数の評価画像127それぞれを復元した複数の復元評価画像128それぞれを生成する。
(Step S105 and Step S106)
In step S105, the control unit 11 operates as the generation unit 113, and provides each of the acquired plurality of additional images 123 to the generative model 5 trained in step S102, thereby generating each of the plurality of additional images 123. A plurality of restored images 124 for restoration and addition are each generated. In step S106, the control unit 11 operates as the generation unit 113, and restores each of the plurality of evaluation images 127 by giving each of the plurality of acquired evaluation images 127 to the generative model 5 trained in step S102. Each of the plurality of restoration evaluation images 128 is generated.

具体的には、制御部11は、ステップS102の機械学習の結果を参照し、学習済みの生成モデル5を用意する。ステップS105では、制御部11は、各追加用画像123を学習済みの生成モデル5に入力する。これにより、制御部11は、各追加用画像123を復元した各復元追加用画像124を生成する。同様に、ステップS106では、制御部11は、各評価画像127を学習済みの生成モデル5に入力する。これにより、制御部11は、各評価画像127を復元した各復元評価画像128を生成する。 Specifically, the control unit 11 refers to the machine learning result in step S102 and prepares the learned generative model 5. In step S105, the control unit 11 inputs each additional image 123 to the trained generative model 5. Thereby, the control unit 11 generates each restored additional image 124 by restoring each additional image 123. Similarly, in step S106, the control unit 11 inputs each evaluation image 127 to the trained generative model 5. Thereby, the control unit 11 generates each restored evaluation image 128 by restoring each evaluation image 127.

なお、本実施形態では、生成モデル5は、パッチ画像毎に用意される。これに応じて、本実施形態では、制御部11は、各追加用画像123を複数のパッチ画像P2に分割する。また、制御部11は、各評価画像127を複数のパッチ画像P3に分割する。画像の分割方法は、第1学習画像121と同様である。各画像(123、127)が既にパッチ画像(P2、P3)に分割されている場合、これらの分割処理は省略されてよい。 Note that in this embodiment, the generation model 5 is prepared for each patch image. Accordingly, in this embodiment, the control unit 11 divides each additional image 123 into a plurality of patch images P2. Further, the control unit 11 divides each evaluation image 127 into a plurality of patch images P3. The method of dividing the image is the same as that for the first learning image 121. If each image (123, 127) has already been divided into patch images (P2, P3), these division processes may be omitted.

ステップS105では、制御部11は、パッチ画像P2毎に、対応する生成モデル5を利用して、各追加用画像123に対応する各復元追加用画像124を生成する。すなわち、制御部11は、各追加用画像123の各パッチ画像P2を対応する生成モデル5に与えることで、各復元追加用画像124の各パッチ画像を生成する。同様に、ステップS106では、制御部11は、パッチ画像P3毎に、対応する生成モデル5を利用して、各評価画像127に対応する各復元評価画像128を生成する。すなわち、制御部11は、各評価画像127の各パッチ画像P3を対応する生成モデル5に与えることで、各復元評価画像128の各パッチ画像を生成する。各復元追加用画像124及び各復元評価画像128を生成すると、制御部11は、次のステップS107に処理を進める。 In step S105, the control unit 11 uses the corresponding generation model 5 for each patch image P2 to generate each restored additional image 124 corresponding to each additional image 123. That is, the control unit 11 generates each patch image of each restored additional image 124 by providing each patch image P2 of each additional image 123 to the corresponding generation model 5. Similarly, in step S106, the control unit 11 generates each restored evaluation image 128 corresponding to each evaluation image 127 using the corresponding generation model 5 for each patch image P3. That is, the control unit 11 generates each patch image of each restored evaluation image 128 by providing each patch image P3 of each evaluation image 127 to the corresponding generation model 5. After generating each restoration addition image 124 and each restoration evaluation image 128, the control unit 11 advances the process to the next step S107.

(ステップS107及びステップS108)
ステップS107では、制御部11は、評価部114として動作し、各追加用画像123と各復元追加用画像124との差分の程度に基づいて、各追加用画像123に欠陥Lが写っているか否かを判定する。ステップS108では、制御部11は、評価部114として動作し、各評価画像127と各復元評価画像128との差分の程度に基づいて、各評価画像127に欠陥Lが写っているか否かを判定する。
(Step S107 and Step S108)
In step S107, the control unit 11 operates as the evaluation unit 114, and determines whether the defect L is reflected in each additional image 123 based on the degree of difference between each additional image 123 and each restored additional image 124. Determine whether In step S108, the control unit 11 operates as the evaluation unit 114, and determines whether the defect L is captured in each evaluation image 127 based on the degree of difference between each evaluation image 127 and each restoration evaluation image 128. do.

差分の程度に応じて欠陥Lの有無を検出する方法は、実施の形態に応じて適宜設定されてよい。本実施形態では、ステップS107において、制御部11は、各追加用画像123と各復元追加用画像124との差分を算出することで、各差分画像182を生成する。制御部11は、各差分画像182を利用して、各追加用画像123に欠陥Lが写っているか否かを判定する。同様に、制御部11は、各評価画像127と各復元評価画像128との差分を算出することで、各差分画像183を生成する。制御部11は、各差分画像183を利用して、各評価画像127に欠陥Lが写っているか否かを判定する。 The method of detecting the presence or absence of the defect L depending on the degree of the difference may be set as appropriate depending on the embodiment. In this embodiment, in step S107, the control unit 11 generates each difference image 182 by calculating the difference between each additional image 123 and each restored additional image 124. The control unit 11 uses each difference image 182 to determine whether the defect L is included in each additional image 123. Similarly, the control unit 11 generates each difference image 183 by calculating the difference between each evaluation image 127 and each restored evaluation image 128. The control unit 11 uses each difference image 183 to determine whether the defect L is included in each evaluation image 127.

更に、本実施形態では、各画像(123、127)に欠陥Lが写っているか否かを判定するための複数の検出パラメータ候補60が与えられる。各検出パラメータ候補60は、検出パラメータの候補の値を示す。各検出パラメータ候補60の値は適宜与えられてよい。例えば、各検出パラメータ候補60の値は、オペレータの入力により取得されてよい。また、例えば、各検出パラメータ候補60の値は、プログラム内で予め与えられてもよい。検出パラメータは、各差分画像(182、183)から欠陥Lの有無を検出するアルゴリズムに応じて適宜設定されてよい。 Furthermore, in this embodiment, a plurality of detection parameter candidates 60 are provided for determining whether the defect L is included in each image (123, 127). Each detected parameter candidate 60 indicates a value of a detected parameter candidate. The value of each detection parameter candidate 60 may be given as appropriate. For example, the value of each detection parameter candidate 60 may be obtained by input from an operator. Further, for example, the value of each detection parameter candidate 60 may be given in advance within the program. The detection parameters may be appropriately set according to the algorithm for detecting the presence or absence of the defect L from each difference image (182, 183).

ここで、図10を更に用いて、欠陥Lを検出する処理の一例と共に、検出パラメータの一例を説明する。図10は、欠陥Lを検出する処理過程の一例を模式的に例示する図である。まず、第1のステップでは、制御部11は、製品Rの写る画像I10を生成モデル5に与えて、復元画像I11を生成する。画像I10は、上記各画像(123、127)に対応し、復元画像I11は、上記各復元画像(124、128)に対応する。詳細には、画像I10は、各画像(123、127)の各パッチ画像(P2、P3)に対応し、復元画像I11は、上記各復元画像(124、128)の各パッチ画像に相当する。当該生成処理は、上記ステップS105及びS106それぞれの処理に対応する。 Here, with further reference to FIG. 10, an example of a process for detecting the defect L and an example of a detection parameter will be described. FIG. 10 is a diagram schematically illustrating an example of the process of detecting the defect L. First, in the first step, the control unit 11 provides the image I10 showing the product R to the generation model 5 to generate the restored image I11. The image I10 corresponds to each of the above images (123, 127), and the restored image I11 corresponds to each of the above restored images (124, 128). Specifically, the image I10 corresponds to each patch image (P2, P3) of each image (123, 127), and the restored image I11 corresponds to each patch image of each restored image (124, 128). The generation process corresponds to each of steps S105 and S106 described above.

次に、第2のステップでは、制御部11は、画像I10と復元画像I11との差分を算出することで、差分画像I12を生成する。差分画像I12は、上記各差分画像(182、183)に対応する。詳細には、差分画像I12は、上記各差分画像(182、183)の各パッチ画像に対応する。画像I10と復元画像I11との間で差異が生じている画素ほど差分画像I12においてその画素値が大きくなる。一方、画像I10と復元画像I11との間で差異のない画素ほど差分画像I12における画素値は小さくなる。本実施形態では、説明の便宜のため、画像I10と復元画像I11との間の差異が大きい画素ほど差分画像I12内の対応画素の実際の画素値も大きくなり、差異が小さい画素ほど差分画像I12内の対応画素の実際の画素値も小さくなると仮定する。ただし、この「画素値が大きい」及び「画素値が小さい」はそれぞれ、画像I10と復元画像I11との間の差異との関係を示しており、差分画像I12内の画素の実際の画素値と対応していなくてもよい。例えば、差分画像I12は、差異の大きい画素ほど対応する画素の実際の画素値が小さくなり、差異の小さい画素ほど対応する画素の実際の画素値が大きくなるように算出されてよい。 Next, in a second step, the control unit 11 generates a difference image I12 by calculating the difference between the image I10 and the restored image I11. The difference image I12 corresponds to each of the above-mentioned difference images (182, 183). Specifically, the difference image I12 corresponds to each patch image of the above-mentioned difference images (182, 183). A pixel that is different between the image I10 and the restored image I11 has a larger pixel value in the difference image I12. On the other hand, the pixel value in the difference image I12 becomes smaller when there is no difference between the image I10 and the restored image I11. In this embodiment, for convenience of explanation, the larger the difference between a pixel between the image I10 and the restored image I11, the larger the actual pixel value of the corresponding pixel in the difference image I12, and the smaller the difference is, the larger the actual pixel value of the corresponding pixel in the difference image I12. Assume that the actual pixel value of the corresponding pixel within is also smaller. However, "the pixel value is large" and "the pixel value is small" each indicate the relationship between the difference between the image I10 and the restored image I11, and the actual pixel value of the pixel in the difference image I12. It doesn't have to be compatible. For example, the difference image I12 may be calculated such that the larger the difference between pixels, the smaller the actual pixel value of the corresponding pixel, and the smaller the difference between the pixels, the larger the actual pixel value of the corresponding pixel.

図10の例では、画像I10と復元画像I11との間で差異が生じている画素ほど差分画像I12において白色になっており、そうではない画素ほど黒色になっている。例えば、各画素の値が256階調で表現される場合、差分画像I12の画素の画素値の最大値が「255」であってよく、最小値が「0」であってよい。この場合、差分画像I12の画素の画素値が大きいほど、画像I10と復元画像I11との間で差異が生じていることを示し、差分画像I12の画素の画素値が小さいほど、画像I10と復元画像I11との間で差異が生じていないことを示す。ただし、画像I10と復元画像I11との間で生じる差異と差分画像I12の画素値との間の関係は、このような例に限定されなくてよい。例えば、画像I10及び復元画像I11の間の差異の程度と差分画像I12の画素値との関係は、この反対であってもよい。 In the example of FIG. 10, the pixels that are more different between the image I10 and the restored image I11 are whiter in the difference image I12, and the pixels that are less white are blacker. For example, when the value of each pixel is expressed in 256 gradations, the maximum value of the pixel value of the pixels of the difference image I12 may be "255", and the minimum value may be "0". In this case, the larger the pixel value of the pixel of the difference image I12, the more difference occurs between the image I10 and the restored image I11, and the smaller the pixel value of the pixel of the difference image I12, the more the difference between the image I10 and the restored image This shows that there is no difference between the image I11 and the image I11. However, the relationship between the difference that occurs between the image I10 and the restored image I11 and the pixel values of the difference image I12 is not limited to this example. For example, the relationship between the degree of difference between the image I10 and the restored image I11 and the pixel value of the difference image I12 may be the opposite.

生成モデル5の機械学習に使用された学習画像に写っていない又は写る可能性の低い特徴(本実施形態では、欠陥L)が画像I10に写っている場合、復元画像I11においてその特徴の再現性が低いため、画像I10と復元画像I11との間で比較的に大きな差異が生じ得る。ただし、画像I10と復元画像I11との間に生じる差異の原因は、このような欠陥Lが画像I10に写っていることに限られない。画像I10と復元画像I11との間で比較的に大きな差異を生じさせるその他の原因として、例えば、与えられた入力画像に写る所定の特徴(本実施形態では、製品R)の様子が、機械学習に使用した学習画像に写る所定の特徴の様子と異なっていることが挙げられる。この場合、画像I10に写る製品Rの様子が復元画像I11では完全には再現されず、画像I10と復元画像I11との間で比較的に大きな差異を生じさせる可能性がある。 If a feature (in this embodiment, defect L) that is not shown in the learning image used for machine learning of the generative model 5 or has a low possibility of appearing is shown in the image I10, the reproducibility of that feature in the restored image I11 is Since the image I10 is low, a relatively large difference may occur between the image I10 and the restored image I11. However, the cause of the difference between the image I10 and the restored image I11 is not limited to the fact that such a defect L appears in the image I10. Another cause of a relatively large difference between the image I10 and the restored image I11 is that, for example, the state of a predetermined feature (product R in this embodiment) appearing in a given input image is determined by machine learning. One example of this is that the appearance of the predetermined features is different from the appearance of the predetermined features in the training images used. In this case, the appearance of the product R that appears in the image I10 is not completely reproduced in the restored image I11, which may cause a relatively large difference between the image I10 and the restored image I11.

また、例えば、生成モデル5は、入力画像を低次元の特徴量に圧縮する。このときに、入力画像の情報が部分的に損失し得る。そのため、入力画像と復元画像との間で多少の誤差が生じ得る。この復元のノイズが、画像I10と復元画像I11との間に生じる差異の原因の一例となり得る。したがって、差分画像I12には、欠陥Lに起因する差異以外に、複数の要因に基づく差異が現れ得る。しかしながら、このノイズに起因する差異は、上記2つの要因に基づく差異よりも程度が低い。そのため、差分画像I12の画素値に基づいて、これらの差異を区別することができる。 Furthermore, for example, the generative model 5 compresses the input image into low-dimensional features. At this time, information of the input image may be partially lost. Therefore, some error may occur between the input image and the restored image. This restoration noise can be an example of the cause of the difference between the image I10 and the restored image I11. Therefore, in addition to the difference caused by the defect L, differences based on a plurality of factors may appear in the difference image I12. However, the difference due to this noise is of a lower magnitude than the difference due to the above two factors. Therefore, these differences can be distinguished based on the pixel values of the difference image I12.

そこで、第3のステップでは、制御部11は、閾値65を利用して、差分画像I12の各画素を二値化する。例えば、制御部11は、画素値が閾値65以上である画素の画素値を「255」に変換し、画素値が閾値65未満である画素の画素値を「0」に変換する。「以上」は、「超える」に置き換えられ、「未満」は、「以下」に置き換えられてよい。以下の説明においても同様である。これにより、制御部11は、二値化画像I13を生成することができる。閾値65を適切に設定することで、上記ノイズに起因する差異等の比較的に程度の低い差異が元の差分画像I12から除外された二値化画像I13を得ることができる。 Therefore, in the third step, the control unit 11 uses the threshold value 65 to binarize each pixel of the difference image I12. For example, the control unit 11 converts the pixel values of pixels whose pixel values are equal to or greater than the threshold value 65 to "255", and converts the pixel values of pixels whose pixel values are less than the threshold value 65 to "0". “More than” may be replaced with “more than” and “less than” may be replaced with “less than”. The same applies to the following description. Thereby, the control unit 11 can generate the binarized image I13. By appropriately setting the threshold value 65, it is possible to obtain a binarized image I13 in which relatively low-level differences such as those caused by the noise are excluded from the original difference image I12.

二値化画像I13には、主に、欠陥Lに起因する差異、及び学習不足に起因する差異が現れ得る。これらの差異を生じさせる原因のうち、欠陥Lは、面積、幅、高さ、周囲の長さ、縦横比、円形度等の形状に関する属性を有し得る。つまり、画像I10に写る製品Rに欠陥Lが存在する場合、二値化画像I13の対応する位置に、白色「255」の画素(以下、白色画素とも記載する)の集まった領域であって、欠陥Lと同等の形状に関する属性を有する領域が現れる。そこで、形状に関する属性に対して閾値66を設定することで、二値化画像I13内に欠陥Lが写っているか否かを判定することができる。 Differences due to the defect L and differences due to insufficient learning may appear in the binarized image I13. Among the causes of these differences, the defect L may have attributes related to shape, such as area, width, height, circumference, aspect ratio, and circularity. That is, when a defect L exists in the product R shown in the image I10, the corresponding position in the binarized image I13 is an area where white "255" pixels (hereinafter also referred to as white pixels) are gathered, A region having the same shape-related attributes as the defect L appears. Therefore, by setting the threshold value 66 for the attribute related to the shape, it is possible to determine whether the defect L is included in the binarized image I13.

処理の一例として、第4のステップでは、制御部11は、二値化画像I13内の連続する白色画素の領域を一つの領域と認定し、白色画素の各領域が閾値66を満たしているか否かを判定する。そして、制御部11は、閾値66を満たしている領域をそのままにし、閾値66を満たしていない領域内の画素の画素値を「0」に変換する。例えば、閾値66が面積に対して設定される場合、制御部11は、白色画素の各領域の面積が閾値66以上であるか否かを判定する。そして、制御部11は、面積が閾値66未満である領域内の画素の画素値を「0」に変換する。これにより、制御部11は、検出画像I14を生成することができる。閾値66を適切に設定することで、欠陥Lの属性を満たさない白色領域が二値化画像I13から除外された検出画像I14を得ることができる。 As an example of the process, in the fourth step, the control unit 11 identifies the area of continuous white pixels in the binarized image I13 as one area, and determines whether each area of white pixels satisfies the threshold value 66. Determine whether Then, the control unit 11 leaves the area that satisfies the threshold value 66 as it is, and converts the pixel values of pixels in the area that does not satisfy the threshold value 66 to "0". For example, when the threshold value 66 is set for area, the control unit 11 determines whether the area of each region of white pixels is equal to or larger than the threshold value 66. Then, the control unit 11 converts the pixel values of pixels within the area whose area is less than the threshold value 66 to "0". Thereby, the control unit 11 can generate the detected image I14. By appropriately setting the threshold value 66, it is possible to obtain a detected image I14 in which white areas that do not satisfy the attributes of the defect L are excluded from the binarized image I13.

第5のステップでは、制御部11は、検出画像I14に白色画素の領域が存在するか否かに応じて、画像I10に欠陥Lが写っているか否かを判定する。具体的に、検出画像I14において白色画素の領域が存在する場合、制御部11は、画像I10の対応する領域に欠陥Lが写っていると判定する。一方、検出画像I14において白色画素の領域が存在しない場合、制御部11は、画像I10に欠陥Lが写っていないと判定する。これにより、制御部11は、欠陥Lの検出に関する処理を終了する。 In the fifth step, the control unit 11 determines whether the defect L is included in the image I10, depending on whether a white pixel area exists in the detected image I14. Specifically, when a region of white pixels exists in the detected image I14, the control unit 11 determines that the defect L is reflected in the corresponding region of the image I10. On the other hand, if there is no area of white pixels in the detected image I14, the control unit 11 determines that the defect L is not included in the image I10. Thereby, the control unit 11 ends the process related to detecting the defect L.

以上の欠陥Lの検出に関する処理手順において、各閾値(65、66)が、検出パラメータの一例である。すなわち、本実施形態では、各検出パラメータ候補60は、各閾値(65、66)の組み合わせにより構成される。ただし、欠陥Lを検出する方法及び検出パラメータはそれぞれ、このような例に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。ステップS107では、制御部11は、各検出パラメータ候補60を利用して、欠陥Lの検出に関する上記第1~第5のステップの処理を実行することで、各追加用画像123に欠陥Lが写っているか否かを判定する。同様に、ステップS108では、制御部11は、各検出パラメータ候補60を利用して、欠陥Lの検出に関する上記第1~第5のステップの処理を実行することで、各評価画像127に欠陥Lが写っているか否かを判定する。 In the processing procedure for detecting the defect L described above, each threshold value (65, 66) is an example of a detection parameter. That is, in this embodiment, each detection parameter candidate 60 is configured by a combination of threshold values (65, 66). However, the method and detection parameters for detecting the defect L do not need to be limited to these examples, and may be appropriately selected depending on the embodiment. In step S107, the control unit 11 uses each detection parameter candidate 60 to execute the processing of the first to fifth steps regarding detection of the defect L, so that the defect L is reflected in each additional image 123. Determine whether or not the Similarly, in step S108, the control unit 11 uses each detection parameter candidate 60 to execute the processes of the first to fifth steps regarding detection of the defect L, so that the defect L is displayed in each evaluation image 127. Determine whether or not the image is captured.

なお、本実施形態では、各画像(123、127)は、複数のパッチ画像(P2、P3)に分割されている。これに応じて、本実施形態に係るステップS107では、制御部11は、パッチ画像P2毎に、各追加用画像123と各復元追加用画像124との差分の程度に基づいて、各追加用画像123に欠陥Lが写っているか否かを判定する。同様に、本実施形態に係るステップS108では、制御部11は、パッチ画像P3毎に、各評価画像127と各復元評価画像128との差分の程度に基づいて、各評価画像127に欠陥Lが写っているか否かを判定する。各判定の処理が完了すると、制御部11は、次のステップS109に処理を進める。 Note that in this embodiment, each image (123, 127) is divided into a plurality of patch images (P2, P3). Accordingly, in step S107 according to the present embodiment, the control unit 11 selects each additional image based on the degree of difference between each additional image 123 and each restored additional image 124 for each patch image P2. It is determined whether the defect L is captured in the image 123. Similarly, in step S108 according to the present embodiment, the control unit 11 determines whether the defect L is present in each evaluation image 127 based on the degree of difference between each evaluation image 127 and each restoration evaluation image 128 for each patch image P3. Determine whether the image is visible or not. When each determination process is completed, the control unit 11 advances the process to the next step S109.

(ステップS109)
ステップS109では、制御部11は、評価部114として動作する。制御部11は、各ステップ(S107、S108)の判定結果に基づいて、欠陥Lが画像に写っているか否かを判定するための検出パラメータの最適化を実行する。具体的には、制御部11は、各ステップ(S107、S108)の判定結果に基づいて、複数の検出パラメータ候補60のうち、欠陥Lが写っていると判定された追加用画像123及び欠陥Lが写っていないと判定された評価画像127の数が最も少ない1つの検出パラメータ候補61を特定する。
(Step S109)
In step S109, the control unit 11 operates as the evaluation unit 114. The control unit 11 optimizes detection parameters for determining whether the defect L is shown in the image based on the determination results of each step (S107, S108). Specifically, the control unit 11 selects the additional image 123 and the defect L determined to include the defect L from among the plurality of detection parameter candidates 60 based on the determination results of each step (S107, S108). One detection parameter candidate 61 with the least number of evaluation images 127 determined not to be captured is identified.

欠陥Lが写っていると判定された追加用画像123の数は、欠陥Lを含まない製品Rが写っているにも関わらず、欠陥Lを含む製品Rが写っていると誤判定された画像の数に相当する。欠陥Lが写っていないと判定された評価画像127の数は、欠陥Lを含む製品Rが写っているにも関わらず、欠陥Lを含まない製品Rが写っていると誤判定された画像の数に相当する。上記欠陥Lの検出に関する処理において、各閾値(65、66)の値を変更すると、検出画像I14に現れる白色画像の領域が変化し得る。つまり、検出パラメータの値を変更すると、誤判定される各画像(123、127)の数が変化し得る。本ステップS109により、誤判定の最も少ない1つの検出パラメータ候補61を特定することは、欠陥Lの検出に利用する検出パラメータを最適化することに相当する。 The number of additional images 123 determined to include defect L is the number of images erroneously determined to include product R that includes defect L, even though the product R that does not include defect L is included in the image. corresponds to the number of The number of evaluation images 127 that were determined not to contain the defect L is the number of images that were erroneously determined to contain the product R that does not contain the defect L, even though the product R that contains the defect L is shown. corresponds to a number. In the process related to the detection of the defect L, if the value of each threshold value (65, 66) is changed, the area of the white image appearing in the detected image I14 may change. That is, changing the value of the detection parameter may change the number of images (123, 127) that are incorrectly determined. Identifying one detection parameter candidate 61 with the least number of false determinations in step S109 corresponds to optimizing the detection parameters used to detect the defect L.

ここで、図11を更に用いて、最適な検出パラメータ候補61を特定する処理の一例について説明する。図11は、ステップS107及びS108の仮想的な判定結果の一例を示す図である。図11の例では、判定結果はテーブル形式で表現され、テーブル内の1つのレコードは、1つの検出パラメータ候補60による判定結果に対応している。ただし、判定結果のデータ形式は、このような例に限定されなくてよく、実施の形態に応じて適宜選択されてよい。 Here, an example of a process for identifying the optimal detection parameter candidate 61 will be described with further reference to FIG. 11. FIG. 11 is a diagram showing an example of hypothetical determination results in steps S107 and S108. In the example of FIG. 11, the determination results are expressed in a table format, and one record in the table corresponds to the determination result of one detection parameter candidate 60. However, the data format of the determination result is not limited to this example, and may be selected as appropriate depending on the embodiment.

図11に例示される各レコードは、検出パラメータ及び判定結果それぞれに関するフィールドを有する。「番号」は、各検出パラメータ候補60の識別子を示す。「2値化閾値」は、二値化の基準となる閾値65の値を示す。「面積閾値」は、欠陥Lの有無を判定する基準となる閾値66の一例の値を示す。「評価画像誤り件数」は、ステップS108において欠陥Lが写っていないと判定された評価画像127の件数を示す。「追加用画像誤り件数」は、ステップS107において欠陥Lが写っていると判定された追加用画像123の件数を示す。「各追加用画像の判定結果」は、各追加用画像123の個別の判定結果を示す。「NG」は、欠陥Lが写っていると判定されたことを示す。「OK」は、欠陥Lが写っていないと判定されたことを示す。「各追加用画像の評価値」は、後述するステップS112で算出される各追加用画像123の評価値125を示す。評価値125の算出については後述する。 Each record illustrated in FIG. 11 has fields related to detection parameters and determination results, respectively. “Number” indicates the identifier of each detection parameter candidate 60. "Binarization threshold" indicates the value of threshold 65, which is a reference for binarization. “Area threshold” indicates an example of a threshold 66 that is a reference for determining the presence or absence of a defect L. The "number of evaluation image errors" indicates the number of evaluation images 127 that were determined in step S108 to not include the defect L. The "number of additional images with errors" indicates the number of additional images 123 that were determined to include the defect L in step S107. “Determination result of each additional image” indicates the individual determination result of each additional image 123. "NG" indicates that it has been determined that the defect L is captured. "OK" indicates that it has been determined that the defect L is not captured. "Evaluation value of each additional image" indicates the evaluation value 125 of each additional image 123 calculated in step S112, which will be described later. Calculation of the evaluation value 125 will be described later.

制御部11は、各検出パラメータ候補60による判定結果に基づいて、最適な検出パラメータ候補61を特定する。図11に例示されるとおり、番号「0」及び「1」の2つの検出パラメータ候補60が与えられ、各レコードに示される判定結果が得られた場合、制御部11は、誤り件数の最も少ない番号「1」の検出パラメータ候補60を最適な検出パラメータ候補61として特定する。 The control unit 11 specifies the optimal detection parameter candidate 61 based on the determination result of each detection parameter candidate 60. As illustrated in FIG. 11, when two detection parameter candidates 60 with numbers "0" and "1" are given and the determination result shown in each record is obtained, the control unit 11 selects the detection parameter candidate with the least number of errors. The detection parameter candidate 60 with number "1" is identified as the optimal detection parameter candidate 61.

なお、本実施形態では、各画像(123、127)は、複数のパッチ画像(P2、P3)に分割されている。また、評価画像127の各パッチ画像P3は、追加用画像123のパッチ画像P2に対応している。これに応じて、本実施形態に係るステップS109では、制御部11は、パッチ画像P2(対応するパッチ画像P3)毎に、各判定結果に基づいて、複数の検出パラメータ候補60から最適な検出パラメータ候補61を特定する。最適な検出パラメータ候補61を特定すると、制御部11は、次のステップS110に進める。 Note that in this embodiment, each image (123, 127) is divided into a plurality of patch images (P2, P3). Furthermore, each patch image P3 of the evaluation image 127 corresponds to the patch image P2 of the additional image 123. Accordingly, in step S109 according to the present embodiment, the control unit 11 determines the optimal detection parameter from the plurality of detection parameter candidates 60 for each patch image P2 (corresponding patch image P3) based on each determination result. Candidate 61 is identified. After identifying the optimal detection parameter candidate 61, the control unit 11 advances to the next step S110.

(ステップS110及びステップS111)
ステップS110では、制御部11は、評価部114として動作し、特定された1つの検出パラメータ候補61を利用した判定の結果において、誤判定の追加用画像123の数が第1の閾値以上であるか否かを判定する。さらに、制御部11は、特定された1つの検出パラメータ候補61を利用した判定の結果において、誤判定の評価画像127の数が第2の閾値以上であるか否かを判定する。
(Step S110 and Step S111)
In step S110, the control unit 11 operates as the evaluation unit 114, and determines that the number of falsely determined additional images 123 is greater than or equal to the first threshold in the determination result using the identified one detection parameter candidate 61. Determine whether or not. Furthermore, the control unit 11 determines whether or not the number of erroneously determined evaluation images 127 is equal to or greater than a second threshold value in the result of determination using the one identified detection parameter candidate 61.

第1の閾値及び第2の閾値はそれぞれ、適宜決定されてよい。例えば、第1の閾値及び第2の閾値はそれぞれ、オペレータの入力により指定されてもよい。また、例えば、第1の閾値及び第2の閾値はそれぞれ、プログラム内の設定値として与えられてもよい。第1の閾値及び第2の閾値は、別々に異なる値に設定されてもよいし、同じ値に設定されてもよい。 The first threshold value and the second threshold value may each be determined as appropriate. For example, the first threshold value and the second threshold value may each be specified by operator input. Further, for example, the first threshold value and the second threshold value may each be given as set values within the program. The first threshold value and the second threshold value may be set to different values separately, or may be set to the same value.

なお、ステップS110では、制御部11は、特定された1つの検出パラメータ候補61を利用した判定の結果において、複数の追加用画像123のうち誤判定の追加用画像123の割合が第1の閾値以上であるか否かを判定してもよい。同様に、制御部11は、特定された1つの検出パラメータ候補61を利用した判定の結果において、複数の評価画像127のうち誤判定の評価画像127の割合が第2の閾値以上であるか否かを判定してもよい。 In addition, in step S110, the control unit 11 determines that, in the result of the determination using the one identified detection parameter candidate 61, the proportion of the falsely determined additional images 123 among the plurality of additional images 123 is a first threshold value. It may be determined whether or not the value is greater than or equal to the value. Similarly, the control unit 11 determines whether or not the proportion of incorrectly determined evaluation images 127 among the plurality of evaluation images 127 is greater than or equal to a second threshold in the determination result using the one identified detection parameter candidate 61. It may be determined whether

ステップS111では、制御部11は、ステップS110の判定結果に基づいて、処理の分岐先を決定する。本実施形態では、誤判定の追加用画像123の数又は割合が第1の閾値以上である、又は誤判定の評価画像127の数又は割合が第2の閾値以上である場合に、制御部11は、ステップS112に処理を進める。他方、そうではない場合に、制御部11は、ステップS117に処理を進める。ただし、分岐の基準は、このような例に限定されなくてもよく、実施の形態に応じて適宜設定されてよい。例えば、誤判定の追加用画像123の数又は割合が第1の閾値以上であること、及び誤判定の評価画像127の数又は割合が第2の閾値以上であることの少なくとも一方を満たす場合に、制御部11は、ステップS112に処理を進めてもよい。そうではない場合に、制御部11は、ステップS117に処理を進めてもよい。また、例えば、誤判定の追加用画像123の数又は割合が第1の閾値以上であるか否かの判定、及び誤判定の評価画像127の数又は割合が第2の閾値以上であるか否かの判定のうちのいずれか一方が省略されてもよい。 In step S111, the control unit 11 determines the branch destination of the process based on the determination result in step S110. In the present embodiment, when the number or proportion of additional images 123 of false judgments is greater than or equal to the first threshold, or the number or proportion of evaluation images 127 of false judgment is greater than or equal to the second threshold, the control unit 11 , the process advances to step S112. On the other hand, if this is not the case, the control unit 11 advances the process to step S117. However, the branch criteria do not need to be limited to such an example, and may be set as appropriate depending on the embodiment. For example, when at least one of the following is satisfied: the number or proportion of additional images 123 of false judgments is equal to or greater than a first threshold, and the number or proportion of evaluation images 127 of false discrimination is equal to or greater than a second threshold. , the control unit 11 may proceed to step S112. If not, the control unit 11 may proceed to step S117. Also, for example, it is possible to determine whether the number or proportion of additional images 123 that are incorrectly determined is equal to or greater than a first threshold, and whether or not the number or proportion of evaluation images 127 that are falsely determined is equal to or greater than a second threshold. Either one of these determinations may be omitted.

なお、本実施形態では、各画像(123、127)は、複数のパッチ画像(P2、P3)に分割されている。これに応じて、本実施形態では、誤判定の追加用画像123の数又は割合が第1の閾値以上であるパッチ画像P2が存在する、又は誤判定の評価画像127の数又は割合が第2の閾値以上である対応のパッチ画像P3が存在する場合に、制御部11は、ステップS112に処理を進める。他方、そのような各パッチ画像(P2、P3)が存在しない場合に、制御部11は、ステップS117に処理を進める。 Note that in this embodiment, each image (123, 127) is divided into a plurality of patch images (P2, P3). Accordingly, in the present embodiment, there is a patch image P2 in which the number or proportion of additional images 123 of false determinations is equal to or higher than the first threshold value, or the number or proportion of evaluation images 127 of false determinations is the second If there is a corresponding patch image P3 that is equal to or greater than the threshold value, the control unit 11 advances the process to step S112. On the other hand, if such patch images (P2, P3) do not exist, the control unit 11 advances the process to step S117.

(ステップS112)
ステップS112では、制御部11は、各追加用画像123及び生成された各復元追加用画像124の間の差分に応じて、各追加用画像123の評価値125であって、各復元追加用画像124における各追加用画像123の復元の程度に対する評価値125を算出する。本実施形態では、制御部11は、各差分画像182を利用して、各追加用画像123の評価値125を算出する。
(Step S112)
In step S112, the control unit 11 sets the evaluation value 125 of each additional image 123 according to the difference between each additional image 123 and each generated restored additional image 124, An evaluation value 125 for the degree of restoration of each additional image 123 in step 124 is calculated. In this embodiment, the control unit 11 uses each difference image 182 to calculate the evaluation value 125 of each additional image 123.

ここで、図12を更に利用して、各追加用画像123の評価値125を算出する方法の一例について説明する。図12は、評価値125を算出する処理過程の一例を模式的に例示する図である。本実施形態では、制御部11は、上記ステップS107において、各差分画像182を生成している。各差分画像182内の画素値の大きい画素は、各追加用画像123と各復元追加用画像124との間で差異の大きい画素に対応する。各差分画像182内の画素値の小さい画素は、各追加用画像123と各復元追加用画像124との間で差異の小さい画素に対応する。制御部11は、各画素の画素値に表れる当該差異の程度に基づいて、復元の程度に対する評価を示す評価値125を算出する。 Here, an example of a method for calculating the evaluation value 125 of each additional image 123 will be described with further reference to FIG. 12. FIG. 12 is a diagram schematically illustrating an example of the process of calculating the evaluation value 125. In this embodiment, the control unit 11 generates each difference image 182 in step S107. A pixel with a large pixel value in each difference image 182 corresponds to a pixel with a large difference between each additional image 123 and each restored additional image 124. A pixel with a small pixel value in each difference image 182 corresponds to a pixel with a small difference between each additional image 123 and each restored additional image 124. The control unit 11 calculates an evaluation value 125 indicating an evaluation of the degree of restoration based on the degree of the difference appearing in the pixel value of each pixel.

本実施形態では、この観点に基づく算出方法の一例として、制御部11は、各画素の画素値が大きいほど評価値125が高くなり、かつ、基準画素値以上の画素の評価値125に与える寄与度が基準画素値未満の画素の評価値125に与える寄与度よりも大きくなるように、評価値125を算出する。具体的には、制御部11は、図12に示されるように、差分画像182を構成する画像について、画素値に関する度数分布(濃度ヒストグラム)を作成する。図12の例では、各差分画像182の画素値は256階調で表現されていると仮定している。図12に例示される濃度ヒストグラムの「度数」は、同一の画素値の画素数を示す。続いて、制御部11は、作成した濃度ヒストグラムにおいて、上位所定割合を占める画素値の最小値を基準画素値として決定する。そして、制御部11は、各差分画像182内の画素から、基準画素値以上の画素(つまり、上位所定割合の画素)を抽出する。所定割合は、オペレータの入力、プログラム内の設定値等により指定されてよい。そして、制御部11は、抽出された画素の画素値の平均値又は合計値を評価値125として算出する。なお、制御部11は、濃度ヒストグラムにおける基準画素値以上の頻度を用いて、当該平均値又は合計値を算出してもよい。これにより、本実施形態では、算出された評価値125が大きいほど、追加用画像123と復元追加用画像124との間の差分が大きい、換言すると、復元追加用画像124における追加用画像123の復元の程度が低いことを示す。 In the present embodiment, as an example of a calculation method based on this viewpoint, the control unit 11 determines that the larger the pixel value of each pixel is, the higher the evaluation value 125 is, and the contribution to the evaluation value 125 of pixels that is equal to or higher than the reference pixel value. The evaluation value 125 is calculated so that it is larger than the contribution given to the evaluation value 125 of pixels whose degree is less than the reference pixel value. Specifically, the control unit 11 creates a frequency distribution (density histogram) regarding pixel values for the images forming the difference image 182, as shown in FIG. In the example of FIG. 12, it is assumed that the pixel values of each difference image 182 are expressed in 256 gradations. The "frequency" of the density histogram illustrated in FIG. 12 indicates the number of pixels having the same pixel value. Subsequently, the control unit 11 determines the minimum value of the pixel values occupying a predetermined upper rank in the created density histogram as the reference pixel value. Then, the control unit 11 extracts pixels having a reference pixel value or higher (that is, a predetermined percentage of pixels at the top) from the pixels in each difference image 182. The predetermined ratio may be specified by an operator's input, a set value in a program, or the like. Then, the control unit 11 calculates the average value or total value of the pixel values of the extracted pixels as the evaluation value 125. Note that the control unit 11 may calculate the average value or total value using a frequency greater than or equal to the reference pixel value in the density histogram. As a result, in this embodiment, the larger the calculated evaluation value 125, the larger the difference between the additional image 123 and the restored additional image 124. In other words, the difference between the additional image 123 and the restored additional image 124 is larger. Indicates that the degree of restoration is low.

ただし、評価値125を算出する方法は、このような例に限定されなくてもよい。各追加用画像123及び各復元追加用画像124の差分と評価値125との間の関係は、評価値125が、当該差分が大きいことに応じて復元の程度が低いことを示し、かつ当該差分が小さいことに応じて復元の程度が高いことを示すように、適宜決定されてよい。例えば、上記算出方法とは反対に、評価値125は、復元の程度が低いほど小さく、復元の程度が高いほど大きくなるように算出されてよい。当該算出方法の一例として、制御部11は、上記の処理により抽出された画素の画素値の平均値又は合計値の逆数を評価値125として算出してもよい。 However, the method for calculating the evaluation value 125 does not have to be limited to this example. The relationship between the difference between each additional image 123 and each restoration additional image 124 and the evaluation value 125 is that the evaluation value 125 indicates that the degree of restoration is low as the difference is large, and may be determined as appropriate so that the smaller the value, the higher the degree of restoration. For example, contrary to the calculation method described above, the evaluation value 125 may be calculated such that the lower the degree of restoration, the smaller the evaluation value 125, and the higher the degree of restoration, the larger the evaluation value 125. As an example of the calculation method, the control unit 11 may calculate the average value or the reciprocal of the total value of the pixel values of the pixels extracted by the above process as the evaluation value 125.

なお、本実施形態では、制御部11は、ステップS107において、各追加用画像123と各復元追加用画像124との差分に基づいて、各追加用画像123に欠陥Lが写っているか否かを判定している。欠陥Lが写っていると判定されることは、追加用画像123と復元追加用画像124との間の差分が大きい、換言すると、復元追加用画像124における追加用画像123の復元の程度が低いことを示す。反対に、欠陥Lが写っていないと判定されることは、追加用画像123と復元追加用画像124との間の差分が小さい、換言すると、復元追加用画像124における追加用画像123の復元の程度が高いことを示す。 In this embodiment, in step S107, the control unit 11 determines whether the defect L is included in each additional image 123 based on the difference between each additional image 123 and each restored additional image 124. Judging. It is determined that the defect L is included because the difference between the additional image 123 and the restored additional image 124 is large. In other words, the degree of restoration of the additional image 123 in the restored additional image 124 is low. Show that. On the other hand, if it is determined that the defect L is not captured, the difference between the additional image 123 and the restored additional image 124 is small.In other words, the difference between the additional restored image 124 and the restored additional image 124 is small. Indicates that the degree is high.

そこで、本実施形態では、制御部11は、複数の追加用画像123のうち、欠陥Lが写っていると判定された少なくとも1又は複数の追加用画像123について、評価値125を算出する。これに対して、欠陥Lが写っていないと判定された追加用画像123の評価値125の算出は任意であってよい。すなわち、図11に示されるとおり、制御部11は、欠陥Lが写っていないと判定された追加用画像123についても、評価値125を算出してもよい。或いは、制御部11は、欠陥Lが写っていないと判定された追加用画像123についての評価値125の算出を省略してもよい。欠陥Lが写っているか否かに問わず、各追加用画像123の評価値125を算出する場合、制御部11は、上記ステップS107の処理よりも前に、本ステップS112の処理を実行してもよい。本ステップS112の処理は、ステップS105の処理を実行した後の任意のタイミングで実行されてよい。 Therefore, in the present embodiment, the control unit 11 calculates the evaluation value 125 for at least one or more additional images 123 that are determined to include the defect L among the plurality of additional images 123. On the other hand, the evaluation value 125 of the additional image 123 determined not to include the defect L may be calculated arbitrarily. That is, as shown in FIG. 11, the control unit 11 may calculate the evaluation value 125 also for the additional image 123 for which it is determined that the defect L does not appear. Alternatively, the control unit 11 may omit calculation of the evaluation value 125 for the additional image 123 determined to not include the defect L. When calculating the evaluation value 125 of each additional image 123 regardless of whether the defect L is captured, the control unit 11 executes the process of this step S112 before the process of the above step S107. Good too. The process of step S112 may be executed at any timing after the process of step S105 is executed.

また、本実施形態では、各追加用画像123は、複数のパッチ画像P2に分割されている。これに応じて、本実施形態では、制御部11は、誤判定の追加用画像123の数又は割合が第1の閾値以上である、又は誤判定の評価画像127の数又は割合が第2の閾値以上であるパッチ画像P2毎に、各追加用画像123の評価値125を算出する。各追加用画像123の評価値125を算出すると、制御部11は、次のステップS113に処理を進める。 Further, in this embodiment, each additional image 123 is divided into a plurality of patch images P2. Accordingly, in the present embodiment, the control unit 11 determines that the number or proportion of additional images 123 of false determination is equal to or greater than the first threshold, or that the number or proportion of evaluation images 127 of false determination is equal to or higher than the second The evaluation value 125 of each additional image 123 is calculated for each patch image P2 that is equal to or greater than the threshold value. After calculating the evaluation value 125 of each additional image 123, the control unit 11 advances the process to the next step S113.

(ステップS113)
ステップS113では、制御部11は、抽出部115として動作し、算出された評価値125に基づいて、復元の程度が低いと評価される1つ以上の追加用画像126を複数の追加用画像123から抽出する。
(Step S113)
In step S113, the control unit 11 operates as the extraction unit 115, and selects one or more additional images 126 that are evaluated to have a low degree of restoration from the plural additional images 123 based on the calculated evaluation value 125. Extract from.

復元の程度が低いと評価するための基準は、特に限定されなくてもよく、実施の形態に応じて適宜設定されてよい。本実施形態では、ステップS112により算出された評価値125が大きいほど、復元追加用画像124における追加用画像123の復元の程度が低いことを示す。そこで、例えば、制御部11は、最も評価値125の大きい(すなわち、復元の程度に対する評価の最も低い)追加用画像123を追加用画像126として抽出してもよい。また、例えば、制御部11は、評価値125の高い方(すなわち、評価の低い方)から順に所定数の追加用画像123を追加用画像126として抽出してもよい。所定数は、オペレータの入力、プログラム内の設定値等により適宜決定されてよい。また、例えば、評価値125が閾値よりも大きい(すなわち、閾値よりも評価の低い)追加用画像123を追加用画像126として抽出してもよい。判定の基準となる閾値は、オペレータの入力、プログラム内の設定値等により適宜決定されてよい。 The criteria for evaluating that the degree of restoration is low does not need to be particularly limited, and may be set as appropriate depending on the embodiment. In this embodiment, the larger the evaluation value 125 calculated in step S112, the lower the degree of restoration of the additional image 123 in the additional restoration image 124. Therefore, for example, the control unit 11 may extract the additional image 123 with the highest evaluation value 125 (that is, the lowest evaluation for the degree of restoration) as the additional image 126. Further, for example, the control unit 11 may extract a predetermined number of additional images 123 as additional images 126 in order from those with higher evaluation values 125 (that is, those with lower evaluations). The predetermined number may be determined as appropriate based on operator input, set values in the program, etc. Further, for example, an additional image 123 whose evaluation value 125 is larger than a threshold (that is, whose evaluation is lower than the threshold) may be extracted as an additional image 126. The threshold value that serves as the criterion for determination may be determined as appropriate based on operator input, set values in the program, and the like.

なお、本実施形態では、制御部11は、ステップS107において、各追加用画像123と各復元追加用画像124との差分に基づいて、各追加用画像123に欠陥Lが写っているか否かを判定している。これに応じて、本実施形態では、制御部11は、本ステップS113において、算出された評価値125に基づいて、欠陥Lが写っていると判定された1又は複数の追加用画像123から、復元の程度が低いと評価される1つ以上の追加用画像126を抽出する。 In this embodiment, in step S107, the control unit 11 determines whether the defect L is included in each additional image 123 based on the difference between each additional image 123 and each restored additional image 124. Judging. Accordingly, in the present embodiment, the control unit 11 selects from the one or more additional images 123 determined to include the defect L based on the calculated evaluation value 125 in step S113. One or more additional images 126 that are evaluated to have a low degree of restoration are extracted.

また、本実施形態では、各追加用画像123は、複数のパッチ画像P2に分割されている。これに応じて、本実施形態では、制御部11は、パッチ画像P2毎に、算出された評価値125に基づいて、1つ以上の追加用画像126を複数の追加用画像123から抽出する。1つ以上の追加用画像126を抽出すると、制御部11は、次のステップS114に処理を進める。 Furthermore, in this embodiment, each additional image 123 is divided into a plurality of patch images P2. Accordingly, in the present embodiment, the control unit 11 extracts one or more additional images 126 from the plurality of additional images 123 for each patch image P2 based on the calculated evaluation value 125. After extracting one or more additional images 126, the control unit 11 advances the process to the next step S114.

(ステップS114及びステップS115)
ステップS114では、制御部11は、表示制御部118として動作し、抽出された1つ以上の追加用画像126それぞれを表示装置15に表示させる。表示装置15は、本発明の「表示装置」の一例である。ステップS115では、制御部11は、選択受付部119として動作し、表示装置15に表示された1つ以上の追加用画像126それぞれについて、当該1つ以上の追加用画像126それぞれを、後述するステップS116の機械学習に使用するか否かの選択を受け付ける。
(Step S114 and Step S115)
In step S<b>114 , the control unit 11 operates as the display control unit 118 and causes the display device 15 to display each of the extracted one or more additional images 126 . The display device 15 is an example of the "display device" of the present invention. In step S115, the control unit 11 operates as the selection reception unit 119, and for each of the one or more additional images 126 displayed on the display device 15, the control unit 11 selects each of the one or more additional images 126 in the steps described below. A selection of whether to use it for machine learning in S116 is accepted.

ここで、図13及び図14を更に用いて、抽出された追加用画像126の表示画面の一例について説明する。図13及び図14は、本実施形態に係る表示画面の一例を模式的に例示する図である。本実施形態に係る表示画面の一例は、3つの領域400~402を有している。領域400には、抽出された追加用画像126を含む各追加用画像123が表示される。領域401には、抽出された追加用画像126を含む複数の追加用画像123及び各追加用画像123の評価値125がリスト表示される。領域402には、後述するステップS116の機械学習に使用される学習画像がリスト表示される。ステップS115の処理による選択を受け付ける前には、領域402のリストには、ステップS102で使用された第1学習画像121の他、抽出された追加用画像126が含まれている。 Here, an example of the display screen of the extracted additional image 126 will be described with further reference to FIGS. 13 and 14. 13 and 14 are diagrams schematically illustrating an example of a display screen according to this embodiment. An example of the display screen according to this embodiment has three areas 400 to 402. In the area 400, each additional image 123 including the extracted additional image 126 is displayed. In the area 401, a list of a plurality of additional images 123 including the extracted additional image 126 and the evaluation value 125 of each additional image 123 is displayed. In the area 402, a list of learning images used for machine learning in step S116, which will be described later, is displayed. Before accepting the selection in step S115, the list of area 402 includes the extracted additional image 126 in addition to the first learning image 121 used in step S102.

本実施形態では、生成モデル5は、機械学習により、欠陥Lの有無に関わらず、欠陥Lを含まない製品Rの画像を復元する能力を獲得する。これにより、学習済みの生成モデル5は、欠陥Lの検出に利用される。そのため、機械学習の使用に追加される追加用画像123には、欠陥Lが写っていないのが好ましい。しかしながら、例えば、人為的なミス等により、ステップS103では、生成モデル5に再現させることを所望しない欠陥Lの写る画像が追加用画像123として取得される可能性がある。追加用画像123に表れる欠陥Lのない製品Rの様子を再現する生成モデル5の能力が不十分である場合と同様に、追加用画像123に欠陥Lが写っている場合にも、評価値125により示される復元の程度に対する評価が低くなり得る。そのため、欠陥Lの写る画像が追加用画像123として取得された場合に、当該欠陥Lの写る追加用画像123がステップS113の処理により追加用画像126として抽出される可能性がある。 In this embodiment, the generative model 5 acquires the ability to restore an image of the product R that does not include the defect L, regardless of the presence or absence of the defect L, through machine learning. Thereby, the trained generative model 5 is used for detecting the defect L. Therefore, it is preferable that the additional image 123 added to use machine learning does not include the defect L. However, for example, due to human error or the like, there is a possibility that an image in which a defect L that is not desired to be reproduced in the generation model 5 is captured as the additional image 123 in step S103. Similarly to the case where the ability of the generation model 5 to reproduce the state of the product R without the defect L appearing in the additional image 123 is insufficient, also when the defect L is shown in the additional image 123, the evaluation value 125 The evaluation of the degree of restoration indicated by may be low. Therefore, when the image in which the defect L is captured is acquired as the additional image 123, there is a possibility that the additional image 123 in which the defect L is captured is extracted as the additional image 126 by the process of step S113.

この点に関して、本実施形態では、制御部11は、ステップS114において、抽出された追加用画像126を領域400に表示する。これにより、オペレータは、領域400に表示される追加用画像126に写る製品Rの様子を目視により確認することができる。そして、オペレータは、欠陥Lが写っている等の理由により、機械学習に使用しないことを所望する追加用画像126を領域402のリストから削除することで、対象の追加用画像126について機械学習に使用しないことを選択することができる。すなわち、本実施形態では、制御部11は、ステップS115において、領域402のリスト表示を介して、抽出された1つ以上の追加用画像126それぞれについて、当該1つ以上の追加用画像126それぞれを機械学習に使用するか否かの選択を受け付ける。 Regarding this point, in this embodiment, the control unit 11 displays the extracted additional image 126 in the area 400 in step S114. Thereby, the operator can visually confirm the state of the product R appearing in the additional image 126 displayed in the area 400. Then, by deleting an additional image 126 that is desired not to be used for machine learning from the list in the area 402 due to the fact that the defect L is included in the image, the operator can perform machine learning on the target additional image 126. You can choose not to use it. That is, in the present embodiment, in step S115, the control unit 11 selects each of the one or more additional images 126 for each of the extracted one or more additional images 126 via the list display in the area 402. Accepts the selection of whether or not to use it for machine learning.

また、本実施形態に係る表示画面の一例は、2つの操作ボタン(405、406)を有している。操作ボタン405は、領域401に表示される追加用画像123のリストから、領域402に表示される使用する学習画像のリストに追加する追加用画像123を追加するために利用される。オペレータは、領域401に表示されるリストから所望の追加用画像123を選択し、操作ボタン405を操作することで、所望の追加用画像123を領域402のリストに追加することができる。操作ボタン406は、領域402のリストに表示される画像を使用して、生成モデル5の機械学習を実施するために利用される。制御部11は、操作ボタン406の操作に応じて、ステップS116に処理を進める。ただし、抽出された追加用画像126を表示し、かつ抽出された追加用画像126を機械学習に使用するか否かの選択を受け付けるための表示画面は、このような例に限定されなくてもよく、実施の形態に応じて適宜設計されてよい。 Further, an example of the display screen according to this embodiment has two operation buttons (405, 406). The operation button 405 is used to add an additional image 123 to be added to the list of learning images to be used displayed in the area 402 from the list of additional images 123 displayed in the area 401. The operator can add the desired additional image 123 to the list in the area 402 by selecting the desired additional image 123 from the list displayed in the area 401 and operating the operation button 405. The operation button 406 is used to perform machine learning on the generative model 5 using the images displayed in the list in the area 402. The control unit 11 advances the process to step S116 in response to the operation of the operation button 406. However, the display screen for displaying the extracted additional image 126 and accepting the selection of whether or not to use the extracted additional image 126 for machine learning is not limited to this example. It may be designed as appropriate depending on the embodiment.

なお、本実施形態では、各追加用画像126(123)は、複数のパッチ画像P2に分割されている。これに応じて、本実施形態では、図13に示されるとおり、制御部11は、領域400に表示される追加用画像126(123)において、各パッチ画像P2の境界にグリッド線G1を更に表示させてもよい。これにより、各追加用画像126(123)におけるパッチ分割の視認性を高めることができる。加えて、図14に示されるとおり、制御部11は、評価値125に基づいて追加用画像126として抽出された対応のパッチ画像P2を示す印G5を更に表示させてもよい。これにより、復元の程度の低いと評価されたパッチ画像P2の視認性を高めることができる。 Note that in this embodiment, each additional image 126 (123) is divided into a plurality of patch images P2. Accordingly, in this embodiment, as shown in FIG. 13, the control unit 11 further displays grid lines G1 at the boundaries of each patch image P2 in the additional image 126 (123) displayed in the area 400. You may let them. Thereby, the visibility of patch division in each additional image 126 (123) can be improved. In addition, as shown in FIG. 14, the control unit 11 may further display a mark G5 indicating the corresponding patch image P2 extracted as the additional image 126 based on the evaluation value 125. Thereby, the visibility of the patch image P2, which has been evaluated as having a low degree of restoration, can be improved.

(ステップS116)
ステップS116では、制御部11は、追加学習部116として動作する。制御部11は、抽出された1つ以上の追加用画像126のうち、機械学習に使用すると選択された画像を第2学習画像126Aとして決定する。制御部11は、機械学習により、決定された1つ以上の第2学習画像126Aそれぞれが与えられると、与えられた1つ以上の第2学習画像126Aそれぞれに適合する復元画像を生成するように生成モデル5を更に訓練する。
(Step S116)
In step S116, the control unit 11 operates as the additional learning unit 116. The control unit 11 determines the image selected to be used for machine learning among the one or more extracted additional images 126 as the second learning image 126A. When the control unit 11 is given each of the one or more second learning images 126A determined by machine learning, the control unit 11 generates a restored image that matches each of the one or more given second learning images 126A. Further train generative model 5.

本実施形態では、制御部11は、第1学習画像121及び第2学習画像126Aを使用して、上記ステップS102と同様に、ニューラルネットワークの演算パラメータMを導出する。これにより、制御部11は、第1学習画像121及び第2学習画像126Aそれぞれが与えられると、与えられた第1学習画像121及び第2学習画像126Aそれぞれに適合する復元画像を生成するように訓練された学習済みの生成モデル5を構築することができる。 In this embodiment, the control unit 11 uses the first learning image 121 and the second learning image 126A to derive the calculation parameter M of the neural network in the same manner as in step S102 above. Thereby, when the first learning image 121 and the second learning image 126A are given, the control unit 11 generates restored images that match the given first learning image 121 and the second learning image 126A, respectively. A trained and learned generative model 5 can be constructed.

なお、本実施形態では、追加用画像126(123)は、第1学習画像121のパッチ分割に対応して、複数のパッチ画像P2に分割されている。これに応じて、本実施形態では、制御部11は、パッチ画像P2毎に、機械学習により、決定された1つ以上の第2学習画像126Aそれぞれが与えられると、与えられた1つ以上の第2学習画像126Aそれぞれに適合する復元画像を生成するように生成モデル5を更に訓練する。すなわち、第1学習画像121のパッチ画像P1毎に構築された学習済みの生成モデル5は、第2学習画像126Aの対応するパッチ画像P2が与えられると、与えられたパッチ画像P2に適合する復元画像を生成するように更に訓練される。これにより、制御部11は、各画像(121、123、126)の対応するパッチ画像(P1、P2)毎に、学習済みの生成モデル5を構築する。 Note that in this embodiment, the additional image 126 (123) is divided into a plurality of patch images P2 in accordance with the patch division of the first learning image 121. Accordingly, in the present embodiment, when each of the one or more second learning images 126A determined by machine learning is given for each patch image P2, the control unit 11 The generative model 5 is further trained to generate restored images suitable for each of the second learning images 126A. That is, when the trained generative model 5 constructed for each patch image P1 of the first learning image 121 is given the corresponding patch image P2 of the second learning image 126A, the trained generative model 5 can be restored to fit the given patch image P2. It is further trained to generate images. Thereby, the control unit 11 constructs a learned generation model 5 for each patch image (P1, P2) corresponding to each image (121, 123, 126).

上述したように、本実施形態では、制御部11は、図13及び図14に例示される表示画面の一例における領域402のリスト表示を介して、抽出された1つ以上の追加用画像126それぞれについて、当該1つ以上の追加用画像126それぞれを機械学習に使用するか否かの選択を受け付ける。これに応じて、本実施形態では、制御部11は、機械学習に使用しないと選択された追加用画像126を本ステップS116による訓練の対象から除外する。より詳細には、本実施形態では、制御部11は、操作ボタン406が操作された時点において、領域402のリストに含まれる画像を使用して、生成モデル5の機械学習を実施する。 As described above, in the present embodiment, the control unit 11 displays each of the one or more extracted additional images 126 through the list display of the area 402 on the example display screen illustrated in FIGS. 13 and 14. , a selection as to whether to use each of the one or more additional images 126 for machine learning is accepted. Accordingly, in this embodiment, the control unit 11 excludes the additional image 126 selected not to be used for machine learning from the training target in step S116. More specifically, in this embodiment, the control unit 11 performs machine learning of the generative model 5 using the images included in the list of the area 402 at the time the operation button 406 is operated.

生成モデル5の更なる訓練が完了すると、制御部11は、ステップS116により得られた訓練済みの生成モデル5を利用して、ステップS105から処理を繰り返す。ステップS105~ステップS116の処理を繰り返すことで、製品Rの写る画像を再現する生成モデル5の能力の適切な向上に貢献する可能性の高い追加用画像126を複数の追加用画像123から抽出することができる。そして、抽出された追加用画像126に含まれる1つ以上の第2学習画像126Aを生成モデル5の更なる機械学習に使用して、製品Rの写る画像を再現する生成モデル5の能力の適切な向上を図ることができる。 When further training of the generative model 5 is completed, the control unit 11 repeats the process from step S105 using the trained generative model 5 obtained in step S116. By repeating the processes from step S105 to step S116, additional images 126 that are likely to contribute to appropriate improvement of the ability of the generative model 5 to reproduce images of the product R are extracted from the plurality of additional images 123. be able to. Then, one or more second learning images 126A included in the extracted additional images 126 are used for further machine learning of the generative model 5 to determine the appropriateness of the ability of the generative model 5 to reproduce the image of the product R. It is possible to make significant improvements.

なお、ステップS105~ステップS116の処理を複数回繰り返す場合、ステップS110の処理を繰り返す度に、第1の閾値及び第2の閾値の値は適宜変更されてもよい。また、ステップS112~ステップS116の処理を実行する前後の生成モデル5の性能を比較した場合に、これらの処理を実行した後に、ステップS107及びステップS108において誤判定される各画像(123、127)の数が増加したと想定する。この場合、制御部11は、誤判定される各画像(123、127)の数の増加に関連したステップS112~ステップS116の処理結果を破棄し、ステップS117に処理を進めてもよい。これにより、制御部11は、直前に構築された学習済みの生成モデル5を最終的な学習結果として採用してもよい。 Note that when the processing of steps S105 to S116 is repeated multiple times, the values of the first threshold value and the second threshold value may be changed as appropriate each time the processing of step S110 is repeated. Furthermore, when comparing the performance of the generative model 5 before and after executing the processes in steps S112 to S116, each image (123, 127) that is incorrectly determined in steps S107 and S108 after executing these processes Assume that the number of In this case, the control unit 11 may discard the processing results of steps S112 to S116 related to the increase in the number of erroneously determined images (123, 127), and proceed to step S117. Thereby, the control unit 11 may adopt the trained generative model 5 constructed immediately before as the final learning result.

(ステップS117)
ステップS117では、制御部11は、保存処理部1110として動作し、最終的に構築された学習済みの生成モデル5に関する情報を学習結果データ129として生成する。本実施形態では、最終的な機械学習に使用される学習画像は、ステップS111の条件分岐、ステップS113の処理、及びステップS115の処理それぞれの結果に応じて、第1学習画像121及び追加用画像123(126)から決定される。なお、本実施形態では、学習画像のパッチ画像毎に学習済みの生成モデル5が構築される。そのため、制御部11は、学習画像のパッチ画像毎に構築された学習済みの生成モデル5に関する情報を学習結果データ129として生成する。
(Step S117)
In step S117, the control unit 11 operates as the storage processing unit 1110 and generates information regarding the finally constructed trained generative model 5 as learning result data 129. In this embodiment, the learning images used for final machine learning are the first learning image 121 and the additional image according to the results of the conditional branching in step S111, the processing in step S113, and the processing in step S115. 123 (126). Note that in this embodiment, a learned generation model 5 is constructed for each patch image of the learning image. Therefore, the control unit 11 generates information regarding the learned generative model 5 constructed for each patch image of the learning image as the learning result data 129.

学習結果データ129には、生成モデル5を構成する演算パラメータMの値を再現可能な情報が含まれる。本実施形態では、生成モデル5は、ニューラルネットワークにより構成される。そのため、例えば、学習結果データ129には、最終的に構築された学習済みのニューラルネットワーク(生成モデル5)の演算パラメータMの値を再現可能な情報が含まれる。また、例えば、学習結果データ129には、学習画像のパッチ画像毎に導出された演算パラメータMが含まれてもよい。制御部11は、生成された学習結果データ129を所定の記憶領域に保存する。 The learning result data 129 includes information that allows the values of the calculation parameters M forming the generative model 5 to be reproduced. In this embodiment, the generative model 5 is configured by a neural network. Therefore, for example, the learning result data 129 includes information that can reproduce the value of the calculation parameter M of the finally constructed trained neural network (generation model 5). Further, for example, the learning result data 129 may include a calculation parameter M derived for each patch image of the learning image. The control unit 11 stores the generated learning result data 129 in a predetermined storage area.

所定の記憶領域は、例えば、制御部11内のRAM、記憶部12、記憶媒体91、外部記憶装置又はこれらの組み合わせであってよい。外部記憶装置は、例えば、NAS(Network Attached Storage)等のデータサーバであってもよい。この場合、制御部11は、通信インタフェース13を利用して、ネットワークを介してデータサーバに学習結果データ129を格納してもよい。また、外部記憶装置は、例えば、学習装置1に接続された外付けの記憶装置であってよい。学習結果データ129を保存すると、制御部11は、本動作例に係る一連の処理を終了する。 The predetermined storage area may be, for example, the RAM in the control unit 11, the storage unit 12, the storage medium 91, an external storage device, or a combination thereof. The external storage device may be, for example, a data server such as NAS (Network Attached Storage). In this case, the control unit 11 may use the communication interface 13 to store the learning result data 129 in the data server via the network. Further, the external storage device may be, for example, an external storage device connected to the learning device 1. After storing the learning result data 129, the control unit 11 ends the series of processes related to this operation example.

なお、学習装置1により生成された学習結果データ129は、任意のタイミングで検出装置2に提供されてよい。例えば、制御部11は、上記ステップS117の処理として又は上記ステップS117とは別に、学習結果データ129を検出装置2に転送してもよい。検出装置2は、この転送を受け付けることで、学習結果データ129を取得してもよい。また、例えば、検出装置2は、通信インタフェース23を利用して、学習装置1又はデータサーバにネットワークを介してアクセスすることで、学習結果データ129を取得してもよい。また、例えば、検出装置2は、記憶媒体92を介して、学習結果データ129を取得してもよい。また、例えば、学習結果データ129は、検出装置2に予め組み込まれてもよい。 Note that the learning result data 129 generated by the learning device 1 may be provided to the detection device 2 at any timing. For example, the control unit 11 may transfer the learning result data 129 to the detection device 2 as the process of step S117 or separately from step S117. The detection device 2 may acquire the learning result data 129 by accepting this transfer. Further, for example, the detection device 2 may obtain the learning result data 129 by accessing the learning device 1 or the data server via the network using the communication interface 23. Further, for example, the detection device 2 may acquire the learning result data 129 via the storage medium 92. Further, for example, the learning result data 129 may be incorporated into the detection device 2 in advance.

[検出装置]
次に、図15を用いて、検出装置2の動作例について説明する。図15は、本実施形態に係る検出装置2の処理手順の一例を示すフローチャートである。以下で説明する処理手順は、検出方法の一例である。ただし、以下で説明する処理手順は一例に過ぎず、各処理は可能な限り変更されてよい。検出方法には、上記学習方法及びモデル選択方法が含まれてよい。また、以下で説明する処理手順について、実施の形態に応じて、適宜、ステップの省略、置換、及び追加が可能である。
[Detection device]
Next, an example of the operation of the detection device 2 will be described using FIG. 15. FIG. 15 is a flowchart showing an example of the processing procedure of the detection device 2 according to this embodiment. The processing procedure described below is an example of a detection method. However, the processing procedure described below is only an example, and each process may be changed as much as possible. The detection method may include the learning method and model selection method described above. Further, regarding the processing procedure described below, steps can be omitted, replaced, or added as appropriate depending on the embodiment.

(ステップS301)
ステップS301では、制御部21は、取得部211として動作し、製品Rを観測することで得られた観測画像221を取得する。本実施形態では、検出装置2には、外部インタフェース27を介してカメラCAが接続されている。そのため、制御部21は、カメラCAから観測画像221を取得する。この観測画像221は、動画像であってもよいし、静止画像であってもよい。
(Step S301)
In step S301, the control unit 21 operates as the acquisition unit 211 and acquires the observation image 221 obtained by observing the product R. In this embodiment, a camera CA is connected to the detection device 2 via an external interface 27. Therefore, the control unit 21 acquires the observed image 221 from the camera CA. This observed image 221 may be a moving image or a still image.

なお、観測画像221を取得する経路は、このような例に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、カメラCAは、検出装置2とは異なる他の情報処理装置に接続されていてもよい。この場合、制御部21は、他の情報処理装置を介して観測画像221を取得してもよい。観測画像221を取得すると、制御部21は、次のステップS302に処理を進める。 Note that the route for acquiring the observed image 221 does not need to be limited to such an example, and may be appropriately selected depending on the embodiment. For example, the camera CA may be connected to another information processing device different from the detection device 2. In this case, the control unit 21 may acquire the observed image 221 via another information processing device. After acquiring the observation image 221, the control unit 21 advances the process to the next step S302.

(ステップS302)
ステップS302では、制御部21は、生成部212として動作し、学習結果データ129を参照して、学習済みの生成モデル5の設定を行う。そして、制御部21は、取得された観測画像221を学習済みの生成モデル5に入力し、学習済みの生成モデル5の演算処理を実行することで、観測画像221を復元した復元観測画像223を生成する。復元観測画像223は、学習済みの生成モデル5の出力、すなわち、学習済みの生成モデル5の演算結果として取得される。
(Step S302)
In step S302, the control unit 21 operates as the generation unit 212, refers to the learning result data 129, and sets the learned generation model 5. Then, the control unit 21 inputs the acquired observation image 221 into the trained generative model 5 and executes the arithmetic processing of the learned generative model 5, thereby creating a restored observation image 223 that is the restored observation image 221. generate. The restored observation image 223 is obtained as an output of the trained generative model 5, that is, as a calculation result of the trained generative model 5.

本ステップS302は、上記ステップS105及びステップS106と同様に処理されてよい。すなわち、本実施形態では、制御部21は、学習結果データ129を参照し、学習済みの生成モデル5を用意する。制御部21は、観測画像221を生成モデル5に入力する。これにより、制御部21は、復元観測画像223を生成する。 This step S302 may be processed in the same manner as steps S105 and S106 described above. That is, in the present embodiment, the control unit 21 refers to the learning result data 129 and prepares the trained generative model 5. The control unit 21 inputs the observed image 221 to the generation model 5. Thereby, the control unit 21 generates a restored observation image 223.

なお、本実施形態では、学習画像のパッチ画像毎に学習済みの生成モデル5が構築される。これに応じて、本実施形態では、制御部21は、各学習画像(121、123)のパッチ分割と同様に、取得された観測画像221を複数のパッチ画像P4に分割してもよい。或いは、上記ステップS301において、制御部21は、複数のパッチ画像P4に分割された観測画像221を取得してもよい。本ステップS302では、制御部21は、学習結果データ129を参照することで、パッチ画像P4毎に、生成モデル5を設定する。そして、制御部21は、観測画像221の各パッチ画像P4を対応する生成モデル5に入力し、各生成モデル5の演算処理を実行する。これにより、制御部21は、観測画像221を復元した復元観測画像223をパッチ画像P4毎に生成する。換言すると、制御部21は、観測画像221の各パッチ画像P4に対応する復元観測画像223の各パッチ画像を生成する。復元観測画像223を生成すると、制御部21は、次のステップS303に処理を進める。 Note that in this embodiment, a learned generation model 5 is constructed for each patch image of the learning image. Accordingly, in the present embodiment, the control unit 21 may divide the acquired observation image 221 into a plurality of patch images P4 in the same manner as the patch division of each learning image (121, 123). Alternatively, in step S301 above, the control unit 21 may acquire the observed image 221 divided into a plurality of patch images P4. In step S302, the control unit 21 sets the generation model 5 for each patch image P4 by referring to the learning result data 129. Then, the control unit 21 inputs each patch image P4 of the observed image 221 to the corresponding generation model 5, and executes arithmetic processing of each generation model 5. Thereby, the control unit 21 generates a restored observation image 223, which is the restored observation image 221, for each patch image P4. In other words, the control unit 21 generates each patch image of the restored observation image 223 corresponding to each patch image P4 of the observation image 221. After generating the restored observation image 223, the control unit 21 advances the process to the next step S303.

(ステップS303)
ステップS303では、制御部21は、検出部213として動作し、生成された復元観測画像223及び観測画像221の間の差分に基づいて、製品Rと共に欠陥が観測画像221に写っているか否か(すなわち、観測画像221に写る製品Rに欠陥が存在するか否か)を検出する。
(Step S303)
In step S303, the control unit 21 operates as the detection unit 213, and determines whether a defect is shown in the observation image 221 together with the product R based on the difference between the generated restored observation image 223 and the observation image 221 ( That is, it is detected whether or not there is a defect in the product R shown in the observation image 221.

本ステップS303は、上記ステップS107及びステップS108と同様に処理されてよい。すなわち、第1のステップでは、制御部21は、観測画像221と復元観測画像223との差分を算出することで、差分画像225を生成する。第2のステップでは、制御部21は、二値化の閾値を利用して、差分画像225の各画素を二値化する。第3のステップでは、制御部21は、得られた二値化画像内の連続する白色画素の領域を一つの領域と認定し、白色画素の各領域の形状に関する属性(例えば、面積、幅、高さ、周囲の長さ、縦横比、円形度等)が閾値を満たしているか否かを判定する。制御部21は、閾値を満たす領域をそのままにし、閾値を満たさない領域内の画素の画素値を「0」に変換する。これにより、制御部21は、欠陥の検出画像を生成することができる。第4のステップでは、制御部21は、検出画像に白色画素の領域が存在するか否かに応じて、観測画像221に写る製品Rに欠陥が存在するか否かを判定する。本実施形態では、これらの一連の処理により、制御部21は、観測画像221と復元観測画像223との間の差分に基づいて、観測画像221に写る製品Rに欠陥が存在するか否かを検出することができる。 This step S303 may be processed in the same manner as steps S107 and S108 described above. That is, in the first step, the control unit 21 generates the difference image 225 by calculating the difference between the observed image 221 and the restored observed image 223. In the second step, the control unit 21 binarizes each pixel of the difference image 225 using a binarization threshold. In the third step, the control unit 21 identifies the area of continuous white pixels in the obtained binarized image as one area, and attributes (for example, area, width, etc.) regarding the shape of each area of white pixels. It is determined whether the height, circumference, aspect ratio, circularity, etc.) satisfy a threshold value. The control unit 21 leaves the area that satisfies the threshold as it is, and converts the pixel values of pixels in the area that does not satisfy the threshold to "0". Thereby, the control unit 21 can generate a defect detection image. In the fourth step, the control unit 21 determines whether a defect exists in the product R shown in the observed image 221, depending on whether a white pixel area exists in the detected image. In this embodiment, through these series of processes, the control unit 21 determines whether or not there is a defect in the product R shown in the observation image 221 based on the difference between the observation image 221 and the restored observation image 223. can be detected.

当該検出処理における各閾値の値は、実施の形態に応じて適宜決定されてよい。例えば、各閾値の値は、オペレータの入力により指定されてよい。また、例えば、各閾値の値は、プログラム内の設定値として与えられてもよい。また、例えば、各閾値には、上記ステップS109により特定された検出パラメータ候補61が利用されてよい。この場合、検出パラメータ候補61は、学習結果データ129と共に又は学習結果データ129とは異なるタイミングで、検出装置2に提供されてよい。検出パラメータ候補61を検出装置2に適用する方法は、学習結果データ129と同様であってよい。 The value of each threshold value in the detection process may be determined as appropriate depending on the embodiment. For example, the value of each threshold may be specified by operator input. Further, for example, the value of each threshold value may be given as a set value within the program. Further, for example, the detection parameter candidate 61 identified in step S109 above may be used for each threshold value. In this case, the detection parameter candidate 61 may be provided to the detection device 2 together with the learning result data 129 or at a timing different from the learning result data 129. The method for applying the detection parameter candidates 61 to the detection device 2 may be the same as that for the learning result data 129.

なお、本実施形態では、観測画像221は、複数のパッチ画像P4に分割される。これに応じて、本実施形態では、制御部21は、観測画像221のパッチ画像P4毎に、観測画像221の対象のパッチ画像P4と復元観測画像223の対応するパッチ画像との差分に基づいて、当該対象のパッチ画像P4に写る製品Rに欠陥が存在するか否かを検出してもよい。観測画像221に写る製品Rに欠陥が存在するか否かを検出すると、制御部21は、次のステップS304に処理を進める。 Note that in this embodiment, the observed image 221 is divided into a plurality of patch images P4. Accordingly, in the present embodiment, the control unit 21 performs a process based on the difference between the target patch image P4 of the observed image 221 and the corresponding patch image of the restored observed image 223 for each patch image P4 of the observed image 221. , it may be detected whether or not there is a defect in the product R shown in the target patch image P4. Upon detecting whether or not there is a defect in the product R shown in the observation image 221, the control unit 21 advances the process to the next step S304.

(ステップS304)
ステップS304では、制御部21は、出力部214として動作し、欠陥の検出の結果、すなわち、製品Rの良否を判定した結果に関する情報を出力する。
(Step S304)
In step S304, the control unit 21 operates as the output unit 214 and outputs information regarding the result of defect detection, that is, the result of determining whether the product R is good or bad.

製品Rの良否を判定した結果の出力形式は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、制御部21は、製品Rの良否を判定した結果をそのまま表示装置25に出力してもよい。更に、ステップS303において、欠陥の存在が検出された場合、制御部21は、欠陥を発見したことを知らせるための警告を本ステップS304の出力処理として行ってもよい。このとき、制御部21は、欠陥を発見したことと共に、この欠陥の位置を通知してもよい。 The output format of the result of determining the quality of the product R is not particularly limited, and may be appropriately selected depending on the embodiment. For example, the control unit 21 may output the result of determining the quality of the product R to the display device 25 as is. Furthermore, if the presence of a defect is detected in step S303, the control unit 21 may issue a warning to notify that a defect has been discovered as an output process in step S304. At this time, the control unit 21 may notify the location of the defect as well as the fact that the defect has been discovered.

また、制御部21は、本ステップS304の出力処理として、製品Rの良否を判定した結果に応じた所定の制御処理を実行してもよい。具体例として、検出装置2は、製品Rの搬送を行う製造ラインに接続されていてもよい。この場合に、制御部21は、欠陥が存在すると判定された製品Rを、欠陥が存在しないと判定された製品Rとは異なる経路で搬送する指令を製造ラインに送信する処理を本ステップS304の出力処理として行ってもよい。 Further, the control unit 21 may execute a predetermined control process according to the result of determining whether the product R is good or bad as the output process in step S304. As a specific example, the detection device 2 may be connected to a manufacturing line where the product R is transported. In this case, the control unit 21 performs processing in step S304 to send a command to the manufacturing line to transport the product R determined to have a defect by a route different from that for the product R determined to have no defect. It may also be performed as output processing.

製品Rの良否を判定した結果の出力処理が完了すると、制御部21は、本動作例に係る処理を終了する。なお、制御部21は、製造ライン上で搬送される製品RがカメラCAの撮影範囲に入る度に、上記ステップS301~S304の一連の処理を実行してもよい。これにより、検出装置2は、製造ライン上で搬送される製品Rの外観検査を継続的に行なうことができる。 When the output process of the result of determining the quality of the product R is completed, the control unit 21 ends the process related to this operation example. Note that the control unit 21 may execute the series of processes from steps S301 to S304 described above each time the product R being transported on the production line enters the photographing range of the camera CA. Thereby, the detection device 2 can continuously perform an external appearance inspection of the product R transported on the production line.

[特徴]
以上のとおり、本実施形態では、ステップS102において、第1学習画像121を使用した機械学習により、学習済みの生成モデル5が暫定的に構築される。そして、ステップS112及びステップS113の処理により、暫定的に構築された学習済みの生成モデル5が各追加用画像123に対して復元能力を発揮した結果に基づいて、当該復元能力の適切な向上に貢献する可能性の高い1つ以上の追加用画像126を複数の追加用画像123から自動的に抽出することができる。したがって、本実施形態によれば、学習画像を適切に選択できる。これに応じて、検出装置2では、上記一連の処理において、このように適切に選択された学習画像を用いて構築された学習済みの生成モデル5を利用することで、製品Rに欠陥が存在するか否かを精度よく検出することができる。その結果、製品Rの欠陥検出にかかるコストを低減することができる。
[Features]
As described above, in this embodiment, the learned generative model 5 is provisionally constructed by machine learning using the first learning image 121 in step S102. Then, through the processing in step S112 and step S113, based on the results of the provisionally constructed trained generative model 5 demonstrating the restoration ability for each additional image 123, the restoration ability is appropriately improved. One or more additional images 126 that are likely to contribute can be automatically extracted from the plurality of additional images 123. Therefore, according to this embodiment, learning images can be appropriately selected. Accordingly, in the series of processes described above, the detection device 2 uses the trained generative model 5 constructed using the learning images appropriately selected in this way to detect the existence of a defect in the product R. It is possible to accurately detect whether or not to do so. As a result, the cost of detecting defects in product R can be reduced.

また、パッチ画像毎に生成モデルを用意する場合、生成モデルの機械学習に使用する学習画像を適切に選択することが更に困難となる。これに対して、本実施形態によれば、パッチ画像毎に用意される生成モデル5の機械学習に使用する学習画像の選択処理の少なくとも一部を自動化することができる。そのため、当該選択に係るコストを大幅に削減することができる。更に、検出装置2では、パッチ画像単位で最適化された生成モデル5を利用することで、欠陥の検出する精度を高めることができる。 Furthermore, when a generative model is prepared for each patch image, it becomes more difficult to appropriately select a learning image to be used for machine learning of the generative model. In contrast, according to the present embodiment, at least part of the process of selecting learning images used for machine learning of the generative model 5 prepared for each patch image can be automated. Therefore, the cost associated with this selection can be significantly reduced. Furthermore, the detection device 2 can improve the accuracy of detecting defects by using the generation model 5 that is optimized for each patch image.

また、本実施形態では、ステップS105~ステップS111の処理により、構築された学習済みの生成モデル5を利用した欠陥検出の性能を評価し、欠陥検出の性能が低いと評価される場合に、生成モデル5の更なる機械学習により当該性能の向上を図ることができる。更に、生成モデル5を利用した欠陥検出の性能を評価する際に、ステップS107~ステップS109の処理において、生成モデル5の復元能力に応じて欠陥の検出に使用する検出パラメータを自動的に最適化することができる。これらにより、機械学習に使用する学習画像は、欠陥の検出する処理に適するように最適化される。これに応じて、検出装置2では、このように適切に選択された学習画像を用いて構築された学習済みの生成モデル5を利用することで、欠陥の検出する精度を高めることができる。 In addition, in this embodiment, the performance of defect detection using the constructed and trained generative model 5 is evaluated through the processing of steps S105 to S111, and if the performance of defect detection is evaluated to be low, the generation The performance can be improved by further machine learning of Model 5. Furthermore, when evaluating the performance of defect detection using the generative model 5, the detection parameters used for defect detection are automatically optimized in accordance with the restoration ability of the generative model 5 in the processing of steps S107 to S109. can do. As a result, the learning images used for machine learning are optimized to be suitable for defect detection processing. Accordingly, the detection device 2 can improve the accuracy of detecting defects by using the trained generative model 5 constructed using the learning images appropriately selected in this way.

また、本実施形態では、ステップS114及びステップS115の処理により、機械学習に使用する学習画像の選択にオペレータの目視の結果を反映させることができる。これにより、欠陥の写る追加用画像126を機械学習の対象から除外することができる。これにより、機械学習の使用する学習画像が、欠陥の検出する処理に適するように選択されることを期待することができる。これに応じて、検出装置2では、このように使用する学習画像が最適化された機械学習により構築された学習済みの生成モデル5を利用することで、欠陥の検出する精度を高めることができる。 Furthermore, in this embodiment, the results of the operator's visual inspection can be reflected in the selection of learning images used for machine learning through the processing in steps S114 and S115. Thereby, the additional image 126 in which the defect appears can be excluded from the machine learning target. As a result, it can be expected that the learning images used in machine learning will be selected in a manner suitable for defect detection processing. Accordingly, the detection device 2 can improve the accuracy of detecting defects by using the trained generative model 5 constructed by machine learning in which the learning images used are optimized. .

§4 実験例
次に、本発明の実験例について説明する。汎用のコンピュータを利用して、以下の実験条件に従って、学習済みの生成モデルを構築する実験を行った。
§4 Experimental Examples Next, experimental examples of the present invention will be explained. Using a general-purpose computer, we conducted an experiment to construct a trained generative model according to the following experimental conditions.

<実験条件>
・第1学習画像の数:10件
・追加用画像の数:3435件
・各第1学習画像および各追加用画像:欠陥のない製品の写る画像
・評価画像の数:42件
・評価画像:欠陥を含む製品の写る画像
・所定の特徴:製品(LED:発光ダイオード)
・他の特徴:欠陥(異物混入)
・各画像のサイズ:350×350
・各画像の画素値:256階調
・差分画像の画素値の範囲:0~255
・二値化の閾値(閾値65)の値:10~70
・面積に対する閾値(閾値66)の値(画素数):10~1000。
<Experimental conditions>
・Number of first learning images: 10 ・Number of additional images: 3435 ・Each first learning image and each additional image: Images showing products without defects ・Number of evaluation images: 42 ・Evaluation images: Image of product with defect/prescribed characteristics: Product (LED: light emitting diode)
・Other characteristics: Defects (contamination with foreign matter)
・Size of each image: 350 x 350
・Pixel value of each image: 256 gradations ・Pixel value range of difference image: 0 to 255
・Binarization threshold (threshold 65) value: 10 to 70
- Value of threshold (threshold 66) for area (number of pixels): 10 to 1000.

パッチ画像に分割されていないことを除き、上記実施形態と同様に、ステップS101~ステップS109及びステップS112~ステップS116の処理を実行した。学習済みの生成モデルは、ニューラルネットワークにより構成した。ステップS112では、画素値の上位10%の画素を抽出し、抽出された画素の画素値の平均値を評価値として算出した。また、ステップS113では、評価値の最も高い(すなわち、復元の程度の最も低い)追加用画像を抽出した。抽出した追加用画像を第2学習画像として決定した。ステップS105~ステップS109及びステップS112~ステップS116の一連の処理を繰り返し、ステップS107及びステップS108において、誤判定される各画像の数を算出した。これにより、機械学習の一連の処理を繰り返す過程で構築された学習済みの生成モデルの性能の評価を行った。 The processes of steps S101 to S109 and steps S112 to S116 were performed in the same manner as in the above embodiment except that the image was not divided into patch images. The trained generative model was constructed using a neural network. In step S112, the top 10% of pixels in terms of pixel values were extracted, and the average value of the pixel values of the extracted pixels was calculated as an evaluation value. Further, in step S113, the additional image with the highest evaluation value (that is, the lowest degree of restoration) was extracted. The extracted additional image was determined as the second learning image. A series of processes from step S105 to step S109 and step S112 to step S116 were repeated, and the number of images that were incorrectly determined was calculated in step S107 and step S108. In this way, we evaluated the performance of the trained generative model that was built through the process of repeating a series of machine learning processes.

図16は、当該実験例により機械学習の処理を繰り返す過程で構築された学習済みの生成モデルの性能を評価した結果を示す。「新たに学習した学習画像の評価値」のフィールドは、機械学習の対象に追加した第2学習画像の評価値を示す。「成績」のフィールドは、ステップS107及びステップS108において誤判定された各画像の数を示す。「検出パラメータ」のフィールドは、ステップS109により特定された各閾値の最適な値を示す。 FIG. 16 shows the results of evaluating the performance of a trained generative model constructed in the process of repeating machine learning processing using the experimental example. The "evaluation value of newly learned learning image" field indicates the evaluation value of the second learning image added to the machine learning target. The "results" field indicates the number of images that were incorrectly determined in step S107 and step S108. The "detection parameter" field indicates the optimal value of each threshold value specified in step S109.

図16に示されるとおり、第1回目から第5回目までは、ステップS105~ステップS109及びステップS112~ステップS116の一連の処理を繰り返すことで、生成モデルの復元能力を適切に向上させることができた。これにより、ステップS107及びステップS108において、誤判定される各画像の数を低減することができた。この結果から、本発明によれば、復元能力の適切な向上に貢献する可能性の高い追加用画像を抽出することができることが分かった。 As shown in FIG. 16, the restoring ability of the generative model can be appropriately improved by repeating the series of processes from step S105 to step S109 and step S112 to step S116 from the first time to the fifth time. Ta. This made it possible to reduce the number of images that were erroneously determined in step S107 and step S108. From this result, it was found that according to the present invention, it is possible to extract additional images that are highly likely to contribute to an appropriate improvement in restoration ability.

また、第6回目の処理により構築された学習済みの生成モデルでは、ステップS107における誤判定される追加用画像の件数が増加した。これにより、学習画像の件数が過剰になると、学習済みの生成モデルを利用した欠陥検出の性能の低下を招く可能性があることが分かった。本実験例のケースでは、第5回目の処理が完了した時点で、学習画像の件数を「14」件に最適化することができ、全画像3487件のうち3439件の画像について、欠陥の有無を正しく検出する性能に対応する製品の復元能力を有する生成モデルを構築することができた。これにより、14件の学習画像により構築された学習済みの生成モデルにより、製品の欠陥検出を高精度に実施することができ、当該検出にかかるコストを大幅に削減することができることが分かった。 Furthermore, in the learned generation model constructed by the sixth processing, the number of additional images that are incorrectly determined in step S107 has increased. As a result, it was found that an excessive number of training images may lead to a decrease in the performance of defect detection using a trained generative model. In the case of this example experiment, the number of learning images can be optimized to "14" by the time the fifth process is completed, and 3439 out of 3487 images have defects. We were able to construct a generative model that has the ability to restore the product corresponding to the ability to correctly detect it. As a result, it was found that the trained generative model constructed using 14 training images can detect defects in products with high precision, and significantly reduce the cost of the detection.

§5 変形例
以上、本発明の実施の形態を詳細に説明してきたが、前述までの説明はあらゆる点において本発明の例示に過ぎない。本発明の範囲を逸脱することなく種々の改良や変形を行うことができることは言うまでもない。例えば、以下のような変更が可能である。なお、以下では、上記実施形態と同様の構成要素に関しては同様の符号を用い、上記実施形態と同様の点については、適宜説明を省略した。以下の変形例は適宜組み合わせ可能である。
§5 Modifications The embodiments of the present invention have been described in detail above, but the above descriptions are merely illustrative of the present invention in all respects. It goes without saying that various improvements and modifications can be made without departing from the scope of the invention. For example, the following changes are possible. In addition, below, the same code|symbol is used regarding the same component as the said embodiment, and description is abbreviate|omitted suitably about the same point as the said embodiment. The following modified examples can be combined as appropriate.

<5.1 変形例1>
上記実施形態では、製品Rの写る画像を利用して、製品Rに欠陥が存在するか否かを検出する場面に本発明を適用した例を示している。製品R(特に、製造ラインで搬送される製品であって、欠陥を含まない製品)が、所定の特徴の一例である。製品Rに発生し得る欠陥が、他の特徴の一例である。しかしながら、本発明の適用範囲は、このような外観検査の例に限られる訳ではない。本発明は、例えば、所定の物体が画像に写っているか否かを検出する場面等、被写体の写る画像から何らかの特徴を検出するあらゆる場面に適用可能である。
<5.1 Modification 1>
In the embodiment described above, an example is shown in which the present invention is applied to a situation where it is detected whether or not a defect exists in the product R using an image of the product R. Product R (particularly a product that is transported on a production line and does not contain any defects) is an example of the predetermined characteristic. Defects that may occur in product R are an example of other characteristics. However, the scope of application of the present invention is not limited to such an example of visual inspection. The present invention is applicable to all situations where some characteristics are detected from an image of a subject, such as a situation where it is detected whether a predetermined object is included in an image.

所定の特徴は、画像に写り得るものであれば、上記製品R以外であってもよい。所定の特徴は、それ自身が抽出の対象となり得るもの、抽出の対象とならない背景、及びこれらの組み合わせであってよい。同様に、他の特徴も、画像に写り得るものであれば、上記欠陥以外であってもよい。上記実施形態以外の一例として、所定の特徴は、例えば、人物、車両(例えば、自動車)等の移動し得る物体であってよい。これに応じて、他の特徴は、例えば、当該移動により変化し得る物体の三次元形状、オプティカルフロー(移動方向)等であってよい。深度カメラ等により観測画像の各画素の画素値に奥行方向の距離が含まれている場合に、観測画像と復元画像との各画素の差分により、対象物体の三次元形状を推定することができる。また、復元画像において移動前の状態を復元した場合に、観測画像と復元画像との差分により、対象物体のオプティカルフローを推定することができる。 The predetermined feature may be other than the product R as long as it can be seen in the image. The predetermined feature may be a feature that itself can be extracted, a background that is not extracted, or a combination thereof. Similarly, other features other than the above defects may be used as long as they can be seen in the image. As an example other than the embodiments described above, the predetermined feature may be a movable object such as a person or a vehicle (eg, a car). Correspondingly, the other features may be, for example, the three-dimensional shape of the object, the optical flow (direction of movement), etc., which may change due to the movement. When the pixel value of each pixel in an observed image from a depth camera etc. includes the distance in the depth direction, the three-dimensional shape of the target object can be estimated from the difference in each pixel between the observed image and the restored image. . Further, when the state before movement is restored in the restored image, the optical flow of the target object can be estimated from the difference between the observed image and the restored image.

また、所定の特徴は、他の特徴を含む状態及び他の特徴を含まない状態の2つの状態を取り得るものであってもよい。所定の特徴と他の特徴とがこのような関係にある場合、各状態の取り得る確率が偏っているのが望ましい。各状態の取り得る確率が偏っているとは、いずれかの状態の取り得る確率が、他の状態の取り得る確率に比べて、生成モデルの再現性に影響を与える程度に高いことである。加えて、所定の特徴の発生確率の高い状態に含まれておらず、発生確率の低い状態に含まれている特徴が当該他の特徴に選択されるのが望ましい。更には、機械学習に使用される各学習画像に写る所定の特徴には、当該他の特徴が含まれていないのが望ましい。これにより、他の特徴を含まない所定の特徴が写る学習画像を生成モデルの機械学習に使用することで、生成モデルは、入力画像に写る所定の特徴に他の特徴が含まれるか否かに関わらず、当該他の特徴を含まない所定の特徴の写る復元画像を生成するように訓練される。そのため、生成モデルにより生成される復元画像と入力画像との差分に基づいて、入力画像に写る所定の特徴に他の特徴が含まれるか否かを検出することができる。 Furthermore, the predetermined feature may be in two states: a state in which it includes other features and a state in which it does not include other features. When a predetermined feature and other features have such a relationship, it is desirable that the probabilities of each state be biased. When the possible probabilities of each state are biased, it means that the possible probabilities of any state are higher than the possible probabilities of other states to the extent that it affects the reproducibility of the generative model. In addition, it is desirable that a feature not included in a state with a high probability of occurrence of a predetermined feature but included in a state with a low probability of occurrence is selected as the other feature. Furthermore, it is desirable that the predetermined features appearing in each learning image used for machine learning do not include the other features. As a result, by using a training image that shows a predetermined feature that does not include other features for machine learning of a generative model, the generative model can determine whether or not the predetermined feature that appears in the input image contains other features. Regardless, it is trained to generate a restored image that shows a predetermined feature that does not include the other features. Therefore, based on the difference between the restored image generated by the generative model and the input image, it is possible to detect whether a predetermined feature appearing in the input image includes another feature.

<5.2 変形例2>
上記実施形態では、生成モデル5は、ニューラルネットワークにより構成されている。しかしながら、生成モデル5の構成は、このような例に限定されなくてもよい。生成モデル5は、画像を変換可能であれば、その種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、生成モデル5は、例えば非特許文献3のように、主成分分析(KL展開)により導出された固有ベクトル行列により構成されてもよい。
<5.2 Modification 2>
In the embodiment described above, the generative model 5 is configured by a neural network. However, the configuration of the generative model 5 does not have to be limited to this example. The type of generation model 5 is not particularly limited as long as it can convert images, and may be selected as appropriate depending on the embodiment. For example, the generative model 5 may be configured by an eigenvector matrix derived by principal component analysis (KL expansion), as in Non-Patent Document 3, for example.

上記ステップS105及びステップS106において復元画像(124、128)を生成する処理が、ニューラルネットワークの演算処理から固有ベクトル行列の演算処理からに置き換わる。また、上記ステップS117では、制御部11は、主成分分析(KL展開)により導出された固有ベクトル行列を再現可能な情報を学習結果データ129として生成し、生成された学習結果データ129を所定の記憶領域に保存する。これらの点を除き、上記実施形態に係る学習装置1は、上記実施形態と同様の処理手順により、機械学習に使用する学習画像を適切に選択できる。なお、上記実施形態と同様に、生成された学習結果データ129は、任意のタイミングで検出装置2に提供されてよい。 The process of generating the restored images (124, 128) in steps S105 and S106 is replaced from the neural network calculation process to the eigenvector matrix calculation process. Further, in step S117, the control unit 11 generates information capable of reproducing the eigenvector matrix derived by principal component analysis (KL expansion) as learning result data 129, and stores the generated learning result data 129 in a predetermined memory. Save to area. Except for these points, the learning device 1 according to the embodiment described above can appropriately select learning images to be used for machine learning using the same processing procedure as in the embodiment described above. Note that, similarly to the above embodiment, the generated learning result data 129 may be provided to the detection device 2 at any timing.

上記実施形態に係る検出装置2についても同様である。すなわち、上記ステップS302において復元観測画像223を生成する処理が、ニューラルネットワークの演算処理から固有ベクトル行列の演算処理に置き換わる。この点を除き、上記実施形態に係る検出装置2は、上記実施形態と同様の処理手順により、観測画像221に写る製品Rに欠陥が存在するか否かを検出することができる。 The same applies to the detection device 2 according to the above embodiment. That is, the process of generating the restored observed image 223 in step S302 above replaces the neural network calculation process with the eigenvector matrix calculation process. Except for this point, the detection device 2 according to the embodiment described above can detect whether a defect exists in the product R shown in the observation image 221 using the same processing procedure as in the embodiment described above.

<5.3 変形例3>
上記実施形態では、制御部11は、抽出された追加用画像126等の情報を表示装置15に出力している。しかしながら、情報の出力先は、このような例に限られなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、制御部11は、抽出された追加用画像126等の情報を、表示装置15とは別の表示装置に出力してもよいし、表示装置以外の出力先(例えば、メモリ、表示装置以外の出力装置)に出力してもよい。
<5.3 Modification 3>
In the embodiment described above, the control unit 11 outputs information such as the extracted additional image 126 to the display device 15. However, the output destination of the information does not need to be limited to this example, and may be appropriately selected depending on the embodiment. For example, the control unit 11 may output information such as the extracted additional image 126 to a display device other than the display device 15, or may output the information to an output destination other than the display device (e.g., memory, output device).

<5.4 変形例4>
上記実施形態では、各画像(121、123、127、221)は、パッチ画像(P1、P2、P3、P4)に分割されている。しかしながら、画像の形態は、このような例に限定されなくてもよい。各画像(121、123、127、221)は、パッチ画像に分割されなくてもよい。この場合、上記実施形態の各処理は、画像全体に適用されてよい。
<5.4 Modification 4>
In the above embodiment, each image (121, 123, 127, 221) is divided into patch images (P1, P2, P3, P4). However, the form of the image does not have to be limited to this example. Each image (121, 123, 127, 221) does not need to be divided into patch images. In this case, each process of the above embodiment may be applied to the entire image.

<5.5 変形例5>
上記実施形態では、学習装置1は、上記ステップS102及びステップS116において、生成モデル5の機械学習を実施している。しかしながら、機械学習の処理は、必ずしも学習装置1により実行されなければならない訳ではない。ステップS102及びステップS116の少なくとも一方の機械学習の処理は、他のコンピュータにより実行されてよい。例えば、ステップS102の機械学習の処理は、他のコンピュータにより実行されてよい。ステップS102及びステップS116の処理が他のコンピュータにより実行される場合、学習装置1は、例えば、学習画像選択装置等と称されてもよい。
<5.5 Modification 5>
In the embodiment described above, the learning device 1 performs machine learning of the generative model 5 in the steps S102 and S116. However, the machine learning process does not necessarily have to be executed by the learning device 1. At least one of the machine learning processes in step S102 and step S116 may be executed by another computer. For example, the machine learning process in step S102 may be executed by another computer. When the processes of step S102 and step S116 are executed by another computer, the learning device 1 may be referred to as a learning image selection device, for example.

図17は、変形例5に係る学習装置1Bのソフトウェア構成の一例を模式的に例示する図である。第1取得部110及び学習部111がモデル取得部111Bに置き換わる点を除き、本変形例に係る学習装置1Bのソフトウェア構成は、上記実施形態に係る学習装置1と同様である。モデル取得部111Bは、1つ以上の第1学習画像121を使用した機械学習により訓練された生成モデル5を取得する。また、本変形例に係る学習装置1Bのハードウェア構成は、上記実施形態に係る学習装置1と同様である。すなわち、学習装置1Bは、制御部11、記憶部12、通信インタフェース13、入力装置14、表示装置15、及びドライブ16が電気的に接続されたコンピュータである(図示は省略)。 FIG. 17 is a diagram schematically illustrating an example of the software configuration of the learning device 1B according to the fifth modification. The software configuration of the learning device 1B according to this modification is the same as the learning device 1 according to the above embodiment, except that the first acquisition section 110 and the learning section 111 are replaced with a model acquisition section 111B. The model acquisition unit 111B acquires the generative model 5 trained by machine learning using one or more first learning images 121. Further, the hardware configuration of the learning device 1B according to this modification is the same as that of the learning device 1 according to the embodiment described above. That is, the learning device 1B is a computer to which a control section 11, a storage section 12, a communication interface 13, an input device 14, a display device 15, and a drive 16 are electrically connected (not shown).

本変形例では、学習装置1Bの制御部11は、上記ステップS101及びステップS102の処理を省略し、モデル取得部111Bとして動作する。すなわち、制御部11は、1つ以上の第1学習画像121を使用した機械学習により訓練された生成モデル5を取得する。上記実施形態と同様に、生成モデル5は、入力画像が与えられると、与えられた入力画像を特徴量に変換し、変換により得られた特徴量から与えられた入力画像を復元した画像を生成するように構成される。機械学習により、生成モデル5は、1つ以上の第1学習画像121それぞれが与えられると、与えられた1つ以上の第1学習画像121それぞれに適合する復元画像を生成するように訓練されている。この機械学習の処理は、他のコンピュータにより実行されてよい。 In this modification, the control unit 11 of the learning device 1B omits the processing of steps S101 and S102, and operates as the model acquisition unit 111B. That is, the control unit 11 acquires the generative model 5 trained by machine learning using one or more first learning images 121. Similar to the above embodiment, when an input image is given, the generative model 5 converts the given input image into a feature amount, and generates an image that restores the given input image from the feature amount obtained by the conversion. configured to do so. Through machine learning, the generative model 5 is trained to, when each of the one or more first learning images 121 is given, generate a restored image that matches each of the given one or more first learning images 121. There is. This machine learning process may be executed by another computer.

上記実施形態の学習結果データ129と同様に、機械学習により訓練された生成モデル5に関する情報は、学習結果データとして学習装置1Bに提供されてよい。また、上記実施形態における学習装置1により生成された学習結果データ129を検出装置2に提供する方法と同様の方法で、他のコンピュータにより生成された学習結果データが学習装置1Bに提供されてよい。1つ以上の第1学習画像121を使用した機械学習により訓練された生成モデル5を取得した後、学習装置1Bは、上記実施形態におけるステップS103~ステップS117の処理を実行してもよい。これにより、本変形例に係る学習装置1Bは、上記実施形態と同様に、機械学習に使用する学習画像を適切に選択できる。なお、この変形例において、第2取得部112は、画像取得部の一例である。 Similar to the learning result data 129 of the above embodiment, information regarding the generative model 5 trained by machine learning may be provided to the learning device 1B as learning result data. Furthermore, the learning result data generated by another computer may be provided to the learning device 1B in the same manner as the method of providing the learning result data 129 generated by the learning device 1 to the detection device 2 in the above embodiment. . After acquiring the generative model 5 trained by machine learning using one or more first learning images 121, the learning device 1B may execute the processes from step S103 to step S117 in the above embodiment. Thereby, the learning device 1B according to this modification can appropriately select learning images to be used for machine learning, similarly to the above embodiment. Note that in this modification, the second acquisition unit 112 is an example of an image acquisition unit.

上記変形例のとおり、機械学習の処理が他のコンピュータにより実行される場合、上記処理手順における機械学習の処理は、当該他のコンピュータから機械学習の処理結果を取得することに置き換わる。また、ステップS116の機械学習の処理を他のコンピュータが実行する場合、学習装置1は、ステップS113の抽出結果を当該他のコンピュータに通知する。抽出結果を通知することは、抽出された追加用画像126の識別子を通知することであってもよいし、抽出された追加用画像126そのものを送信することであってもよい。 As in the above modification, when the machine learning process is executed by another computer, the machine learning process in the above processing procedure is replaced by acquiring the machine learning process result from the other computer. Furthermore, when another computer executes the machine learning process in step S116, the learning device 1 notifies the other computer of the extraction result in step S113. Notifying the extraction result may mean notifying the identifier of the extracted additional image 126, or may mean transmitting the extracted additional image 126 itself.

<5.6 変形例6>
上記実施形態では、学習装置1は、ステップS115により、表示装置15に表示された1つ以上の追加用画像126それぞれについて、当該1つ以上の追加用画像126それぞれを、機械学習に使用するか否かの選択を受け付けている。この選択を受け付ける処理は、省略されてよい。この場合、上記実施形態に係る学習装置1の処理手順からステップS115の処理は省略され、1つ以上の追加用画像126の各々が第2学習画像126Aとして自動的に決定されてもよい。上記実施形態に係る学習装置1のソフトウェア構成から選択受付部119は省略されてよい。加えて、ステップS115を省略する場合、追加用画像126を出力するステップS114の処理が更に省略されてよい。この場合、上記実施形態に係る学習装置1のソフトウェア構成から表示制御部118が更に省略されてよい。
<5.6 Modification 6>
In the above embodiment, in step S115, the learning device 1 determines whether each of the one or more additional images 126 displayed on the display device 15 is used for machine learning. We accept the choice of “no” or “no”. The process of accepting this selection may be omitted. In this case, the process of step S115 may be omitted from the processing procedure of the learning device 1 according to the embodiment, and each of the one or more additional images 126 may be automatically determined as the second learning image 126A. The selection reception unit 119 may be omitted from the software configuration of the learning device 1 according to the above embodiment. In addition, when step S115 is omitted, the process of step S114 for outputting the additional image 126 may be further omitted. In this case, the display control unit 118 may be further omitted from the software configuration of the learning device 1 according to the above embodiment.

また、上記実施形態では、ステップS105~ステップS111の処理により、構築された学習済みの生成モデル5を利用した欠陥検出の性能を評価している。この欠陥検出の性能を評価する処理は省略されてよい。この場合、上記実施形態に係る学習装置1の処理手順からステップS106~ステップS111の処理は省略されてよい。上記実施形態に係る学習装置1のソフトウェア構成から第3取得部117は省略されてよい。 Further, in the embodiment described above, the performance of defect detection using the constructed and trained generative model 5 is evaluated through the processing of steps S105 to S111. This process of evaluating defect detection performance may be omitted. In this case, steps S106 to S111 may be omitted from the processing procedure of the learning device 1 according to the above embodiment. The third acquisition unit 117 may be omitted from the software configuration of the learning device 1 according to the above embodiment.

また、上記実施形態において、各ステップの処理順序は適宜変更されてよい。例えば、ステップS103及びステップS104の処理順序は入れ替わってもよい。ステップS103の処理は、ステップS105の処理を実行する前のいずれのタイミングに実行されてよい。ステップS104の処理は、ステップS106の処理を実行する前のいずれのタイミングに実行されてよい。また、例えば、ステップS105及びステップS106の処理順序は入れ替わってもよい。ステップS105の処理は、ステップS107の処理を実行する前のいずれのタイミングに実行されてよい。ステップS106の処理は、ステップS108の処理を実行する前のいずれのタイミングに実行されてよい。また、例えば、ステップS107及びステップS108の処理順序は入れ替わってもよい。ステップS107及びステップS108の各処理は、ステップS109の処理を実行する前のいずれのタイミングに実行されてよい。ステップS107及びステップS108の一方の判定結果をステップS109の処理で利用しない場合、その判定処理は、ステップS110を実行する前のいずれのタイミングに実行されてよい。 Furthermore, in the embodiments described above, the processing order of each step may be changed as appropriate. For example, the processing order of step S103 and step S104 may be reversed. The process of step S103 may be executed at any timing before the process of step S105 is executed. The process of step S104 may be executed at any timing before the process of step S106 is executed. Furthermore, for example, the processing order of step S105 and step S106 may be reversed. The process of step S105 may be executed at any timing before the process of step S107 is executed. The process of step S106 may be executed at any timing before the process of step S108 is executed. Furthermore, for example, the processing order of step S107 and step S108 may be reversed. Each process of step S107 and step S108 may be executed at any timing before executing the process of step S109. If the determination result of either step S107 or step S108 is not used in the process of step S109, the determination process may be executed at any timing before executing step S110.

<5.7 変形例7>
上記実施形態では、複数の検出パラメータ候補60が与えられている。制御部11は、ステップS109により、誤判定の最も少ない1つの検出パラメータ候補61を複数の検出パラメータ候補60から特定している。しかしながら、検出パラメータの与え方は、このような例に限定されなくてもよい。
<5.7 Modification 7>
In the embodiment described above, a plurality of detection parameter candidates 60 are provided. In step S<b>109 , the control unit 11 identifies one detection parameter candidate 61 with the least number of false determinations from the plurality of detection parameter candidates 60 . However, the way the detection parameters are given does not have to be limited to this example.

例えば、制御部11は、誤判定される各画像(123,127)の数又は割合が予め定められた閾値以下となる1以上の検出パラメータ候補を複数の検出パラメータ候補60から抽出してもよい。あるいは、制御部11は、誤判定される各画像(123,127)の数又は割合の少ない上位所定数(例えば5個)の検出パラメータ候補を複数の検出パラメータ候補60から抽出してもよい。 For example, the control unit 11 may extract from the plurality of detection parameter candidates 60 one or more detection parameter candidates for which the number or proportion of images (123, 127) that are erroneously determined is equal to or less than a predetermined threshold. . Alternatively, the control unit 11 may extract from the plurality of detection parameter candidates 60 a predetermined number (for example, five) of detection parameter candidates with a low number or proportion of each image (123, 127) that is erroneously determined.

製造ラインにおいて、不良品が良品として出荷されることは、できるだけ回避されるべきである。そのため、制御部11は、複数の評価画像127のうち、誤判定される評価画像127の割合が予め定められた閾値(以下、「許容見逃し率」と記載する。)以下となる少なくとも1つの検出パラメータ候補60を抽出する。許容見逃し率は、オペレータの入力、プログラム内の設定値等により与えられてよい。誤判定される評価画像127の割合が許容見逃し率以下となる2以上の検出パラメータ候補60が存在する場合、制御部11は、当該2以上の検出パラメータ候補60を抽出する。あるいは、制御部11は、誤判定される評価画像127の数又は割合の少ない上位所定数(例えば5個)の検出パラメータ候補60を抽出してもよい。 In the production line, it is important to avoid shipping defective products as non-defective products as much as possible. Therefore, the control unit 11 detects at least one of the plurality of evaluation images 127 in which the proportion of the evaluation images 127 that are erroneously determined is equal to or less than a predetermined threshold (hereinafter referred to as "acceptable missed rate"). Parameter candidates 60 are extracted. The allowable missed rate may be given by operator input, a set value in a program, etc. If there are two or more detection parameter candidates 60 for which the proportion of evaluation images 127 that are erroneously determined is less than or equal to the allowable oversight rate, the control unit 11 extracts the two or more detection parameter candidates 60. Alternatively, the control unit 11 may extract a predetermined number (for example, five) of detection parameter candidates 60 with a small number or percentage of erroneously determined evaluation images 127.

制御部11は、抽出された1以上又は所定数の検出パラメータ候補60の各々と、当該各検出パラメータ候補を用いたときの、誤判定される各画像(123,127)の数又は割合を表示装置15に表示する。そして、制御部11は、入力装置14に入力された選択指示に従って、表示された1以上又は所定数の検出パラメータ候補60の中から1つの検出パラメータ候補61を選択してもよい。誤判定される評価画像127の数又は割合は、不良品が良品として判定される数又は割合である。誤判定される評価画像127の数又は割合が小さいほど、不良品の流出を抑制できる。一方、誤判定される追加用画像123の数又は割合は、良品が不良品として判定される数又は割合である。誤判定される追加用画像123の数又は割合が小さいほど、歩留まりが良い。オペレータは、製造ラインに要求される不良品の流出割合および歩留まりを考慮しながら、検出パラメータ候補61を選択すればよい。 The control unit 11 displays each of the extracted one or more or a predetermined number of detection parameter candidates 60 and the number or proportion of each image (123, 127) that is incorrectly determined when each detection parameter candidate is used. It is displayed on the device 15. Then, the control unit 11 may select one detection parameter candidate 61 from one or more or a predetermined number of detection parameter candidates 60 displayed according to the selection instruction input to the input device 14. The number or percentage of evaluation images 127 that are erroneously determined is the number or percentage of defective products that are determined to be non-defective products. The smaller the number or proportion of evaluation images 127 that are incorrectly determined, the more it is possible to suppress the outflow of defective products. On the other hand, the number or ratio of additional images 123 that are incorrectly determined is the number or ratio at which non-defective products are determined to be defective. The smaller the number or proportion of additional images 123 that are incorrectly determined, the better the yield. The operator may select the detection parameter candidate 61 while considering the outflow rate of defective products and the yield rate required for the production line.

あるいは、検出パラメータの値は、予め決定されていてもよい。検出パラメータの値は、オペレータの入力、プログラム内の設定値等により与えられてよい。この場合、上記実施形態に係る学習装置1の処理手順からステップS109の処理が省略されてよい。また、制御部11は、決定された検出パラメータを利用して、ステップS107及びステップS108それぞれの処理を実行してもよい。更に、ステップS110では、制御部11は、決定された検出パラメータを利用した判定の結果において、誤判定の追加用画像123の数又は割合が第1の閾値以上であるか否かを判定してもよい。また、制御部11は、決定された検出パラメータを利用した判定の結果において、誤判定の評価画像127の数又は割合が第2の閾値以上であるか否かを判定してもよい。 Alternatively, the value of the detection parameter may be determined in advance. The value of the detection parameter may be given by an operator's input, a set value in a program, or the like. In this case, the process of step S109 may be omitted from the process procedure of the learning device 1 according to the above embodiment. Further, the control unit 11 may execute the respective processes of step S107 and step S108 using the determined detection parameters. Further, in step S110, the control unit 11 determines whether or not the number or proportion of additional images 123 with false determinations is equal to or higher than a first threshold in the determination results using the determined detection parameters. Good too. Furthermore, the control unit 11 may determine whether the number or proportion of evaluation images 127 that are incorrectly determined is greater than or equal to a second threshold value in the result of determination using the determined detection parameters.

<5.8 変形例8>
上記実施形態では、制御部11(第3取得部117)は、所定の特徴である製品R及び他の特徴である欠陥Lがそれぞれ写る複数の評価画像127を取得している。しかしながら、制御部11は、製品R及び欠陥Lがそれぞれ写る複数の第1評価画像と、製品Rが写り、欠陥Lが写っていない複数の第2評価画像とを取得してもよい。すなわち、第1評価画像には良品である製品Rが写り、第2評価画像には不良品である製品Rが写る。
<5.8 Modification 8>
In the embodiment described above, the control unit 11 (third acquisition unit 117) acquires a plurality of evaluation images 127 in which the product R, which is a predetermined feature, and the defect L, which is another feature, are respectively captured. However, the control unit 11 may acquire a plurality of first evaluation images in which the product R and the defect L are respectively shown, and a plurality of second evaluation images in which the product R is shown and the defect L is not shown. That is, the first evaluation image shows the product R, which is a non-defective product, and the second evaluation image shows the product R, which is a defective product.

図18は、変形例8に係る学習装置のソフトウェア構成の一例を模式的に例示する図である。図18に例示される学習装置1Cは、図5に例示される学習装置1と比較して、第3取得部117の代わりに第3取得部117Cを備える点で相違する。 FIG. 18 is a diagram schematically illustrating an example of the software configuration of a learning device according to modification 8. The learning device 1C illustrated in FIG. 18 differs from the learning device 1 illustrated in FIG. 5 in that it includes a third acquisition unit 117C instead of the third acquisition unit 117.

第3取得部117Cは、製品R及び欠陥Lがそれぞれ写る複数の第1評価画像127Aと、製品Rが写り、欠陥Lが写っていない複数の第2評価画像127Bとを取得する。 The third acquisition unit 117C acquires a plurality of first evaluation images 127A in which the product R and the defect L are respectively shown, and a plurality of second evaluation images 127B in which the product R is shown and the defect L is not shown.

複数の第1評価画像127Aは、上記評価画像127と同様に生成されてもよい。すなわち、各第1評価画像127Aは、各画像(121、123)と同様に、コンピュータの動作により自動的に生成されてもよいし、オペレータの操作により手動的に生成されてもよい。また、各第1評価画像127Aの生成は、学習装置1により行われてもよいし、学習装置1以外の他のコンピュータにより行われてもよい。制御部11は、自動的に又は入力装置14を介したオペレータの操作により手動的に上記一連の処理を実行することで、複数の第1評価画像127Aを取得してもよい。或いは、制御部11は、例えば、ネットワーク、記憶媒体91等を介して、他のコンピュータにより生成された複数の第1評価画像127Aを取得してもよい。複数の第1評価画像127Aのうちの一部が学習装置1により生成され、残りが他のコンピュータにより生成されてもよい。取得する第1評価画像127Aの件数は、特に限定されなくてもよく、適宜決定されてよい。 The plurality of first evaluation images 127A may be generated in the same manner as the evaluation image 127 described above. That is, like each image (121, 123), each first evaluation image 127A may be automatically generated by a computer operation, or may be manually generated by an operator's operation. Furthermore, the generation of each first evaluation image 127A may be performed by the learning device 1, or may be performed by another computer other than the learning device 1. The control unit 11 may acquire the plurality of first evaluation images 127A by automatically or manually executing the series of processes described above through an operator's operation via the input device 14. Alternatively, the control unit 11 may acquire the plurality of first evaluation images 127A generated by another computer, for example, via the network, the storage medium 91, or the like. Some of the plurality of first evaluation images 127A may be generated by the learning device 1, and the rest may be generated by another computer. The number of first evaluation images 127A to be acquired does not need to be particularly limited and may be determined as appropriate.

複数の第2評価画像127Bは、上記画像(121、123)と同様に生成されてもよい。各第2評価画像127Bの生成は、学習装置1により行われてもよいし、学習装置1以外の他のコンピュータにより行われてもよい。制御部11は、自動的に又は入力装置14を介したオペレータの操作により手動的に上記一連の処理を実行することで、複数の第2評価画像127Bを取得してもよい。或いは、制御部11は、例えば、ネットワーク、記憶媒体91等を介して、他のコンピュータにより生成された複数の第2評価画像を取得してもよい。複数の第2評価画像127Bのうちの一部が学習装置1により生成され、残りが他のコンピュータにより生成されてもよい。取得する第2評価画像の件数は、特に限定されなくてもよく、適宜決定されてよい。 The plurality of second evaluation images 127B may be generated in the same manner as the above images (121, 123). The generation of each second evaluation image 127B may be performed by the learning device 1, or may be performed by another computer other than the learning device 1. The control unit 11 may acquire the plurality of second evaluation images 127B by automatically or manually executing the series of processes described above through an operator's operation via the input device 14. Alternatively, the control unit 11 may acquire a plurality of second evaluation images generated by another computer, for example, via a network, the storage medium 91, or the like. Some of the plurality of second evaluation images 127B may be generated by the learning device 1, and the rest may be generated by another computer. The number of second evaluation images to be acquired does not need to be particularly limited and may be determined as appropriate.

本変形例では、制御部11(生成部113)は、上記ステップS105において、取得された複数の第2評価画像127Bそれぞれを生成モデル5に与えることで、複数の第2評価画像127Bそれぞれを復元した複数の第2復元評価画像128Bそれぞれを生成する。また、制御部11は、上記ステップS106において、取得された複数の第1評価画像127Aそれぞれを生成モデル5に与えることで、複数の第1評価画像127Aそれぞれを復元した複数の第1復元評価画像128Aそれぞれを生成する。 In this modification, the control unit 11 (generation unit 113) restores each of the plurality of second evaluation images 127B by giving each of the plurality of acquired second evaluation images 127B to the generation model 5 in step S105. A plurality of second restoration evaluation images 128B are generated respectively. Further, in step S106, the control unit 11 provides a plurality of first restored evaluation images obtained by restoring each of the plurality of first evaluation images 127A by providing each of the plurality of acquired first evaluation images 127A to the generation model 5. 128A respectively.

上記ステップS107では、制御部11(評価部114)は、各第2評価画像127Bと各第2復元評価画像128Bとの差分の程度に基づいて、各第2評価画像に欠陥Lが写っているか否かを判定する。すなわち、制御部11(評価部114)は、複数の第2評価画像127Bそれぞれと複数の第2復元評価画像128Bそれぞれとの間の差分を示す複数の差分画像183Bそれぞれを生成する。制御部11(評価部114)は、各差分画像183Bを利用して、各第2評価画像127Bに欠陥Lが写っているか否かを判定する。 In step S107, the control unit 11 (evaluation unit 114) determines whether the defect L is reflected in each second evaluation image based on the degree of difference between each second evaluation image 127B and each second restoration evaluation image 128B. Determine whether or not. That is, the control unit 11 (evaluation unit 114) generates each of the plurality of difference images 183B indicating the difference between each of the plurality of second evaluation images 127B and each of the plurality of second restored evaluation images 128B. The control unit 11 (evaluation unit 114) uses each difference image 183B to determine whether the defect L is included in each second evaluation image 127B.

上記ステップS108では、制御部11(評価部114)は、各第1評価画像127Aと各第1復元評価画像128Aとの差分の程度に基づいて、各第1評価画像127Aに欠陥Lが写っているか否かを判定する。すなわち、制御部11(評価部114)は、複数の第1評価画像127Aそれぞれと複数の第1復元評価画像128Aそれぞれとの間の差分を示す複数の差分画像183Aそれぞれを生成する。制御部11(評価部114)は、各差分画像183Aを利用して、各第1評価画像127Aに欠陥Lが写っているか否かを判定する。 In step S108, the control unit 11 (evaluation unit 114) determines whether the defect L is reflected in each first evaluation image 127A based on the degree of difference between each first evaluation image 127A and each first restoration evaluation image 128A. Determine whether or not there is. That is, the control unit 11 (evaluation unit 114) generates each of the plurality of difference images 183A indicating the difference between each of the plurality of first evaluation images 127A and each of the plurality of first restored evaluation images 128A. The control unit 11 (evaluation unit 114) uses each difference image 183A to determine whether the defect L is included in each first evaluation image 127A.

上記ステップS109では、制御部11は、各ステップ(S107、S108)の判定結果に基づいて、欠陥Lが画像に写っているか否かを判定するための検出パラメータの最適化を実行する。具体的には、制御部11は、欠陥Lが写っていると判定された第2評価画像127Bの数(以下、誤判定の第2評価画像の数とも記載する)をカウントする。制御部11は、欠陥Lが写っていないと判定された第1評価画像127Aの数(以下、誤判定の第1評価画像の数と記載する)の数をカウントする。制御部11は、誤判定の第1評価画像の数及び誤判定の第2評価画像の数が最も少ない1つの検出パラメータ候補61を特定する。 In step S109, the control unit 11 optimizes the detection parameters for determining whether the defect L is shown in the image, based on the determination results of each step (S107, S108). Specifically, the control unit 11 counts the number of second evaluation images 127B determined to include the defect L (hereinafter also referred to as the number of erroneously determined second evaluation images). The control unit 11 counts the number of first evaluation images 127A in which it is determined that the defect L is not captured (hereinafter referred to as the number of erroneously determined first evaluation images). The control unit 11 identifies one detection parameter candidate 61 that has the smallest number of first evaluation images that are incorrectly determined and the least number of second evaluation images that are incorrectly judged.

あるいは、制御部11は、上記変形例7と同様に、複数の第1評価画像127Aのうち、欠陥Lが写っていないと判定された第1評価画像127Aの割合が許容見逃し率以下となる少なくとも1つの検出パラメータ候補60を抽出してもよい。以下、複数の第1評価画像127Aのうち欠陥Lが写っていると判定された第1評価画像127Aの割合を、誤判定の第1評価画像の割合とも記載する。制御部11は、抽出された1以上の検出パラメータ候補60の各々と、当該各検出パラメータ候補を用いたときの、複数の第2評価画像127Bのうち欠陥Lが写っていると判定された第2評価画像127Bの割合とを表示装置15に表示する。以下、複数の第2評価画像127Bのうち欠陥Lが写っていると判定された第2評価画像127Bの割合を、誤判定の第2評価画像の割合とも記載する。そして、制御部11は、入力装置14に入力された選択指示に従って、抽出された1以上の検出パラメータ候補60の中から1つの検出パラメータ候補61を選択してもよい。 Alternatively, as in Modification Example 7, the control unit 11 controls the control unit 11 so that the proportion of the first evaluation images 127A determined not to include the defect L among the plurality of first evaluation images 127A is at least equal to or less than the allowable overlook rate. One detection parameter candidate 60 may be extracted. Hereinafter, the ratio of first evaluation images 127A determined to include the defect L among the plurality of first evaluation images 127A will also be referred to as the ratio of first evaluation images that are incorrectly determined. The control unit 11 selects each of the one or more extracted detection parameter candidates 60 and the second evaluation image 127B that is determined to include the defect L when each of the detection parameter candidates is used. The ratio of the 2-evaluation image 127B is displayed on the display device 15. Hereinafter, the ratio of second evaluation images 127B determined to include the defect L among the plurality of second evaluation images 127B will also be referred to as the ratio of second evaluation images that are incorrectly determined. Then, the control unit 11 may select one detection parameter candidate 61 from the one or more extracted detection parameter candidates 60 according to the selection instruction input to the input device 14.

上記のステップS110では、制御部11は、評価部114として動作し、特定された1つの検出パラメータ候補61を利用した判定の結果において、誤判定の第2評価画像の数又は割合が第1の閾値以上であるか否かを判定する。さらに、制御部11は、特定された1つの検出パラメータ候補61を利用した判定の結果において、誤判定の第1評価画像の数又は割合が第2の閾値以上であるか否かを判定する。 In step S110 described above, the control unit 11 operates as the evaluation unit 114, and in the result of the determination using the one identified detection parameter candidate 61, the number or proportion of the second evaluation images that are incorrectly determined is the same as the first one. Determine whether or not the threshold value is greater than or equal to the threshold value. Furthermore, the control unit 11 determines whether or not the number or proportion of first evaluation images that are incorrectly determined is equal to or greater than a second threshold value in the result of the determination using the one identified detection parameter candidate 61.

上記のステップS112では、制御部11は、生成部113として動作し、取得された複数の追加用画像123それぞれを生成モデル5に与えることで、複数の追加用画像123それぞれを復元した複数の復元追加用画像124それぞれを生成する。そして、制御部11は、各追加用画像123及び生成された各復元追加用画像124の間の差分に応じて、各追加用画像123の評価値125であって、各復元追加用画像124における各追加用画像123の復元の程度に対する評価値125を算出すればよい。 In step S<b>112 described above, the control unit 11 operates as the generation unit 113 and provides each of the acquired plurality of additional images 123 to the generation model 5 to generate a plurality of restorations in which each of the plurality of additional images 123 is restored. Each additional image 124 is generated. Then, the control unit 11 determines the evaluation value 125 of each additional image 123 according to the difference between each additional image 123 and each generated restored additional image 124, and the evaluation value 125 of each additional restored image 124. An evaluation value 125 for the degree of restoration of each additional image 123 may be calculated.

<5.9 変形例9>
上述したように、製品Rの個体差および撮像条件の変動等の要因により、観測画像221内に写る製品Rの様子も変動し得る。観測画像221内に写る製品Rの様子の変動幅が大きいほど、機械学習に必要な学習画像の数も増大する。1つ以上の第2学習画像126Aは、観測画像221内に写る製品Rの様子の変動幅に応じて選択されることが好ましい。そのため、本変形例では、制御部11(第2取得部112)は、検出装置2によって取得された観測画像221を複数の追加用画像123の1つとして取得する。
<5.9 Modification 9>
As described above, the appearance of the product R reflected in the observation image 221 may also vary due to factors such as individual differences in the product R and fluctuations in imaging conditions. The larger the fluctuation range of the appearance of the product R reflected in the observed image 221, the larger the number of learning images required for machine learning. It is preferable that the one or more second learning images 126A be selected according to the range of variation in the appearance of the product R reflected in the observed image 221. Therefore, in this modification, the control unit 11 (second acquisition unit 112) acquires the observed image 221 acquired by the detection device 2 as one of the plurality of additional images 123.

制御部11は、通信インタフェース13を介して、観測画像221を検出装置2から取得すればよい。あるいは、検出装置2は、カメラCAから取得した観測画像221を記憶媒体92に格納してもよい。そして、制御部11は、ドライブ16を介して、記憶媒体92から観測画像221を読み込んでもよい。 The control unit 11 may acquire the observation image 221 from the detection device 2 via the communication interface 13 . Alternatively, the detection device 2 may store the observation image 221 acquired from the camera CA in the storage medium 92. Then, the control unit 11 may read the observation image 221 from the storage medium 92 via the drive 16.

検出装置2は、製造ラインにおいて搬送される各製品Rについて観測画像221を取得する。一般に、検出装置2によって取得される観測画像221の数は、短時間で膨大となる。学習装置における記憶部12の容量には限界があるため、記憶部12は、検出装置2から取得した全ての観測画像221を記憶できない。そのため、変形例9に係る学習装置では、制御部11(抽出部115)は、検出装置2から取得した複数の観測画像221(追加用画像123)のうち、評価値125の高い方から順に所定数の観測画像221(追加用画像123)を追加用画像126として抽出する。所定数は、1以上の整数である。そして、制御部11(保存処理部1110)は、複数の追加用画像123のうち抽出した追加用画像126のみを記憶部12に保存する。 The detection device 2 acquires an observation image 221 for each product R transported on the production line. Generally, the number of observation images 221 acquired by the detection device 2 becomes enormous in a short period of time. Since the storage unit 12 in the learning device has a limited capacity, the storage unit 12 cannot store all observed images 221 acquired from the detection device 2. Therefore, in the learning device according to modification example 9, the control unit 11 (extraction unit 115) selects a predetermined number of observation images 221 (additional images 123) obtained from the detection device 2 in order from the one with the highest evaluation value 125. A number of observed images 221 (additional images 123) are extracted as additional images 126. The predetermined number is an integer of 1 or more. Then, the control unit 11 (storage processing unit 1110) stores only the extracted additional image 126 from among the plurality of additional images 123 in the storage unit 12.

観測画像221には、良品である製品Rが写るとは限らない。すなわち、制御部11は、不良品である製品Rが写る観測画像221を追加用画像123として取得し得る。そのため、制御部11(表示制御部118)は、複数の追加用画像123(観測画像221)の中から抽出された所定数の追加用画像126それぞれを表示装置15に表示させる。そして、制御部11(選択受付部119)は、所定数の追加用画像126それぞれについて、機械学習に使用するか否かの選択を受け付ける。具体的には、制御部11(選択受付部119)は、所定数の追加用画像126それぞれについて、欠陥Lが写っているか否かの選択を受け付ける。制御部11(追加学習部116)は、欠陥Lが写っていないと選択された追加用画像126を第2学習画像126Aとして決定する。 The observed image 221 does not necessarily show the product R, which is a good product. That is, the control unit 11 can acquire the observation image 221 in which the defective product R is captured as the additional image 123. Therefore, the control unit 11 (display control unit 118) causes the display device 15 to display each of the predetermined number of additional images 126 extracted from the plurality of additional images 123 (observation images 221). Then, the control unit 11 (selection reception unit 119) receives a selection as to whether or not to use each of the predetermined number of additional images 126 for machine learning. Specifically, the control unit 11 (selection accepting unit 119) accepts a selection as to whether or not the defect L is included in each of the predetermined number of additional images 126. The control unit 11 (additional learning unit 116) determines the additional image 126 selected as not showing the defect L as the second learning image 126A.

変形例9は、上記変形例8と組み合わせてもよい。すなわち、制御部11(第3取得部117C)は、製品R及び欠陥Lがそれぞれ写る複数の第1評価画像127Aと、製品Rが写り、欠陥Lが写っていない複数の第2評価画像127Bとを取得する。制御部11は、欠陥Lが写っていると選択された各追加用画像126を複数の第1評価画像127Aの1つとして取得してもよい。さらに、制御部11は、欠陥Lが写っていないと選択された各追加用画像126を複数の第2評価画像127Bの1つとして取得してもよい。 Modification 9 may be combined with Modification 8 above. That is, the control unit 11 (third acquisition unit 117C) generates a plurality of first evaluation images 127A in which the product R and the defect L are respectively shown, and a plurality of second evaluation images 127B in which the product R is shown and the defect L is not shown. get. The control unit 11 may acquire each additional image 126 selected to include the defect L as one of the plurality of first evaluation images 127A. Furthermore, the control unit 11 may acquire each additional image 126 selected as not showing the defect L as one of the plurality of second evaluation images 127B.

図19~図22を参照して、変形例9に係る学習装置の動作例について説明する。図19及び図20は、変形例9に係る学習装置における追加用画像の抽出処理の手順の一例を示すフローチャートである。なお、以下の処理手順は、第1学習画像121を使用した機械学習により訓練された生成モデル5を取得した後に実施される。第1学習画像121を使用した機械学習により訓練された生成モデル5は、上記ステップS101及びステップS102の処理によって取得されてもよい。あるいは、第1学習画像121を使用した機械学習により訓練された生成モデル5は、変形例5と同様の方法により取得されてもよい。 An example of the operation of the learning device according to modification example 9 will be described with reference to FIGS. 19 to 22. FIGS. 19 and 20 are flowcharts illustrating an example of a procedure for extracting images for addition in the learning device according to Modification 9. FIG. Note that the following processing procedure is performed after acquiring the generative model 5 trained by machine learning using the first learning image 121. The generative model 5 trained by machine learning using the first learning image 121 may be obtained by the processing in step S101 and step S102 described above. Alternatively, the generative model 5 trained by machine learning using the first learning image 121 may be obtained by a method similar to the fifth modification.

(ステップS401)
ステップS401では、制御部11は、第2取得部112として動作し、検出装置2によって取得された観測画像221を追加用画像123として取得する。追加用画像123を取得すると、制御部11は、ステップS402に処理を進める。
(Step S401)
In step S401, the control unit 11 operates as the second acquisition unit 112 and acquires the observation image 221 acquired by the detection device 2 as the additional image 123. After acquiring the additional image 123, the control unit 11 advances the process to step S402.

(ステップS402)
ステップS402では、制御部11は、生成部113として動作し、取得された追加用画像123を生成モデル5に与えることで、追加用画像123を復元した復元追加用画像124を生成する。ステップS4023は、上記ステップS105と同様である。そのため、ステップS402の詳細な説明を省略する。復元追加用画像124を生成すると、制御部11は、ステップS403に処理を進める。
(Step S402)
In step S402, the control unit 11 operates as the generation unit 113, and generates a restored additional image 124 by restoring the additional image 123 by providing the acquired additional image 123 to the generation model 5. Step S4023 is similar to step S105 above. Therefore, detailed explanation of step S402 will be omitted. After generating the restoration addition image 124, the control unit 11 advances the process to step S403.

(ステップS403)
ステップS403では、制御部11は、追加用画像123及び生成された復元追加用画像124の間の差分に応じて、追加用画像123の評価値125であって、復元追加用画像124における追加用画像123の復元の程度に対する評価値125を算出する。ステップS403は、上記ステップS112と同様である。そのため、ステップS403の詳細な説明を省略する。評価値125を生成すると、制御部11は、ステップS404に処理を進める。
(Step S403)
In step S403, the control unit 11 determines the evaluation value 125 of the additional image 123 according to the difference between the additional image 123 and the generated restored additional image 124, and the additional restored image 124. An evaluation value 125 for the degree of restoration of the image 123 is calculated. Step S403 is similar to step S112 above. Therefore, detailed explanation of step S403 will be omitted. After generating the evaluation value 125, the control unit 11 advances the process to step S404.

(ステップS404)
ステップS404では、制御部11は、記憶部12に保存する追加用画像126に対する評価値125の下限値LLが設定されているか否かを判定する。下限値LLは、必要に応じて、オペレータの入力、プログラム内の設定値等により適宜設定される。ステップS404でYESの場合、制御部11は、ステップS405に処理を進める。ステップS404でNOの場合、制御部11は、ステップS407に処理を進める。
(Step S404)
In step S404, the control unit 11 determines whether the lower limit LL of the evaluation value 125 for the additional image 126 to be stored in the storage unit 12 has been set. The lower limit value LL is appropriately set by operator input, a set value in the program, etc., as necessary. If YES in step S404, the control unit 11 advances the process to step S405. If NO in step S404, the control unit 11 advances the process to step S407.

(ステップS405)
ステップS405では、制御部11は、ステップS403の処理によって算出された評価値125と下限値LLとを比較する。評価値125が下限値LL以下である場合(ステップS405でNO)、制御部11は、ステップS406に処理を進める。評価値125が下限値LLを超える場合(ステップS405でYES)、制御部11は、ステップS407に処理を進める。
(Step S405)
In step S405, the control unit 11 compares the evaluation value 125 calculated by the process in step S403 and the lower limit value LL. If the evaluation value 125 is less than or equal to the lower limit value LL (NO in step S405), the control unit 11 advances the process to step S406. If the evaluation value 125 exceeds the lower limit LL (YES in step S405), the control unit 11 advances the process to step S407.

(ステップS406)
ステップS406では、制御部11は、ステップS401の処理によって取得した観測画像221(追加用画像123)を破棄する。追加用画像123が破棄されると、制御部11は、追加用画像126の抽出処理を終了する。
(Step S406)
In step S406, the control unit 11 discards the observed image 221 (additional image 123) acquired by the process in step S401. When the additional image 123 is discarded, the control unit 11 ends the process of extracting the additional image 126.

(ステップS407)
ステップS407では、制御部11は、記憶部12に保存する追加用画像126の数の上限値HLが設定されているか否かを判定する。上限値HLは、必要に応じて、オペレータの入力、プログラム内の設定値等により適宜設定される。ステップS407でNOの場合、制御部11は、ステップS412に処理を進める。ステップS407でYESの場合、制御部11は、ステップS408に処理を進める。
(Step S407)
In step S407, the control unit 11 determines whether an upper limit HL for the number of additional images 126 to be stored in the storage unit 12 has been set. The upper limit value HL is appropriately set according to operator input, a set value in the program, etc., as necessary. If NO in step S407, the control unit 11 advances the process to step S412. If YES in step S407, the control unit 11 advances the process to step S408.

(ステップS408)
ステップS408では、制御部11は、記憶部12に保存されている追加用画像126の数が上限値HLに到達しているか否かを判定する。ステップS408でNOの場合、制御部11は、ステップS412に処理を進める。ステップS408でYESの場合、制御部11は、ステップS409に処理を進める。
(Step S408)
In step S408, the control unit 11 determines whether the number of additional images 126 stored in the storage unit 12 has reached the upper limit HL. If NO in step S408, the control unit 11 advances the process to step S412. If YES in step S408, the control unit 11 advances the process to step S409.

(ステップS409)
ステップS409では、制御部11は、記憶部12に保存されている所定数(上限値HLと同数)の追加用画像126に対する評価値125のうちの最小値を特定する。ステップS412において後述するように、記憶部12には追加用画像126と評価値125とが対応付けて保存される。制御部11は、追加用画像126に対応付けられた評価値125を確認することにより、最小値を特定する。最小値を特定すると、制御部11は、ステップS410に処理を進める。
(Step S409)
In step S409, the control unit 11 identifies the minimum value of the evaluation values 125 for a predetermined number (same number as the upper limit HL) of additional images 126 stored in the storage unit 12. As will be described later in step S412, the additional image 126 and the evaluation value 125 are stored in association with each other in the storage unit 12. The control unit 11 identifies the minimum value by checking the evaluation value 125 associated with the additional image 126. After specifying the minimum value, the control unit 11 advances the process to step S410.

(ステップS410)
ステップS410では、制御部11は、ステップS403の処理によって算出された評価値125がステップS409の処理によって特定された最小値を超えるか否かを判定する。ステップS410でYESの場合、制御部11は、ステップS411に処理を進める。ステップS410でNOの場合、制御部11は、ステップS406に処理を進め、ステップS401の処理によって取得した観測画像221(追加用画像123)を破棄する。
(Step S410)
In step S410, the control unit 11 determines whether the evaluation value 125 calculated in the process in step S403 exceeds the minimum value specified in the process in step S409. If YES in step S410, the control unit 11 advances the process to step S411. If NO in step S410, the control unit 11 advances the process to step S406, and discards the observed image 221 (additional image 123) acquired by the process in step S401.

(ステップS411)
ステップS411では、制御部11は、記憶部12に保存されている複数(上限値HLと同数)の追加用画像126のうち、評価値125が最も小さい1つの追加用画像126を記憶部12から削除する。評価値125が最も小さい1つの追加用画像126を記憶部12から削除すると、制御部11は、ステップS412に処理を進める。
(Step S411)
In step S411, the control unit 11 selects one additional image 126 with the smallest evaluation value 125 from the storage unit 12 among the plurality of additional images 126 (same number as the upper limit HL) stored in the storage unit 12. delete. After deleting the one additional image 126 with the smallest evaluation value 125 from the storage unit 12, the control unit 11 advances the process to step S412.

(ステップS412)
ステップS412では、制御部11は、ステップS401の処理によって取得した観測画像221(追加用画像123)を新たな追加用画像126として記憶部12に保存する。このとき、制御部11は、ステップS403の処理によって算出した評価値125を新たな追加用画像126と対応付けて記憶部12に保存する。新たな追加用画像126を記憶部12に保存した後、制御部11は、追加用画像126の抽出処理を終了する。
(Step S412)
In step S412, the control unit 11 stores the observation image 221 (additional image 123) acquired through the process in step S401 as a new addition image 126 in the storage unit 12. At this time, the control unit 11 stores the evaluation value 125 calculated by the process in step S403 in the storage unit 12 in association with the new additional image 126. After storing the new additional image 126 in the storage unit 12, the control unit 11 ends the process of extracting the additional image 126.

図19及び図20に示されるステップS401~ステップS412の一連の処理は、検出装置2から観測画像221を取得するたびに実施される。これにより、上限値HLが設定されている場合、学習装置1の記憶部12には、過去に取得した複数の観測画像221(追加用画像123)のうち、評価値125の高い方から順に所定数(=上限値HL)の観測画像221が追加用画像126として記憶部12に保存される。 A series of processes from step S401 to step S412 shown in FIGS. 19 and 20 are performed every time the observation image 221 is acquired from the detection device 2. As a result, when the upper limit value HL is set, the storage unit 12 of the learning device 1 stores a predetermined number of observation images 221 (additional images 123) acquired in the past in order from the one with the highest evaluation value 125. number (=upper limit HL) of observation images 221 are stored in the storage unit 12 as additional images 126.

図21及び図22は、変形例9に係る学習装置における追加学習処理の手順の一例を示すフローチャートである。図21及び図22に示される追加学習処理は、上記の追加用画像126の抽出処理が実行された後に実施される。なお、以下では、記憶部12に所定数(=上限値HL)の追加用画像126が保存されている場合の例について説明する。 21 and 22 are flowcharts illustrating an example of the procedure of additional learning processing in the learning device according to Modification 9. FIG. The additional learning process shown in FIGS. 21 and 22 is performed after the above-described process for extracting the additional image 126 is executed. Note that, below, an example will be described in which a predetermined number (=upper limit value HL) of additional images 126 are stored in the storage unit 12.

(ステップS501)
ステップS501では、制御部11は、記憶部12に保存されている所定数の追加用画像126を復元の程度に応じてソートする。具体的には、制御部11は、所定数の追加用画像126を評価値125の高い順に並び替える。ソートが完了すると、制御部11は、ステップS502に処理を進める。
(Step S501)
In step S501, the control unit 11 sorts a predetermined number of additional images 126 stored in the storage unit 12 according to the degree of restoration. Specifically, the control unit 11 sorts the predetermined number of additional images 126 in descending order of evaluation value 125. When the sorting is completed, the control unit 11 advances the process to step S502.

(ステップS502)
ステップS502では、制御部11は、表示制御部118として動作し、所定数の追加用画像126を含む表示画面を表示装置15に表示させる。
(Step S502)
In step S502, the control unit 11 operates as the display control unit 118 and causes the display device 15 to display a display screen including a predetermined number of additional images 126.

図23は、ステップS502において表示される表示画面の一例を示す図である。図23に例示される表示画面70は、チェックボックス71,73と、入力欄72,74とを含む。チェックボックス71は、記憶部12に保存する追加用画像126に対する評価値125の下限値LLの設定を有効にするためのオブジェクトである。チェックボックス71がチェックされている場合、下限値LLの設定が有効となる。入力欄72には、下限値LLが入力される。チェックボックス73は、記憶部12に保存する追加用画像126の数の上限値HLの設定を有効にするためのオブジェクトである。チェックボックス73がチェックされている場合、上限値HLの設定が有効となる。入力欄74には、上限値HLが入力される。 FIG. 23 is a diagram showing an example of the display screen displayed in step S502. The display screen 70 illustrated in FIG. 23 includes check boxes 71 and 73 and input fields 72 and 74. The check box 71 is an object for enabling the setting of the lower limit value LL of the evaluation value 125 for the additional image 126 stored in the storage unit 12. When the check box 71 is checked, the setting of the lower limit value LL becomes valid. In the input field 72, the lower limit value LL is input. The check box 73 is an object for enabling the setting of the upper limit HL of the number of additional images 126 to be saved in the storage unit 12. When the check box 73 is checked, the setting of the upper limit value HL becomes valid. In the input field 74, the upper limit value HL is input.

表示画面70は、領域75,78を含む。領域75には、記憶部12に保存されている所定数の追加用画像126の一覧が表示される。具体的には、領域75には、所定数の追加用画像126にそれぞれ対応する所定数のサムネイル画像76が表示される。所定数のサムネイル画像76は、ステップS501の処理によってソートされた順に並べられる。さらに、領域75には、各追加用画像126に対応する評価値125も表示される。領域75には、所定数のサムネイル画像76のうちの1つを選択するためのカーソル77が表示される。カーソル77は、入力装置14への入力に応じて移動する。領域78には、カーソル77によって選択されたサムネイル画像76に対応する追加用画像126が表示される。 Display screen 70 includes areas 75 and 78. In the area 75, a list of a predetermined number of additional images 126 stored in the storage unit 12 is displayed. Specifically, in the area 75, a predetermined number of thumbnail images 76 corresponding to the predetermined number of additional images 126 are displayed. The predetermined number of thumbnail images 76 are arranged in the order sorted by the process in step S501. Furthermore, the evaluation value 125 corresponding to each additional image 126 is also displayed in the area 75. A cursor 77 for selecting one of a predetermined number of thumbnail images 76 is displayed in the area 75. The cursor 77 moves according to input to the input device 14. In the area 78, an additional image 126 corresponding to the thumbnail image 76 selected by the cursor 77 is displayed.

表示画面70は、さらに領域79~81とボタン82~89とを含む。領域79には、不良品画像として分類された追加用画像126のリスト(以下、不良品画像リストとも記載する)が表示される。領域80には、良品画像として分類された追加用画像126のリスト(以下、良品画像リストとも記載する)が表示される。領域81には、第2学習画像126Aとして選択された追加用画像126のリスト(以下、「学習画像リスト」とも記載する)が表示される。不良品画像リスト、良品画像リストおよび学習画像リストは、画像のファイル名の一覧である。ボタン82~85は、追加用画像126を不良品画像および良品画像のいずれかに分類するためのボタンである。ボタン86は、第2学習画像126Aを決定するためのボタンである。ボタン87は、追加学習を実行させるためのボタンである。ボタン88は、検出パラメータの最適化を実行させるためのボタンである。ボタン89は、表示画面70を閉じるためのボタンである。 Display screen 70 further includes areas 79-81 and buttons 82-89. In the area 79, a list of additional images 126 classified as defective product images (hereinafter also referred to as a defective product image list) is displayed. In the area 80, a list of additional images 126 classified as non-defective images (hereinafter also referred to as a non-defective image list) is displayed. In the area 81, a list of additional images 126 selected as the second learning images 126A (hereinafter also referred to as "learning image list") is displayed. The defective product image list, the non-defective product image list, and the learning image list are lists of file names of images. Buttons 82 to 85 are buttons for classifying the additional image 126 into either a defective product image or a non-defective product image. The button 86 is a button for determining the second learning image 126A. Button 87 is a button for executing additional learning. The button 88 is a button for optimizing detection parameters. Button 89 is a button for closing display screen 70.

表示画面70は、各種の情報が表示される領域90を含む。領域90において、「前回最低スコア」は、前回の追加学習の前に抽出された所定数の追加用画像126にそれぞれ対応する所定数の評価値125のうちの最小値を示す。「前回平均スコア」は、前回の追加学習の前に抽出された所定数の追加用画像126にそれぞれ対応する所定数の評価値125の平均値を示す。「最低スコア」は、今回の追加学習の前に抽出された所定数の追加用画像126にそれぞれ対応する所定数の評価値125のうちの最小値を示す。「平均スコア」は、今回の追加学習の前に抽出された所定数の追加用画像126にそれぞれ対応する所定数の評価値125の平均値を示す。「残ストレージ容量」は、記憶部12における空き容量を示す。「保存可能枚数」は、記憶部12に保存可能な追加用画像126の最大数を示す。 Display screen 70 includes an area 90 where various information is displayed. In the area 90, the "previous lowest score" indicates the minimum value among the predetermined number of evaluation values 125 corresponding to the predetermined number of additional images 126 extracted before the previous additional learning. The "previous average score" indicates the average value of a predetermined number of evaluation values 125 corresponding to the predetermined number of additional images 126 extracted before the previous additional learning. The "lowest score" indicates the minimum value among the predetermined number of evaluation values 125 corresponding to the predetermined number of additional images 126 extracted before the current additional learning. The "average score" indicates the average value of the predetermined number of evaluation values 125 corresponding to the predetermined number of additional images 126 extracted before the current additional learning. “Remaining storage capacity” indicates the free capacity in the storage unit 12. “Number of images that can be saved” indicates the maximum number of additional images 126 that can be saved in the storage unit 12.

図23に例示される表示画面70の表示が完了すると、制御部11は、ステップS503に処理を進める。 When the display of the display screen 70 illustrated in FIG. 23 is completed, the control unit 11 advances the process to step S503.

(ステップS503)
ステップS503では、制御部11は、選択受付部119として動作し、良品画像および不良品画像への分類の操作を受け付けたか否かを判定する。制御部11は、表示画面70に含まれるボタン82~85が操作されたことに応じて、良品画像および不良品画像への分類の操作を受け付けたと判定する。ボタン82~85が操作されていない場合(ステップS503でNO)、制御部11は、ステップS505に処理を進める。ボタン82~85が操作された場合(ステップS503でYES)、制御部11は、ステップS504に処理を進める。
(Step S503)
In step S503, the control unit 11 operates as the selection reception unit 119 and determines whether or not an operation for classification into non-defective images and defective images has been accepted. In response to the operation of the buttons 82 to 85 included in the display screen 70, the control unit 11 determines that an operation for classifying images into non-defective images and defective images has been accepted. If the buttons 82 to 85 are not operated (NO in step S503), the control unit 11 advances the process to step S505. If the buttons 82 to 85 are operated (YES in step S503), the control unit 11 advances the process to step S504.

(ステップS504)
ステップS504では、制御部11は、選択受付部119として動作し、ボタン82~85への操作に応じて、選択された追加用画像126を不良品画像および良品画像のいずれかに分類する。
(Step S504)
In step S504, the control unit 11 operates as the selection reception unit 119, and classifies the selected additional image 126 into either a defective product image or a non-defective product image according to the operations on the buttons 82 to 85.

制御部11は、ボタン82が操作されると、領域78に表示されている追加用画像126を良品画像に分類する。制御部11は、良品画像に分類された追加用画像126に対応するサムネイル画像76を領域75から削除する。制御部11は、良品画像に分類された追加用画像126を新たな第2評価画像127Bとして記憶部12に保存する。制御部11は、領域80に表示される良品画像リストに当該新たな第2評価画像127Bを追加する。 When the button 82 is operated, the control unit 11 classifies the additional image 126 displayed in the area 78 as a non-defective image. The control unit 11 deletes the thumbnail image 76 corresponding to the additional image 126 classified as a non-defective image from the area 75. The control unit 11 stores the additional image 126 classified as a non-defective image in the storage unit 12 as a new second evaluation image 127B. The control unit 11 adds the new second evaluation image 127B to the non-defective image list displayed in the area 80.

制御部11は、ボタン83が操作されると、領域78に表示されている追加用画像126を不良品画像に分類する。制御部11は、不良品画像に分類された追加用画像126に対応するサムネイル画像76を領域75から削除する。制御部11は、不良品画像に分類された追加用画像126を新たな第1評価画像127Aとして記憶部12に保存する。制御部11は、領域79に表示される不良品画像リストに当該新たな第1評価画像127Aを追加する。 When the button 83 is operated, the control unit 11 classifies the additional image 126 displayed in the area 78 as a defective product image. The control unit 11 deletes the thumbnail image 76 corresponding to the additional image 126 classified as a defective product image from the area 75. The control unit 11 stores the additional image 126 classified as a defective product image in the storage unit 12 as a new first evaluation image 127A. The control unit 11 adds the new first evaluation image 127A to the defective product image list displayed in the area 79.

オペレータは、ボタン82,83を誤って操作し得る。例えば、オペレータは、ボタン82を操作すべきところボタン83を誤って操作し得る。この場合、良品画像として分類すべき追加用画像126が不良品画像として分類され、領域79に表示される不良品画像リストに追加される。このような誤操作が行なわれた場合であっても修復できるように、表示画面70にはボタン84,85が用意されている。ボタン84は、不良品画像リストから選択された画像を良品画像リストに移動させるためのボタンである。ボタン85は、良品画像リストから選択された画像を不良品画像リストに移動させるためのボタンである。 The operator may operate the buttons 82, 83 incorrectly. For example, the operator may mistakenly operate button 83 when button 82 should have been operated. In this case, the additional image 126 that should be classified as a non-defective image is classified as a defective image and added to the defective image list displayed in area 79. Buttons 84 and 85 are provided on the display screen 70 so that even if such an erroneous operation is performed, it can be repaired. The button 84 is a button for moving an image selected from the defective product image list to the non-defective product image list. The button 85 is a button for moving an image selected from the non-defective image list to the defective image list.

制御部11は、不良品画像リストおよび良品画像リストのいずれかに含まれる1つの画像の選択を受け付ける。不良品画像リストおよび良品画像リストのいずれかに含まれる1つの画像が選択されると、制御部11は、選択された画像を領域78に表示させる。これにより、オペレータは、領域78に表示される画像を確認することにより、ボタン82,83の誤操作の有無を確認できる。 The control unit 11 accepts selection of one image included in either the defective product image list or the non-defective product image list. When one image included in either the defective product image list or the non-defective product image list is selected, the control unit 11 displays the selected image in the area 78. Thereby, the operator can confirm whether or not the buttons 82 and 83 have been operated incorrectly by checking the image displayed in the area 78.

不良品画像リストの中の1つの第1評価画像127Aが選択された状態でボタン84の操作を受け付けると、制御部11は、選択された第1評価画像127Aを良品画像に分類し直す。制御部11は、良品画像に分類された第1評価画像127Aを新たな第2評価画像127Bとして記憶部12に保存し直す。制御部11は、領域80に表示される良品画像リストに当該新たな第2評価画像127Bを追加する。 When the button 84 is operated with one first evaluation image 127A in the defective image list selected, the control unit 11 reclassifies the selected first evaluation image 127A as a non-defective image. The control unit 11 saves the first evaluation image 127A classified as a non-defective image in the storage unit 12 as a new second evaluation image 127B. The control unit 11 adds the new second evaluation image 127B to the non-defective image list displayed in the area 80.

良品画像リストの中の1つの第2評価画像127Bが選択された状態でボタン85の操作を受け付けると、制御部11は、選択された第2評価画像127Bを不良品画像に分類し直す。制御部11は、不良品画像に分類された第2評価画像127Bを新たな第1評価画像127Aとして記憶部12に保存し直す。制御部11は、領域79に表示される不良品画像リストに当該新たな第1評価画像127Aを追加する。 When the button 85 is operated with one second evaluation image 127B in the non-defective image list selected, the control unit 11 reclassifies the selected second evaluation image 127B as a defective image. The control unit 11 saves the second evaluation image 127B classified as a defective image in the storage unit 12 as a new first evaluation image 127A. The control unit 11 adds the new first evaluation image 127A to the defective product image list displayed in the area 79.

操作されたボタンに応じた処理が完了すると、制御部11は、ステップS505に処理を進める。 When the process corresponding to the operated button is completed, the control unit 11 advances the process to step S505.

(ステップS505)
ステップS505では、制御部11は、良品画像として分類された追加用画像126のうちの1つ以上の画像を第2学習画像126Aとして選択する旨の指示を受け付けたか否かを判定する。制御部11は、良品画像リストの中の1つ以上の第2評価画像127Bが選択された状態でボタン86が操作されたことに応じて、第2学習画像126Aの選択指示を受け付けたと判定する。ボタン86が操作された場合(ステップS504でYES)、制御部11は、ステップS506に処理を進める。ボタン86が操作されていない場合(ステップS505でNO)、制御部11は、ステップS507に処理を進める。
(Step S505)
In step S505, the control unit 11 determines whether an instruction to select one or more of the additional images 126 classified as non-defective images as the second learning image 126A has been received. The control unit 11 determines that the instruction to select the second learning image 126A has been received in response to the button 86 being operated with one or more second evaluation images 127B in the non-defective image list being selected. . If the button 86 is operated (YES in step S504), the control unit 11 advances the process to step S506. If the button 86 is not operated (NO in step S505), the control unit 11 advances the process to step S507.

(ステップS506)
ステップS506では、制御部11は、ボタン86の操作に応じて、選択された第2評価画像127Bを第2学習画像126Aとして決定する。制御部11は、決定された第2学習画像126Aを領域81に表示される学習画像リストに追加する。なお、第2学習画像126Aとして決定された第2評価画像127Bは、良品画像リストにも残される。ステップS506の処理が完了した後、制御部11は、ステップS507に処理を進める。
(Step S506)
In step S506, the control unit 11 determines the selected second evaluation image 127B as the second learning image 126A in response to the operation of the button 86. The control unit 11 adds the determined second learning image 126A to the learning image list displayed in the area 81. Note that the second evaluation image 127B determined as the second learning image 126A is also left in the non-defective image list. After completing the process in step S506, the control unit 11 advances the process to step S507.

(ステップS507)
ステップS507では、制御部11は、追加学習の実行指示を受け付けたか否かを判定する。制御部11は、表示画面70に含まれるボタン87が操作されたことに応じて、追加学習の実行指示を受け付けたと判定する。ボタン87が操作された場合(ステップS506でYES)、制御部11は、ステップS508に処理を進める。ボタン87が操作されていない場合(ステップS507でNO)、制御部11は、ステップS510に処理を進める。
(Step S507)
In step S507, the control unit 11 determines whether an instruction to perform additional learning has been received. The control unit 11 determines that an instruction to perform additional learning has been received in response to the button 87 included in the display screen 70 being operated. If the button 87 is operated (YES in step S506), the control unit 11 advances the process to step S508. If the button 87 is not operated (NO in step S507), the control unit 11 advances the process to step S510.

(ステップS508)
ステップS508では、制御部11は、追加学習部116として動作し、機械学習により、学習画像リストに含まれる各第2学習画像126Aそれぞれが与えられると、与えられた各第2学習画像126Aに適合する復元画像を生成するように生成モデル5を更に訓練する。ステップS508は、上記ステップS116と同様である。そのため、ステップS508の詳細な説明を省略する。生成モデル5の訓練が完了すると、制御部11は、ステップS509に処理を進める。
(Step S508)
In step S508, the control unit 11 operates as the additional learning unit 116, and when each of the second learning images 126A included in the learning image list is given by machine learning, the control unit 11 adapts to each given second learning image 126A. The generative model 5 is further trained to generate a restored image. Step S508 is similar to step S116 above. Therefore, detailed explanation of step S508 will be omitted. When training of the generative model 5 is completed, the control unit 11 advances the process to step S509.

(ステップS509)
ステップS509では、制御部11は、保存処理部1110として動作し、構築された学習済みの生成モデル5に関する情報を学習結果データ129として生成する。制御部11は、生成された学習結果データ129を所定の記憶領域に保存する。なお、生成された学習結果データ129は、任意のタイミングで検出装置2に提供されてよい。ステップS509の処理は、上記ステップS117と同様の処理である。学習結果データ129を保存すると、制御部11は、ステップS510に処理を進める。
(Step S509)
In step S509, the control unit 11 operates as the storage processing unit 1110 and generates information regarding the constructed trained generative model 5 as the learning result data 129. The control unit 11 stores the generated learning result data 129 in a predetermined storage area. Note that the generated learning result data 129 may be provided to the detection device 2 at any timing. The process in step S509 is similar to the process in step S117 above. After storing the learning result data 129, the control unit 11 advances the process to step S510.

(ステップS510)
ステップS510では、制御部11は、検出パラメータの最適化の実行指示を受け付けたか否かを判定する。制御部11は、表示画面70に含まれるボタン88が操作されたことに応じて、検出パラメータの最適化の実行指示を受け付けたと判定する。ボタン88が操作された場合(ステップS510でYES)、制御部11は、ステップS511に処理を進める。ボタン88が操作されていない場合(ステップS510でNO)、制御部11は、ステップS514に処理を進める。
(Step S510)
In step S510, the control unit 11 determines whether an instruction to perform optimization of detection parameters has been received. The control unit 11 determines that an instruction to optimize the detection parameters has been received in response to the button 88 included in the display screen 70 being operated. If the button 88 is operated (YES in step S510), the control unit 11 advances the process to step S511. If the button 88 is not operated (NO in step S510), the control unit 11 advances the process to step S514.

(ステップS511)
ステップS511では、制御部11は、生成部113及び評価部114として動作し、検出パラメータの最適化を実施する。具体的には、制御部11は、複数の検出パラメータ候補60の中から最適な検出パラメータ候補61を特定する。ステップS511の処理は、上記ステップS105~ステップS109と同様の処理である。ただし、制御部11は、変形例8と同様に、複数の評価画像127および1つ以上の第2学習画像126Aの代わりに、複数の第1評価画像127Aおよび複数の第2評価画像127Bを用いて、検出パラメータの最適化を実施する。なお、制御部11は、複数の第2評価画像127Bの中から第2学習画像126Aとして決定された画像を除外してもよいし、第2学習画像126Aを複数の第2評価画像127Bに含めてもよい。ステップS511の処理が完了した後、制御部11は、ステップS512に処理を進める。
(Step S511)
In step S511, the control unit 11 operates as the generation unit 113 and the evaluation unit 114, and optimizes the detection parameters. Specifically, the control unit 11 identifies the optimal detection parameter candidate 61 from among the plurality of detection parameter candidates 60. The process in step S511 is similar to steps S105 to S109 described above. However, similarly to Modification Example 8, the control unit 11 uses a plurality of first evaluation images 127A and a plurality of second evaluation images 127B instead of a plurality of evaluation images 127 and one or more second learning images 126A. Then, optimize the detection parameters. Note that the control unit 11 may exclude the image determined as the second learning image 126A from among the plurality of second evaluation images 127B, or may exclude the image determined as the second learning image 126A from among the plurality of second evaluation images 127B. It's okay. After completing the process in step S511, the control unit 11 advances the process to step S512.

(ステップS512)
ステップS512では、制御部11は、評価部114として動作し、特定された1つの検出パラメータ候補61を利用した判定の結果において、誤判定の第2評価画像127Bの数又は割合が第1の閾値以上であるか否かを判定する。さらに、制御部11は、特定された1つの検出パラメータ候補61を利用した判定の結果において、誤判定の第1評価画像127Aの数又は割合が第2の閾値以上であるか否かを判定する。ステップS512でYESの場合、制御部11は、ステップS513に処理を進める。ステップS512でNOの場合、制御部11は、ステップS514に処理を進める。
(Step S512)
In step S512, the control unit 11 operates as the evaluation unit 114, and in the result of the determination using the identified one detection parameter candidate 61, the number or proportion of the second evaluation images 127B that are incorrectly determined is equal to the first threshold value. It is determined whether or not the value is greater than or equal to the value. Further, the control unit 11 determines whether or not the number or proportion of the first evaluation images 127A that are incorrectly determined is equal to or higher than a second threshold value in the result of the determination using the one identified detection parameter candidate 61. . If YES in step S512, the control unit 11 advances the process to step S513. If NO in step S512, the control unit 11 advances the process to step S514.

(ステップS513)
ステップS513では、制御部11は、複数の第2評価画像127B(第2学習画像126Aとして選択済みの画像を除く)のうちの復元の程度の低い1つ以上の第2評価画像127Bを第2学習画像126Aとして決定する。ステップS513の処理が完了した後、制御部11は、ステップS508に処理を戻す。これにより、複数の第2評価画像127Bのうちの復元の程度の低い1つ以上の第2評価画像127Bを第2学習画像126Aとして用いた機械学習が繰り返される。
(Step S513)
In step S513, the control unit 11 selects one or more second evaluation images 127B with a low degree of restoration from among the plurality of second evaluation images 127B (excluding images already selected as the second learning images 126A). This is determined as the learning image 126A. After completing the process in step S513, the control unit 11 returns the process to step S508. Thereby, machine learning is repeated using one or more second evaluation images 127B with a low degree of restoration among the plurality of second evaluation images 127B as the second learning image 126A.

(ステップS514)
ステップS514では、制御部11は、表示画面70を閉じる旨の指示を受け付けたか否かを判定する。制御部11は、表示画面70に含まれるボタン89が操作されたことに応じて、表示画面70を閉じる旨の指示を受け付けたと判定する。ボタン89が操作されていない場合(ステップS514でNO)、制御部11は、ステップS503に処理を戻す。ボタン89が操作された場合(ステップS514でYES)、制御部11は、追加学習に関する一連の処理を終了する。
(Step S514)
In step S514, the control unit 11 determines whether an instruction to close the display screen 70 has been received. The control unit 11 determines that an instruction to close the display screen 70 has been received in response to the button 89 included in the display screen 70 being operated. If the button 89 has not been operated (NO in step S514), the control unit 11 returns the process to step S503. If the button 89 is operated (YES in step S514), the control unit 11 ends a series of processes related to additional learning.

以上のように、変形例9に係る学習装置では、制御部11(第2取得部112)は、検出装置2によって取得された観測画像221を複数の追加用画像123の1つとして取得する。これにより、オペレータは、追加用画像123を準備する手間を省略できる。 As described above, in the learning device according to modification 9, the control unit 11 (second acquisition unit 112) acquires the observation image 221 acquired by the detection device 2 as one of the plurality of additional images 123. Thereby, the operator can omit the effort of preparing the additional image 123.

制御部11(抽出部115)は、評価値125に基づいて、復元の程度が低いと評価される所定数の追加用画像126を複数の追加用画像123から抽出する。そして、制御部11(選択受付部119)は、表示装置15に表示された所定数の追加用画像126それぞれについて、当該所定数の追加用画像126それぞれを機械学習に使用するか否かの選択を受け付ける。具体的には、制御部11(選択受付部119)は、所定数の追加用画像126それぞれについて、欠陥Lが写っているか否かの選択を受け付ける。制御部11(追加学習部116)は、機械学習に使用すると選択された追加用画像126(すなわち、欠陥Lが写っていないと選択された追加用画像126)を第2学習画像126Aとして決定する。 Based on the evaluation value 125, the control unit 11 (extraction unit 115) extracts a predetermined number of additional images 126 that are evaluated as having a low degree of restoration from the plurality of additional images 123. Then, the control unit 11 (selection reception unit 119) selects, for each of the predetermined number of additional images 126 displayed on the display device 15, whether or not to use each of the predetermined number of additional images 126 for machine learning. accept. Specifically, the control unit 11 (selection reception unit 119) receives a selection as to whether or not the defect L is included in each of the predetermined number of additional images 126. The control unit 11 (additional learning unit 116) determines the additional image 126 selected to be used for machine learning (that is, the additional image 126 selected as not showing the defect L) as the second learning image 126A. .

学習装置は、不良品の製品Rが写っている観測画像221を追加用画像123として取得し得る。しかしながら、上記の構成によれば、オペレータの選択に応じて、欠陥Lの写っていない追加用画像126が第2学習画像126Aとして決定される。これにより、欠陥Lの写っている画像を用いた機械学習による生成モデル5の性能の低下を防止できる。 The learning device can acquire the observation image 221 showing the defective product R as the additional image 123. However, according to the above configuration, the additional image 126 that does not include the defect L is determined as the second learning image 126A in accordance with the operator's selection. Thereby, it is possible to prevent the performance of the generation model 5 based on machine learning using the image containing the defect L from deteriorating.

制御部11(第3取得部117C)は、製品R及び欠陥Lが写る複数の第1評価画像127Aと、製品Rが写り、欠陥Lが写っていない複数の第2評価画像127Bとを取得する。制御部11(評価部114)には、欠陥Lが画像に写っているか否かを判定するための複数の検出パラメータ候補60が与えられる。制御部11(評価部114)は、複数の検出パラメータ候補60それぞれを利用して、欠陥Lが各第1評価画像127Aに写っているか否かの判定、及び欠陥Lが各第2評価画像127Bに写っているか否かの判定を実行する。制御部11(評価部114)は、各判定の結果に基づいて、欠陥Lが画像に写っているか否かを判定するための検出パラメータの最適化を実行する。制御部11(選択受付部119)は、表示装置15に表示された所定数の追加用画像126それぞれについて、欠陥Lが写っているか否かの選択を受け付ける。制御部11(第3取得部117)は、欠陥Lが写っていると選択された各追加用画像126を複数の第1評価画像127Aの1つとして取得する。制御部11(第3取得部117)は、欠陥Lが写っていないと選択された各追加用画像126を複数の第2評価画像127Bの1つとして取得する。これにより、オペレータは、第1評価画像127Aおよび第2評価画像127Bを準備する手間を省略できる。 The control unit 11 (third acquisition unit 117C) acquires a plurality of first evaluation images 127A in which the product R and the defect L are shown, and a plurality of second evaluation images 127B in which the product R is shown and the defect L is not shown. . The control unit 11 (evaluation unit 114) is provided with a plurality of detection parameter candidates 60 for determining whether the defect L is shown in the image. The control unit 11 (evaluation unit 114) uses each of the plurality of detection parameter candidates 60 to determine whether or not the defect L appears in each first evaluation image 127A, and determines whether the defect L appears in each second evaluation image 127B. A determination is made as to whether or not the image is captured in the image. The control unit 11 (evaluation unit 114) optimizes detection parameters for determining whether the defect L is shown in the image based on the results of each determination. The control unit 11 (selection accepting unit 119) accepts a selection as to whether or not the defect L is included in each of the predetermined number of additional images 126 displayed on the display device 15. The control unit 11 (third acquisition unit 117) acquires each additional image 126 selected to include the defect L as one of the plurality of first evaluation images 127A. The control unit 11 (third acquisition unit 117) acquires each additional image 126 selected as not showing the defect L as one of the plurality of second evaluation images 127B. Thereby, the operator can omit the effort of preparing the first evaluation image 127A and the second evaluation image 127B.

制御部11(保存処理部1110)、複数の追加用画像123のうち、抽出された所定数の追加用画像126を記憶部12に保存する。一般に、検出装置2によって取得される観測画像221の数は、短時間で膨大となる。しかしながら、上記の構成によれば、観測画像221が追加用画像123として取得されるものの、評価値125の高い方から順に所定数の観測画像221(追加用画像123)が追加用画像126として抽出され、抽出された所定数の追加用画像126のみが記憶部12に保存される。そのため、記憶部12における空き領域が不足する事態を避けることができる。 The control unit 11 (storage processing unit 1110) stores a predetermined number of additional images 126 extracted from the plurality of additional images 123 in the storage unit 12. Generally, the number of observation images 221 acquired by the detection device 2 becomes enormous in a short period of time. However, according to the above configuration, although the observed image 221 is acquired as the additional image 123, a predetermined number of observed images 221 (additional images 123) are extracted as the additional images 126 in order from the one with the highest evaluation value 125. Only the predetermined number of extracted additional images 126 are stored in the storage unit 12. Therefore, a situation in which the free space in the storage unit 12 becomes insufficient can be avoided.

§6 付記
以上のように、本実施の形態は以下のような開示を含む。
§6 Supplementary notes As described above, this embodiment includes the following disclosures.

(構成1)
所定の特徴の写る1つ以上の第1学習画像(121)を取得する第1取得部(11,110)と、
前記1つ以上の第1学習画像(121)を使用して、生成モデル(5)の機械学習を実施する学習部(11,111)であって、
生成モデル(5)は、画像が与えられると、与えられた画像を特徴量に変換し、前記特徴量から与えられた前記画像を復元した画像を生成するように構成され、
前記機械学習により、前記1つ以上の第1学習画像(121)それぞれが与えられると、与えられた前記1つ以上の第1学習画像(121)それぞれに適合する復元画像を生成するように前記生成モデル(5)を訓練する、
学習部(11,111)と、
前記所定の特徴の写る複数の追加用画像(123)を取得する第2取得部(11,112)と、
前記複数の追加用画像(123)それぞれを前記生成モデル(5)に与えることで、前記複数の追加用画像(123)それぞれを復元した複数の復元追加用画像(124)それぞれを生成する生成部(11,113)と、
前記各追加用画像(123)及び前記各復元追加用画像(124)の間の差分に応じて、前記各追加用画像(124)の評価値であって、前記各復元追加用画像(124)における前記各追加用画像(124)の復元の程度に対する評価値を算出する評価部(11,114)と、
前記評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像(126)を前記複数の追加用画像(123)から抽出する抽出部(11,115)と、
機械学習により、抽出された前記1つ以上の追加用画像(126)に含まれる1つ以上の第2学習画像(126A)それぞれが与えられると、与えられた前記1つ以上の第2学習画像(126A)それぞれに適合する復元画像を生成するように前記生成モデル(5)を更に訓練する追加学習部(11,116)と、
を備える、
学習装置(1,1C)。
(Configuration 1)
a first acquisition unit (11, 110) that acquires one or more first learning images (121) in which predetermined features are captured;
A learning unit (11, 111) that performs machine learning of the generative model (5) using the one or more first learning images (121),
The generative model (5) is configured to, when an image is given, convert the given image into a feature amount, and generate an image that restores the given image from the feature amount,
By the machine learning, when each of the one or more first learning images (121) is given, the machine learning generates a restored image that matches each of the one or more given first learning images (121). training the generative model (5);
Learning department (11, 111) and
a second acquisition unit (11, 112) that acquires a plurality of additional images (123) showing the predetermined characteristics;
a generation unit that generates each of a plurality of restored additional images (124) obtained by restoring each of the plurality of additional images (123) by supplying each of the plurality of additional images (123) to the generation model (5); (11,113) and
An evaluation value of each additional image (124) according to the difference between each additional image (123) and each restored additional image (124), which is an evaluation value of each additional restored image (124). an evaluation unit (11, 114) that calculates an evaluation value for the degree of restoration of each of the additional images (124);
an extraction unit (11, 115) that extracts one or more additional images (126) that are evaluated as having a low degree of restoration from the plurality of additional images (123) based on the evaluation value;
When each of the one or more second learning images (126A) included in the one or more extracted additional images (126) is given by machine learning, the one or more given second learning images (126A) an additional learning unit (11, 116) that further trains the generative model (5) to generate a restored image that fits each;
Equipped with
Learning device (1, 1C).

(構成2)
前記差分に応じて前記評価値を算出することは、
前記複数の追加用画像(123)それぞれと前記複数の復元追加用画像(124)それぞれとの間の差分を示す複数の差分画像(182)それぞれを生成し、
前記各差分画像(182)において、各画素の画素値が大きいほど前記評価値が高くなり、かつ、基準画素値以上の画素の前記評価値に与える寄与度が前記基準画素値未満の画素の前記評価値に与える寄与度よりも大きくなるように、前記評価値を算出すること、
により構成される、
構成1に記載の学習装置(1,1C)。
(Configuration 2)
Calculating the evaluation value according to the difference includes:
generating each of a plurality of difference images (182) indicating the difference between each of the plurality of additional images (123) and each of the plurality of restored additional images (124);
In each of the difference images (182), the larger the pixel value of each pixel, the higher the evaluation value, and the contribution of pixels whose contribution to the evaluation value is equal to or greater than the reference pixel value is less than the reference pixel value. Calculating the evaluation value so that it is larger than the contribution given to the evaluation value;
Consisting of
The learning device (1, 1C) according to Configuration 1.

(構成3)
抽出された前記1つ以上の追加用画像(126)それぞれを表示装置(15)に表示させる表示制御部(11,118)を更に備える、
構成1又は2に記載の学習装置(1,1C)。
(Configuration 3)
further comprising a display control unit (11, 118) that causes the display device (15) to display each of the one or more extracted additional images (126);
The learning device (1, 1C) according to Configuration 1 or 2.

(構成4)
前記表示装置(15)に表示された前記1つ以上の追加用画像(126)それぞれについて、当該1つ以上の追加用画像(126)それぞれを機械学習に使用するか否かの選択を受け付ける選択受付部(11,119)を更に備え、
追加学習部(11,116)は、前記機械学習に使用すると選択された追加用画像(126)を前記1つ以上の第2学習画像(126A)として決定する 、
構成3に記載の学習装置(1,1C)。
(Configuration 4)
For each of the one or more additional images (126) displayed on the display device (15), a selection that accepts a selection of whether to use each of the one or more additional images (126) for machine learning. Further equipped with a reception department (11, 119),
The additional learning unit (11, 116) determines the additional image (126) selected for use in the machine learning as the one or more second learning images (126A),
The learning device (1, 1C) according to configuration 3.

(構成5)
前記所定の特徴及び前記所定の特徴以外の他の特徴の写る複数の評価画像(127)を取得する第3取得部(11,117)を更に備え、
前記複数の追加用画像(123)には前記他の特徴が写っておらず、
前記生成部(11,113)は、取得された前記複数の評価画像(127)それぞれを訓練された前記生成モデル(5)に与えることで、前記複数の評価画像(127)それぞれを復元した複数の復元評価画像(128)それぞれを更に生成し、
前記評価部(11,114)は、更に、
前記各追加用画像(123)と生成された前記各復元追加用画像(124)との差分の程度に基づいて、前記他の特徴が前記各追加用画像(123)に写っているか否かを判定し、及び
前記各評価画像(127)と生成された前記各復元評価画像(128)との差分の程度に基づいて、前記他の特徴が前記各評価画像(127)に写っているか否かを判定し、
前記評価部(11,114)は、前記複数の追加用画像(123)のうち、前記他の特徴が写っていると判定された追加用画像(123)の数又は割合が第1の閾値以上である、又は、前記複数の評価画像(127)のうち、前記他の特徴が写っていないと判定された評価画像(127)の数又は割合が第2の閾値以上である場合に、前記他の特徴が写っていると判定された1又は複数の追加用画像(123)について、前記評価値を算出し、
前記抽出部(11,115)は、算出された前記評価値に基づいて、前記他の特徴が写っていると判定された前記1又は複数の追加用画像(123)のうち、復元の程度が低いと評価される画像を前記1つ以上の追加用画像(126)として抽出する、
構成1から4のいずれかに記載の学習装置(1)。
(Configuration 5)
further comprising a third acquisition unit (11, 117) that acquires a plurality of evaluation images (127) in which the predetermined feature and other features other than the predetermined feature are captured;
The other features are not included in the plurality of additional images (123);
The generation unit (11, 113) provides a plurality of restored evaluation images (127) for each of the plurality of evaluation images (127) by giving each of the plurality of acquired evaluation images (127) to the trained generation model (5). Further generate each restoration evaluation image (128) of
The evaluation unit (11, 114) further includes:
Based on the degree of difference between each of the additional images (123) and the generated restored additional images (124), it is determined whether the other features are reflected in each of the additional images (123). and determining, based on the degree of difference between each of the evaluation images (127) and each of the generated restoration evaluation images (128), whether or not the other features are reflected in each of the evaluation images (127). Determine,
The evaluation unit (11, 114) determines that the number or proportion of the additional images (123) determined to include the other features among the plurality of additional images (123) is equal to or higher than a first threshold value. or, when the number or proportion of the evaluation images (127) determined to not include the other features among the plurality of evaluation images (127) is equal to or higher than a second threshold, Calculate the evaluation value for one or more additional images (123) that are determined to include the characteristics of
The extraction unit (11, 115) determines the degree of restoration of the one or more additional images (123) determined to include the other features based on the calculated evaluation value. extracting images that are evaluated as low as the one or more additional images (126);
The learning device (1) according to any one of configurations 1 to 4.

(構成6)
前記他の特徴が前記各追加用画像(123)に写っているか否か、及び前記他の特徴が前記各評価画像(127)に写っているか否かを判定するための複数のパラメータ候補が与えられ、
前記評価部(11,114)は、
前記複数のパラメータ候補それぞれを利用して、前記他の特徴が前記各追加用画像(123)に写っているか否かの判定、及び前記他の特徴が前記各評価画像(127)に写っているか否かの判定を実行し、
前記各判定の結果に基づいて、前記他の特徴が画像に写っているか否かを判定するためのパラメータの最適化を実行し、及び
最適化されたパラメータを利用した前記各判定の結果において、前記他の特徴が写っていると判定された追加用画像(123)の数又は割合が前記第1の閾値以上である、又は前記他の特徴が写っていないと判定された評価画像(127)の数又は割合が前記第2の閾値以上である場合に、前記他の特徴が写っていると判定された1又は複数の追加用画像(123)について、前記評価値を算出する、
構成5に記載の学習装置(1)。
(Configuration 6)
A plurality of parameter candidates are provided for determining whether or not the other features are shown in each of the additional images (123) and whether or not the other features are shown in each of the evaluation images (127). is,
The evaluation unit (11, 114)
Using each of the plurality of parameter candidates, it is determined whether or not the other feature is shown in each of the additional images (123), and whether the other feature is shown in each of the evaluation images (127). Execute a determination of whether or not
Based on the results of each of the determinations, optimization of parameters for determining whether or not the other features are included in the image is performed, and in the results of each of the determinations using the optimized parameters, The number or proportion of additional images (123) determined to include the other feature is equal to or greater than the first threshold, or an evaluation image (127) determined to not include the other feature. calculating the evaluation value for one or more additional images (123) that are determined to include the other features when the number or ratio of the other features is greater than or equal to the second threshold;
Learning device (1) according to configuration 5.

(構成7)
複数の第1評価画像(127A)と複数の第2評価画像(127B)とを取得する第3取得部(11,117C)を更に備え、
前記複数の第1評価画像(127A)には、前記所定の特徴及び前記所定の特徴以外の他の特徴が写り、
前記複数の第2評価画像(127B)には、前記所定の特徴が写り、前記他の特徴が写っておらず、
前記評価部(11,114)は、
前記他の特徴が画像に写っているか否かを判定するための複数のパラメータ候補が与えられ、
前記複数のパラメータ候補それぞれを利用して、前記他の特徴が前記各第1評価画像(127A)に写っているか否かの判定、及び前記他の特徴が前記各第2評価画像(127B)に写っているか否かの判定を実行し、
前記各判定の結果に基づいて、前記他の特徴が画像に写っているか否かを判定するためのパラメータの最適化を実行し、
前記選択受付部(11,119)は、前記表示装置(15)に表示された前記1つ以上の追加用画像(126)それぞれについて、前記他の特徴が写っているか否かの選択を更に受け付け、
前記第3取得部(11,117C)は、
前記他の特徴が写っていると選択された各追加用画像(126)を前記複数の第1評価画像(127A)の1つとして取得し、
前記他の特徴が写っていないと選択された各追加用画像(126)を前記複数の第2評価画像(127B)の1つとして取得する、
構成4に記載の学習装置(1C)。
(Configuration 7)
Further comprising a third acquisition unit (11, 117C) that acquires a plurality of first evaluation images (127A) and a plurality of second evaluation images (127B),
The plurality of first evaluation images (127A) include the predetermined feature and features other than the predetermined feature,
The plurality of second evaluation images (127B) include the predetermined feature and do not include the other feature,
The evaluation unit (11, 114)
A plurality of parameter candidates are given for determining whether the other feature is included in the image,
Using each of the plurality of parameter candidates, it is determined whether or not the other feature appears in each of the first evaluation images (127A), and whether or not the other feature appears in each of the second evaluation images (127B). Execute a judgment as to whether the image is visible or not,
Based on the results of each of the determinations, optimizing parameters for determining whether the other features are included in the image;
The selection accepting unit (11, 119) further accepts a selection as to whether or not the other characteristics are included in each of the one or more additional images (126) displayed on the display device (15). ,
The third acquisition unit (11, 117C) is
each additional image (126) selected as showing the other characteristics is acquired as one of the plurality of first evaluation images (127A);
acquiring each additional image (126) selected as not showing the other features as one of the plurality of second evaluation images (127B);
Learning device (1C) according to configuration 4.

(構成8)
前記第2取得部(11,112)は、検出装置(2)と通信し、
前記検出装置(2)は、
前記所定の特徴を観測することで得られた観測画像を取得し、
前記生成モデル(5)に前記観測画像(221)を入力することで、前記観測画像(221)に対応する復元観測画像(223)を生成し、
生成された前記復元観測画像(223)及び前記観測画像(221)の間の差分に基づいて、前記所定の特徴以外の他の特徴が前記観測画像(221)に写っているか否かを検出し、
前記第2取得部(11,112)は、前記検出装置(2)によって取得された前記観測画像(221)を前記複数の追加用画像の1つとして取得する、
構成4又は7に記載の学習装置(1,1C)。
(Configuration 8)
The second acquisition unit (11, 112) communicates with the detection device (2),
The detection device (2) includes:
Obtaining an observation image obtained by observing the predetermined features,
By inputting the observed image (221) to the generative model (5), a restored observed image (223) corresponding to the observed image (221) is generated;
Based on the difference between the generated restored observation image (223) and the observation image (221), it is detected whether or not other features other than the predetermined features are reflected in the observation image (221). ,
The second acquisition unit (11, 112) acquires the observation image (221) acquired by the detection device (2) as one of the plurality of additional images.
The learning device (1, 1C) according to configuration 4 or 7.

(構成9)
前記複数の追加用画像(123)のうち、前記抽出部(11,115)によって抽出された前記1つ以上の追加用画像(126)を記憶部(12)に保存する保存処理部(11,1110)を更に備える、
構成1から8のいずれかに記載の学習装置(1,1C)。
(Configuration 9)
A storage processing unit (11, 1110),
The learning device (1, 1C) according to any one of configurations 1 to 8.

(構成10)
前記各第1学習画像(121)及び前記各追加用画像(123)はそれぞれ、複数のパッチ画像に分割され、
前記生成モデル(5)は、前記パッチ画像毎に与えられ、
前記学習部(11,111)は、前記パッチ画像毎に、機械学習により、前記1つ以上の第1学習画像(121)それぞれが与えられると、与えられた前記1つ以上の第1学習画像(121)それぞれに適合する復元画像を生成するように前記生成モデル(5)を訓練し、
前記生成部(11,113)は、前記パッチ画像毎に、前記各追加用画像(123)に対応する前記各復元追加用画像(124)を生成し、
前記評価部(11,114)は、前記パッチ画像毎に、前記各追加用画像(123)の前記評価値を算出し、
前記抽出部(11,115)は、前記パッチ画像毎に、算出された前記評価値に基づいて、前記1つ以上の追加用画像(126)を前記複数の追加用画像(123)から抽出し、
前記追加学習部(11,116)は、前記パッチ画像毎に、機械学習により、前記1つ以上の第2学習画像(126A)それぞれが与えられると、与えられた前記1つ以上の第2学習画像(126A)それぞれに適合する復元画像を生成するように前記生成モデル(5)を更に訓練する、
構成1から6のいずれかに記載の学習装置(1,1C)。
(Configuration 10)
Each of the first learning images (121) and each additional image (123) is divided into a plurality of patch images,
The generative model (5) is given for each patch image,
When each of the one or more first learning images (121) is given, the learning unit (11, 111) performs machine learning for each of the patch images to determine the one or more given first learning images. (121) training the generative model (5) to generate restored images that suit each;
The generation unit (11, 113) generates each restored additional image (124) corresponding to each additional image (123) for each patch image,
The evaluation unit (11, 114) calculates the evaluation value of each additional image (123) for each patch image,
The extraction unit (11, 115) extracts the one or more additional images (126) from the plurality of additional images (123) based on the calculated evaluation value for each patch image. ,
The additional learning unit (11, 116) performs machine learning for each of the patch images, when each of the one or more second learning images (126A) is given, the one or more given second learning images. further training the generative model (5) to generate restored images that match each of the images (126A);
The learning device (1, 1C) according to any one of configurations 1 to 6.

(構成11)
前記生成モデル(5)は、ニューラルネットワークにより構成される、
構成1から10のいずれかに記載の学習装置。
(Configuration 11)
The generative model (5) is configured by a neural network.
The learning device according to any one of configurations 1 to 10.

(構成12)
前記機械学習は、主成分分析を含み、
前記生成モデル(5)は、前記主成分分析により導出された固有ベクトルにより構成される、
構成1から10のいずれかに記載の学習装置(1,1C)。
(Configuration 12)
The machine learning includes principal component analysis,
The generative model (5) is composed of eigenvectors derived by the principal component analysis,
The learning device (1, 1C) according to any one of Configurations 1 to 10.

(構成13)
前記所定の特徴は、製造ラインで搬送される製品であって、欠陥を含まない製品である、
構成1から12のいずれかに記載の学習装置(1,1C)。
(Configuration 13)
The predetermined characteristic is a product transported on a production line that does not contain defects;
The learning device (1, 1C) according to any one of configurations 1 to 12.

(構成14)
前記所定の特徴を観測することで得られた観測画像(221)を取得する取得部(21)と、
構成1から13のいずれかに記載の学習装置(1,1C)により訓練された前記生成モデル(5)に前記観測画像(221)を入力することで、前記観測画像(221)に対応する復元観測画像(223)を生成する生成部(22)と、
生成された前記復元観測画像(223)及び前記観測画像(221)の間の差分に基づいて、前記所定の特徴以外の他の特徴が前記観測画像(221)に写っているか否かを検出する検出部(23)と、
を備える、
検出装置(2)。
(Configuration 14)
an acquisition unit (21) that acquires an observation image (221) obtained by observing the predetermined characteristics;
By inputting the observed image (221) to the generative model (5) trained by the learning device (1, 1C) according to any one of configurations 1 to 13, the observed image (221) is restored corresponding to the observed image (221). a generation unit (22) that generates an observation image (223);
Based on the difference between the generated restored observation image (223) and the observation image (221), it is detected whether features other than the predetermined features are included in the observation image (221). a detection section (23);
Equipped with
Detection device (2).

(構成15)
所定の特徴の写る1つ以上の第1学習画像(121)を使用した機械学習により訓練された生成モデル(5)を取得するモデル取得部(11,111B)であって、
生成モデル(5)は、画像が与えられると、与えられた画像を特徴量に変換し、前記特徴量から与えられた前記画像を復元した画像を生成するように構成され、
前記機械学習により、前記生成モデル(5)は、前記1つ以上の第1学習画像(121)それぞれが与えられると、与えられた前記1つ以上の第1学習画像(121)それぞれに適合する復元画像を生成するように訓練されている、
モデル取得部(11,111B)と、
前記所定の特徴の写る複数の追加用画像(123)を取得する画像取得部(11,112)と、
前記複数の追加用画像(123)それぞれを前記生成モデル(5)に与えることで、前記複数の追加用画像(123)それぞれを復元した複数の復元追加用画像(124)それぞれを生成する生成部(11,113)と、
前記各追加用画像(123)及び前記各復元追加用画像(124)の間の差分に応じて、前記各追加用画像(124)の評価値であって、前記各復元追加用画像(124)における前記各追加用画像(124)の復元の程度に対する評価値を算出する評価部(11,114)と、
前記評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像(126)を前記複数の追加用画像(123)から抽出する抽出部(11,115)と、
機械学習により、抽出された前記1つ以上の追加用画像(126)に含まれる1つ以上の第2学習画像(126A)それぞれが与えられると、与えられた前記1つ以上の第2学習画像(126A)それぞれに適合する復元画像を生成するように前記生成モデル(5)を更に訓練する追加学習部(11,116)と、
を備える、
学習装置(11B)。
(Configuration 15)
A model acquisition unit (11, 111B) that acquires a generative model (5) trained by machine learning using one or more first learning images (121) in which predetermined features are captured,
The generative model (5) is configured to, when an image is given, convert the given image into a feature amount, and generate an image that restores the given image from the feature amount,
Through the machine learning, when each of the one or more first learning images (121) is given, the generative model (5) adapts to each of the one or more given first learning images (121). trained to generate reconstructed images,
A model acquisition unit (11, 111B),
an image acquisition unit (11, 112) that acquires a plurality of additional images (123) showing the predetermined characteristics;
a generation unit that generates each of a plurality of restored additional images (124) obtained by restoring each of the plurality of additional images (123) by supplying each of the plurality of additional images (123) to the generation model (5); (11,113) and
An evaluation value of each additional image (124) according to the difference between each additional image (123) and each restored additional image (124), which is an evaluation value of each additional restored image (124). an evaluation unit (11, 114) that calculates an evaluation value for the degree of restoration of each of the additional images (124);
an extraction unit (11, 115) that extracts one or more additional images (126) that are evaluated as having a low degree of restoration from the plurality of additional images (123) based on the evaluation value;
When each of the one or more second learning images (126A) included in the one or more extracted additional images (126) is given by machine learning, the one or more given second learning images (126A) an additional learning unit (11, 116) that further trains the generative model (5) to generate a restored image that fits each;
Equipped with
Learning device (11B).

(構成16)
コンピュータが、
所定の特徴の写る1つ以上の第1学習画像(121)を取得するステップと、
前記1つ以上の第1学習画像(121)を使用して、生成モデル(5)の機械学習を実施するステップであって、
生成モデル(5)は、画像が与えられると、与えられた画像を特徴量に変換し、前記特徴量から与えられた前記画像を復元した画像を生成するように構成され、
前記機械学習により、前記1つ以上の第1学習画像(121)それぞれが与えられると、与えられた前記1つ以上の第1学習画像(121)それぞれに適合する復元画像を生成するように前記生成モデル(5)を訓練する、
ステップと、
前記所定の特徴の写る複数の追加用画像(123)を取得するステップと、
前記複数の追加用画像(123)それぞれを前記生成モデル(5)に与えることで、前記複数の追加用画像(123)それぞれを復元した複数の復元追加用画像(124)それぞれを生成するステップと、
前記各追加用画像(123)及び前記各復元追加用画像(124)の間の差分に応じて、前記各追加用画像(123)の評価値であって、前記各復元追加用画像(124)における前記各追加用画像(123)の復元の程度に対する評価値を算出するステップと、
前記評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像(126)を前記複数の追加用画像(123)から抽出するステップと、
機械学習により、抽出された前記1つ以上の追加用画像(126)に含まれる1つ以上の第2学習画像(126A)それぞれが与えられると、与えられた前記1つ以上の第2学習画像(126A)それぞれに適合する復元画像を生成するように前記生成モデル(5)を更に訓練するステップと、
を実行する、
学習方法。
(Configuration 16)
The computer is
a step of acquiring one or more first learning images (121) in which predetermined features are captured;
performing machine learning of the generative model (5) using the one or more first learning images (121),
The generative model (5) is configured to, when an image is given, convert the given image into a feature amount, and generate an image that restores the given image from the feature amount,
By the machine learning, when each of the one or more first learning images (121) is given, the machine learning generates a restored image that matches each of the one or more given first learning images (121). training the generative model (5);
step and
acquiring a plurality of additional images (123) showing the predetermined characteristics;
generating each of a plurality of restored additional images (124) obtained by restoring each of the plurality of additional images (123) by supplying each of the plurality of additional images (123) to the generation model (5); ,
An evaluation value of each additional image (123) according to the difference between each additional image (123) and each restored additional image (124), which is an evaluation value of each additional restored image (124). calculating an evaluation value for the degree of restoration of each of the additional images (123);
extracting one or more additional images (126) that are evaluated as having a low degree of restoration from the plurality of additional images (123) based on the evaluation value;
When each of the one or more second learning images (126A) included in the one or more extracted additional images (126) is given by machine learning, the one or more given second learning images (126A) further training the generative model (5) to generate restored images that fit each;
execute,
How to learn.

(構成17)
コンピュータに、
所定の特徴の写る1つ以上の第1学習画像(121)を取得するステップと、
前記1つ以上の第1学習画像(121)を使用して、生成モデル(5)の機械学習を実施するステップであって、
生成モデル(5)は、画像が与えられると、与えられた画像を特徴量に変換し、前記特徴量から与えられた前記画像を復元した画像を生成するように構成され、
前記機械学習により、前記1つ以上の第1学習画像(121)それぞれが与えられると、与えられた前記1つ以上の第1学習画像(121)それぞれに適合する復元画像を生成するように前記生成モデル(5)を訓練する、
ステップと、
前記所定の特徴の写る複数の追加用画像(123)を取得するステップと、
前記複数の追加用画像(123)それぞれを前記生成モデル(5)に与えることで、前記複数の追加用画像(123)それぞれを復元した複数の復元追加用画像(124)それぞれを生成するステップと、
前記各追加用画像(123)及び前記各復元追加用画像(124)の間の差分に応じて、前記各追加用画像(123)の評価値であって、前記各復元追加用画像(124)における前記各追加用画像(123)の復元の程度に対する評価値を算出するステップと、
前記評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像(126)を前記複数の追加用画像(123)から抽出するステップと、
機械学習により、抽出された前記1つ以上の追加用画像(126)に含まれる1つ以上の第2学習画像(126A)それぞれが与えられると、与えられた前記1つ以上の第2学習画像(126A)それぞれに適合する復元画像を生成するように前記生成モデル(5)を更に訓練するステップと、
を実行させるための、
学習プログラム。
(Configuration 17)
to the computer,
a step of acquiring one or more first learning images (121) in which predetermined features are captured;
performing machine learning of the generative model (5) using the one or more first learning images (121),
The generative model (5) is configured to, when an image is given, convert the given image into a feature amount, and generate an image that restores the given image from the feature amount,
By the machine learning, when each of the one or more first learning images (121) is given, the machine learning generates a restored image that matches each of the one or more given first learning images (121). training the generative model (5);
step and
acquiring a plurality of additional images (123) showing the predetermined characteristics;
generating each of a plurality of restored additional images (124) obtained by restoring each of the plurality of additional images (123) by supplying each of the plurality of additional images (123) to the generation model (5); ,
An evaluation value of each additional image (123) according to the difference between each additional image (123) and each restored additional image (124), which is an evaluation value of each additional restored image (124). calculating an evaluation value for the degree of restoration of each of the additional images (123);
extracting one or more additional images (126) that are evaluated as having a low degree of restoration from the plurality of additional images (123) based on the evaluation value;
When each of the one or more second learning images (126A) included in the one or more extracted additional images (126) is given by machine learning, the one or more given second learning images (126A) further training the generative model (5) to generate restored images that fit each;
In order to execute
learning program.

本発明の実施の形態について説明したが、今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 Although the embodiments of the present invention have been described, the embodiments disclosed this time should be considered to be illustrative in all respects and not restrictive. The scope of the present invention is indicated by the claims, and it is intended that all changes within the meaning and range equivalent to the claims are included.

1,1B,1C 学習装置、2 検出装置、5 生成モデル、11,21 制御部、12,22 記憶部、13,23 通信インタフェース、14,24 入力装置、15,25 表示装置、16,26 ドライブ、27 外部インタフェース、51 入力層、52 中間層、53 出力層、60,61 検出パラメータ候補、65 (2値化の)閾値,66 (判定の)閾値、70 表示画面、71,73 ラジオボタン、72,74 入力欄、75,78~81,90,400~402 領域、76 サムネイル画像、77 カーソル、82~89 ボタン、91,92 記憶媒体、100 検出システム、110 第1取得部、111 学習部、111B モデル取得部、112 第2取得部、113 生成部、114 評価部、115 抽出部、116 追加学習部、117,117C 第3取得部、118 表示制御部、119 選択受付部、120 学習プログラム、121 第1学習画像、123 追加用画像、124 復元追加用画像、125 評価値、126 (抽出された)追加用画像、126A 第2学習画像、127 評価画像、127A 第1評価画像、127B 第2評価画像、128 復元評価画像、128A 第1復元評価画像、128B 第2復元評価画像、129 学習結果データ、182,183,183A,183B,225 差分画像、211 取得部、212 生成部、213 検出部、214 出力部、220 検出プログラム、221 観測画像、223 復元観測画像、405,406 操作ボタン、1110 保存処理部、CA カメラ、I10 画像、I11 復元画像、I12 差分画像、I13 二値化画像、I14 検出画像、L 欠陥、M 演算パラメータ、P1,P2,P3,P4 パッチ画像、R 製品。 1, 1B, 1C learning device, 2 detection device, 5 generation model, 11, 21 control unit, 12, 22 storage unit, 13, 23 communication interface, 14, 24 input device, 15, 25 display device, 16, 26 drive , 27 external interface, 51 input layer, 52 intermediate layer, 53 output layer, 60, 61 detection parameter candidate, 65 (binarization) threshold, 66 (judgment) threshold, 70 display screen, 71, 73 radio button, 72, 74 input field, 75, 78-81, 90, 400-402 area, 76 thumbnail image, 77 cursor, 82-89 button, 91, 92 storage medium, 100 detection system, 110 first acquisition section, 111 learning section , 111B model acquisition unit, 112 second acquisition unit, 113 generation unit, 114 evaluation unit, 115 extraction unit, 116 additional learning unit, 117, 117C third acquisition unit, 118 display control unit, 119 selection reception unit, 120 learning program , 121 first learning image, 123 image for addition, 124 image for restoration and addition, 125 evaluation value, 126 (extracted) image for addition, 126A second learning image, 127 evaluation image, 127A first evaluation image, 127B 2 evaluation image, 128 restoration evaluation image, 128A first restoration evaluation image, 128B second restoration evaluation image, 129 learning result data, 182, 183, 183A, 183B, 225 difference image, 211 acquisition unit, 212 generation unit, 213 detection section, 214 output section, 220 detection program, 221 observation image, 223 restored observation image, 405, 406 operation button, 1110 storage processing section, CA camera, I10 image, I11 restored image, I12 difference image, I13 binarized image, I14 Detection image, L defect, M calculation parameter, P1, P2, P3, P4 patch image, R product.

Claims (16)

所定の特徴の写る1つ以上の第1学習画像を取得する第1取得部と、
前記1つ以上の第1学習画像を使用して、生成モデルの機械学習を実施する学習部であって、
生成モデルは、画像が与えられると、与えられた画像を特徴量に変換し、前記特徴量から与えられた前記画像を復元した画像を生成するように構成され、
前記機械学習により、前記1つ以上の第1学習画像それぞれが与えられると、与えられた前記1つ以上の第1学習画像それぞれに適合する復元画像を生成するように前記生成モデルを訓練する、
学習部と、
前記所定の特徴の写る複数の追加用画像を取得する第2取得部と、
前記複数の追加用画像それぞれを前記生成モデルに与えることで、前記複数の追加用画像それぞれを復元した複数の復元追加用画像それぞれを生成する生成部と、
前記各追加用画像及び前記各復元追加用画像の間の差分に応じて、前記各追加用画像の評価値であって、前記各復元追加用画像における前記各追加用画像の復元の程度に対する評価値を算出する評価部と、
前記評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像を前記複数の追加用画像から抽出する抽出部と、
機械学習により、抽出された前記1つ以上の追加用画像に含まれる1つ以上の第2学習画像それぞれが与えられると、与えられた前記1つ以上の第2学習画像それぞれに適合する復元画像を生成するように前記生成モデルを更に訓練する追加学習部と、
前記所定の特徴及び前記所定の特徴以外の他の特徴の写る複数の評価画像を取得する第3取得部とを備え、
前記複数の追加用画像には前記他の特徴が写っておらず、
前記生成部は、取得された前記複数の評価画像それぞれを訓練された前記生成モデルに与えることで、前記複数の評価画像それぞれを復元した複数の復元評価画像それぞれを更に生成し、
前記評価部は、更に、
前記各追加用画像と生成された前記各復元追加用画像との差分の程度に基づいて、前記他の特徴が前記各追加用画像に写っているか否かを判定し、及び
前記各評価画像と生成された前記各復元評価画像との差分の程度に基づいて、前記他の特徴が前記各評価画像に写っているか否かを判定し、
前記評価部は、前記複数の追加用画像のうち、前記他の特徴が写っていると判定された追加用画像の数又は割合が第1の閾値以上である、又は、前記複数の評価画像のうち、前記他の特徴が写っていないと判定された評価画像の数又は割合が第2の閾値以上である場合に、前記他の特徴が写っていると判定された1又は複数の追加用画像について、前記評価値を算出し、
前記抽出部は、算出された前記評価値に基づいて、前記他の特徴が写っていると判定された前記1又は複数の追加用画像のうち、復元の程度が低いと評価される画像を前記1つ以上の追加用画像として抽出する、
学習装置。
a first acquisition unit that acquires one or more first learning images showing predetermined features;
A learning unit that performs machine learning of a generative model using the one or more first learning images,
The generative model is configured to, when an image is given, convert the given image into a feature amount, and generate an image that restores the given image from the feature amount,
Training the generative model by the machine learning so that, when each of the one or more first learning images is given, a restored image matching each of the one or more given first learning images is generated;
Learning department and
a second acquisition unit that acquires a plurality of additional images showing the predetermined characteristics;
a generation unit that generates each of a plurality of restored and additional images obtained by restoring each of the plurality of additional images by supplying each of the plurality of additional images to the generation model;
An evaluation value of each additional image according to the difference between each additional image and each restored additional image, which is an evaluation of the degree of restoration of each additional image in each restored additional image. an evaluation section that calculates a value;
an extraction unit that extracts one or more additional images that are evaluated as having a low degree of restoration from the plurality of additional images based on the evaluation value;
By machine learning, when each of the one or more second learning images included in the one or more extracted additional images is given, a restored image that matches each of the one or more given second learning images is generated. an additional learning unit that further trains the generative model to generate
a third acquisition unit that acquires a plurality of evaluation images showing the predetermined feature and other features other than the predetermined feature;
The other features are not included in the plurality of additional images;
The generation unit further generates each of a plurality of restored evaluation images obtained by restoring each of the plurality of evaluation images by giving each of the acquired evaluation images to the trained generation model,
The evaluation unit further includes:
Determining whether or not the other feature is reflected in each of the additional images based on the degree of difference between each of the additional images and the generated restored and additional images, and
Determining whether or not the other feature is reflected in each of the evaluation images based on the degree of difference between each of the evaluation images and each of the generated restored evaluation images;
The evaluation unit is configured to determine whether, among the plurality of additional images, the number or proportion of additional images determined to include the other features is equal to or higher than a first threshold, or the Among them, if the number or proportion of evaluation images determined not to include the other feature is equal to or higher than the second threshold, one or more additional images determined to include the other feature. Calculate the evaluation value for
The extraction unit selects an image that is evaluated to have a low degree of restoration from among the one or more additional images determined to include the other features based on the calculated evaluation value. Extract as one or more additional images,
learning device.
前記差分に応じて前記評価値を算出することは、
前記複数の追加用画像それぞれと前記複数の復元追加用画像それぞれとの間の差分を示す複数の差分画像それぞれを生成し、
前記各差分画像において、各画素の画素値が大きいほど前記評価値が高くなり、かつ、基準画素値以上の画素の前記評価値に与える寄与度が前記基準画素値未満の画素の前記評価値に与える寄与度よりも大きくなるように、前記評価値を算出すること、
により構成される、
請求項1に記載の学習装置。
Calculating the evaluation value according to the difference includes:
generating each of a plurality of difference images indicating the difference between each of the plurality of additional images and each of the plurality of restored and additional images;
In each of the difference images, the larger the pixel value of each pixel is, the higher the evaluation value is, and the contribution of pixels having a reference pixel value or more to the evaluation value is greater than the evaluation value of pixels less than the reference pixel value. Calculating the evaluation value so that it is larger than the contribution given;
Consisting of
The learning device according to claim 1.
抽出された前記1つ以上の追加用画像それぞれを表示装置に表示させる表示制御部を更に備える、
請求項1又は2に記載の学習装置。
further comprising a display control unit that causes a display device to display each of the one or more extracted additional images;
The learning device according to claim 1 or 2.
前記表示装置に表示された前記1つ以上の追加用画像それぞれについて、当該1つ以上の追加用画像それぞれを機械学習に使用するか否かの選択を受け付ける選択受付部を更に備え、
追加学習部は、前記機械学習に使用すると選択された追加用画像を前記1つ以上の第2学習画像として決定する、
請求項3に記載の学習装置。
For each of the one or more additional images displayed on the display device, the method further includes a selection reception unit that accepts a selection as to whether or not to use each of the one or more additional images for machine learning,
The additional learning unit determines the additional image selected to be used for the machine learning as the one or more second learning images.
The learning device according to claim 3.
前記他の特徴が前記各追加用画像に写っているか否か、及び前記他の特徴が前記各評価画像に写っているか否かを判定するための複数のパラメータ候補が与えられ、
前記評価部は、
前記複数のパラメータ候補それぞれを利用して、前記他の特徴が前記各追加用画像に写っているか否かの判定、及び前記他の特徴が前記各評価画像に写っているか否かの判定を実行し、
前記各判定の結果に基づいて、前記他の特徴が画像に写っているか否かを判定するためのパラメータの最適化を実行し、及び
最適化されたパラメータを利用した前記各判定の結果において、前記他の特徴が写っていると判定された追加用画像の数又は割合が前記第1の閾値以上である、又は前記他の特徴が写っていないと判定された評価画像の数又は割合が前記第2の閾値以上である場合に、前記他の特徴が写っていると判定された1又は複数の追加用画像について、前記評価値を算出する、
請求項1から4のいずれか1項に記載の学習装置。
A plurality of parameter candidates are provided for determining whether or not the other features are shown in each of the additional images and whether or not the other features are shown in each of the evaluation images,
The evaluation department is
Using each of the plurality of parameter candidates, determine whether or not the other feature is depicted in each of the additional images, and determine whether or not the other feature is depicted in each of the evaluation images. death,
Based on the results of each of the determinations, optimization of parameters for determining whether or not the other features are included in the image is performed, and in the results of each of the determinations using the optimized parameters, The number or percentage of additional images determined to include the other feature is equal to or greater than the first threshold, or the number or percentage of evaluation images determined not to include the other feature is the calculating the evaluation value for one or more additional images that are determined to include the other feature when the evaluation value is equal to or higher than a second threshold;
The learning device according to any one of claims 1 to 4 .
複数の第1評価画像と複数の第2評価画像とを取得する第3取得部を更に備え、
前記複数の第1評価画像には、前記所定の特徴及び前記所定の特徴以外の他の特徴が写り、
前記複数の第2評価画像には、前記所定の特徴が写り、前記他の特徴が写っておらず、
前記評価部は、
前記他の特徴が画像に写っているか否かを判定するための複数のパラメータ候補が与えられ、
前記複数のパラメータ候補それぞれを利用して、前記他の特徴が前記各第1評価画像に写っているか否かの判定、及び前記他の特徴が前記各第2評価画像に写っているか否かの判定を実行し、
前記各判定の結果に基づいて、前記他の特徴が画像に写っているか否かを判定するためのパラメータの最適化を実行し、
前記選択受付部は、前記表示装置に表示された前記1つ以上の追加用画像それぞれについて、前記他の特徴が写っているか否かの選択を更に受け付け、
前記第3取得部は、
前記他の特徴が写っていると選択された各追加用画像を前記複数の第1評価画像の1つとして取得し、
前記他の特徴が写っていないと選択された各追加用画像を前記複数の第2評価画像の1つとして取得する、
請求項4に記載の学習装置。
further comprising a third acquisition unit that acquires a plurality of first evaluation images and a plurality of second evaluation images,
The plurality of first evaluation images include the predetermined feature and features other than the predetermined feature,
The plurality of second evaluation images include the predetermined feature and do not include the other feature,
The evaluation department is
A plurality of parameter candidates are given for determining whether the other feature is included in the image,
Using each of the plurality of parameter candidates, determining whether or not the other feature is depicted in each of the first evaluation images, and determining whether or not the other feature is depicted in each of the second evaluation images. perform the judgment,
Based on the results of each of the determinations, optimizing parameters for determining whether the other features are included in the image;
The selection accepting unit further accepts a selection as to whether or not the other feature is included in each of the one or more additional images displayed on the display device,
The third acquisition unit is
acquiring each additional image selected as showing the other features as one of the plurality of first evaluation images;
acquiring each additional image selected as not showing the other features as one of the plurality of second evaluation images;
The learning device according to claim 4.
前記第2取得部は、検出装置と通信し、
前記検出装置は、
前記所定の特徴を観測することで得られた観測画像を取得し、
前記生成モデルに前記観測画像を入力することで、前記観測画像に対応する復元観測画像を生成し、
生成された前記復元観測画像及び前記観測画像の間の差分に基づいて、前記所定の特徴以外の他の特徴が前記観測画像に写っているか否かを検出し、
前記第2取得部は、前記検出装置によって取得された前記観測画像を前記複数の追加用画像の1つとして取得する、
請求項4又はに記載の学習装置。
The second acquisition unit communicates with a detection device,
The detection device includes:
Obtaining an observation image obtained by observing the predetermined features,
generating a restored observation image corresponding to the observation image by inputting the observation image to the generative model;
Based on the difference between the generated restored observation image and the observation image, detecting whether or not other features other than the predetermined feature appear in the observation image;
The second acquisition unit acquires the observation image acquired by the detection device as one of the plurality of additional images.
The learning device according to claim 4 or 6 .
前記複数の追加用画像のうち、前記抽出部によって抽出された前記1つ以上の追加用画像を記憶部に保存する保存処理部を更に備える、
請求項1からのいずれか1項に記載の学習装置。
further comprising a storage processing unit that stores the one or more additional images extracted by the extraction unit among the plurality of additional images in a storage unit;
The learning device according to any one of claims 1 to 7 .
前記各第1学習画像及び前記各追加用画像はそれぞれ、複数のパッチ画像に分割され、
前記生成モデルは、前記パッチ画像毎に与えられ、
前記学習部は、前記パッチ画像毎に、機械学習により、前記1つ以上の第1学習画像それぞれが与えられると、与えられた前記1つ以上の第1学習画像それぞれに適合する復元画像を生成するように前記生成モデルを訓練し、
前記生成部は、前記パッチ画像毎に、前記各追加用画像に対応する前記各復元追加用画像を生成し、
前記評価部は、前記パッチ画像毎に、前記各追加用画像の前記評価値を算出し、
前記抽出部は、前記パッチ画像毎に、算出された前記評価値に基づいて、前記1つ以上の追加用画像を前記複数の追加用画像から抽出し、
前記追加学習部は、前記パッチ画像毎に、機械学習により、前記1つ以上の第2学習画像それぞれが与えられると、与えられた前記1つ以上の第2学習画像それぞれに適合する復元画像を生成するように前記生成モデルを更に訓練する、
請求項1からのいずれか1項に記載の学習装置。
Each of the first learning images and each additional image is divided into a plurality of patch images,
The generative model is given for each patch image,
The learning unit generates a restored image that matches each of the one or more given first learning images by machine learning for each of the patch images, when each of the one or more first learning images is given. training the generative model to
The generation unit generates each restored additional image corresponding to each additional image for each patch image,
The evaluation unit calculates the evaluation value of each additional image for each patch image,
The extraction unit extracts the one or more additional images from the plurality of additional images based on the calculated evaluation value for each patch image,
For each of the patch images, when each of the one or more second learning images is given, the additional learning unit generates a restored image that matches each of the one or more given second learning images by machine learning. further training the generative model to generate;
The learning device according to any one of claims 1 to 5 .
前記生成モデルは、ニューラルネットワークにより構成される、
請求項1からのいずれか1項に記載の学習装置。
The generative model is configured by a neural network,
The learning device according to any one of claims 1 to 9 .
前記機械学習は、主成分分析を含み、
前記生成モデルは、前記主成分分析により導出された固有ベクトルにより構成される、請求項1からのいずれか1項に記載の学習装置。
The machine learning includes principal component analysis,
The learning device according to any one of claims 1 to 9 , wherein the generative model is composed of eigenvectors derived by the principal component analysis.
前記所定の特徴は、製造ラインで搬送される製品であって、欠陥を含まない製品である、
請求項1から11のいずれか1項に記載の学習装置。
The predetermined characteristic is a product transported on a production line that does not contain defects;
The learning device according to any one of claims 1 to 11 .
前記所定の特徴を観測することで得られた観測画像を取得する取得部と、
請求項1から12のいずれか1項に記載の学習装置により訓練された前記生成モデルに前記観測画像を入力することで、前記観測画像に対応する復元観測画像を生成する生成部と、
生成された前記復元観測画像及び前記観測画像の間の差分に基づいて、前記所定の特徴以外の他の特徴が前記観測画像に写っているか否かを検出する検出部と、
を備える、
検出装置。
an acquisition unit that acquires an observation image obtained by observing the predetermined feature;
a generation unit that generates a restored observed image corresponding to the observed image by inputting the observed image to the generative model trained by the learning device according to claim 1 ;
a detection unit that detects whether a feature other than the predetermined feature is included in the observation image based on a difference between the generated restored observation image and the observation image;
Equipped with
Detection device.
所定の特徴の写る1つ以上の第1学習画像を使用した機械学習により訓練された生成モデルを取得するモデル取得部であって、
生成モデルは、画像が与えられると、与えられた画像を特徴量に変換し、前記特徴量から与えられた前記画像を復元した画像を生成するように構成され、
前記機械学習により、前記生成モデルは、前記1つ以上の第1学習画像それぞれが与えられると、与えられた前記1つ以上の第1学習画像それぞれに適合する復元画像を生成するように訓練されている、
モデル取得部と、
前記所定の特徴の写る複数の追加用画像を取得する第1画像取得部と、
前記複数の追加用画像それぞれを前記生成モデルに与えることで、前記複数の追加用画像それぞれを復元した複数の復元追加用画像それぞれを生成する生成部と、
前記各追加用画像及び前記各復元追加用画像の間の差分に応じて、前記各追加用画像の評価値であって、前記各復元追加用画像における前記各追加用画像の復元の程度に対する評価値を算出する評価部と、
前記評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像を前記複数の追加用画像から抽出する抽出部と、
機械学習により、抽出された前記1つ以上の追加用画像に含まれる1つ以上の第2学習画像それぞれが与えられると、与えられた前記1つ以上の第2学習画像それぞれに適合する復元画像を生成するように前記生成モデルを更に訓練する追加学習部と、
前記所定の特徴及び前記所定の特徴以外の他の特徴の写る複数の評価画像を取得する第2画像取得部とを備え、
前記複数の追加用画像には前記他の特徴が写っておらず、
前記生成部は、取得された前記複数の評価画像それぞれを訓練された前記生成モデルに与えることで、前記複数の評価画像それぞれを復元した複数の復元評価画像それぞれを更に生成し、
前記評価部は、更に、
前記各追加用画像と生成された前記各復元追加用画像との差分の程度に基づいて、前記他の特徴が前記各追加用画像に写っているか否かを判定し、及び
前記各評価画像と生成された前記各復元評価画像との差分の程度に基づいて、前記他の特徴が前記各評価画像に写っているか否かを判定し、
前記評価部は、前記複数の追加用画像のうち、前記他の特徴が写っていると判定された追加用画像の数又は割合が第1の閾値以上である、又は、前記複数の評価画像のうち、前記他の特徴が写っていないと判定された評価画像の数又は割合が第2の閾値以上である場合に、前記他の特徴が写っていると判定された1又は複数の追加用画像について、前記評価値を算出し、
前記抽出部は、算出された前記評価値に基づいて、前記他の特徴が写っていると判定された前記1又は複数の追加用画像のうち、復元の程度が低いと評価される画像を前記1つ以上の追加用画像として抽出する、
学習装置。
A model acquisition unit that acquires a generative model trained by machine learning using one or more first learning images in which predetermined features are captured,
The generative model is configured to, when an image is given, convert the given image into a feature amount, and generate an image that restores the given image from the feature amount,
Through the machine learning, the generative model is trained to, when each of the one or more first learning images is given, generate a restored image that matches each of the one or more given first learning images. ing,
a model acquisition section;
a first image acquisition unit that acquires a plurality of additional images showing the predetermined characteristics;
a generation unit that generates each of a plurality of restored and additional images obtained by restoring each of the plurality of additional images by supplying each of the plurality of additional images to the generation model;
An evaluation value of each additional image according to the difference between each additional image and each restored additional image, which is an evaluation of the degree of restoration of each additional image in each restored additional image. an evaluation section that calculates a value;
an extraction unit that extracts one or more additional images that are evaluated as having a low degree of restoration from the plurality of additional images based on the evaluation value;
By machine learning, when each of the one or more second learning images included in the one or more extracted additional images is given, a restored image that matches each of the one or more given second learning images is generated. an additional learning unit that further trains the generative model to generate
a second image acquisition unit that acquires a plurality of evaluation images showing the predetermined feature and other features other than the predetermined feature;
The other features are not included in the plurality of additional images;
The generation unit further generates each of a plurality of restored evaluation images obtained by restoring each of the plurality of evaluation images by giving each of the acquired evaluation images to the trained generation model,
The evaluation unit further includes:
Determining whether or not the other feature is reflected in each of the additional images based on the degree of difference between each of the additional images and the generated restored and additional images, and
Determining whether or not the other feature is reflected in each of the evaluation images based on the degree of difference between each of the evaluation images and each of the generated restored evaluation images;
The evaluation unit is configured to determine whether, among the plurality of additional images, the number or proportion of additional images determined to include the other features is equal to or higher than a first threshold, or the Among them, if the number or proportion of evaluation images determined not to include the other feature is equal to or higher than the second threshold, one or more additional images determined to include the other feature. Calculate the evaluation value for
The extraction unit selects an image that is evaluated to have a low degree of restoration from among the one or more additional images determined to include the other features based on the calculated evaluation value. Extract as one or more additional images,
learning device.
コンピュータが、
所定の特徴の写る1つ以上の第1学習画像を取得するステップと、
前記1つ以上の第1学習画像を使用して、生成モデルの機械学習を実施するステップであって、
生成モデルは、画像が与えられると、与えられた画像を特徴量に変換し、前記特徴量から与えられた前記画像を復元した画像を生成するように構成され、
前記機械学習により、前記1つ以上の第1学習画像それぞれが与えられると、与えられた前記1つ以上の第1学習画像それぞれに適合する復元画像を生成するように前記生成モデルを訓練する、
ステップと、
前記所定の特徴の写る複数の追加用画像を取得するステップと、
前記複数の追加用画像それぞれを前記生成モデルに与えることで、前記複数の追加用画像それぞれを復元した複数の復元追加用画像それぞれを生成するステップと、
前記各追加用画像及び前記各復元追加用画像の間の差分に応じて、前記各追加用画像の評価値であって、前記各復元追加用画像における前記各追加用画像の復元の程度に対する評価値を算出するステップと、
前記評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像を前記複数の追加用画像から抽出するステップと、
機械学習により、抽出された前記1つ以上の追加用画像に含まれる1つ以上の第2学習画像それぞれが与えられると、与えられた前記1つ以上の第2学習画像それぞれに適合する復元画像を生成するように前記生成モデルを更に訓練するステップと、
前記所定の特徴及び前記所定の特徴以外の他の特徴の写る複数の評価画像を取得するステップと、
を実行
前記複数の追加用画像には前記他の特徴が写っておらず、
前記生成するステップは、取得された前記複数の評価画像それぞれを訓練された前記生成モデルに与えることで、前記複数の評価画像それぞれを復元した複数の復元評価画像それぞれを更に生成するステップを含み、
前記算出するステップは、
前記各追加用画像と生成された前記各復元追加用画像との差分の程度に基づいて、前記他の特徴が前記各追加用画像に写っているか否かを判定するステップと、
前記各評価画像と生成された前記各復元評価画像との差分の程度に基づいて、前記他の特徴が前記各評価画像に写っているか否かを判定するステップと、
前記複数の追加用画像のうち、前記他の特徴が写っていると判定された追加用画像の数又は割合が第1の閾値以上である、又は、前記複数の評価画像のうち、前記他の特徴が写っていないと判定された評価画像の数又は割合が第2の閾値以上である場合に、前記他の特徴が写っていると判定された1又は複数の追加用画像について、前記評価値を算出するステップとを含み、
前記抽出するステップは、算出された前記評価値に基づいて、前記他の特徴が写っていると判定された前記1又は複数の追加用画像のうち、復元の程度が低いと評価される画像を前記1つ以上の追加用画像として抽出するステップを含む、
学習方法。
The computer is
obtaining one or more first learning images showing predetermined features;
performing machine learning of a generative model using the one or more first learning images, the step of:
The generative model is configured to, when an image is given, convert the given image into a feature amount, and generate an image that restores the given image from the feature amount,
Training the generative model by the machine learning so that, when each of the one or more first learning images is given, a restored image matching each of the one or more given first learning images is generated;
step and
acquiring a plurality of additional images showing the predetermined characteristics;
generating each of a plurality of restored additional images obtained by restoring each of the plurality of additional images by supplying each of the plurality of additional images to the generation model;
An evaluation value of each additional image according to the difference between each additional image and each restored additional image, which is an evaluation of the degree of restoration of each additional image in each restored additional image. a step of calculating a value;
extracting one or more additional images that are evaluated as having a low degree of restoration from the plurality of additional images based on the evaluation value;
By machine learning, when each of the one or more second learning images included in the one or more extracted additional images is given, a restored image that matches each of the one or more given second learning images is generated. further training the generative model to generate
acquiring a plurality of evaluation images showing the predetermined feature and features other than the predetermined feature;
Run
The other features are not included in the plurality of additional images;
The generating step includes a step of further generating each of a plurality of restored evaluation images obtained by restoring each of the plurality of evaluation images by giving each of the plurality of acquired evaluation images to the trained generation model,
The step of calculating is
determining whether or not the other feature is reflected in each of the additional images, based on the degree of difference between each of the additional images and the generated restored and additional images;
determining whether or not the other feature is reflected in each of the evaluation images based on the degree of difference between each of the evaluation images and each of the generated restored evaluation images;
Among the plurality of additional images, the number or proportion of additional images determined to include the other feature is equal to or higher than the first threshold, or among the plurality of evaluation images, the other If the number or proportion of evaluation images determined not to include the feature is equal to or higher than the second threshold, the evaluation value for one or more additional images determined to include the other feature. and a step of calculating
The extracting step includes selecting an image that is evaluated to have a low degree of restoration from among the one or more additional images determined to include the other features based on the calculated evaluation value. including the step of extracting the one or more additional images;
How to learn.
コンピュータに、
所定の特徴の写る1つ以上の第1学習画像を取得するステップと、
前記1つ以上の第1学習画像を使用して、生成モデルの機械学習を実施するステップであって、
生成モデルは、画像が与えられると、与えられた画像を特徴量に変換し、前記特徴量から与えられた前記画像を復元した画像を生成するように構成され、
前記機械学習により、前記1つ以上の第1学習画像それぞれが与えられると、与えられた前記1つ以上の第1学習画像それぞれに適合する復元画像を生成するように前記生成モデルを訓練する、
ステップと、
前記所定の特徴の写る複数の追加用画像を取得するステップと、
前記複数の追加用画像それぞれを前記生成モデルに与えることで、前記複数の追加用画像それぞれを復元した複数の復元追加用画像それぞれを生成するステップと、
前記各追加用画像及び前記各復元追加用画像の間の差分に応じて、前記各追加用画像の評価値であって、前記各復元追加用画像における前記各追加用画像の復元の程度に対する評価値を算出するステップと、
前記評価値に基づいて、復元の程度が低いと評価される1つ以上の追加用画像を前記複数の追加用画像から抽出するステップと、
機械学習により、抽出された前記1つ以上の追加用画像に含まれる1つ以上の第2学習画像それぞれが与えられると、与えられた前記1つ以上の第2学習画像それぞれに適合する復元画像を生成するように前記生成モデルを更に訓練するステップと、
前記所定の特徴及び前記所定の特徴以外の他の特徴の写る複数の評価画像を取得するステップと、
を実行させるための学習プログラムであって
前記複数の追加用画像には前記他の特徴が写っておらず、
前記生成するステップは、取得された前記複数の評価画像それぞれを訓練された前記生成モデルに与えることで、前記複数の評価画像それぞれを復元した複数の復元評価画像それぞれを更に生成するステップを含み、
前記算出するステップは、
前記各追加用画像と生成された前記各復元追加用画像との差分の程度に基づいて、前記他の特徴が前記各追加用画像に写っているか否かを判定するステップと、
前記各評価画像と生成された前記各復元評価画像との差分の程度に基づいて、前記他の特徴が前記各評価画像に写っているか否かを判定するステップと、
前記複数の追加用画像のうち、前記他の特徴が写っていると判定された追加用画像の数又は割合が第1の閾値以上である、又は、前記複数の評価画像のうち、前記他の特徴が写っていないと判定された評価画像の数又は割合が第2の閾値以上である場合に、前記他の特徴が写っていると判定された1又は複数の追加用画像について、前記評価値を算出するステップとを含み、
前記抽出するステップは、算出された前記評価値に基づいて、前記他の特徴が写っていると判定された前記1又は複数の追加用画像のうち、復元の程度が低いと評価される画像を前記1つ以上の追加用画像として抽出するステップを含む、
学習プログラム。
to the computer,
obtaining one or more first learning images showing predetermined features;
performing machine learning of a generative model using the one or more first learning images, the step of:
The generative model is configured to, when an image is given, convert the given image into a feature amount, and generate an image that restores the given image from the feature amount,
Training the generative model by the machine learning so that, when each of the one or more first learning images is given, a restored image matching each of the one or more given first learning images is generated;
step and
acquiring a plurality of additional images showing the predetermined characteristics;
generating each of a plurality of restored additional images obtained by restoring each of the plurality of additional images by supplying each of the plurality of additional images to the generation model;
An evaluation value of each additional image according to the difference between each additional image and each restored additional image, which is an evaluation of the degree of restoration of each additional image in each restored additional image. a step of calculating a value;
extracting one or more additional images that are evaluated as having a low degree of restoration from the plurality of additional images based on the evaluation value;
By machine learning, when each of the one or more second learning images included in the one or more extracted additional images is given, a restored image that matches each of the one or more given second learning images is generated. further training the generative model to generate
acquiring a plurality of evaluation images showing the predetermined feature and features other than the predetermined feature;
A learning program for executing
The other features are not included in the plurality of additional images;
The generating step includes a step of further generating each of a plurality of restored evaluation images obtained by restoring each of the plurality of evaluation images by giving each of the plurality of acquired evaluation images to the trained generation model,
The step of calculating is
determining whether or not the other feature is reflected in each of the additional images, based on the degree of difference between each of the additional images and the generated restored and additional images;
determining whether or not the other feature is reflected in each of the evaluation images based on the degree of difference between each of the evaluation images and each of the generated restored evaluation images;
Among the plurality of additional images, the number or proportion of additional images determined to include the other feature is equal to or higher than the first threshold, or among the plurality of evaluation images, the other If the number or proportion of evaluation images determined not to include the feature is equal to or higher than the second threshold, the evaluation value for one or more additional images determined to include the other feature. and a step of calculating
The extracting step includes selecting an image that is evaluated to have a low degree of restoration from among the one or more additional images determined to include the other features based on the calculated evaluation value. including the step of extracting the one or more additional images;
learning program.
JP2019214618A 2019-11-27 2019-11-27 Learning device, detection device, learning method, and learning program Active JP7404817B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019214618A JP7404817B2 (en) 2019-11-27 2019-11-27 Learning device, detection device, learning method, and learning program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019214618A JP7404817B2 (en) 2019-11-27 2019-11-27 Learning device, detection device, learning method, and learning program

Publications (2)

Publication Number Publication Date
JP2021086382A JP2021086382A (en) 2021-06-03
JP7404817B2 true JP7404817B2 (en) 2023-12-26

Family

ID=76087787

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019214618A Active JP7404817B2 (en) 2019-11-27 2019-11-27 Learning device, detection device, learning method, and learning program

Country Status (1)

Country Link
JP (1) JP7404817B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2024005710A (en) * 2022-06-30 2024-01-17 オムロン株式会社 Learning device, learning method, and program
JP2024021487A (en) * 2022-08-03 2024-02-16 JDI Design and Development 合同会社 Inspection method, inspection device and program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017219529A (en) 2016-06-07 2017-12-14 株式会社豊田中央研究所 Appearance abnormality inspection device, method, and program
JP2017224184A (en) 2016-06-16 2017-12-21 株式会社日立製作所 Machine learning device
JP2018205163A (en) 2017-06-06 2018-12-27 株式会社デンソー Visual inspection device, conversion data generator, and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017219529A (en) 2016-06-07 2017-12-14 株式会社豊田中央研究所 Appearance abnormality inspection device, method, and program
JP2017224184A (en) 2016-06-16 2017-12-21 株式会社日立製作所 Machine learning device
JP2018205163A (en) 2017-06-06 2018-12-27 株式会社デンソー Visual inspection device, conversion data generator, and program

Also Published As

Publication number Publication date
JP2021086382A (en) 2021-06-03

Similar Documents

Publication Publication Date Title
CN110945528B (en) Method for generating training set for inspecting semiconductor sample and system thereof
US11947890B2 (en) Implementation of deep neural networks for testing and quality control in the production of memory devices
US7602962B2 (en) Method of classifying defects using multiple inspection machines
CN108562589B (en) Method for detecting surface defects of magnetic circuit material
CN113095438B (en) Wafer defect classification method, device and system thereof, electronic equipment and storage medium
EP2302583B1 (en) Image segmentation
CN112967243A (en) Deep learning chip packaging crack defect detection method based on YOLO
US20220269996A1 (en) Information processing apparatus, information processing method, and storage medium
JP7058941B2 (en) Dictionary generator, dictionary generation method, and program
JP2012026982A (en) Inspection device
KR102530950B1 (en) Classification of Defects in Semiconductor Specimens
US20230288345A1 (en) Automatic optimization of an examination recipe
JPWO2019026104A1 (en) Information processing apparatus, information processing program, and information processing method
JP7404817B2 (en) Learning device, detection device, learning method, and learning program
US20230222645A1 (en) Inspection apparatus, unit selection apparatus, inspection method, and computer-readable storage medium storing an inspection program
US20210004721A1 (en) Inspection system, discrimination system, and learning data generation device
CN114862832A (en) Method, device and equipment for optimizing defect detection model and storage medium
JP2022027473A (en) Generation of training data usable for inspection of semiconductor sample
CN115362445A (en) Data sorting device, data sorting method, and data sorting program
JP7059889B2 (en) Learning device, image generator, learning method, and learning program
Nayak et al. Fruit recognition using image processing
TW202331238A (en) Method and apparatus for automated defect detection
CN114998889A (en) Intelligent identification method and system for immersive three-dimensional image
Liu et al. Investigation on automated visual SMD-PCB inspection based on multimodal one-class novelty detection
WO2022196433A1 (en) Model generation device, sorting device, data generation device, model generation method, and model generation program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220907

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230713

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230718

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230914

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20231114

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20231127

R150 Certificate of patent or registration of utility model

Ref document number: 7404817

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150