JP7404817B2 - Learning device, detection device, learning method, and learning program - Google Patents
Learning device, detection device, learning method, and learning program Download PDFInfo
- 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
Links
- 238000001514 detection method Methods 0.000 title claims description 247
- 238000000034 method Methods 0.000 title claims description 228
- 238000011156 evaluation Methods 0.000 claims description 532
- 230000007547 defect Effects 0.000 claims description 218
- 238000010801 machine learning Methods 0.000 claims description 178
- 238000003860 storage Methods 0.000 claims description 100
- 238000012545 processing Methods 0.000 claims description 82
- 238000012549 training Methods 0.000 claims description 52
- 238000013528 artificial neural network Methods 0.000 claims description 39
- 239000000284 extract Substances 0.000 claims description 34
- 238000000605 extraction Methods 0.000 claims description 28
- 238000004519 manufacturing process Methods 0.000 claims description 23
- 238000000513 principal component analysis Methods 0.000 claims description 11
- 238000005457 optimization Methods 0.000 claims description 4
- 239000000047 product Substances 0.000 description 200
- 230000008569 process Effects 0.000 description 177
- 230000002950 deficient Effects 0.000 description 74
- 230000004048 modification Effects 0.000 description 38
- 238000012986 modification Methods 0.000 description 38
- 238000004364 calculation method Methods 0.000 description 30
- 210000002569 neuron Anatomy 0.000 description 28
- 238000010586 diagram Methods 0.000 description 27
- 238000004891 communication Methods 0.000 description 23
- 230000010365 information processing Effects 0.000 description 12
- 238000006243 chemical reaction Methods 0.000 description 9
- 230000006872 improvement Effects 0.000 description 9
- 239000011159 matrix material Substances 0.000 description 7
- 230000004044 response Effects 0.000 description 7
- 238000011179 visual inspection Methods 0.000 description 6
- 230000008859 change Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 5
- 239000003814 drug Substances 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000011109 contamination Methods 0.000 description 3
- 238000011478 gradient descent method Methods 0.000 description 3
- 238000007689 inspection Methods 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 239000003990 capacitor Substances 0.000 description 2
- 229940079593 drug Drugs 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 239000012467 final product Substances 0.000 description 2
- 239000013067 intermediate product Substances 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 239000000126 substance Substances 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000032258 transport Effects 0.000 description 2
- 238000004804 winding Methods 0.000 description 2
- 240000001973 Ficus microcarpa Species 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 230000002542 deteriorative effect Effects 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000010304 firing Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000003550 marker Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000011176 pooling Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 238000010187 selection method Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
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
非特許文献1~3の検出方法では、与えられた画像を特徴量に変換し、変換により得られた特徴量から与えられた画像を復元した画像を生成する生成モデルが利用される。この生成モデルには、ニューラルネットワーク、主成分分析により導出される固有ベクトル等の機械学習モデルを用いることができる。生成モデルは、機械学習により、学習画像が与えられると、与えられた学習画像に適合する復元画像を生成するように訓練される。この訓練の結果として、生成モデルは、学習画像に写る特徴については再現性が高く、学習画像に写る可能性の低い(例えば、可能性のない)他の特徴については再現性の低い復元画像を生成する能力を獲得する。
The detection methods in
そのため、欠陥のない製品の写る良品画像を学習画像として使用して、上記のとおりに生成モデルを訓練することで、生成モデルは、欠陥の有無を問わず、製品の写る画像が与えられると、与えられた画像に写る製品の欠陥のない状態を再現した(又は、欠陥については再現性の低い)復元画像を生成する能力を獲得することができる。この能力を獲得した結果、観測画像に写る製品に欠陥が含まれている場合に、訓練された生成モデルにより生成された復元画像と観測画像との間において、その欠陥の存在する領域に差異が生じる。よって、訓練された生成モデルにより生成された復元画像と観測画像との間の差分に基づいて、欠陥の有無を検出することができる。 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.
以下、本発明の一側面に係る実施の形態(以下、「本実施形態」とも表記する)を、図面に基づいて説明する。ただし、以下で説明する本実施形態は、あらゆる点において本発明の例示に過ぎない。本発明の範囲を逸脱することなく種々の改良や変形を行うことができることは言うまでもない。つまり、本発明の実施にあたって、実施形態に応じた具体的構成が適宜採用されてもよい。なお、本実施形態において登場するデータを自然言語により説明しているが、より具体的には、コンピュータが認識可能な疑似言語、コマンド、パラメータ、マシン語等で指定される。 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
ただし、学習装置1及び検出装置2の間でデータをやりとりする方法は、このような例に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、学習装置1及び検出装置2の間では、記憶媒体を利用して、データがやりとりされてよい。また、本実施形態では、学習装置1及び検出装置2は互いに別個のコンピュータである。しかしながら、検出システム100の構成は、このような例に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、学習装置1及び検出装置2は一体のコンピュータであってもよい。また、例えば、学習装置1及び検出装置2の少なくとも一方は、複数台のコンピュータにより構成されてよい。
However, the method of exchanging data between the
本実施形態に係る学習装置1は、所定の特徴の一例として良品である製品Rの写る1つ以上の第1学習画像121を取得する。製品Rは、例えば、電子機器、電子部品、自動車部品、薬品、食品等の製造ラインで搬送される製品であってよい。電子部品は、例えば、基盤、チップコンデンサ、液晶、リレーの巻線等であってよい。自動車部品は、例えば、コンロッド、シャフト、エンジンブロック、パワーウィンドウスイッチ、パネル等であってよい。薬品は、例えば、包装済みの錠剤、未包装の錠剤等であってよい。製品Rは、製造過程完了後に生成される最終品であってもよいし、製造過程の途中で生成される中間品であってもよいし、製造過程を経過する前に用意される初期品であってもよい。
The
学習装置1は、取得された1つ以上の第1学習画像121を使用して、生成モデル5の機械学習を実施する。生成モデル5は、入力画像が与えられると、与えられた入力画像を特徴量に変換し、変換により得られた特徴量から与えられた入力画像を復元した画像を生成するように構成されている。学習装置1は、機械学習により、1つ以上の第1学習画像121それぞれが与えられると、与えられた1つ以上の第1学習画像121それぞれに適合する復元画像を生成するように生成モデル5を訓練する。これにより、生成モデル5は、第1学習画像121に表れる範囲において、良品である製品Rの写る画像を復元する能力を獲得する。
The
ただし、製品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
そこで、学習装置1は、それぞれ製品Rの写る複数の追加用画像123を取得する。学習装置1は、取得された複数の追加用画像123それぞれを訓練された生成モデル5に与えることで、複数の追加用画像123それぞれを復元した複数の復元追加用画像124それぞれを生成する。そして、学習装置1は、各追加用画像123及び生成された各復元追加用画像124の間の差分に応じて、各追加用画像123の評価値125であって、各復元追加用画像124における各追加用画像123の復元の程度に対する評価値125を算出する。
Therefore, the
追加用画像123と復元追加用画像124との間の差分が大きいほど、復元追加用画像124における追加用画像123の復元の程度が低い、すなわち、この追加用画像123に表れる製品Rの様子を再現する生成モデル5の能力が不十分であることを示す。そのため、復元追加用画像124との差分が大きい、換言すると、復元の程度の低い追加用画像123は、製品Rの写る画像を再現する生成モデル5の能力の適切な向上に貢献する可能性が高い。
The larger the difference between the
反対に、復元の程度が高い追加用画像123は、生成モデル5の能力の適切な向上に貢献する可能性が低い。加えて、復元の程度が高い追加用画像123を機械学習に使用する学習画像に追加することで、生成モデル5の能力の向上を図ると、追加用画像123の過剰な追加により、機械学習に使用する学習画像の件数の膨大化を招き、当該機械学習の処理コストを増大させてしまう可能性がある。更には、製品R以外のパターンを復元する能力を向上させてしまうことで、あらゆるパターンを忠実に再現する能力を生成モデル5に獲得させてしまう可能性がある。
On the contrary, the
これらの点を考慮して、学習装置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
本実施形態に係る検出装置2は、製品Rを観測することで得られた観測画像221を取得する。本実施形態では、検出装置2は、製品Rを観測するように配置されたカメラCAに接続されている。検出装置2は、カメラCAから観測画像221を取得する。なお、各画像(121、123、221)の種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。各画像(121、123、221)は、例えば、白黒画像等の二値画像、RGB画像、深度画像、赤外線画像等であってよい。これに応じて、カメラCAは、例えば、一般的なデジタルカメラ、深度カメラ、赤外線カメラ等であってよい。
The
次に、検出装置2は、学習装置1により訓練された生成モデル5に観測画像221を入力することで、観測画像221に対応する復元観測画像223を生成する。そして、検出装置2は、生成された復元観測画像223及び観測画像221の間の差分に基づいて、所定の特徴以外の他の特徴の一例として欠陥が観測画像221に写っているか否か、換言すると、製品Rに欠陥が含まれるか否かを検出する。欠陥は、例えば、傷、汚れ、クラック、打痕、バリ、色ムラ、異物混入等であってよい。これにより、検出装置2は、学習済みの生成モデル5を利用して、製品Rの外観検査を実施する(すなわち、製品Rの良否を判定する)。
Next, the
以上のとおり、本実施形態では、第1学習画像121を使用した機械学習により、学習済みの生成モデル5が暫定的に構築される。上記学習装置1の一連の処理では、この暫定的に構築された学習済みの生成モデル5が各追加用画像123に対して復元能力を発揮した結果に基づいて、複数の追加用画像123から、当該復元能力の適切な向上に貢献する可能性の高い1つ以上の追加用画像126を自動的に抽出することができる。したがって、機械学習に使用する画像(学習画像)を適切に選択できる。加えて、適切に選択された学習画像を用いて構築された学習済みの生成モデル5によれば、観測画像221に欠陥が写っているか否か、すなわち、製品Rに欠陥が存在するか否かを精度よく検出することができる。
As described above, in this embodiment, the learned
§2 具体例
[ハードウェア構成]
<学習装置>
次に、図2を用いて、本実施形態に係る学習装置1のハードウェア構成の一例について説明する。図2は、本実施形態に係る学習装置1のハードウェア構成の一例を模式的に例示する図である。
§2 Specific example [Hardware configuration]
<Learning device>
Next, an example of the hardware configuration of the
図2に示されるとおり、本実施形態に係る学習装置1は、制御部11、記憶部12、通信インタフェース13、入力装置14、表示装置15、及びドライブ16が電気的に接続されたコンピュータである。なお、図2では、通信インタフェースを「通信I/F」と記載している。
As shown in FIG. 2, the
制御部11は、ハードウェアプロセッサであるCPU(Central Processing Unit)、RAM(Random Access Memory)、ROM(Read Only Memory)等を含み、プログラム及び各種データに基づいて情報処理を実行するように構成される。記憶部12は、メモリの一例であり、例えば、ハードディスクドライブ、ソリッドステートドライブ等で構成される。本実施形態では、記憶部12は、学習プログラム120、1つ以上の第1学習画像121、複数の追加用画像123、複数の評価画像127、学習結果データ129等の各種情報を記憶する。
The
学習プログラム120は、学習済みの生成モデル5を構築するための後述の機械学習の処理(図7及び図8)を学習装置1に実行させるためのプログラムである。学習プログラム120は、当該情報処理の一連の命令を含む。1つ以上の第1学習画像121は、生成モデル5の機械学習に使用される。各追加用画像123は、第1学習画像121以外で生成モデル5の機械学習に使用される学習画像の候補である。各評価画像127には、製品R及び欠陥が写る。各評価画像127は、生成モデル5により生成される復元画像を利用した欠陥の検出処理の性能を評価するのに使用される。学習結果データ129は、機械学習により構築された学習済みの生成モデル5に関する情報を示す。学習結果データ129は、学習プログラム120の実行結果として得られる。詳細は後述する。
The
通信インタフェース13は、例えば、有線LAN(Local Area Network)モジュール、無線LANモジュール等であり、ネットワークを介した有線又は無線通信を行うためのインタフェースである。学習装置1は、この通信インタフェース13を利用することで、ネットワークを介したデータ通信を他の情報処理装置(例えば、検出装置2)と行うことができる。学習装置1は、通信インタフェース13を介して、複数の追加用画像123を取得してもよい。
The
入力装置14は、例えば、マウス、キーボード等の入力を行うための装置である。また、表示装置15は、出力装置の一例であり、例えば、ディスプレイである。オペレータは、入力装置14及び表示装置15を介して、学習装置1を操作することができる。なお、表示装置15は、タッチパネルディスプレイであってもよい。この場合、入力装置14は省略されてもよい。
The
ドライブ16は、例えば、CDドライブ、DVDドライブ等であり、記憶媒体91に記憶されたプログラムを読み込むためのドライブ装置である。ドライブ16の種類は、記憶媒体91の種類に応じて適宜選択されてよい。上記学習プログラム120、1つ以上の第1学習画像121、複数の追加用画像123、及び複数の評価画像127の少なくともいずれかは、この記憶媒体91に記憶されていてもよい。
The
記憶媒体91は、コンピュータその他装置、機械等が記録されたプログラム等の情報を読み取り可能なように、当該プログラム等の情報を、電気的、磁気的、光学的、機械的又は化学的作用によって蓄積する媒体である。学習装置1は、この記憶媒体91から、上記学習プログラム120、1つ以上の第1学習画像121、複数の追加用画像123、及び複数の評価画像127の少なくともいずれかを取得してもよい。
The
ここで、図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
なお、学習装置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
<検出装置>
次に、図3を用いて、本実施形態に係る検出装置2のハードウェア構成の一例について説明する。図3は、本実施形態に係る検出装置2のハードウェア構成の一例を模式的に例示する図である。
<Detection device>
Next, an example of the hardware configuration of the
図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
すなわち、制御部21は、ハードウェアプロセッサであるCPU、RAM、ROM等を含み、プログラム及びデータに基づいて各種情報処理を実行するように構成される。記憶部22は、例えば、ハードディスクドライブ、ソリッドステートドライブ等で構成される。記憶部22は、検出プログラム220、学習結果データ129等の各種情報を記憶する。
That is, the
検出プログラム220は、学習装置1により訓練された学習済みの生成モデル5を利用して、観測画像221に写る製品Rの良否を判定する後述の情報処理(図15)を検出装置2に実行させるためのプログラムである。検出プログラム220は、当該情報処理の一連の命令を含む。詳細は後述する。
The
通信インタフェース23は、例えば、有線LANモジュール、無線LANモジュール等であり、ネットワークを介した有線又は無線通信を行うためのインタフェースである。検出装置2は、この通信インタフェース23を利用することで、ネットワークを介したデータ通信を他の情報処理装置(例えば、学習装置1)と行うことができる。
The
入力装置24は、例えば、マウス、キーボード等の入力を行うための装置である。表示装置25は、出力装置の一例であり、例えば、ディスプレイである。オペレータは、入力装置24及び表示装置25を介して、検出装置2を操作することができる。入力装置24及び表示装置25はタッチパネルディスプレイに置き換えられてもよい。
The
ドライブ26は、例えば、CDドライブ、DVDドライブ等であり、記憶媒体92に記憶されたプログラムを読み込むためのドライブ装置である。上記検出プログラム220及び学習結果データ129のうちの少なくともいずれかは、記憶媒体92に記憶されていてもよい。また、検出装置2は、記憶媒体92から、上記検出プログラム220及び学習結果データ129のうちの少なくともいずれかを取得してもよい。記憶媒体92の種類は、ディスク型であってもよいし、ディスク型以外であってもよい。
The
外部インタフェース27は、例えば、USB(Universal Serial Bus)ポート、専用ポート等であり、外部装置と接続するためのインタフェースである。外部インタフェース27の種類及び数は、接続される外部装置の種類及び数に応じて適宜選択されてよい。本実施形態では、検出装置2は、外部インタフェース27を介して、カメラCAに接続される。
The
カメラCAは、外観検査の対象となる製品Rを写した観測画像221を取得するのに利用される。カメラCAの種類及び配置場所は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。カメラCAには、例えば、一般的なデジタルカメラ、深度カメラ、赤外線カメラ等が用いられてよい。また、カメラCAは、製造ラインにより搬送される製品Rを観測可能なように適宜配置されてよい。カメラCAは、例えば、製品Rを搬送する製造ラインの近傍に配置されてよい。なお、カメラCAが通信インタフェースを備える場合、検出装置2は、外部インタフェース27ではなく、通信インタフェース23を介して、カメラCAに接続されてもよい。
The camera CA is used to obtain an
なお、検出装置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
[ソフトウェア構成]
<学習装置>
次に、図4及び図5を用いて、本実施形態に係る学習装置1のソフトウェア構成の一例について説明する。図4及び図5は、本実施形態に係る学習装置1のソフトウェア構成の一例を模式的に例示する図である。
[Software configuration]
<Learning device>
Next, an example of the software configuration of the
学習装置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
図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
詳細には、生成モデル5は、入力画像を特徴量に変換し、変換により得られた特徴量から入力画像を復元した画像を生成する演算処理に使用される演算パラメータMを備えるモジュール(学習モデル)により構成される。この生成モデル5の構成は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、生成モデル5には、ニューラルネットワーク(例えば、オートエンコーダ等)、主成分分析により導出される固有ベクトル等の公知の学習モデルを用いることができる。機械学習では、第1学習画像121が与えられると、与えられた第1学習画像121に適合する復元画像を生成するように、この演算パラメータMの値が調整される。本実施形態では、生成モデル5は、オートエンコーダ等のニューラルネットワークにより構成される。
In detail, the
第2取得部112は、製品Rの写る複数の追加用画像123を取得する。本実施の形態では、各追加用画像123には、欠陥の含まれていない製品R(すなわち、良品)が写っている。すなわち、各追加用画像123には欠陥が写っていない。生成部113は、取得された複数の追加用画像123それぞれを訓練された生成モデル5に与えることで、複数の追加用画像123それぞれを復元した複数の復元追加用画像124それぞれを生成する。評価部114は、各追加用画像123及び生成された各復元追加用画像124の間の差分に応じて、各追加用画像123の評価値125であって、各復元追加用画像124における各追加用画像123の復元の程度に対する評価値125を算出する。
The
本実施形態では、評価部114は、各追加用画像123と各復元追加用画像124との差分を算出する。これにより、評価部114は、複数の追加用画像123それぞれと複数の復元追加用画像124それぞれとの間の差分を示す複数の差分画像182それぞれを生成する。追加用画像123と復元追加用画像124との間で差異が生じている画素ほど、差分画像182においてその画素値が大きい。つまり、差分画像182内で画素値の大きい画素が多いほど、復元追加用画像124における追加用画像123の復元の程度が低いことを示す。反対に、差分画像182内で画素値の大きい画素が少ないほど、復元追加用画像124における追加用画像123の復元の程度が高いことを示す。この観点に基づいて、評価部114は、生成された各差分画像182を利用して、各追加用画像123の復元の程度に対する各評価値125を算出する。
In this embodiment, the
抽出部115は、算出された各評価値125に基づいて、復元の程度が低いと評価される1つ以上の追加用画像126を複数の追加用画像123から抽出する。復元の程度が低いと評価するための基準は、特に限定されなくてもよく、実施の形態に応じて適宜設定されてよい。
The
本実施形態に係る学習装置1は、抽出された1つ以上の追加用画像126が追加学習に用いる画像として適切か否かをチェックするための処理を実行するように構成される。具体的には、表示制御部118は、抽出された1つ以上の追加用画像126それぞれを表示装置15に表示させる。選択受付部119は、表示装置15に表示された1つ以上の追加用画像126それぞれについて、当該1つ以上の追加用画像126それぞれを機械学習に使用するか否かの選択を受け付ける。
The
追加学習部116は、選択受付部119が受け付けた選択結果に応じて、抽出された1つ以上の追加用画像126に含まれる1つ以上の画像を第2学習画像126Aとして決定する。すなわち、追加学習部116は、機械学習に使用すると選択された追加用画像126を上記訓練の対象となる第2学習画像126Aとして決定する。追加学習部116は、機械学習に使用しないと選択された追加用画像126を上記訓練の対象から除外する。
The
追加学習部116は、機械学習により、決定された1つ以上の第2学習画像126Aそれぞれが与えられると、与えられた1つ以上の第2学習画像126Aそれぞれに適合する復元画像を生成するように生成モデル5を更に訓練する。
The
更に、本実施形態では、図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
評価部114は、更に、各追加用画像123と各復元追加用画像124との差分の程度に基づいて、各追加用画像123に欠陥Lが写っているか否か(すなわち、各追加用画像123に写る製品Rに欠陥Lが存在するか否か)を判定する。また、評価部114は、各評価画像127と各復元評価画像128との差分の程度に基づいて、各評価画像127に欠陥Lが写っているか否か(すなわち、各評価画像127に写る製品Rに欠陥Lが存在するか否か)を判定する。
The
本実施形態では、評価部114は、各差分画像182を利用して、各追加用画像123に欠陥Lが写っているか否かを判定する。同様に、評価部114は、各評価画像127と各復元評価画像128との差分を算出することで、複数の評価画像127それぞれと複数の復元評価画像128それぞれとの間の差分を示す複数の差分画像183それぞれを生成する。評価部114は、各差分画像183を利用して、各評価画像127に欠陥Lが写っているか否かを判定する。
In this embodiment, the
各画像(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
評価部114は、各検出パラメータ候補60を利用して、各追加用画像123に欠陥Lが写っているか否かの判定、及び各評価画像127に欠陥Lが写っているか否かの判定を実行する。評価部114は、各判定の結果に基づいて、複数の検出パラメータ候補60のうち、欠陥Lが写っていると判定される追加用画像123及び欠陥Lが写っていないと判定される評価画像127の数が最も少ない1つの検出パラメータ候補61を特定する。これにより、評価部114は、欠陥Lの検出に利用する検出パラメータを自動的に最適化する。
The
そして、評価部114は、特定された1つの検出パラメータ候補61を利用した判定において、欠陥Lが写っていると判定された追加用画像123の数(以下、誤判定の追加用画像123の数とも記載する)が第1の閾値以上であるか否かを判定する。また、評価部114は、特定された1つの検出パラメータ候補61を利用した判定において、欠陥Lが写っていないと判定された評価画像127の数(以下、誤判定の評価画像127の数とも記載する)が第2の閾値以上であるか否かを判定する。第1の閾値及び第2の閾値はそれぞれ、適宜決定されてよい。
Then, the
あるいは、評価部114は、特定された1つの検出パラメータ候補61を利用した判定において、複数の追加用画像123のうち欠陥Lが写っていると判定された追加用画像123の割合(以下、誤判定の追加用画像123の割合とも記載する)が第1の閾値以上であるか否かを判定してもよい。また、評価部114は、特定された1つの検出パラメータ候補61を利用した判定において、複数の評価画像127のうち欠陥Lが写っていないと判定された評価画像127の割合(以下、誤判定の評価画像127の割合とも記載する)が第2の閾値以上であるか否かを判定してもよい。
Alternatively, the
学習装置1は、誤判定の追加用画像123の数又は割合が第1の閾値以上である、又は誤判定の評価画像127の数又は割合が第2の閾値以上である場合に、追加用画像126による追加学習に関する上記一連の処理を実行する。すなわち、評価部114は、特定された1つの検出パラメータ候補61を利用した各判定の結果において、誤判定の追加用画像123の数又は割合が第1の閾値以上である、又は誤判定の評価画像127の数又は割合が第2の閾値以上である場合に、誤判定された1又は複数の追加用画像123について、評価値125を算出する。
The
抽出部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
更に、本実施形態では、図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
生成部113は、パッチ画像P2毎に、対応する生成モデル5を利用して、各追加用画像123に対応する各復元追加用画像124を生成する。同様に、各評価画像127も、複数のパッチ画像P3に分割される。生成部113は、パッチ画像P3毎に、対応する生成モデル5を利用して、各評価画像127に対応する各復元評価画像128を生成する。
The
評価部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
抽出部115は、パッチ画像P2毎に、算出された評価値125に基づいて、1つ以上の追加用画像126を複数の追加用画像123から抽出する。パッチ画像P2毎に、抽出される追加用画像126の件数は異なっていてもよい。追加学習部116は、抽出された1つ以上の追加用画像126に含まれる1つ以上の画像を第2学習画像126Aとして決定する。追加学習部116は、パッチ画像P2毎に、機械学習により、決定された1つ以上の第2学習画像126Aそれぞれが与えられると、与えられた1つ以上の第2学習画像126Aそれぞれに適合する復元画像を生成するように各生成モデル5を更に訓練する。
The
なお、図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
<検出装置>
次に、図6を用いて、本実施形態に係る検出装置2のソフトウェア構成の一例について説明する。図6は、本実施形態に係る検出装置2のソフトウェア構成の一例を模式的に例示する図である。
<Detection device>
Next, an example of the software configuration of the
検出装置2の制御部21は、記憶部22に記憶された検出プログラム220をRAMに展開する。そして、制御部21は、RAMに展開された検出プログラム220に含まれる命令をCPUにより解釈及び実行して、各構成要素を制御する。これによって、図6に示されるとおり、本実施形態に係る検出装置2は、取得部211、生成部212、検出部213及び出力部214をソフトウェアモジュールとして備えるコンピュータとして構成される。すなわち、本実施形態では、検出装置2の各ソフトウェアモジュールも、上記学習装置1と同様に、制御部21(CPU)により実現される。
The
取得部211は、製品Rを観測することで得られた観測画像221を取得する。生成部212は、学習結果データ129を保持することで、学習済みの生成モデル5を備えている。生成部212は、学習結果データ129を参照して、学習済みの生成モデル5の設定を行う。そして、生成部212は、取得された観測画像221を学習済みの生成モデル5に入力することで、観測画像221を復元した復元観測画像223を生成する。
The acquisition unit 211 acquires an
検出部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
本実施形態では、観測画像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
<その他>
学習装置1及び検出装置2の各ソフトウェアモジュールに関しては後述する動作例で詳細に説明する。なお、本実施形態では、学習装置1及び検出装置2の各ソフトウェアモジュールがいずれも汎用のCPUによって実現される例について説明している。しかしながら、以上のソフトウェアモジュールの一部又は全部が、1又は複数の専用のプロセッサにより実現されてもよい。また、学習装置1及び検出装置2それぞれのソフトウェア構成に関して、実施形態に応じて、適宜、ソフトウェアモジュールの省略、置換及び追加が行われてもよい。
<Others>
Each software module of the
§3 動作例
[学習装置]
次に、図7及び図8を用いて、学習装置1の動作例について説明する。図7及び図8は、本実施形態に係る学習装置1の処理手順の一例を示すフローチャートである。以下で説明する処理手順は、学習方法の一例である。ただし、以下で説明する処理手順は一例に過ぎず、各処理は可能な限り変更されてよい。また、以下で説明する処理手順について、実施の形態に応じて、適宜、ステップの省略、置換、及び追加が可能である。
§3 Operation example [Learning device]
Next, an example of the operation of the
(ステップS101)
ステップS101では、制御部11は、第1取得部110として動作し、製品Rの写る1つ以上の第1学習画像121を取得する。
(Step S101)
In step S101, the
本実施形態では、基本的には、製品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
第1学習画像121を生成する方法は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、カメラCAと同種のカメラ及び欠陥のない製品Rを用意し、製品Rの検査を行う環境に応じた様々な条件で、用意したカメラにより製品Rを撮影する。これにより、製品Rの写る第1学習画像121を生成することができる。
The method of generating the
第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
取得する第1学習画像121の件数は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、取得する第1学習画像121の件数は、暫定的な学習済みの生成モデル5を構築可能な程度に決定されてよい。1つ以上の第1学習画像121を取得すると、制御部11は、次のステップS102に処理を進める。
The number of
(ステップS102)
ステップS102では、制御部11は、学習部111として動作し、取得された1つ以上の第1学習画像121を使用して、生成モデル5の機械学習を実施する。この機械学習の処理では、制御部11は、1つ以上の第1学習画像121それぞれが与えられると、与えられた1つ以上の第1学習画像121それぞれに適合する復元画像を生成するように生成モデル5を訓練する。
(Step S102)
In step S102, the
生成モデル5は、入力画像を特徴量に変換し、変換により得られた特徴量から入力画像を復元した画像を生成する演算処理に使用される演算パラメータMを備える学習モデルにより構成される。機械学習の方法は、生成モデル5として利用する学習モデルの種類に応じて、適宜選択されてよい。本実施形態では、ニューラルネットワークにより構成される生成モデル5を生成するための機械学習の方法が採用される。機械学習の一例として、制御部11は、以下の処理手順により、学習済みの生成モデル5を構築する。
The
図9は、ニューラルネットワークにより構成される生成モデル5の一例を模式的に例示する図である。ニューラルネットワークの代表例としてオートエンコーダが挙げられる。オートエンコーダは、次元圧縮を目的としたニューラルネットワークである。
FIG. 9 is a diagram schematically illustrating an example of the
図9に例示される生成モデル5を備えるニューラルネットワークは、入力層51、中間(隠れ)層52、出力層53を備えている。ただし、ニューラルネットワークの構造は、このような例に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、中間層の数は、1つに限定されなくてもよく、2つ以上であってもよい。
The neural network including the
入力層51に含まれるニューロン(ノード)の数は入力画像の画素数に対応する。中間層52に含まれるニューロンの数は特徴量の次元数に対応する。出力層53に含まれるニューロンの数は復元画像の画素数に対応する。中間層52に含まれるニューロンの数は、入力層51及び出力層53それぞれに含まれるニューロンの数よりも少なく設定されてよい。次元圧縮を目的としたオートエンコーダの場合、中間層52に含まれるニューロンの数は、入力層51及び出力層53それぞれに含まれるニューロンの数よりも少なく設定される。これに応じて、特徴量の次元数が、入力画像及び復元画像の次元数よりも小さく設定される。
The number of neurons (nodes) included in the
ニューラルネットワークでは、隣接する層のニューロン同士は適宜結合され、各結合には重み(結合荷重)が設定される。図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
制御部11は、生成モデル5を構成するニューラルネットワークを用意する。ニューラルネットワークの構造(例えば、層の数、各層に含まれるニューロンの数、隣接する層のニューロン同士の結合関係等)、パラメータの初期値(例えば、各ニューロン間の結合の重みの初期値、各ニューロンの閾値の初期値)は、テンプレートにより与えられてもよいし、オペレータの入力により与えられてもよい。
The
次に、制御部11は、各学習画像を訓練データ及び教師データとして利用し、各ニューラルネットワークの学習処理を実行する。この学習処理には、バッチ勾配降下法、確率的勾配降下法、ミニバッチ勾配降下法等が用いられてよい。例えば、第1のステップでは、制御部11は、各ニューラルネットワークの入力層51に各学習画像を入力し、各ニューラルネットワークの演算処理を実行する。すなわち、制御部11は、各ニューラルネットワークの入力層51に各学習画像を入力し、入力側から順に各層51~53に含まれる各ニューロンの発火判定を行う。この演算処理により、制御部11は、各学習画像を特徴量に変換し、変換により得られた特徴量から各学習画像を復元した画像を生成した結果に対応する出力値を出力層53から取得する。この演算処理の過程で、中間層52から得られる出力は、入力画像を特徴量に変換した結果に対応する。
Next, the
第2のステップでは、制御部11は、出力層53から得られた出力値と各学習画像との誤差を損失関数に基づいて算出する。損失関数の種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。損失関数には、公知のものが採用されてよい。第3のステップでは、制御部11は、誤差逆伝播(Back propagation)法により、算出された出力値の誤差を用いて、各ニューラルネットワークの演算パラメータM、すなわち、各層51~53における各ニューロン間の結合の重み及び各ニューロンの閾値それぞれの誤差を算出する。第4のステップでは、制御部11は、算出された各誤差に基づいて、各層51~53における各ニューロン間の結合の重み及び各ニューロンの閾値それぞれの値を更新する。
In the second step, the
制御部11は、上記第1~第4のステップを繰り返すことで、出力層53から出力される出力値(復元画像)と各学習画像との誤差の和が小さくなるように、演算パラメータMの値を調整する。例えば、制御部11は、出力層53から出力される出力値と各学習画像との誤差の和が閾値以下になるまで、上記第1~第4のステップによる演算パラメータMの調整を繰り返してもよい。閾値は、実施の形態に応じて適宜設定されてよい。
By repeating the first to fourth steps above, the
これにより、制御部11は、各学習画像を入力層51に入力すると、各学習画像に適合する復元画像を出力層53から出力するように訓練されたニューラルネットワークを学習済みの生成モデル5として構築することができる。ニューラルネットワークでは、入力された各学習画像は、入力層51から中間層52までの演算の過程で特徴量に変換される。そして、中間層52から出力層53までの演算の過程により、得られた特徴量から復元画像が生成される。学習済みの生成モデル5を構築すると、制御部11は、次のステップS103に処理を進める。
Thereby, the
なお、本実施形態では、制御部11は、ステップS102を実行する前に、取得された1つ以上の第1学習画像121それぞれを複数のパッチ画像P1に分割する。分割方法及びパッチ画像P1の件数は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、制御部11は、縦方向及び横方向それぞれに指定された数で等分に第1学習画像121を分割してもよい。これにより、第1学習画像121は、複数のパッチ画像P1にグリッド状に分割されてよい。分割数は、オペレータの入力により指定されてもよいし、プログラム内で予め与えられてもよい。また、グリッド状に分割する場合、複数のパッチ画像P1の一部の寸法がその他の寸法と相違してもよい。なお、第1学習画像121が既にパッチ画像P1に分割されている場合には、本分割処理は省略されてよい。
Note that in this embodiment, the
そして、ステップS102において、制御部11は、上記機械学習の処理により、パッチ画像P1毎に学習済みの生成モデル5を構築する。すなわち、本実施形態では、制御部11は、第1学習画像121の対応するパッチ画像P1を与えると、与えられたパッチ画像P1を特徴量に変換し、変換により得られた特徴量から対応するパッチ画像P1に適合する画像を復元するように訓練された生成モデル5をパッチ画像P1毎に構築する。これにより、学習済みの生成モデル5が、パッチ画像P1毎に与えられる。
Then, in step S102, the
ただし、複数のパッチ画像に各画像が分割される場合に、ニューラルネットワークが必ずしもパッチ画像毎に用意されなければならない訳ではない。例えば、パッチ画像のクラスを入力するニューロンをニューラルネットワークの入力層に加えることで、異なるパッチ画像に対応する画像を復元するニューラルネットワークを構成することができる。そのため、複数のパッチ画像のうちの少なくとも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
(ステップS103)
ステップS103では、制御部11は、第2取得部112として動作し、それぞれ製品Rの写る複数の追加用画像123を取得する。
(Step S103)
In step S103, the
本実施の形態において、各追加用画像123には、上記第1学習画像121と同様に、基本的には、欠陥の存在しない製品R(良品)の写る画像が利用される。各追加用画像123は、上記第1学習画像121と同様に生成されてよい。また、上記処理により生成された画像であって、欠陥の存在しない製品Rの写る画像の一部が上記第1学習画像121として利用されてよく、その他が追加用画像123として利用されてよい。例えば、制御部11は、欠陥の存在しない製品Rの写る複数の画像を取得してもよい。そして、上記ステップS101では、取得された複数の画像の一部を第1学習画像121として取得し、本ステップS103では、取得された複数の画像の残りを追加用画像123として取得してもよい。
In this embodiment, each
また、第1学習画像121と同様に、追加用画像123の生成は、学習装置1により行われてもよいし、学習装置1以外の他のコンピュータにより行われてもよい。制御部11は、自動的に又は入力装置14を介したオペレータの操作により手動的に上記一連の処理を実行することで、複数の追加用画像123を取得してもよい。或いは、制御部11は、例えば、ネットワーク、記憶媒体91等を介して、他のコンピュータにより生成された複数の追加用画像123を取得してもよい。複数の追加用画像123のうちの一部が学習装置1により生成され、残りが他のコンピュータにより生成されてもよい。
Furthermore, similarly to the
取得する追加用画像123の件数は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。複数の追加用画像123を取得すると、制御部11は、次のステップS104に処理を進める。
The number of
(ステップS104)
ステップS104では、制御部11は、第3取得部117として動作し、欠陥Lを含む製品Rがそれぞれ写る複数の評価画像127を取得する。
(Step S104)
In step S104, the
各評価画像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
各評価画像127は、各画像(121、123)と同様に、コンピュータの動作により自動的に生成されてもよいし、オペレータの操作により手動的に生成されてもよい。また、各評価画像127の生成は、学習装置1により行われてもよいし、学習装置1以外の他のコンピュータにより行われてもよい。制御部11は、自動的に又は入力装置14を介したオペレータの操作により手動的に上記一連の処理を実行することで、複数の評価画像127を取得してもよい。或いは、制御部11は、例えば、ネットワーク、記憶媒体91等を介して、他のコンピュータにより生成された複数の評価画像127を取得してもよい。複数の評価画像127のうちの一部が学習装置1により生成され、残りが他のコンピュータにより生成されてもよい。
Like each image (121, 123), each
取得する評価画像127の件数は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。複数の評価画像127を取得すると、制御部11は、次のステップS105に処理を進める。
The number of
(ステップ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
具体的には、制御部11は、ステップS102の機械学習の結果を参照し、学習済みの生成モデル5を用意する。ステップS105では、制御部11は、各追加用画像123を学習済みの生成モデル5に入力する。これにより、制御部11は、各追加用画像123を復元した各復元追加用画像124を生成する。同様に、ステップS106では、制御部11は、各評価画像127を学習済みの生成モデル5に入力する。これにより、制御部11は、各評価画像127を復元した各復元評価画像128を生成する。
Specifically, the
なお、本実施形態では、生成モデル5は、パッチ画像毎に用意される。これに応じて、本実施形態では、制御部11は、各追加用画像123を複数のパッチ画像P2に分割する。また、制御部11は、各評価画像127を複数のパッチ画像P3に分割する。画像の分割方法は、第1学習画像121と同様である。各画像(123、127)が既にパッチ画像(P2、P3)に分割されている場合、これらの分割処理は省略されてよい。
Note that in this embodiment, the
ステップ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
(ステップ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
差分の程度に応じて欠陥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
更に、本実施形態では、各画像(123、127)に欠陥Lが写っているか否かを判定するための複数の検出パラメータ候補60が与えられる。各検出パラメータ候補60は、検出パラメータの候補の値を示す。各検出パラメータ候補60の値は適宜与えられてよい。例えば、各検出パラメータ候補60の値は、オペレータの入力により取得されてよい。また、例えば、各検出パラメータ候補60の値は、プログラム内で予め与えられてもよい。検出パラメータは、各差分画像(182、183)から欠陥Lの有無を検出するアルゴリズムに応じて適宜設定されてよい。
Furthermore, in this embodiment, a plurality of
ここで、図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
次に、第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
図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
また、例えば、生成モデル5は、入力画像を低次元の特徴量に圧縮する。このときに、入力画像の情報が部分的に損失し得る。そのため、入力画像と復元画像との間で多少の誤差が生じ得る。この復元のノイズが、画像I10と復元画像I11との間に生じる差異の原因の一例となり得る。したがって、差分画像I12には、欠陥Lに起因する差異以外に、複数の要因に基づく差異が現れ得る。しかしながら、このノイズに起因する差異は、上記2つの要因に基づく差異よりも程度が低い。そのため、差分画像I12の画素値に基づいて、これらの差異を区別することができる。
Furthermore, for example, the
そこで、第3のステップでは、制御部11は、閾値65を利用して、差分画像I12の各画素を二値化する。例えば、制御部11は、画素値が閾値65以上である画素の画素値を「255」に変換し、画素値が閾値65未満である画素の画素値を「0」に変換する。「以上」は、「超える」に置き換えられ、「未満」は、「以下」に置き換えられてよい。以下の説明においても同様である。これにより、制御部11は、二値化画像I13を生成することができる。閾値65を適切に設定することで、上記ノイズに起因する差異等の比較的に程度の低い差異が元の差分画像I12から除外された二値化画像I13を得ることができる。
Therefore, in the third step, the
二値化画像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
処理の一例として、第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
第5のステップでは、制御部11は、検出画像I14に白色画素の領域が存在するか否かに応じて、画像I10に欠陥Lが写っているか否かを判定する。具体的に、検出画像I14において白色画素の領域が存在する場合、制御部11は、画像I10の対応する領域に欠陥Lが写っていると判定する。一方、検出画像I14において白色画素の領域が存在しない場合、制御部11は、画像I10に欠陥Lが写っていないと判定する。これにより、制御部11は、欠陥Lの検出に関する処理を終了する。
In the fifth step, the
以上の欠陥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
なお、本実施形態では、各画像(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
(ステップS109)
ステップS109では、制御部11は、評価部114として動作する。制御部11は、各ステップ(S107、S108)の判定結果に基づいて、欠陥Lが画像に写っているか否かを判定するための検出パラメータの最適化を実行する。具体的には、制御部11は、各ステップ(S107、S108)の判定結果に基づいて、複数の検出パラメータ候補60のうち、欠陥Lが写っていると判定された追加用画像123及び欠陥Lが写っていないと判定された評価画像127の数が最も少ない1つの検出パラメータ候補61を特定する。
(Step S109)
In step S109, the
欠陥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
ここで、図11を更に用いて、最適な検出パラメータ候補61を特定する処理の一例について説明する。図11は、ステップS107及びS108の仮想的な判定結果の一例を示す図である。図11の例では、判定結果はテーブル形式で表現され、テーブル内の1つのレコードは、1つの検出パラメータ候補60による判定結果に対応している。ただし、判定結果のデータ形式は、このような例に限定されなくてよく、実施の形態に応じて適宜選択されてよい。
Here, an example of a process for identifying the optimal
図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
制御部11は、各検出パラメータ候補60による判定結果に基づいて、最適な検出パラメータ候補61を特定する。図11に例示されるとおり、番号「0」及び「1」の2つの検出パラメータ候補60が与えられ、各レコードに示される判定結果が得られた場合、制御部11は、誤り件数の最も少ない番号「1」の検出パラメータ候補60を最適な検出パラメータ候補61として特定する。
The
なお、本実施形態では、各画像(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
(ステップS110及びステップS111)
ステップS110では、制御部11は、評価部114として動作し、特定された1つの検出パラメータ候補61を利用した判定の結果において、誤判定の追加用画像123の数が第1の閾値以上であるか否かを判定する。さらに、制御部11は、特定された1つの検出パラメータ候補61を利用した判定の結果において、誤判定の評価画像127の数が第2の閾値以上であるか否かを判定する。
(Step S110 and Step S111)
In step S110, the
第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
ステップ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
なお、本実施形態では、各画像(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
(ステップS112)
ステップS112では、制御部11は、各追加用画像123及び生成された各復元追加用画像124の間の差分に応じて、各追加用画像123の評価値125であって、各復元追加用画像124における各追加用画像123の復元の程度に対する評価値125を算出する。本実施形態では、制御部11は、各差分画像182を利用して、各追加用画像123の評価値125を算出する。
(Step S112)
In step S112, the
ここで、図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
本実施形態では、この観点に基づく算出方法の一例として、制御部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
ただし、評価値125を算出する方法は、このような例に限定されなくてもよい。各追加用画像123及び各復元追加用画像124の差分と評価値125との間の関係は、評価値125が、当該差分が大きいことに応じて復元の程度が低いことを示し、かつ当該差分が小さいことに応じて復元の程度が高いことを示すように、適宜決定されてよい。例えば、上記算出方法とは反対に、評価値125は、復元の程度が低いほど小さく、復元の程度が高いほど大きくなるように算出されてよい。当該算出方法の一例として、制御部11は、上記の処理により抽出された画素の画素値の平均値又は合計値の逆数を評価値125として算出してもよい。
However, the method for calculating the
なお、本実施形態では、制御部11は、ステップS107において、各追加用画像123と各復元追加用画像124との差分に基づいて、各追加用画像123に欠陥Lが写っているか否かを判定している。欠陥Lが写っていると判定されることは、追加用画像123と復元追加用画像124との間の差分が大きい、換言すると、復元追加用画像124における追加用画像123の復元の程度が低いことを示す。反対に、欠陥Lが写っていないと判定されることは、追加用画像123と復元追加用画像124との間の差分が小さい、換言すると、復元追加用画像124における追加用画像123の復元の程度が高いことを示す。
In this embodiment, in step S107, the
そこで、本実施形態では、制御部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
また、本実施形態では、各追加用画像123は、複数のパッチ画像P2に分割されている。これに応じて、本実施形態では、制御部11は、誤判定の追加用画像123の数又は割合が第1の閾値以上である、又は誤判定の評価画像127の数又は割合が第2の閾値以上であるパッチ画像P2毎に、各追加用画像123の評価値125を算出する。各追加用画像123の評価値125を算出すると、制御部11は、次のステップS113に処理を進める。
Further, in this embodiment, each
(ステップS113)
ステップS113では、制御部11は、抽出部115として動作し、算出された評価値125に基づいて、復元の程度が低いと評価される1つ以上の追加用画像126を複数の追加用画像123から抽出する。
(Step S113)
In step S113, the
復元の程度が低いと評価するための基準は、特に限定されなくてもよく、実施の形態に応じて適宜設定されてよい。本実施形態では、ステップ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
なお、本実施形態では、制御部11は、ステップS107において、各追加用画像123と各復元追加用画像124との差分に基づいて、各追加用画像123に欠陥Lが写っているか否かを判定している。これに応じて、本実施形態では、制御部11は、本ステップS113において、算出された評価値125に基づいて、欠陥Lが写っていると判定された1又は複数の追加用画像123から、復元の程度が低いと評価される1つ以上の追加用画像126を抽出する。
In this embodiment, in step S107, the
また、本実施形態では、各追加用画像123は、複数のパッチ画像P2に分割されている。これに応じて、本実施形態では、制御部11は、パッチ画像P2毎に、算出された評価値125に基づいて、1つ以上の追加用画像126を複数の追加用画像123から抽出する。1つ以上の追加用画像126を抽出すると、制御部11は、次のステップS114に処理を進める。
Furthermore, in this embodiment, each
(ステップ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
ここで、図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
本実施形態では、生成モデル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
この点に関して、本実施形態では、制御部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
また、本実施形態に係る表示画面の一例は、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
なお、本実施形態では、各追加用画像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
(ステップS116)
ステップS116では、制御部11は、追加学習部116として動作する。制御部11は、抽出された1つ以上の追加用画像126のうち、機械学習に使用すると選択された画像を第2学習画像126Aとして決定する。制御部11は、機械学習により、決定された1つ以上の第2学習画像126Aそれぞれが与えられると、与えられた1つ以上の第2学習画像126Aそれぞれに適合する復元画像を生成するように生成モデル5を更に訓練する。
(Step S116)
In step S116, the
本実施形態では、制御部11は、第1学習画像121及び第2学習画像126Aを使用して、上記ステップS102と同様に、ニューラルネットワークの演算パラメータMを導出する。これにより、制御部11は、第1学習画像121及び第2学習画像126Aそれぞれが与えられると、与えられた第1学習画像121及び第2学習画像126Aそれぞれに適合する復元画像を生成するように訓練された学習済みの生成モデル5を構築することができる。
In this embodiment, the
なお、本実施形態では、追加用画像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
上述したように、本実施形態では、制御部11は、図13及び図14に例示される表示画面の一例における領域402のリスト表示を介して、抽出された1つ以上の追加用画像126それぞれについて、当該1つ以上の追加用画像126それぞれを機械学習に使用するか否かの選択を受け付ける。これに応じて、本実施形態では、制御部11は、機械学習に使用しないと選択された追加用画像126を本ステップS116による訓練の対象から除外する。より詳細には、本実施形態では、制御部11は、操作ボタン406が操作された時点において、領域402のリストに含まれる画像を使用して、生成モデル5の機械学習を実施する。
As described above, in the present embodiment, the
生成モデル5の更なる訓練が完了すると、制御部11は、ステップS116により得られた訓練済みの生成モデル5を利用して、ステップS105から処理を繰り返す。ステップS105~ステップS116の処理を繰り返すことで、製品Rの写る画像を再現する生成モデル5の能力の適切な向上に貢献する可能性の高い追加用画像126を複数の追加用画像123から抽出することができる。そして、抽出された追加用画像126に含まれる1つ以上の第2学習画像126Aを生成モデル5の更なる機械学習に使用して、製品Rの写る画像を再現する生成モデル5の能力の適切な向上を図ることができる。
When further training of the
なお、ステップ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
(ステップS117)
ステップS117では、制御部11は、保存処理部1110として動作し、最終的に構築された学習済みの生成モデル5に関する情報を学習結果データ129として生成する。本実施形態では、最終的な機械学習に使用される学習画像は、ステップS111の条件分岐、ステップS113の処理、及びステップS115の処理それぞれの結果に応じて、第1学習画像121及び追加用画像123(126)から決定される。なお、本実施形態では、学習画像のパッチ画像毎に学習済みの生成モデル5が構築される。そのため、制御部11は、学習画像のパッチ画像毎に構築された学習済みの生成モデル5に関する情報を学習結果データ129として生成する。
(Step S117)
In step S117, the
学習結果データ129には、生成モデル5を構成する演算パラメータMの値を再現可能な情報が含まれる。本実施形態では、生成モデル5は、ニューラルネットワークにより構成される。そのため、例えば、学習結果データ129には、最終的に構築された学習済みのニューラルネットワーク(生成モデル5)の演算パラメータMの値を再現可能な情報が含まれる。また、例えば、学習結果データ129には、学習画像のパッチ画像毎に導出された演算パラメータMが含まれてもよい。制御部11は、生成された学習結果データ129を所定の記憶領域に保存する。
The learning
所定の記憶領域は、例えば、制御部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
なお、学習装置1により生成された学習結果データ129は、任意のタイミングで検出装置2に提供されてよい。例えば、制御部11は、上記ステップS117の処理として又は上記ステップS117とは別に、学習結果データ129を検出装置2に転送してもよい。検出装置2は、この転送を受け付けることで、学習結果データ129を取得してもよい。また、例えば、検出装置2は、通信インタフェース23を利用して、学習装置1又はデータサーバにネットワークを介してアクセスすることで、学習結果データ129を取得してもよい。また、例えば、検出装置2は、記憶媒体92を介して、学習結果データ129を取得してもよい。また、例えば、学習結果データ129は、検出装置2に予め組み込まれてもよい。
Note that the learning
[検出装置]
次に、図15を用いて、検出装置2の動作例について説明する。図15は、本実施形態に係る検出装置2の処理手順の一例を示すフローチャートである。以下で説明する処理手順は、検出方法の一例である。ただし、以下で説明する処理手順は一例に過ぎず、各処理は可能な限り変更されてよい。検出方法には、上記学習方法及びモデル選択方法が含まれてよい。また、以下で説明する処理手順について、実施の形態に応じて、適宜、ステップの省略、置換、及び追加が可能である。
[Detection device]
Next, an example of the operation of the
(ステップS301)
ステップS301では、制御部21は、取得部211として動作し、製品Rを観測することで得られた観測画像221を取得する。本実施形態では、検出装置2には、外部インタフェース27を介してカメラCAが接続されている。そのため、制御部21は、カメラCAから観測画像221を取得する。この観測画像221は、動画像であってもよいし、静止画像であってもよい。
(Step S301)
In step S301, the
なお、観測画像221を取得する経路は、このような例に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、カメラCAは、検出装置2とは異なる他の情報処理装置に接続されていてもよい。この場合、制御部21は、他の情報処理装置を介して観測画像221を取得してもよい。観測画像221を取得すると、制御部21は、次のステップS302に処理を進める。
Note that the route for acquiring the observed
(ステップS302)
ステップS302では、制御部21は、生成部212として動作し、学習結果データ129を参照して、学習済みの生成モデル5の設定を行う。そして、制御部21は、取得された観測画像221を学習済みの生成モデル5に入力し、学習済みの生成モデル5の演算処理を実行することで、観測画像221を復元した復元観測画像223を生成する。復元観測画像223は、学習済みの生成モデル5の出力、すなわち、学習済みの生成モデル5の演算結果として取得される。
(Step S302)
In step S302, the
本ステップ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
なお、本実施形態では、学習画像のパッチ画像毎に学習済みの生成モデル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
(ステップS303)
ステップS303では、制御部21は、検出部213として動作し、生成された復元観測画像223及び観測画像221の間の差分に基づいて、製品Rと共に欠陥が観測画像221に写っているか否か(すなわち、観測画像221に写る製品Rに欠陥が存在するか否か)を検出する。
(Step S303)
In step S303, the
本ステップ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
当該検出処理における各閾値の値は、実施の形態に応じて適宜決定されてよい。例えば、各閾値の値は、オペレータの入力により指定されてよい。また、例えば、各閾値の値は、プログラム内の設定値として与えられてもよい。また、例えば、各閾値には、上記ステップ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
なお、本実施形態では、観測画像221は、複数のパッチ画像P4に分割される。これに応じて、本実施形態では、制御部21は、観測画像221のパッチ画像P4毎に、観測画像221の対象のパッチ画像P4と復元観測画像223の対応するパッチ画像との差分に基づいて、当該対象のパッチ画像P4に写る製品Rに欠陥が存在するか否かを検出してもよい。観測画像221に写る製品Rに欠陥が存在するか否かを検出すると、制御部21は、次のステップS304に処理を進める。
Note that in this embodiment, the observed
(ステップS304)
ステップS304では、制御部21は、出力部214として動作し、欠陥の検出の結果、すなわち、製品Rの良否を判定した結果に関する情報を出力する。
(Step S304)
In step S304, the
製品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
また、制御部21は、本ステップS304の出力処理として、製品Rの良否を判定した結果に応じた所定の制御処理を実行してもよい。具体例として、検出装置2は、製品Rの搬送を行う製造ラインに接続されていてもよい。この場合に、制御部21は、欠陥が存在すると判定された製品Rを、欠陥が存在しないと判定された製品Rとは異なる経路で搬送する指令を製造ラインに送信する処理を本ステップS304の出力処理として行ってもよい。
Further, the
製品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
[特徴]
以上のとおり、本実施形態では、ステップS102において、第1学習画像121を使用した機械学習により、学習済みの生成モデル5が暫定的に構築される。そして、ステップS112及びステップS113の処理により、暫定的に構築された学習済みの生成モデル5が各追加用画像123に対して復元能力を発揮した結果に基づいて、当該復元能力の適切な向上に貢献する可能性の高い1つ以上の追加用画像126を複数の追加用画像123から自動的に抽出することができる。したがって、本実施形態によれば、学習画像を適切に選択できる。これに応じて、検出装置2では、上記一連の処理において、このように適切に選択された学習画像を用いて構築された学習済みの生成モデル5を利用することで、製品Rに欠陥が存在するか否かを精度よく検出することができる。その結果、製品Rの欠陥検出にかかるコストを低減することができる。
[Features]
As described above, in this embodiment, the learned
また、パッチ画像毎に生成モデルを用意する場合、生成モデルの機械学習に使用する学習画像を適切に選択することが更に困難となる。これに対して、本実施形態によれば、パッチ画像毎に用意される生成モデル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
また、本実施形態では、ステップ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
また、本実施形態では、ステップ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
§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
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
In the embodiment described above, the
上記ステップ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
上記実施形態に係る検出装置2についても同様である。すなわち、上記ステップS302において復元観測画像223を生成する処理が、ニューラルネットワークの演算処理から固有ベクトル行列の演算処理に置き換わる。この点を除き、上記実施形態に係る検出装置2は、上記実施形態と同様の処理手順により、観測画像221に写る製品Rに欠陥が存在するか否かを検出することができる。
The same applies to the
<5.3 変形例3>
上記実施形態では、制御部11は、抽出された追加用画像126等の情報を表示装置15に出力している。しかしながら、情報の出力先は、このような例に限られなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、制御部11は、抽出された追加用画像126等の情報を、表示装置15とは別の表示装置に出力してもよいし、表示装置以外の出力先(例えば、メモリ、表示装置以外の出力装置)に出力してもよい。
<5.3 Modification 3>
In the embodiment described above, the
<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
In the embodiment described above, the
図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
本変形例では、学習装置1Bの制御部11は、上記ステップS101及びステップS102の処理を省略し、モデル取得部111Bとして動作する。すなわち、制御部11は、1つ以上の第1学習画像121を使用した機械学習により訓練された生成モデル5を取得する。上記実施形態と同様に、生成モデル5は、入力画像が与えられると、与えられた入力画像を特徴量に変換し、変換により得られた特徴量から与えられた入力画像を復元した画像を生成するように構成される。機械学習により、生成モデル5は、1つ以上の第1学習画像121それぞれが与えられると、与えられた1つ以上の第1学習画像121それぞれに適合する復元画像を生成するように訓練されている。この機械学習の処理は、他のコンピュータにより実行されてよい。
In this modification, the
上記実施形態の学習結果データ129と同様に、機械学習により訓練された生成モデル5に関する情報は、学習結果データとして学習装置1Bに提供されてよい。また、上記実施形態における学習装置1により生成された学習結果データ129を検出装置2に提供する方法と同様の方法で、他のコンピュータにより生成された学習結果データが学習装置1Bに提供されてよい。1つ以上の第1学習画像121を使用した機械学習により訓練された生成モデル5を取得した後、学習装置1Bは、上記実施形態におけるステップS103~ステップS117の処理を実行してもよい。これにより、本変形例に係る学習装置1Bは、上記実施形態と同様に、機械学習に使用する学習画像を適切に選択できる。なお、この変形例において、第2取得部112は、画像取得部の一例である。
Similar to the learning
上記変形例のとおり、機械学習の処理が他のコンピュータにより実行される場合、上記処理手順における機械学習の処理は、当該他のコンピュータから機械学習の処理結果を取得することに置き換わる。また、ステップ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
<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
また、上記実施形態では、ステップ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
また、上記実施形態において、各ステップの処理順序は適宜変更されてよい。例えば、ステップ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
例えば、制御部11は、誤判定される各画像(123,127)の数又は割合が予め定められた閾値以下となる1以上の検出パラメータ候補を複数の検出パラメータ候補60から抽出してもよい。あるいは、制御部11は、誤判定される各画像(123,127)の数又は割合の少ない上位所定数(例えば5個)の検出パラメータ候補を複数の検出パラメータ候補60から抽出してもよい。
For example, the
製造ラインにおいて、不良品が良品として出荷されることは、できるだけ回避されるべきである。そのため、制御部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
制御部11は、抽出された1以上又は所定数の検出パラメータ候補60の各々と、当該各検出パラメータ候補を用いたときの、誤判定される各画像(123,127)の数又は割合を表示装置15に表示する。そして、制御部11は、入力装置14に入力された選択指示に従って、表示された1以上又は所定数の検出パラメータ候補60の中から1つの検出パラメータ候補61を選択してもよい。誤判定される評価画像127の数又は割合は、不良品が良品として判定される数又は割合である。誤判定される評価画像127の数又は割合が小さいほど、不良品の流出を抑制できる。一方、誤判定される追加用画像123の数又は割合は、良品が不良品として判定される数又は割合である。誤判定される追加用画像123の数又は割合が小さいほど、歩留まりが良い。オペレータは、製造ラインに要求される不良品の流出割合および歩留まりを考慮しながら、検出パラメータ候補61を選択すればよい。
The
あるいは、検出パラメータの値は、予め決定されていてもよい。検出パラメータの値は、オペレータの入力、プログラム内の設定値等により与えられてよい。この場合、上記実施形態に係る学習装置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
<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
図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
第3取得部117Cは、製品R及び欠陥Lがそれぞれ写る複数の第1評価画像127Aと、製品Rが写り、欠陥Lが写っていない複数の第2評価画像127Bとを取得する。
The third acquisition unit 117C acquires a plurality of
複数の第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
複数の第2評価画像127Bは、上記画像(121、123)と同様に生成されてもよい。各第2評価画像127Bの生成は、学習装置1により行われてもよいし、学習装置1以外の他のコンピュータにより行われてもよい。制御部11は、自動的に又は入力装置14を介したオペレータの操作により手動的に上記一連の処理を実行することで、複数の第2評価画像127Bを取得してもよい。或いは、制御部11は、例えば、ネットワーク、記憶媒体91等を介して、他のコンピュータにより生成された複数の第2評価画像を取得してもよい。複数の第2評価画像127Bのうちの一部が学習装置1により生成され、残りが他のコンピュータにより生成されてもよい。取得する第2評価画像の件数は、特に限定されなくてもよく、適宜決定されてよい。
The plurality of
本変形例では、制御部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
上記ステップ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
上記ステップ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
上記ステップS109では、制御部11は、各ステップ(S107、S108)の判定結果に基づいて、欠陥Lが画像に写っているか否かを判定するための検出パラメータの最適化を実行する。具体的には、制御部11は、欠陥Lが写っていると判定された第2評価画像127Bの数(以下、誤判定の第2評価画像の数とも記載する)をカウントする。制御部11は、欠陥Lが写っていないと判定された第1評価画像127Aの数(以下、誤判定の第1評価画像の数と記載する)の数をカウントする。制御部11は、誤判定の第1評価画像の数及び誤判定の第2評価画像の数が最も少ない1つの検出パラメータ候補61を特定する。
In step S109, the
あるいは、制御部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
上記のステップS110では、制御部11は、評価部114として動作し、特定された1つの検出パラメータ候補61を利用した判定の結果において、誤判定の第2評価画像の数又は割合が第1の閾値以上であるか否かを判定する。さらに、制御部11は、特定された1つの検出パラメータ候補61を利用した判定の結果において、誤判定の第1評価画像の数又は割合が第2の閾値以上であるか否かを判定する。
In step S110 described above, the
上記のステップS112では、制御部11は、生成部113として動作し、取得された複数の追加用画像123それぞれを生成モデル5に与えることで、複数の追加用画像123それぞれを復元した複数の復元追加用画像124それぞれを生成する。そして、制御部11は、各追加用画像123及び生成された各復元追加用画像124の間の差分に応じて、各追加用画像123の評価値125であって、各復元追加用画像124における各追加用画像123の復元の程度に対する評価値125を算出すればよい。
In step S<b>112 described above, the
<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
制御部11は、通信インタフェース13を介して、観測画像221を検出装置2から取得すればよい。あるいは、検出装置2は、カメラCAから取得した観測画像221を記憶媒体92に格納してもよい。そして、制御部11は、ドライブ16を介して、記憶媒体92から観測画像221を読み込んでもよい。
The
検出装置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
観測画像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
変形例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
図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
(ステップS401)
ステップS401では、制御部11は、第2取得部112として動作し、検出装置2によって取得された観測画像221を追加用画像123として取得する。追加用画像123を取得すると、制御部11は、ステップS402に処理を進める。
(Step S401)
In step S401, the
(ステップS402)
ステップS402では、制御部11は、生成部113として動作し、取得された追加用画像123を生成モデル5に与えることで、追加用画像123を復元した復元追加用画像124を生成する。ステップS4023は、上記ステップS105と同様である。そのため、ステップS402の詳細な説明を省略する。復元追加用画像124を生成すると、制御部11は、ステップS403に処理を進める。
(Step S402)
In step S402, the
(ステップS403)
ステップS403では、制御部11は、追加用画像123及び生成された復元追加用画像124の間の差分に応じて、追加用画像123の評価値125であって、復元追加用画像124における追加用画像123の復元の程度に対する評価値125を算出する。ステップS403は、上記ステップS112と同様である。そのため、ステップS403の詳細な説明を省略する。評価値125を生成すると、制御部11は、ステップS404に処理を進める。
(Step S403)
In step S403, the
(ステップS404)
ステップS404では、制御部11は、記憶部12に保存する追加用画像126に対する評価値125の下限値LLが設定されているか否かを判定する。下限値LLは、必要に応じて、オペレータの入力、プログラム内の設定値等により適宜設定される。ステップS404でYESの場合、制御部11は、ステップS405に処理を進める。ステップS404でNOの場合、制御部11は、ステップS407に処理を進める。
(Step S404)
In step S404, the
(ステップS405)
ステップS405では、制御部11は、ステップS403の処理によって算出された評価値125と下限値LLとを比較する。評価値125が下限値LL以下である場合(ステップS405でNO)、制御部11は、ステップS406に処理を進める。評価値125が下限値LLを超える場合(ステップS405でYES)、制御部11は、ステップS407に処理を進める。
(Step S405)
In step S405, the
(ステップS406)
ステップS406では、制御部11は、ステップS401の処理によって取得した観測画像221(追加用画像123)を破棄する。追加用画像123が破棄されると、制御部11は、追加用画像126の抽出処理を終了する。
(Step S406)
In step S406, the
(ステップS407)
ステップS407では、制御部11は、記憶部12に保存する追加用画像126の数の上限値HLが設定されているか否かを判定する。上限値HLは、必要に応じて、オペレータの入力、プログラム内の設定値等により適宜設定される。ステップS407でNOの場合、制御部11は、ステップS412に処理を進める。ステップS407でYESの場合、制御部11は、ステップS408に処理を進める。
(Step S407)
In step S407, the
(ステップS408)
ステップS408では、制御部11は、記憶部12に保存されている追加用画像126の数が上限値HLに到達しているか否かを判定する。ステップS408でNOの場合、制御部11は、ステップS412に処理を進める。ステップS408でYESの場合、制御部11は、ステップS409に処理を進める。
(Step S408)
In step S408, the
(ステップS409)
ステップS409では、制御部11は、記憶部12に保存されている所定数(上限値HLと同数)の追加用画像126に対する評価値125のうちの最小値を特定する。ステップS412において後述するように、記憶部12には追加用画像126と評価値125とが対応付けて保存される。制御部11は、追加用画像126に対応付けられた評価値125を確認することにより、最小値を特定する。最小値を特定すると、制御部11は、ステップS410に処理を進める。
(Step S409)
In step S409, the
(ステップS410)
ステップS410では、制御部11は、ステップS403の処理によって算出された評価値125がステップS409の処理によって特定された最小値を超えるか否かを判定する。ステップS410でYESの場合、制御部11は、ステップS411に処理を進める。ステップS410でNOの場合、制御部11は、ステップS406に処理を進め、ステップS401の処理によって取得した観測画像221(追加用画像123)を破棄する。
(Step S410)
In step S410, the
(ステップS411)
ステップS411では、制御部11は、記憶部12に保存されている複数(上限値HLと同数)の追加用画像126のうち、評価値125が最も小さい1つの追加用画像126を記憶部12から削除する。評価値125が最も小さい1つの追加用画像126を記憶部12から削除すると、制御部11は、ステップS412に処理を進める。
(Step S411)
In step S411, the
(ステップS412)
ステップS412では、制御部11は、ステップS401の処理によって取得した観測画像221(追加用画像123)を新たな追加用画像126として記憶部12に保存する。このとき、制御部11は、ステップS403の処理によって算出した評価値125を新たな追加用画像126と対応付けて記憶部12に保存する。新たな追加用画像126を記憶部12に保存した後、制御部11は、追加用画像126の抽出処理を終了する。
(Step S412)
In step S412, the
図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
図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
(ステップS501)
ステップS501では、制御部11は、記憶部12に保存されている所定数の追加用画像126を復元の程度に応じてソートする。具体的には、制御部11は、所定数の追加用画像126を評価値125の高い順に並び替える。ソートが完了すると、制御部11は、ステップS502に処理を進める。
(Step S501)
In step S501, the
(ステップS502)
ステップS502では、制御部11は、表示制御部118として動作し、所定数の追加用画像126を含む表示画面を表示装置15に表示させる。
(Step S502)
In step S502, the
図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
表示画面70は、領域75,78を含む。領域75には、記憶部12に保存されている所定数の追加用画像126の一覧が表示される。具体的には、領域75には、所定数の追加用画像126にそれぞれ対応する所定数のサムネイル画像76が表示される。所定数のサムネイル画像76は、ステップS501の処理によってソートされた順に並べられる。さらに、領域75には、各追加用画像126に対応する評価値125も表示される。領域75には、所定数のサムネイル画像76のうちの1つを選択するためのカーソル77が表示される。カーソル77は、入力装置14への入力に応じて移動する。領域78には、カーソル77によって選択されたサムネイル画像76に対応する追加用画像126が表示される。
表示画面70は、さらに領域79~81とボタン82~89とを含む。領域79には、不良品画像として分類された追加用画像126のリスト(以下、不良品画像リストとも記載する)が表示される。領域80には、良品画像として分類された追加用画像126のリスト(以下、良品画像リストとも記載する)が表示される。領域81には、第2学習画像126Aとして選択された追加用画像126のリスト(以下、「学習画像リスト」とも記載する)が表示される。不良品画像リスト、良品画像リストおよび学習画像リストは、画像のファイル名の一覧である。ボタン82~85は、追加用画像126を不良品画像および良品画像のいずれかに分類するためのボタンである。ボタン86は、第2学習画像126Aを決定するためのボタンである。ボタン87は、追加学習を実行させるためのボタンである。ボタン88は、検出パラメータの最適化を実行させるためのボタンである。ボタン89は、表示画面70を閉じるためのボタンである。
表示画面70は、各種の情報が表示される領域90を含む。領域90において、「前回最低スコア」は、前回の追加学習の前に抽出された所定数の追加用画像126にそれぞれ対応する所定数の評価値125のうちの最小値を示す。「前回平均スコア」は、前回の追加学習の前に抽出された所定数の追加用画像126にそれぞれ対応する所定数の評価値125の平均値を示す。「最低スコア」は、今回の追加学習の前に抽出された所定数の追加用画像126にそれぞれ対応する所定数の評価値125のうちの最小値を示す。「平均スコア」は、今回の追加学習の前に抽出された所定数の追加用画像126にそれぞれ対応する所定数の評価値125の平均値を示す。「残ストレージ容量」は、記憶部12における空き容量を示す。「保存可能枚数」は、記憶部12に保存可能な追加用画像126の最大数を示す。
図23に例示される表示画面70の表示が完了すると、制御部11は、ステップS503に処理を進める。
When the display of the
(ステップ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
(ステップS504)
ステップS504では、制御部11は、選択受付部119として動作し、ボタン82~85への操作に応じて、選択された追加用画像126を不良品画像および良品画像のいずれかに分類する。
(Step S504)
In step S504, the
制御部11は、ボタン82が操作されると、領域78に表示されている追加用画像126を良品画像に分類する。制御部11は、良品画像に分類された追加用画像126に対応するサムネイル画像76を領域75から削除する。制御部11は、良品画像に分類された追加用画像126を新たな第2評価画像127Bとして記憶部12に保存する。制御部11は、領域80に表示される良品画像リストに当該新たな第2評価画像127Bを追加する。
When the
制御部11は、ボタン83が操作されると、領域78に表示されている追加用画像126を不良品画像に分類する。制御部11は、不良品画像に分類された追加用画像126に対応するサムネイル画像76を領域75から削除する。制御部11は、不良品画像に分類された追加用画像126を新たな第1評価画像127Aとして記憶部12に保存する。制御部11は、領域79に表示される不良品画像リストに当該新たな第1評価画像127Aを追加する。
When the
オペレータは、ボタン82,83を誤って操作し得る。例えば、オペレータは、ボタン82を操作すべきところボタン83を誤って操作し得る。この場合、良品画像として分類すべき追加用画像126が不良品画像として分類され、領域79に表示される不良品画像リストに追加される。このような誤操作が行なわれた場合であっても修復できるように、表示画面70にはボタン84,85が用意されている。ボタン84は、不良品画像リストから選択された画像を良品画像リストに移動させるためのボタンである。ボタン85は、良品画像リストから選択された画像を不良品画像リストに移動させるためのボタンである。
The operator may operate the
制御部11は、不良品画像リストおよび良品画像リストのいずれかに含まれる1つの画像の選択を受け付ける。不良品画像リストおよび良品画像リストのいずれかに含まれる1つの画像が選択されると、制御部11は、選択された画像を領域78に表示させる。これにより、オペレータは、領域78に表示される画像を確認することにより、ボタン82,83の誤操作の有無を確認できる。
The
不良品画像リストの中の1つの第1評価画像127Aが選択された状態でボタン84の操作を受け付けると、制御部11は、選択された第1評価画像127Aを良品画像に分類し直す。制御部11は、良品画像に分類された第1評価画像127Aを新たな第2評価画像127Bとして記憶部12に保存し直す。制御部11は、領域80に表示される良品画像リストに当該新たな第2評価画像127Bを追加する。
When the
良品画像リストの中の1つの第2評価画像127Bが選択された状態でボタン85の操作を受け付けると、制御部11は、選択された第2評価画像127Bを不良品画像に分類し直す。制御部11は、不良品画像に分類された第2評価画像127Bを新たな第1評価画像127Aとして記憶部12に保存し直す。制御部11は、領域79に表示される不良品画像リストに当該新たな第1評価画像127Aを追加する。
When the
操作されたボタンに応じた処理が完了すると、制御部11は、ステップS505に処理を進める。
When the process corresponding to the operated button is completed, the
(ステップ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
(ステップ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
(ステップS507)
ステップS507では、制御部11は、追加学習の実行指示を受け付けたか否かを判定する。制御部11は、表示画面70に含まれるボタン87が操作されたことに応じて、追加学習の実行指示を受け付けたと判定する。ボタン87が操作された場合(ステップS506でYES)、制御部11は、ステップS508に処理を進める。ボタン87が操作されていない場合(ステップS507でNO)、制御部11は、ステップS510に処理を進める。
(Step S507)
In step S507, the
(ステップS508)
ステップS508では、制御部11は、追加学習部116として動作し、機械学習により、学習画像リストに含まれる各第2学習画像126Aそれぞれが与えられると、与えられた各第2学習画像126Aに適合する復元画像を生成するように生成モデル5を更に訓練する。ステップS508は、上記ステップS116と同様である。そのため、ステップS508の詳細な説明を省略する。生成モデル5の訓練が完了すると、制御部11は、ステップS509に処理を進める。
(Step S508)
In step S508, the
(ステップS509)
ステップS509では、制御部11は、保存処理部1110として動作し、構築された学習済みの生成モデル5に関する情報を学習結果データ129として生成する。制御部11は、生成された学習結果データ129を所定の記憶領域に保存する。なお、生成された学習結果データ129は、任意のタイミングで検出装置2に提供されてよい。ステップS509の処理は、上記ステップS117と同様の処理である。学習結果データ129を保存すると、制御部11は、ステップS510に処理を進める。
(Step S509)
In step S509, the
(ステップS510)
ステップS510では、制御部11は、検出パラメータの最適化の実行指示を受け付けたか否かを判定する。制御部11は、表示画面70に含まれるボタン88が操作されたことに応じて、検出パラメータの最適化の実行指示を受け付けたと判定する。ボタン88が操作された場合(ステップS510でYES)、制御部11は、ステップS511に処理を進める。ボタン88が操作されていない場合(ステップS510でNO)、制御部11は、ステップS514に処理を進める。
(Step S510)
In step S510, the
(ステップ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
(ステップ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
(ステップ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
(ステップS514)
ステップS514では、制御部11は、表示画面70を閉じる旨の指示を受け付けたか否かを判定する。制御部11は、表示画面70に含まれるボタン89が操作されたことに応じて、表示画面70を閉じる旨の指示を受け付けたと判定する。ボタン89が操作されていない場合(ステップS514でNO)、制御部11は、ステップS503に処理を戻す。ボタン89が操作された場合(ステップS514でYES)、制御部11は、追加学習に関する一連の処理を終了する。
(Step S514)
In step S514, the
以上のように、変形例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
制御部11(抽出部115)は、評価値125に基づいて、復元の程度が低いと評価される所定数の追加用画像126を複数の追加用画像123から抽出する。そして、制御部11(選択受付部119)は、表示装置15に表示された所定数の追加用画像126それぞれについて、当該所定数の追加用画像126それぞれを機械学習に使用するか否かの選択を受け付ける。具体的には、制御部11(選択受付部119)は、所定数の追加用画像126それぞれについて、欠陥Lが写っているか否かの選択を受け付ける。制御部11(追加学習部116)は、機械学習に使用すると選択された追加用画像126(すなわち、欠陥Lが写っていないと選択された追加用画像126)を第2学習画像126Aとして決定する。
Based on the
学習装置は、不良品の製品Rが写っている観測画像221を追加用画像123として取得し得る。しかしながら、上記の構成によれば、オペレータの選択に応じて、欠陥Lの写っていない追加用画像126が第2学習画像126Aとして決定される。これにより、欠陥Lの写っている画像を用いた機械学習による生成モデル5の性能の低下を防止できる。
The learning device can acquire the
制御部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
制御部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
§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
(構成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
(構成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
(構成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
(構成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
(構成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
(構成11)
前記生成モデル(5)は、ニューラルネットワークにより構成される、
構成1から10のいずれかに記載の学習装置。
(Configuration 11)
The generative model (5) is configured by a neural network.
The learning device according to any one of
(構成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
(構成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
(構成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
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学習画像それぞれに適合する復元画像を生成するように前記生成モデルを訓練する、
学習部と、
前記所定の特徴の写る複数の追加用画像を取得する第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又は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つ以上の第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評価画像には、前記所定の特徴が写り、前記他の特徴が写っておらず、
前記評価部は、
前記他の特徴が画像に写っているか否かを判定するための複数のパラメータ候補が与えられ、
前記複数のパラメータ候補それぞれを利用して、前記他の特徴が前記各第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取得部は、前記検出装置によって取得された前記観測画像を前記複数の追加用画像の1つとして取得する、
請求項4又は6に記載の学習装置。 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から7のいずれか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つ以上の第2学習画像それぞれが与えられると、与えられた前記1つ以上の第2学習画像それぞれに適合する復元画像を生成するように前記生成モデルを更に訓練する、
請求項1から5のいずれか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から9のいずれか1項に記載の学習装置。 The generative model is configured by a neural network,
The learning device according to any one of claims 1 to 9 .
前記生成モデルは、前記主成分分析により導出された固有ベクトルにより構成される、請求項1から9のいずれか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つ以上の第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.
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)
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)
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 |
-
2019
- 2019-11-27 JP JP2019214618A patent/JP7404817B2/en active Active
Patent Citations (3)
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 |