JP2020060879A - Learning device, image generator, method for learning, and learning program - Google Patents

Learning device, image generator, method for learning, and learning program Download PDF

Info

Publication number
JP2020060879A
JP2020060879A JP2018190514A JP2018190514A JP2020060879A JP 2020060879 A JP2020060879 A JP 2020060879A JP 2018190514 A JP2018190514 A JP 2018190514A JP 2018190514 A JP2018190514 A JP 2018190514A JP 2020060879 A JP2020060879 A JP 2020060879A
Authority
JP
Japan
Prior art keywords
learning
image
input
generator
estimator
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.)
Granted
Application number
JP2018190514A
Other languages
Japanese (ja)
Other versions
JP7059883B2 (en
Inventor
瑩 王
Ying Wang
瑩 王
雄希 半澤
Yuki Hanzawa
雄希 半澤
真嗣 栗田
Masashi Kurita
真嗣 栗田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP2018190514A priority Critical patent/JP7059883B2/en
Publication of JP2020060879A publication Critical patent/JP2020060879A/en
Application granted granted Critical
Publication of JP7059883B2 publication Critical patent/JP7059883B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

To reduce the cost for preparing learning data used for a mechanical learning for acquiring an ability to detect the range of an object.SOLUTION: The learning device according to an aspect of the present invention forms a generator trained to acquire plural learning data sets each made of a combination of a learning image of an object, the label showing the type of the object, and boundary information showing the range of the object and to generate an image corresponding to the learning image for an input of each label by performing a first mechanical learning, and also forms an estimation unit trained to estimate the type and the range of the object in the learning image so that the label and the boundary information will conform to each other for input of each learning image by performing a second mechanical learning.SELECTED DRAWING: Figure 1

Description

本発明は、学習装置、画像生成装置、学習方法、及び学習プログラムに関する。   The present invention relates to a learning device, an image generation device, a learning method, and a learning program.

従来、製造ライン等の製品を製造する場面では、製造される製品を撮影装置により撮影し、得られた画像データに基づいて製品の良否を検査する技術が利用されている。例えば、特許文献1では、学習済みの第1のニューラルネットワークに基づいて画像に写る検査対象物が正常であるか異常であるかを判定し、検査対象物が異常であると判定した場合に、学習済みの第2のニューラルネットワークに基づいて当該異常の種類を分類する検査装置が提案されている。   2. Description of the Related Art Conventionally, in a scene of manufacturing a product such as a manufacturing line, a technique of photographing a manufactured product with a photographing device and inspecting the quality of the product based on the obtained image data is used. For example, in Patent Document 1, it is determined whether the inspection target in the image is normal or abnormal based on the learned first neural network, and when it is determined that the inspection target is abnormal, An inspection apparatus has been proposed which classifies the type of abnormality based on the learned second neural network.

特開2012−026982号公報JP 2012-026982A

Jianmin Bao, Dong Chen, Fang Wen, Houqiang Li, Gang Hua, "CVAE-GAN: Fine-Grained Image Generation through Asymmetric Training", 2017 IEEE International Conference on Computer Vision, 2764-2773, 2017Jianmin Bao, Dong Chen, Fang Wen, Houqiang Li, Gang Hua, "CVAE-GAN: Fine-Grained Image Generation through Asymmetric Training", 2017 IEEE International Conference on Computer Vision, 2764-2773, 2017

本件発明者らは、特許文献1のようなニューラルネットワーク等の学習モデルにより構成される識別器を利用して、画像データから製品の良否を判定する従来の技術には、次のような問題が生じ得ることを見出した。すなわち、製品の良否を判定する能力を学習モデルに習得させるための機械学習を行う場合、訓練データとしてサンプル画像を用意することになる。このサンプル画像の件数が少ないと、学習済みの学習モデル(識別器)による良否の判定の精度が不十分になってしまう。一方で、識別器による判定の精度を高めるために、十分な件数のサンプル画像を用意するにはコストがかかってしまう。   The inventors of the present invention have the following problems in the conventional technology for determining the quality of a product from image data by using a classifier configured by a learning model such as a neural network as disclosed in Patent Document 1. It has been found that this can happen. That is, when machine learning is performed to allow a learning model to acquire the ability to determine the quality of a product, sample images are prepared as training data. If the number of sample images is small, the accuracy of the quality determination by the learned model (discriminator) that has been learned becomes insufficient. On the other hand, it is costly to prepare a sufficient number of sample images in order to improve the accuracy of determination by the classifier.

そこで、本件発明者らは、生成器(生成モデル)を利用して、用意した画像から異なる複数の画像を量産し、量産した複数の画像を機械学習の訓練データとして利用することを検討した。例えば、非特許文献1には、機械学習により、用意した学習画像及びクラスから生成器(生成モデル)を構築する方法が提案されている。この生成器は、機械学習により、指定されたクラスの学習画像に対応する画像を生成するように訓練される。したがって、製品を写した画像を学習画像として利用し、製品に含まれる欠陥をクラスにより指定すれば、生成器は、指定された欠陥を含む製品の写り得る画像を生成するように訓練される。この訓練された生成器を利用すれば、指定したクラスの欠陥を含む製品の写る画像を自動的に生成することができるようになる。つまり、製品に含まれる欠陥を識別する能力を学習モデルに習得させるための機械学習に利用可能なサンプル画像を自動的に生成することができるようになる。そのため、サンプル画像を用意するコストを低減することができる。そして、自動的に生成したサンプル画像を機械学習に利用することにより、機械学習に利用するサンプル画像の件数を増やすことができ、これによって、製品の良否を判定する能力の高い学習済みの学習モデルを構築することができるようになる。   Therefore, the inventors of the present invention considered using a generator (generation model) to mass-produce a plurality of different images from prepared images and use the mass-produced images as training data for machine learning. For example, Non-Patent Document 1 proposes a method of constructing a generator (generation model) from prepared learning images and classes by machine learning. This generator is trained by machine learning to generate an image corresponding to a specified class of learning images. Therefore, if the image of the product is used as a learning image and the defects included in the product are designated by the class, the generator is trained to generate a visible image of the product including the designated defect. This trained generator can be used to automatically generate an image of a product containing a specified class of defects. That is, it becomes possible to automatically generate a sample image that can be used for machine learning for making a learning model acquire the ability to identify a defect included in a product. Therefore, the cost of preparing the sample image can be reduced. By using the automatically generated sample images for machine learning, the number of sample images used for machine learning can be increased, and as a result, a learned learning model with high ability to judge the quality of the product can be obtained. Will be able to build.

しかしながら、本件発明者らは、この生成器を利用する場面において、次のような問題点が生じ得ることを見出した。すなわち、製品に含まれる欠陥を識別すると共に、その欠陥の範囲を検出するように学習モデルを訓練する場合、欠陥の種別を示すラベルの他に、サンプル画像内における欠陥の範囲を示す境界情報(例えば、バウンディングボックスのグラウンドトゥルース)が教師データとして用意される。従来、この欠陥の範囲は、サンプル画像内において手動で指定され、指定された範囲を示す情報が境界情報としてサンプル画像に付与されていた。そのため、サンプル画像内で欠陥の範囲を指定する工程及び境界情報に付与する工程の分だけ機械学習に利用する学習データを用意する作業に手間がかかっていた。加えて、欠陥を識別し、その欠陥の範囲を特定するための知識を有さない作業者には、境界情報をサンプル画像に付与するのは困難であった。そのため、その知識を作業者に十分に習得させるのにも手間がかかっていた。したがって、欠陥の範囲を検出する能力を学習モデルに習得させるための機械学習に利用する学習データを用意するのにはコストがかかってしまうという問題点が生じ得る。   However, the inventors of the present invention have found that the following problems may occur in the scene where this generator is used. That is, when identifying a defect included in a product and training the learning model to detect the range of the defect, in addition to the label indicating the type of the defect, boundary information indicating the range of the defect in the sample image ( For example, the ground truth of the bounding box) is prepared as teacher data. Conventionally, the range of this defect has been manually specified in the sample image, and information indicating the specified range has been added to the sample image as boundary information. Therefore, it takes a lot of time to prepare the learning data to be used for machine learning by the steps of designating the range of the defect in the sample image and the step of adding the boundary information. In addition, it is difficult for an operator who does not have knowledge to identify a defect and specify the range of the defect to attach the boundary information to the sample image. Therefore, it took some time to make the workers fully acquire the knowledge. Therefore, it may be costly to prepare the learning data to be used for the machine learning for making the learning model acquire the ability to detect the defect range.

なお、このような問題点は、製品の良否を判定する能力と共に欠陥の範囲を検出する能力を学習モデルに習得させる場面だけではなく、何らかの対象物の範囲を検出する能力を学習モデルに習得させるあらゆる場面で生じ得る。例えば、対象者の顔を写した顔画像に対して目等の器官の写る範囲を検出する能力を学習モデルに習得させるための機械学習を行う場面を想定する。この場面において、サンプル画像内で目の写る範囲を手動により指定し、指定した範囲を示す情報を境界情報として手動でサンプル画像に付与していたのでは、機械学習に利用する学習データを用意するのに大きなコストがかかってしまう。   It is to be noted that such a problem is not limited to the case where the learning model learns the ability to judge the quality of the product and the ability to detect the range of defects, and the learning model to learn the ability to detect the range of some object. It can occur in any situation. For example, assume a case where machine learning is performed to make a learning model acquire the ability to detect a range in which an organ such as an eye appears in a face image showing a face of a subject. In this scene, the range in which the eyes are visible is manually specified in the sample image, and the information indicating the specified range is manually added to the sample image as boundary information. Therefore, the learning data used for machine learning is prepared. It costs a lot of money.

本発明は、一側面では、このような実情を鑑みてなされたものであり、その目的は、対象物の範囲を検出する能力を習得させるための機械学習に利用する学習データを用意するのにかかるコストを低減する技術を提供することである。   The present invention, in one aspect, has been made in view of such circumstances, and an object thereof is to prepare learning data used for machine learning for acquiring the ability to detect a range of an object. It is to provide a technique for reducing the cost.

本発明は、上述した課題を解決するために、以下の構成を採用する。   The present invention adopts the following configurations in order to solve the problems described above.

すなわち、本発明の一側面に係る学習装置は、外観検査の対象となる製品を写した学習画像、前記製品に含まれる欠陥の種別を示すラベル、及び前記欠陥の範囲を示す境界情報の組み合わせによりそれぞれ構成された複数の学習データセットを取得するデータ取得部と、第1の機械学習を行うことで、前記各件の学習データセットに含まれる前記ラベルの入力に対して、入力された前記ラベルに関連付けられた前記学習画像に対応する画像を生成するように訓練された生成器を構築する第1学習処理部と、第2の機械学習を行うことで、前記各件の学習データセットに含まれる前記学習画像の入力に対して、入力された前記学習画像に関連付けられた前記ラベル及び前記境界情報と一致するように、入力された前記学習画像に写る前記製品に含まれる前記欠陥の種別及び範囲を推定するように訓練された推定器を構築する第2学習処理部と、を備える。   That is, the learning device according to one aspect of the present invention uses a learning image obtained by copying the product to be subjected to the visual inspection, a label indicating the type of defect included in the product, and boundary information indicating the range of the defect. By performing the first machine learning with a data acquisition unit that acquires a plurality of learning data sets that are each configured, the label that is input with respect to the input of the label that is included in each of the learning data sets A first learning processing unit that constructs a generator trained to generate an image corresponding to the learning image associated with For the input of the learning image to be input, the product reflected in the input learning image is matched with the label and the boundary information associated with the input learning image. Comprising a second learning processing unit for constructing a trained estimator to estimate the type and scope of Murrell the defect, the.

当該構成に係る学習装置によれば、指定されたラベルに関連付けられた学習画像に対応する画像を生成するように訓練された生成器を構築すると共に、学習画像に写る欠陥の種別及び範囲を推定するように訓練された推定器を構築することができる。これらのうち、生成器を利用することで、指定した欠陥を含む製品の写り得るサンプル画像を自動的に生成することができる。加えて、推定器を利用することで、生成されたサンプル画像に含まれる欠陥の範囲を推定し、推定した欠陥の範囲を示す情報を境界情報としてサンプル画像に自動的に付与することができる。したがって、当該構成によれば、学習データを用意する際に、サンプル画像内において欠陥の範囲を手動で指定する手間を省略することができる。そのため、対象物の範囲を検出する能力を習得させるための機械学習に利用する学習データを用意するのにかかるコストを低減することができる。   According to the learning device according to the configuration, a generator trained to generate an image corresponding to a learning image associated with a specified label is constructed, and the type and range of defects appearing in the learning image are estimated. An estimator trained to do so can be constructed. Of these, by using the generator, it is possible to automatically generate a sample image in which a product including the designated defect can be captured. In addition, by using the estimator, the range of defects included in the generated sample image can be estimated, and information indicating the estimated range of defects can be automatically added to the sample image as boundary information. Therefore, according to the configuration, it is possible to omit the trouble of manually designating the defect range in the sample image when preparing the learning data. Therefore, it is possible to reduce the cost required to prepare the learning data used for machine learning for acquiring the ability to detect the range of the object.

なお、推定器及び生成器はそれぞれ、機械学習を実施可能な学習モデルにより構成される。学習モデルには、例えば、ニューラルネットワーク等が用いられてよい。第1の機械学習及び第2の機械学習を実行する順序は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。第1の機械学習及び第2の機械学習は、同時に実行されてもよいし、別々に実行されてもよい。第1及び第2の機械学習を別々に実行する場合、第1の機械学習は、第2の機械学習よりも先に実行されてもよいし、第2の機械学習よりも後に実行されてもよい。   The estimator and the generator are each composed of a learning model capable of performing machine learning. For the learning model, for example, a neural network or the like may be used. The order of executing the first machine learning and the second machine learning may not be particularly limited, and may be appropriately selected according to the embodiment. The first machine learning and the second machine learning may be executed simultaneously or separately. When the first and second machine learnings are executed separately, the first machine learning may be executed before the second machine learning or may be executed after the second machine learning. Good.

また、製品は、外観検査の対象となり得るものであれば、その種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。製品は、例えば、電子機器、電子部品、自動車部品、薬品、食品等の製造ラインで搬送される物であってよい。電子機器は、例えば、携帯電話等である。電子部品は、例えば、基盤、チップコンデンサ、液晶、リレーの巻線等である。自動車部品は、例えば、コンロッド、シャフト、エンジンブロック、パワーウィンドウスイッチ、パネル等である。薬品は、例えば、包装済みの錠剤、未包装の錠剤等であってよい。また、欠陥は、製品の良否に関係し得るものであれば、その種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。欠陥は、例えば、傷、汚れ、クラック、打痕、バリ、色ムラ、異物混入等である。   Further, the type of the product is not particularly limited as long as it can be subjected to the visual inspection, and may be appropriately selected according to the embodiment. The product may be, for example, a product conveyed on a production line for electronic devices, electronic parts, automobile parts, chemicals, foods, and the like. The electronic device is, for example, a mobile phone or the like. The electronic component is, for example, a substrate, a chip capacitor, a liquid crystal, a winding of a relay, or the like. The automobile parts are, for example, connecting rods, shafts, engine blocks, power window switches, panels and the like. The drug may be, for example, a packaged tablet, an unpackaged tablet, or the like. Further, the type of the defect is not particularly limited as long as it can relate to the quality of the product, and may be appropriately selected according to the embodiment. The defects include, for example, scratches, stains, cracks, dents, burrs, color unevenness, and foreign matter mixed.

上記一側面に係る学習装置において、前記生成器の入力は、エンコーダの出力に接続されてよく、前記生成器の出力は、前記推定器の入力及び判別器の入力に接続されてもよい。そして、前記第1の機械学習を行うことは、前記判別器に入力された入力画像が、前記生成器により生成された前記画像であるか前記複数の学習データセットから得られた前記学習画像であるかを判別するように前記判別器を訓練する第1訓練ステップと、前記生成器により生成される前記画像が、前記判別器による前記判別を誤らせるようなものとなるように、前記生成器を訓練する第2訓練ステップと、前記生成器により生成される前記画像が、前記推定器により前記画像に写る製品に含まれる欠陥の種別を推定した結果が前記ラベルと一致するようなものとなるように、前記生成器を訓練する第3訓練ステップと、前記ラベル及び潜在変数を前記生成器に入力することで前記生成器により生成された前記画像が、前記学習画像を復元したものとなるように、前記エンコーダ及び前記生成器を訓練する第4訓練ステップであって、前記潜在変数は、前記ラベル及び前記学習画像を前記エンコーダに入力することで前記エンコーダから得られる出力に基づいて導出される、第4訓練ステップと、前記エンコーダから得られる出力に基づいて導出される前記潜在変数の分布が所定の事前分布に従うように前記エンコーダを訓練する第5訓練ステップと、を含んでもよい。当該構成によれば、学習済みの生成器及び推定器を適切に構築することができ、これにより、対象物の範囲を検出する能力を習得させるための機械学習に利用する学習データを用意するのにかかるコストを低減することができる。なお、第1〜第5訓練ステップを実行する順序は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。   In the learning device according to the above aspect, the input of the generator may be connected to the output of the encoder, and the output of the generator may be connected to the input of the estimator and the input of the discriminator. Then, performing the first machine learning means that the input image input to the discriminator is the image generated by the generator or the learning image obtained from the plurality of learning data sets. A first training step of training the discriminator to discriminate whether or not there is, and the generator so that the image generated by the generator causes the discrimination by the discriminator to be erroneous. The second training step of training and the image generated by the generator are such that the result of estimating the type of defects included in the product shown in the image by the estimator matches the label. And a third training step of training the generator, and the image generated by the generator by inputting the label and latent variables into the generator restores the learning image. A fourth training step for training the encoder and the generator such that the latent variable is based on an output obtained from the encoder by inputting the label and the training image to the encoder. And a fifth training step of training the encoder so that the distribution of the latent variable derived based on the output obtained from the encoder follows a predetermined prior distribution. Good. According to this configuration, it is possible to appropriately construct a learned generator and an estimator, and thereby prepare learning data used for machine learning for acquiring the ability to detect the range of an object. It is possible to reduce the cost involved. The order in which the first to fifth training steps are executed may not be particularly limited and may be appropriately selected according to the embodiment.

上記一側面に係る学習装置において、前記生成器の出力は、判別器の入力に接続されてよい。そして、前記第1の機械学習を行うことは、前記判別器に入力された入力画像が、前記生成器により生成された前記画像であるか前記複数の学習データセットから得られた前記学習画像であるかを判別するように、前記判別器を訓練する第1訓練ステップと、前記生成器により生成される前記画像が、前記判別器による前記判別を誤らせるようなものとなるように、前記生成器を訓練する第2訓練ステップと、を交互に行うことを含んでもよい。当該構成によれば、学習済みの生成器を適切に構築することができ、これにより、対象物の範囲を検出する能力を習得させるための機械学習に利用する学習データを用意するのにかかるコストを低減することができる。   In the learning device according to the above aspect, the output of the generator may be connected to the input of the discriminator. Then, performing the first machine learning means that the input image input to the discriminator is the image generated by the generator or the learning image obtained from the plurality of learning data sets. A first training step of training the discriminator to determine if there is, and the generator so that the image generated by the generator is such that the discriminator by the discriminator is erroneous. Alternating with a second training step of training According to this configuration, it is possible to appropriately construct a learned generator, and thus the cost of preparing learning data used for machine learning to acquire the ability to detect the range of an object. Can be reduced.

上記一側面に係る学習装置において、前記欠陥の範囲は、バウンディングボックスにより表されてよい。当該構成によれば、対象物の範囲としてバウンディングボックスを検出する能力を習得させるための機械学習に利用する学習データを用意するのにかかるコストを低減することができる。   In the learning device according to the above aspect, the range of the defect may be represented by a bounding box. With this configuration, it is possible to reduce the cost of preparing learning data used for machine learning for acquiring the ability to detect a bounding box as a range of an object.

また、本発明の一側面に係る画像生成装置は、上記いずれかの形態に係る学習装置により構築された前記生成器に、前記欠陥の種別を示す入力値を与えることで、前記欠陥を含む前記製品を写した生成画像を生成する生成部と、前記学習装置により構築された前記推定器に生成された前記生成画像を与えることで、前記生成画像に写る前記製品に含まれる前記欠陥の種別及び範囲を推定する推定部と、前記生成画像に写る前記製品に含まれる前記欠陥の種別を推定した結果が前記入力値により示される前記欠陥の種別と一致するか否かを判定する判定部と、前記欠陥の種別を推定した結果が前記入力値により示される前記欠陥の種別と一致すると前記判定部が判定した場合に、生成した前記生成画像と前記欠陥の範囲を推定した結果とを関連付けて所定の記憶領域に格納する画像保存部と、を備える。当該構成によれば、対象物の範囲を手動で指定する手間を省略した上で、対象物の範囲を検出する能力を習得させるための機械学習に利用可能な学習データを生成することができる。   Further, the image generation device according to one aspect of the present invention includes the defect including the defect by giving an input value indicating the type of the defect to the generator constructed by the learning device according to any one of the above aspects. By providing a generation unit that generates a generated image of a product and the generated image generated by the estimator constructed by the learning device, the defect type and the defect included in the product reflected in the generated image, and An estimation unit that estimates a range, and a determination unit that determines whether or not the result of estimating the type of the defect included in the product shown in the generated image matches the type of the defect indicated by the input value, When the determination unit determines that the result of estimating the type of the defect matches the type of the defect indicated by the input value, the generated image generated and the result of estimating the range of the defect are associated with each other. Comprising only an image storage unit for storing in a predetermined storage area, the. According to the configuration, it is possible to generate learning data that can be used for machine learning for acquiring the ability to detect the range of the object while omitting the trouble of manually specifying the range of the object.

また、上記各形態に係る学習装置及び画像生成装置は、製品の良否を判定する能力と共に欠陥の範囲を検出する能力を学習モデルに習得させる場面だけではなく、何らかの対象物の範囲を検出する能力を学習モデルに習得させるあらゆる場面に適用されてよい。例えば、上記各形態に係る学習装置及び画像生成装置は、対象者の顔を写した顔画像に対して目等の器官の写る範囲を検出する能力を学習モデルに習得させる場面に適用されてもよい。   Further, the learning device and the image generation device according to each of the above-described embodiments are not limited to the case where the learning model is made to acquire the ability to determine the quality of the product and the ability to detect the range of defects, and the ability to detect the range of some object May be applied to any situation in which the learning model is mastered. For example, the learning device and the image generation device according to each of the above embodiments may be applied to a scene in which a learning model acquires the ability to detect a range in which an organ such as an eye appears in a face image showing a face of a subject. Good.

例えば、本発明の一側面に係る学習装置は、対象物を写した学習画像、前記対象物の種別を示すラベル、及び前記学習画像内における前記対象物の範囲を示す境界情報の組み合わせによりそれぞれ構成された複数の学習データセットを取得するデータ取得部と、第1の機械学習を行うことで、前記各件の学習データセットに含まれる前記ラベルの入力に対して、入力された前記ラベルに関連付けられた前記学習画像に対応する画像を生成するように訓練された生成器を構築する第1学習処理部と、第2の機械学習を行うことで、前記各件の学習データセットに含まれる前記学習画像の入力に対して、入力された前記学習画像に関連付けられた前記ラベル及び前記境界情報と一致するように、入力された前記学習画像に写る前記対象物の種別及び範囲を推定するように訓練された推定器を構築する第2学習処理部と、を備える。   For example, the learning device according to one aspect of the present invention is configured by a combination of a learning image of a target object, a label indicating the type of the target object, and boundary information indicating the range of the target object in the learning image. A data acquisition unit that acquires a plurality of learned learning data sets, and performs the first machine learning to associate the input of the labels included in the learning data sets of the respective cases with the input labels. The first learning processing unit that constructs a generator trained to generate an image corresponding to the learned image that has been obtained, and the second machine learning are performed, so that the learning data set included in each of the learning data sets With respect to the input of the learning image, the type and the type of the target object appearing in the input learning image are matched so as to match the label and the boundary information associated with the input learning image. Comprising a second learning processing unit for constructing a trained estimator to estimate the range of.

なお、「対象物」は、画像から検出する対象となり得るものであれば、その種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。対象物は、例えば、上記外観検査の対象となる製品、製品に含まれる欠陥、人物、人物の身体部位(例えば、顔等)、人物の器官等であってよい。また、道路交通の監視画像に本発明を利用する場合、対象物は、例えば、車、歩行者、標識等であってもよい。   The “object” may be of any type as long as it can be an object to be detected from an image, and may be appropriately selected according to the embodiment. The object may be, for example, a product to be subjected to the appearance inspection, a defect included in the product, a person, a human body part (for example, face), a human organ, or the like. When the present invention is applied to a road traffic monitoring image, the object may be, for example, a car, a pedestrian, or a sign.

本発明の一側面に係る画像生成システムは、上記いずれかの形態に係る学習装置及び画像生成装置により構成されてもよい。また、本発明の一側面に係る推定システムは、上記いずれかの形態に係る学習装置、上記画像生成装置、生成された画像を利用して、画像に写る対象物の範囲を推定する推定器を構築する推定器生成装置、及び構築された推定器を利用して、画像に写る対象物の範囲を推定する推定装置により構成されてよい。更に、上記各形態に係る学習装置、画像生成装置、画像生成システム、及び推定システムそれぞれの別の形態として、本発明の一側面は、以上の各構成を実現する情報処理方法であってもよいし、プログラムであってもよいし、このようなプログラムを記憶した、コンピュータ等が読み取り可能な記憶媒体であってもよい。ここで、コンピュータ等が読み取り可能な記憶媒体とは、プログラム等の情報を、電気的、磁気的、光学的、機械的、又は、化学的作用によって蓄積する媒体である。   The image generation system according to one aspect of the present invention may be configured by the learning device and the image generation device according to any one of the above modes. Further, an estimation system according to one aspect of the present invention includes a learning device according to any one of the above modes, the image generation device, and an estimator that estimates a range of an object captured in the image by using the generated image. It may be configured by an estimator generation device that is constructed and an estimation device that estimates the range of an object shown in an image by using the constructed estimator. Furthermore, as another mode of each of the learning device, the image generation device, the image generation system, and the estimation system according to each of the above modes, one aspect of the present invention may be an information processing method that realizes each of the above configurations. However, it may be a program or 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 by electrical, magnetic, optical, mechanical, or chemical action.

例えば、本発明の一側面に係る学習方法は、コンピュータが、外観検査の対象となる製品を写した学習画像、前記製品に含まれる欠陥の種別を示すラベル、及び前記欠陥の範囲を示す境界情報の組み合わせによりそれぞれ構成された複数の学習データセットを取得するステップと、第1の機械学習を行うことで、前記各件の学習データセットに含まれる前記ラベルの入力に対して、入力された前記ラベルに関連付けられた前記学習画像に対応する画像を生成するように訓練された生成器を構築するステップと、第2の機械学習を行うことで、前記各件の学習データセットに含まれる前記学習画像の入力に対して、入力された前記学習画像に関連付けられた前記ラベル及び前記境界情報と一致するように、入力された前記学習画像に写る前記製品に含まれる前記欠陥の種別及び範囲を推定するように訓練された推定器を構築するステップと、を実行する、情報処理方法である。   For example, in a learning method according to one aspect of the present invention, a computer includes a learning image in which a product to be subjected to a visual inspection is copied, a label indicating a type of defect included in the product, and boundary information indicating a range of the defect. The step of acquiring a plurality of learning data sets each configured by a combination of and the first machine learning is performed, and the input of the label included in the learning data set of each case is performed. Constructing a generator trained to generate an image corresponding to the learning image associated with a label, and performing a second machine learning to include the learning included in each of the learning data sets. With respect to the input of the image, the product reflected in the input learning image so as to match the label and the boundary information associated with the input learning image. A step of constructing a trained estimator to estimate the type and extent of the defects included in the execution, an information processing method.

また、例えば、本発明の一側面に係る学習プログラムは、コンピュータに、外観検査の対象となる製品を写した学習画像、前記製品に含まれる欠陥の種別を示すラベル、及び前記欠陥の範囲を示す境界情報の組み合わせによりそれぞれ構成された複数の学習データセットを取得するステップと、第1の機械学習を行うことで、前記各件の学習データセットに含まれる前記ラベルの入力に対して、入力された前記ラベルに関連付けられた前記学習画像に対応する画像を生成するように訓練された生成器を構築するステップと、第2の機械学習を行うことで、前記各件の学習データセットに含まれる前記学習画像の入力に対して、入力された前記学習画像に関連付けられた前記ラベル及び前記境界情報と一致するように、入力された前記学習画像に写る前記製品に含まれる前記欠陥の種別及び範囲を推定するように訓練された推定器を構築するステップと、を実行させるための、プログラムである。   Further, for example, a learning program according to one aspect of the present invention indicates to a computer a learning image showing a product to be subjected to a visual inspection, a label indicating a type of defect included in the product, and a range of the defect. A step of acquiring a plurality of learning data sets each configured by a combination of boundary information and a first machine learning are performed to input the labels included in the learning data sets of the respective cases. Constructing a generator trained to generate an image corresponding to the learning image associated with the label, and performing a second machine learning to include the learning data set in each case. With respect to the input of the learning image, the input learning image so as to match the label and the boundary information associated with the input learning image For executing the steps of constructing a trained estimator to estimate the type and extent of the defect the included in the product Utsuru, a, a program.

また、例えば、本発明の一側面に係る学習方法は、コンピュータが、対象物を写した学習画像、前記対象物の種別を示すラベル、及び前記学習画像内における前記対象物の範囲を示す境界情報の組み合わせによりそれぞれ構成された複数の学習データセットを取得するステップと、第1の機械学習を行うことで、前記各件の学習データセットに含まれる前記ラベルの入力に対して、入力された前記ラベルに関連付けられた前記学習画像に対応する画像を生成するように訓練された生成器を構築するステップと、第2の機械学習を行うことで、前記各件の学習データセットに含まれる前記学習画像の入力に対して、入力された前記学習画像に関連付けられた前記ラベル及び前記境界情報と一致するように、入力された前記学習画像に写る前記対象物の種別及び範囲を推定するように訓練された推定器を構築するステップと、を実行する、情報処理方法である。   Further, for example, in a learning method according to one aspect of the present invention, a computer includes a learning image in which an object is copied, a label indicating a type of the object, and boundary information indicating a range of the object in the learning image. The step of acquiring a plurality of learning data sets each configured by a combination of and the first machine learning is performed, and the input of the label included in the learning data set of each case is performed. Constructing a generator trained to generate an image corresponding to the learning image associated with a label, and performing a second machine learning to include the learning included in each of the learning data sets. With respect to the input of the image, the pair captured in the input learning image so as to match the label and the boundary information associated with the input learning image. Performing the steps of constructing a trained estimator to estimate the type and range of the object, and an information processing method.

また、例えば、本発明の一側面に係る学習プログラムは、コンピュータに、対象物を写した学習画像、前記対象物の種別を示すラベル、及び前記学習画像内における前記対象物の範囲を示す境界情報の組み合わせによりそれぞれ構成された複数の学習データセットを取得するステップと、第1の機械学習を行うことで、前記各件の学習データセットに含まれる前記ラベルの入力に対して、入力された前記ラベルに関連付けられた前記学習画像に対応する画像を生成するように訓練された生成器を構築するステップと、第2の機械学習を行うことで、前記各件の学習データセットに含まれる前記学習画像の入力に対して、入力された前記学習画像に関連付けられた前記ラベル及び前記境界情報と一致するように、入力された前記学習画像に写る前記対象物の種別及び範囲を推定するように訓練された推定器を構築するステップと、を実行させるための、プログラムである。   Further, for example, the learning program according to one aspect of the present invention, a computer, a learning image of the object, a label indicating the type of the object, and boundary information indicating the range of the object in the learning image. The step of acquiring a plurality of learning data sets each configured by a combination of and the first machine learning is performed, and the input of the label included in the learning data set of each case is performed. Constructing a generator trained to generate an image corresponding to the learning image associated with a label, and performing a second machine learning to include the learning included in each of the learning data sets. When the image is input, it is reflected in the input learning image so as to match the label and the boundary information associated with the input learning image. For executing the steps of constructing a trained estimator to estimate the type and extent of the serial object, and a program.

本発明によれば、対象物の範囲を検出する能力を習得させるための機械学習に利用する学習データを用意するのにかかるコストを低減することができる。   According to the present invention, it is possible to reduce the cost required to prepare learning data used for machine learning for acquiring the ability to detect the range of an object.

図1は、本発明が適用される場面の一例を模式的に例示する。FIG. 1 schematically illustrates an example of a scene to which the present invention is applied. 図2は、実施の形態に係る学習画像に指定された欠陥の範囲を示す境界情報の一例を模式的に例示する。FIG. 2 schematically illustrates an example of boundary information indicating a range of a defect designated in the learning image according to the embodiment. 図3は、実施の形態に係る学習装置のハードウェア構成の一例を模式的に例示する。FIG. 3 schematically illustrates an example of the hardware configuration of the learning device according to the embodiment. 図4は、実施の形態に係る画像生成装置のハードウェア構成の一例を模式的に例示する。FIG. 4 schematically illustrates an example of the hardware configuration of the image generation apparatus according to the embodiment. 図5は、実施の形態に係る推定器生成装置のハードウェア構成の一例を模式的に例示する。FIG. 5 schematically illustrates an example of the hardware configuration of the estimator generation device according to the embodiment. 図6は、実施の形態に係る検査装置のハードウェア構成の一例を模式的に例示する。FIG. 6 schematically illustrates an example of the hardware configuration of the inspection device according to the embodiment. 図7は、実施の形態に係る学習装置のソフトウェア構成の一例を模式的に例示する。FIG. 7 schematically illustrates an example of the software configuration of the learning device according to the embodiment. 図8Aは、実施の形態に係る学習ネットワークの機械学習の過程の一例を模式的に例示する。FIG. 8A schematically illustrates an example of a machine learning process of the learning network according to the embodiment. 図8Bは、実施の形態に係る学習ネットワークの機械学習の過程の一例を模式的に例示する。FIG. 8B schematically illustrates an example of a machine learning process of the learning network according to the embodiment. 図9は、実施の形態に係る画像生成装置のソフトウェア構成の一例を模式的に例示する。FIG. 9 schematically illustrates an example of the software configuration of the image generating apparatus according to the embodiment. 図10は、実施の形態に係る推定器生成装置のソフトウェア構成の一例を模式的に例示する。FIG. 10 schematically illustrates an example of the software configuration of the estimator generation device according to the embodiment. 図11は、実施の形態に係る検査装置のソフトウェア構成の一例を模式的に例示する。FIG. 11 schematically illustrates an example of the software configuration of the inspection device according to the embodiment. 図12は、実施の形態に係る学習装置の処理手順の一例を例示する。FIG. 12 illustrates an example of a processing procedure of the learning device according to the embodiment. 図13は、実施の形態に係る画像生成装置の処理手順の一例を例示する。FIG. 13 illustrates an example of a processing procedure of the image generation apparatus according to the embodiment. 図14は、実施の形態に係る推定器生成装置の処理手順の一例を例示する。FIG. 14 illustrates an example of the processing procedure of the estimator generation device according to the embodiment. 図15は、実施の形態に係る検査装置の処理手順の一例を例示する。FIG. 15 illustrates an example of a processing procedure of the inspection device according to the embodiment. 図16は、変形例に係る学習ネットワークの構成の一例を模式的に例示する。FIG. 16 schematically illustrates an example of the configuration of the learning network according to the modification. 図17Aは、変形例に係る学習ネットワークの機械学習の過程の一例を模式的に例示する。FIG. 17A schematically illustrates an example of a process of machine learning of a learning network according to the modification. 図17Bは、変形例に係る学習ネットワークの機械学習の過程の一例を模式的に例示する。FIG. 17B schematically illustrates an example of a process of machine learning of the learning network according to the modification. 図17Cは、変形例に係る推定器の機械学習の仮定の過程を模式的に例示する。FIG. 17C schematically illustrates a hypothetical process of machine learning of the estimator according to the modification. 図18は、変形例に係る第1の機械学習の処理手順の一例を例示する。FIG. 18 illustrates an example of a processing procedure of the first machine learning according to the modification. 図19は、本発明が適用される場面の変形例を模式的に例示する。FIG. 19 schematically illustrates a modified example of a scene to which the present invention is applied. 図20は、変形例に係る検出装置のソフトウェア構成の一例を模式的に例示する。FIG. 20 schematically illustrates an example of the software configuration of the detection device according to the modification.

以下、本発明の一側面に係る実施の形態(以下、「本実施形態」とも表記する)を、図面に基づいて説明する。ただし、以下で説明する本実施形態は、あらゆる点において本発明の例示に過ぎない。本発明の範囲を逸脱することなく種々の改良や変形を行うことができることは言うまでもない。つまり、本発明の実施にあたって、実施形態に応じた具体的構成が適宜採用されてもよい。なお、本実施形態において登場するデータを自然言語により説明しているが、より具体的には、コンピュータが認識可能な疑似言語、コマンド、パラメータ、マシン語等で指定される。   Hereinafter, an embodiment according to one aspect of the present invention (hereinafter, also referred to as “this embodiment”) will be described with reference to the drawings. However, the present embodiment described below is merely an example 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 present invention. That is, in implementing the present invention, a specific configuration according to the embodiment may be appropriately adopted. It should be noted that although the data that appears in this embodiment is described in natural language, more specifically, it is specified by a computer-recognizable pseudo language, command, parameter, machine language, or the like.

§1 適用例
まず、図1を用いて、本発明が適用される場面の一例について説明する。図1は、製品Rの外観検査に本発明を適用した場面の一例を模式的に例示する。製品Rに含まれ得る欠陥は、本発明の「対象物」の一例である。ただし、本発明の適用範囲は、以下で例示する外観検査の例に限られる訳ではない。本発明は、画像に写る何らかの対象物の範囲を検出するあらゆる場面に適用可能である。
§1 Application Example First, an example of a scene to which the present invention is applied will be described with reference to FIG. FIG. 1 schematically illustrates an example of a situation in which the present invention is applied to an appearance inspection of a product R. The defects that can be included in the product R are an example of the “object” of the present invention. However, the application range of the present invention is not limited to the example of the visual inspection described below. INDUSTRIAL APPLICABILITY The present invention can be applied to all situations in which the range of any object in an image is detected.

図1に例示されるとおり、本実施形態に係る検査システム100は、ネットワークを介して接続される学習装置1、画像生成装置2、推定器生成装置3、及び検査装置4を備えている。これにより、検査システム100は、製品Rの良否を検査するように構成される。学習装置1、画像生成装置2、推定器生成装置3、及び検査装置4の間のネットワークの種類は、特に限定されなくてもよく、例えば、インターネット、無線通信網、移動通信網、電話網、専用網等から適宜選択されてよい。   As illustrated in FIG. 1, the inspection system 100 according to the present embodiment includes a learning device 1, an image generation device 2, an estimator generation device 3, and an inspection device 4 which are connected via a network. Accordingly, the inspection system 100 is configured to inspect the quality of the product R. The type of network among the learning device 1, the image generation device 2, the estimator generation device 3, and the inspection device 4 may not be particularly limited, and examples thereof include the Internet, a wireless communication network, a mobile communication network, and a telephone network. It may be appropriately selected from a dedicated network or the like.

なお、図1の例では、学習装置1、画像生成装置2、推定器生成装置3、及び検査装置4はそれぞれ別個のコンピュータである。しかしながら、検査システム100の構成は、このような例に限定されなくてもよい。学習装置1、画像生成装置2、推定器生成装置3、及び検査装置4の少なくともいずれかのペアは一体のコンピュータであってもよい。また、学習装置1、画像生成装置2、推定器生成装置3、及び検査装置4はそれぞれ複数台のコンピュータにより構成されてもよい。   In the example of FIG. 1, the learning device 1, the image generation device 2, the estimator generation device 3, and the inspection device 4 are separate computers. However, the configuration of the inspection system 100 may not be limited to such an example. At least one pair of the learning device 1, the image generation device 2, the estimator generation device 3, and the inspection device 4 may be an integrated computer. The learning device 1, the image generation device 2, the estimator generation device 3, and the inspection device 4 may each be configured by a plurality of computers.

本実施形態に係る学習装置1は、外観検査の対象となる製品Rを写した画像を生成するための生成器50、及び生成器50により生成された画像に対して製品Rに含まれる欠陥の種別及び範囲を推定するための推定器52を構築するように構成されたコンピュータである。具体的には、学習装置1は、外観検査の対象となる製品Rを写した学習画像61、製品Rに含まれる欠陥の種別を示すラベル63、及び欠陥の範囲を示す境界情報65の組み合わせによりそれぞれ構成された複数の学習データセット60を取得する。   The learning device 1 according to the present embodiment includes a generator 50 for generating an image of a product R to be subjected to a visual inspection, and a defect included in the product R with respect to the image generated by the generator 50. A computer configured to build an estimator 52 for estimating type and range. Specifically, the learning device 1 uses a combination of a learning image 61 showing a product R to be subjected to an appearance inspection, a label 63 indicating a type of defect included in the product R, and boundary information 65 indicating a range of the defect. A plurality of configured learning data sets 60 are acquired.

続いて、学習装置1は、第1の機械学習を実行することで、各学習データセット60に含まれるラベル63の入力に対して、入力されたラベル63に関連付けられた学習画像61に対応する画像を生成するように訓練された生成器50を構築する。学習画像61に対応する画像とは、学習画像61に類似し、製品Rの写り得る画像である。生成器50は、学習画像61の分布に従った(沿う)画像を生成するように訓練される。更に、学習装置1は、第2の機械学習を実行することで、各学習データセット60に含まれる学習画像61の入力に対して、入力された学習画像61に関連付けられたラベル63及び境界情報65と一致するように、入力された学習画像61に写る製品Rに含まれる欠陥の種別及び範囲を推定するように訓練された推定器52を構築する。   Subsequently, the learning device 1 executes the first machine learning to correspond to the learning image 61 associated with the input label 63 with respect to the input of the label 63 included in each learning data set 60. Construct a generator 50 trained to generate an image. The image corresponding to the learning image 61 is an image similar to the learning image 61 and in which the product R can be captured. The generator 50 is trained to generate an image according to the distribution of the learning image 61. Further, the learning device 1 executes the second machine learning, so that for the input of the learning image 61 included in each learning data set 60, the label 63 and the boundary information associated with the input learning image 61. The estimator 52 trained to estimate the type and range of the defect included in the product R shown in the input learning image 61 is constructed so as to match 65.

ここで、図2を用いて、欠陥の範囲を指定する方法の一例について説明する。図2は、本実施形態に係る学習画像61内に指定された欠陥の範囲を示す境界情報65の一例を模式的に例示する。図2の例では、学習画像61には、楕円形状の欠陥612を含む製品Rが写っている。学習画像61の横幅がWピクセルであり、縦幅がHピクセルであるのに対して、欠陥612の横幅はwピクセルであり、縦幅はhピクセルである。この欠陥612の範囲は、学習画像61内で欠陥612の写る領域を含むように適宜指定されてよい。   Here, an example of a method of designating a defect range will be described with reference to FIG. FIG. 2 schematically illustrates an example of the boundary information 65 indicating the range of the defect designated in the learning image 61 according to this embodiment. In the example of FIG. 2, the learning image 61 shows the product R including the elliptical defect 612. The learning image 61 has a horizontal width of W pixels and a vertical width of H pixels, whereas the defect 612 has a horizontal width of w pixels and a vertical width of h pixels. The range of this defect 612 may be appropriately designated so as to include the region in which the defect 612 appears in the learning image 61.

欠陥612の範囲の表現方法は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。本実施形態では、欠陥612の範囲は、バウンディングボックスにより表される。図2に示されるとおり、欠陥612の中心座標(cx、cy)、横幅(wピクセル)、及び縦幅(hピクセル)により、バウンディングボックスを規定することができる。つまり、欠陥612の外周を囲む矩形状の範囲(図の点線で示される範囲)が、バウンディングボックスの一例である。ただし、バウンディングボックスを規定する形式は、このような例に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、バウンディングボックスは、中心座標及び欠陥612を含むように指定された円(例えば、外接円)の半径により規定されてよい。この場合、欠陥612を含む円形状の範囲が、バウンディングボックスとなる。本実施形態に係る学習装置1によれば、学習画像61に対応する画像を生成するように訓練された生成器50を構築すると共に、このようなバウンディングボックスにより表される欠陥の範囲を学習画像61内で推定するように訓練された推定器52を構築することができる。   The method of expressing the range of the defect 612 is not particularly limited and may be appropriately selected according to the embodiment. In this embodiment, the range of the defect 612 is represented by a bounding box. As shown in FIG. 2, the center coordinates (cx, cy) of the defect 612, the width (w pixels), and the height (h pixels) can define the bounding box. That is, the rectangular range surrounding the outer circumference of the defect 612 (the range indicated by the dotted line in the figure) is an example of the bounding box. However, the format that defines the bounding box is not limited to such an example, and may be appropriately selected according to the embodiment. For example, the bounding box may be defined by the radius of a circle (eg, a circumscribing circle) designated to include the center coordinate and the defect 612. In this case, the circular range including the defect 612 becomes the bounding box. According to the learning device 1 according to the present embodiment, the generator 50 that is trained to generate the image corresponding to the learning image 61 is constructed, and the range of the defect represented by such a bounding box is used as the learning image. An estimator 52 trained to estimate in 61 can be constructed.

図1に戻り、本実施形態に係る画像生成装置2は、学習装置1により構築された学習済みの生成器50及び推定器52を利用して、製品Rの写り得る画像を生成すると共に、生成した画像内で欠陥の範囲を推定するように構成されたコンピュータである。具体的には、画像生成装置2は、学習装置1により構築された生成器50に、欠陥の種別を示す入力値71を与えることで、欠陥を含む製品Rを写した生成画像73を生成する。生成された生成画像73は、上記学習画像61に対応する。   Returning to FIG. 1, the image generation device 2 according to the present embodiment uses the learned generator 50 and the estimator 52 constructed by the learning device 1 to generate an image in which the product R can be captured and generate the image. Is a computer configured to estimate the extent of a defect in the captured image. Specifically, the image generation device 2 generates the generated image 73 in which the product R including the defect is copied by giving the generator 50 constructed by the learning device 1 an input value 71 indicating the type of the defect. . The generated image 73 generated corresponds to the learning image 61.

次に、画像生成装置2は、学習装置1により構築された推定器52に生成された生成画像73を与えることで、生成画像73に写る製品Rに含まれる欠陥の種別及び範囲を推定する。続いて、画像生成装置2は、生成画像73に写る製品に含まれる欠陥の種別を推定した結果が入力値71により示される欠陥の種別と一致するか否かを判定する。そして、画像生成装置2は、欠陥の種別を推定した結果が入力値71により示される欠陥の種別と一致すると判定した場合に、生成した生成画像73と欠陥の範囲を推定した結果とを関連付けて所定の記憶領域に格納する。   Next, the image generation device 2 gives the generated image 73 to the estimator 52 constructed by the learning device 1 to estimate the type and range of the defect included in the product R shown in the generated image 73. Subsequently, the image generation device 2 determines whether or not the result of estimating the type of the defect included in the product shown in the generated image 73 matches the type of the defect indicated by the input value 71. Then, when the image generation device 2 determines that the result of estimating the type of defect matches the type of defect indicated by the input value 71, the generated image 73 and the result of estimating the range of the defect are associated with each other. Store in a predetermined storage area.

本実施形態に係る推定器生成装置3は、製品Rの良否を推定するための推定器を構築するように構成されたコンピュータである。具体的に、推定器生成装置3は、製品Rを写したサンプル画像及び正解データの組み合わせによりそれぞれ構成された複数の学習データセットを取得する。正解データは、サンプル画像に写る製品Rの良否を判定した結果(すなわち、正解)を示す。本実施形態では、正解データは、サンプル画像に写る製品Rに含まれる欠陥の範囲を示す境界情報を含む。そして、推定器生成装置3は、複数の学習データセットを利用した機械学習を実施することで、与えられた画像に写る製品Rの良否を判定すると共に、製品Rが欠陥を含む場合には、その欠陥の範囲を検出する能力を習得した学習済みの推定器を構築する。なお、推定器生成装置3は、画像生成装置2により生成された生成画像73をサンプル画像として利用し、かつ生成画像73に関連付けられた欠陥の範囲を推定した結果を示す情報を正解データとして利用することができる。   The estimator generation device 3 according to the present embodiment is a computer configured to construct an estimator for estimating the quality of the product R. Specifically, the estimator generation device 3 acquires a plurality of learning data sets each configured by a combination of a sample image of the product R and correct answer data. The correct answer data indicates the result (that is, correct answer) of the quality of the product R shown in the sample image. In this embodiment, the correct answer data includes boundary information indicating the range of defects included in the product R shown in the sample image. Then, the estimator generation device 3 determines whether the product R shown in the given image is good or bad by performing machine learning using a plurality of learning data sets, and when the product R includes a defect, Build a trained estimator that has acquired the ability to detect the range of the defect. Note that the estimator generation device 3 uses the generated image 73 generated by the image generation device 2 as a sample image, and uses information indicating the result of estimating the range of the defect associated with the generated image 73 as the correct answer data. can do.

これに対して、本実施形態に係る検査装置4は、推定器生成装置3により構築された学習済みの推定器を利用して、製品Rの良否を判定するように構成されたコンピュータである。検査装置4は、画像に写る対象物の範囲を推定する推定装置の一例である。具体的に、検査装置4は、外観検査の対象となる製品Rの写る対象画像を取得する。本実施形態では、検査装置4には、カメラCAが接続されている。検査装置4は、このカメラCAにより製品Rを撮影することで対象画像を取得する。次に、検査装置4は、取得した対象画像を学習済みの推定器に入力し、学習済みの推定器の演算処理を実行する。これにより、検査装置4は、製品Rの良否を判定した結果、及び製品Rに含まれる欠陥の範囲を検出した結果に対応する出力値を学習済みの推定器から取得する。そして、検査装置4は、学習済みの推定器から得られた出力値に基づいて製品Rの良否を判定した結果に関する情報を出力する。   On the other hand, the inspection device 4 according to the present embodiment is a computer configured to determine the quality of the product R using the learned estimator constructed by the estimator generation device 3. The inspection device 4 is an example of an estimation device that estimates the range of an object shown in an image. Specifically, the inspection device 4 acquires a target image of the product R that is the target of the visual inspection. In the present embodiment, a camera CA is connected to the inspection device 4. The inspection device 4 acquires the target image by photographing the product R with the camera CA. Next, the inspection device 4 inputs the acquired target image to the learned estimator, and executes the arithmetic processing of the learned estimator. Thereby, the inspection device 4 acquires the output value corresponding to the result of determining the quality of the product R and the result of detecting the range of defects included in the product R from the learned estimator. Then, the inspection device 4 outputs information regarding the result of determining the quality of the product R based on the output value obtained from the learned estimator.

以上のとおり、本実施形態に係る学習装置1によれば、欠陥の種別を指定するラベル63に関連付けられた学習画像61に対応する画像を生成するように訓練された生成器50を構築すると共に、学習画像61に写る欠陥の種別及び範囲を推定するように訓練された推定器52を構築することができる。これらのうち、生成器50を利用することで、指定した欠陥を含む製品の写り得るサンプル画像を自動的に生成することができる。加えて、推定器52を利用することで、生成されたサンプル画像に写る製品Rに含まれる欠陥の範囲を推定し、推定した欠陥の範囲を示す情報を境界情報としてサンプル画像に自動的に付与することができる。したがって、本実施形態によれば、学習データを用意する際に、サンプル画像内において欠陥の範囲を手動で指定する手間を省略することができる。そのため、欠陥の範囲を検出する能力を習得させるための機械学習に利用する学習データを用意するのにかかるコストを低減することができる。   As described above, the learning device 1 according to the present embodiment builds the generator 50 trained to generate the image corresponding to the learning image 61 associated with the label 63 that specifies the defect type, and It is possible to construct the estimator 52 that has been trained to estimate the type and range of the defect shown in the learning image 61. Of these, by using the generator 50, it is possible to automatically generate a sample image in which a product including the designated defect can be captured. In addition, by using the estimator 52, the range of defects included in the product R shown in the generated sample image is estimated, and information indicating the estimated range of defects is automatically added to the sample image as boundary information. can do. Therefore, according to the present embodiment, when preparing the learning data, it is possible to omit the trouble of manually specifying the defect range in the sample image. Therefore, it is possible to reduce the cost required to prepare learning data used for machine learning for acquiring the ability to detect the range of defects.

また、本実施形態に係る画像生成装置2では、学習装置1により構築された生成器50及び推定器52を利用することで、欠陥の範囲を手動で指定する手間を省略した上で、欠陥の範囲を検出する能力を習得させるための機械学習に利用可能な学習データを生成することができる。加えて、本実施形態では、画像生成装置2により生成された生成画像73をサンプル画像として利用し、かつ生成画像73に関連付けられた欠陥の範囲を推定した結果を示す情報を正解データとして利用することができる。これにより、推定器生成装置3において、学習データセットを収集するコストを低減することができる。更に、本実施形態では、画像生成装置2により生成された生成画像73をサンプル画像として利用し、かつ生成画像73に関連付けられた欠陥の範囲を推定した結果を示す情報を正解データとして利用することで、推定器の機械学習に利用する学習データセットの件数を増やすことができる。これにより、検査装置4において、製品Rに含まれ得る欠陥の範囲を推定する精度を高めることができる。   Further, in the image generating apparatus 2 according to the present embodiment, by using the generator 50 and the estimator 52 constructed by the learning apparatus 1, the trouble of manually specifying the defect range is omitted, and Learning data that can be used for machine learning to acquire the ability to detect a range can be generated. In addition, in the present embodiment, the generated image 73 generated by the image generation device 2 is used as a sample image, and the information indicating the result of estimating the range of the defect associated with the generated image 73 is used as the correct answer data. be able to. As a result, it is possible to reduce the cost of collecting the learning data set in the estimator generation device 3. Furthermore, in the present embodiment, the generated image 73 generated by the image generation device 2 is used as a sample image, and the information indicating the result of estimating the range of the defect associated with the generated image 73 is used as the correct answer data. Can increase the number of training data sets used for machine learning of the estimator. Thereby, in the inspection device 4, the accuracy of estimating the range of defects that can be included in the product R can be improved.

なお、外観検査の対象となる製品Rは、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。製品Rは、例えば、電子部品、自動車部品等の製造ラインで搬送される物であってよい。電子部品は、例えば、基盤、チップコンデンサ、液晶、リレーの巻線等である。自動車部品は、例えば、コンロッド、シャフト、エンジンブロック、パワーウィンドウスイッチ、パネル等である。また、良否の判定は、製品Rに欠陥があるか否かを単に判定することであってもよいし、製品Rに欠陥がある否かを判定することに加えて、その欠陥の種類を識別することを含んでもよい。欠陥は、例えば、傷、汚れ、クラック、打痕、埃、バリ、色ムラ等である。   Note that the product R to be subjected to the visual inspection is not particularly limited, and may be appropriately selected according to the embodiment. The product R may be, for example, a product conveyed on a manufacturing line for electronic components, automobile components, and the like. The electronic component is, for example, a substrate, a chip capacitor, a liquid crystal, a winding of a relay, or the like. The automobile parts are, for example, connecting rods, shafts, engine blocks, power window switches, panels and the like. Further, the determination of pass / fail may be performed simply by determining whether or not the product R has a defect, or in addition to determining whether or not the product R has a defect, the type of the defect is identified. It may include doing. The defects are, for example, scratches, dirt, cracks, dents, dust, burrs, color unevenness, and the like.

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

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

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

学習プログラム121は、製品Rの写り得る画像を生成するよう訓練された生成器50、及び画像に写る製品Rに含まれ得る欠陥の種別及び範囲を推定するよう訓練された推定器52を構築する後述の情報処理(図12)を学習装置1に実行させるためのプログラムである。学習プログラム121は、当該情報処理の一連の命令を含む。各学習データセット60は、外観検査の対象となる製品Rを写した学習画像61、製品Rに含まれる欠陥の種別を示すラベル63、及び欠陥の範囲を示す境界情報65の組み合わせにより構成される。各学習データセット60は、生成器50及び推定器52の機械学習に利用される。学習データセット60の件数は、実施の形態に応じて適宜決定されてよい。第1学習結果データ123は、機械学習により構築された学習済みの生成器50の設定を行うためのデータである。第2学習結果データ125は、機械学習により構築された学習済みの推定器52の設定を行うためのデータである。第1学習結果データ123及び第2学習結果データ125は、学習プログラム121の実行結果として生成される。詳細は後述する。   The learning program 121 constructs a generator 50 trained to generate a visible image of the product R and an estimator 52 trained to estimate the type and range of defects that may be included in the product R in the image. It is a program for causing the learning device 1 to execute information processing (FIG. 12) described later. The learning program 121 includes a series of instructions for the information processing. Each learning data set 60 is composed of a combination of a learning image 61 showing a product R to be subjected to an appearance inspection, a label 63 showing a type of defect included in the product R, and boundary information 65 showing a range of the defect. . Each learning data set 60 is used for machine learning of the generator 50 and the estimator 52. The number of learning data sets 60 may be appropriately determined according to the embodiment. The first learning result data 123 is data for setting the learned generator 50 constructed by machine learning. The second learning result data 125 is data for setting the learned estimator 52 constructed by machine learning. The first learning result data 123 and the second learning result data 125 are generated as execution results of the learning program 121. Details will be described later.

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

入力装置14は、例えば、マウス、キーボード等の入力を行うための装置である。また、出力装置15は、例えば、ディスプレイ、スピーカ等の出力を行うための装置である。オペレータは、入力装置14及び出力装置15を利用することで、学習装置1を操作することができる。   The input device 14 is a device for inputting, for example, a mouse or a keyboard. The output device 15 is, for example, a device for outputting a display, a speaker, or the like. The operator can operate the learning device 1 by using the input device 14 and the output device 15.

ドライブ16は、例えば、CDドライブ、DVDドライブ等であり、記憶媒体91に記憶されたプログラムを読み込むためのドライブ装置である。ドライブ16の種類は、記憶媒体91の種類に応じて適宜選択されてよい。上記学習プログラム121及び複数の学習データセット60の少なくともいずれかは、この記憶媒体91に記憶されていてもよい。   The drive 16 is, for example, a CD drive, a DVD drive, or the like, and is a drive device for reading a program stored in the storage medium 91. The type of the drive 16 may be appropriately selected according to the type of the storage medium 91. At least one of the learning program 121 and the plurality of learning data sets 60 may be stored in the storage medium 91.

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

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

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

<画像生成装置>
次に、図4を用いて、本実施形態に係る画像生成装置2のハードウェア構成の一例について説明する。図4は、本実施形態に係る画像生成装置2のハードウェア構成の一例を模式的に例示する。
<Image generation device>
Next, an example of the hardware configuration of the image generating apparatus 2 according to this embodiment will be described with reference to FIG. FIG. 4 schematically illustrates an example of the hardware configuration of the image generating apparatus 2 according to this embodiment.

図4に示されるとおり、本実施形態に係る画像生成装置2は、制御部21、記憶部22、通信インタフェース23、入力装置24、出力装置25、及びドライブ26が電気的に接続されたコンピュータである。本実施形態に係る画像生成装置2の制御部21〜ドライブ26それぞれは、上記学習装置1の制御部11〜ドライブ16それぞれと同様に構成されてよい。   As shown in FIG. 4, the image generation device 2 according to the present embodiment is a computer in which a control unit 21, a storage unit 22, a communication interface 23, an input device 24, an output device 25, and a drive 26 are electrically connected. is there. Each of the control unit 21 to the drive 26 of the image generation device 2 according to the present embodiment may be configured similarly to each of the control unit 11 to the drive 16 of the learning device 1.

すなわち、制御部21は、ハードウェアプロセッサであるCPU、RAM、ROM等を含み、プログラム及びデータに基づいて各種情報処理を実行するように構成される。記憶部22は、例えば、ハードディスクドライブ、ソリッドステートドライブ等で構成される。記憶部22は、画像生成プログラム221、第1学習結果データ123、第2学習結果データ125、1又は複数のデータセット等の各種情報を記憶する。   That is, the control unit 21 includes a CPU that is a hardware processor, a RAM, a ROM, and the like, and is configured to execute various types of information processing based on programs and data. The storage unit 22 is composed of, for example, a hard disk drive, a solid state drive, or the like. The storage unit 22 stores various information such as the image generation program 221, the first learning result data 123, the second learning result data 125, one or a plurality of data sets.

画像生成プログラム221は、学習済みの生成器50を利用して生成画像73を生成すると共に、学習済みの推定器52を利用して生成画像73内で欠陥の範囲を推定する後述の情報処理(図13)を画像生成装置2に実行させるためのプログラムである。画像生成プログラム221は、当該情報処理の一連の命令を含む。各データセットは、生成画像73、ラベル75、及び境界情報77の組み合わせにより構成される。ラベル75は、生成画像73を生成する際に生成器50に与えた入力値71に対応する。境界情報77は、推定器52により欠陥の範囲を推定した結果を示す。各データセットは、画像生成プログラム221の実行結果として生成される。詳細は後述する。   The image generation program 221 uses the learned generator 50 to generate the generated image 73, and uses the learned estimator 52 to estimate the range of defects in the generated image 73. 13) is a program for causing the image generating apparatus 2 to execute (FIG. 13). The image generation program 221 includes a series of instructions for the information processing. Each data set is composed of a combination of the generated image 73, the label 75, and the boundary information 77. The label 75 corresponds to the input value 71 given to the generator 50 when generating the generated image 73. The boundary information 77 indicates the result of estimating the defect range by the estimator 52. Each data set is generated as the execution result of the image generation program 221. Details will be described later.

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

入力装置24は、例えば、マウス、キーボード等の入力を行うための装置である。また、出力装置25は、例えば、ディスプレイ、スピーカ等の出力を行うための装置である。オペレータは、入力装置24及び出力装置25を利用することで、画像生成装置2を操作することができる。   The input device 24 is a device for inputting, for example, a mouse or a keyboard. The output device 25 is, for example, a device for outputting a display, a speaker, or the like. The operator can operate the image generating apparatus 2 by using the input device 24 and the output device 25.

ドライブ26は、例えば、CDドライブ、DVDドライブ等であり、記憶媒体92に記憶されたプログラムを読み込むためのドライブ装置である。上記画像生成プログラム221、第1学習結果データ123及び第2学習結果データ125のうちの少なくともいずれかは、記憶媒体92に記憶されていてもよい。また、画像生成装置2は、記憶媒体92から、上記画像生成プログラム221、第1学習結果データ123及び第2学習結果データ125のうちの少なくともいずれかを取得してもよい。   The drive 26 is, for example, a CD drive, a DVD drive, or the like, and is a drive device for reading a program stored in the storage medium 92. At least one of the image generation program 221, the first learning result data 123, and the second learning result data 125 may be stored in the storage medium 92. Further, the image generating device 2 may acquire at least one of the image generating program 221, the first learning result data 123, and the second learning result data 125 from the storage medium 92.

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

<推定器生成装置>
次に、図5を用いて、本実施形態に係る推定器生成装置3のハードウェア構成の一例について説明する。図5は、本実施形態に係る推定器生成装置3のハードウェア構成の一例を模式的に例示する。
<Estimator generator>
Next, an example of the hardware configuration of the estimator generation device 3 according to the present embodiment will be described with reference to FIG. FIG. 5 schematically illustrates an example of the hardware configuration of the estimator generation device 3 according to this embodiment.

図5に示されるとおり、本実施形態に係る推定器生成装置3は、制御部31、記憶部32、通信インタフェース33、入力装置34、出力装置35、及びドライブ36が電気的に接続されたコンピュータである。本実施形態に係る推定器生成装置3の制御部31〜ドライブ36それぞれは、上記学習装置1の制御部11〜ドライブ16それぞれと同様に構成されてよい。   As shown in FIG. 5, the estimator generation device 3 according to the present embodiment is a computer in which a control unit 31, a storage unit 32, a communication interface 33, an input device 34, an output device 35, and a drive 36 are electrically connected. Is. Each of the control unit 31 to the drive 36 of the estimator generation device 3 according to the present embodiment may be configured similarly to each of the control unit 11 to the drive 16 of the learning device 1.

すなわち、制御部31は、ハードウェアプロセッサであるCPU、RAM、ROM等を含み、プログラム及びデータに基づいて各種情報処理を実行するように構成される。記憶部32は、例えば、ハードディスクドライブ、ソリッドステートドライブ等で構成される。記憶部32は、推定器生成プログラム321、学習データセット322、第3学習結果データ325等の各種情報を記憶する。   That is, the control unit 31 includes a CPU that is a hardware processor, a RAM, a ROM, and the like, and is configured to execute various types of information processing based on programs and data. The storage unit 32 is composed of, for example, a hard disk drive, a solid state drive, or the like. The storage unit 32 stores various kinds of information such as the estimator generation program 321, the learning data set 322, and the third learning result data 325.

推定器生成プログラム321は、製品Rの良否を判定するための推定器を構築する後述の情報処理(図14)を推定器生成装置3に実行させるためのプログラムである。推定器生成プログラム321は、当該情報処理の一連の命令を含む。学習データセット322は、この推定器の機械学習に利用される。第3学習結果データ325は、機械学習により構築された学習済みの推定器の設定を行うためのデータである。第3学習結果データ325は、推定器生成プログラム321の実行結果として生成される。詳細は後述する。   The estimator generation program 321 is a program for causing the estimator generation device 3 to execute the information processing (FIG. 14) described later that constructs an estimator for determining the quality of the product R. The estimator generation program 321 includes a series of instructions for the information processing. The learning data set 322 is used for machine learning of this estimator. The third learning result data 325 is data for setting the learned estimator constructed by machine learning. The third learning result data 325 is generated as the execution result of the estimator generation program 321. Details will be described later.

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

入力装置34は、例えば、マウス、キーボード等の入力を行うための装置である。また、出力装置35は、例えば、ディスプレイ、スピーカ等の出力を行うための装置である。オペレータは、入力装置34及び出力装置35を利用することで、推定器生成装置3を操作することができる。   The input device 34 is a device for inputting, for example, a mouse or a keyboard. The output device 35 is, for example, a device for outputting a display, a speaker, or the like. The operator can operate the estimator generation device 3 by using the input device 34 and the output device 35.

ドライブ36は、例えば、CDドライブ、DVDドライブ等であり、記憶媒体93に記憶されたプログラムを読み込むためのドライブ装置である。上記推定器生成プログラム321及び学習データセット322のうちの少なくともいずれかは、記憶媒体93に記憶されていてもよい。また、推定器生成装置3は、記憶媒体93から、上記推定器生成プログラム321及び学習データセット322のうちの少なくともいずれかを取得してもよい。   The drive 36 is, for example, a CD drive, a DVD drive, or the like, and is a drive device for reading a program stored in the storage medium 93. At least one of the estimator generation program 321 and the learning data set 322 may be stored in the storage medium 93. Further, the estimator generation device 3 may acquire at least one of the estimator generation program 321 and the learning data set 322 from the storage medium 93.

なお、推定器生成装置3の具体的なハードウェア構成に関して、実施形態に応じて、適宜、構成要素の省略、置換及び追加が可能である。例えば、制御部31は、複数のハードウェアプロセッサを含んでもよい。ハードウェアプロセッサは、マイクロプロセッサ、FPGA、DSP等で構成されてよい。記憶部32は、制御部31に含まれるRAM及びROMにより構成されてもよい。通信インタフェース33、入力装置34、出力装置35及びドライブ36の少なくともいずれかは省略されてもよい。推定器生成装置3は、複数台のコンピュータで構成されてもよい。この場合、各コンピュータのハードウェア構成は、一致していてもよいし、一致していなくてもよい。また、推定器生成装置3は、提供されるサービス専用に設計された情報処理装置の他、汎用のサーバ装置、汎用のPC等であってもよい。   Regarding the specific hardware configuration of the estimator generation device 3, it is possible to appropriately omit, replace, and add the constituent elements depending on the embodiment. For example, the control unit 31 may include a plurality of hardware processors. The hardware processor may be configured by a microprocessor, FPGA, DSP or the like. The storage unit 32 may include a RAM and a ROM included in the control unit 31. At least one of the communication interface 33, the input device 34, the output device 35, and the drive 36 may be omitted. The estimator generation device 3 may be composed of a plurality of computers. In this case, the hardware configurations of the computers may or may not match. The estimator generation device 3 may be a general-purpose server device, a general-purpose PC, or the like, in addition to an information processing device designed exclusively for the provided service.

<検査装置>
次に、図6を用いて、本実施形態に係る検査装置4のハードウェア構成の一例について説明する。図6は、本実施形態に係る検査装置4のハードウェア構成の一例を模式的に例示する。
<Inspection device>
Next, an example of the hardware configuration of the inspection device 4 according to the present embodiment will be described with reference to FIG. FIG. 6 schematically illustrates an example of the hardware configuration of the inspection device 4 according to the present embodiment.

図6に示されるとおり、本実施形態に係る検査装置4は、制御部41、記憶部42、通信インタフェース43、入力装置44、出力装置45、ドライブ46、及び外部インタフェース47が電気的に接続されたコンピュータである。なお、図6では、外部インタフェースを「外部I/F」と記載している。検査装置4の制御部41〜ドライブ46はそれぞれ、上記学習装置1の制御部11〜ドライブ16それぞれと同様に構成されてよい。   As shown in FIG. 6, the inspection device 4 according to the present embodiment is electrically connected to the control unit 41, the storage unit 42, the communication interface 43, the input device 44, the output device 45, the drive 46, and the external interface 47. It is a computer. In FIG. 6, the external interface is described as “external I / F”. The control unit 41 to the drive 46 of the inspection device 4 may be configured similarly to the control unit 11 to the drive 16 of the learning device 1, respectively.

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

検査プログラム421は、推定器生成装置3により構築された学習済みの推定器を利用して、対象画像に写る製品Rの良否を判定する後述する情報処理(図15)を検査装置4に実行させるためのプログラムである。検査プログラム421は、当該情報処理の一連の命令を含む。詳細は後述する。   The inspection program 421 uses the learned estimator constructed by the estimator generation device 3 to cause the inspection device 4 to execute the information processing (FIG. 15) described below for determining the quality of the product R shown in the target image. It is a program for. The inspection program 421 includes a series of instructions for the information processing. Details will be described later.

通信インタフェース43は、例えば、有線LANモジュール、無線LANモジュール等であり、ネットワークを介した有線又は無線通信を行うためのインタフェースである。検査装置4は、この通信インタフェース43を利用することで、ネットワークを介したデータ通信を他の情報処理装置(例えば、推定器生成装置3)と行うことができる。   The communication interface 43 is, for example, a wired LAN module, a wireless LAN module, or the like, and is an interface for performing wired or wireless communication via a network. The inspection device 4 can perform data communication via the network with another information processing device (for example, the estimator generation device 3) by using the communication interface 43.

入力装置44は、例えば、マウス、キーボード等の入力を行うための装置である。また、出力装置45は、例えば、ディスプレイ、スピーカ等の出力を行うための装置である。オペレータは、入力装置44及び出力装置45を利用することで、検査装置4を操作することができる。   The input device 44 is a device for inputting, for example, a mouse or a keyboard. The output device 45 is, for example, a device for outputting a display, a speaker, or the like. The operator can operate the inspection device 4 by using the input device 44 and the output device 45.

ドライブ46は、例えば、CDドライブ、DVDドライブ等であり、記憶媒体94に記憶されたプログラムを読み込むためのドライブ装置である。上記検査プログラム421及び第3学習結果データ325のうちの少なくともいずれかは、記憶媒体94に記憶されていてもよい。また、検査装置4は、記憶媒体94から、上記検査プログラム421及び第3学習結果データ325のうちの少なくともいずれかを取得してもよい。   The drive 46 is, for example, a CD drive, a DVD drive, or the like, and is a drive device for reading a program stored in the storage medium 94. At least one of the inspection program 421 and the third learning result data 325 may be stored in the storage medium 94. Further, the inspection device 4 may acquire at least one of the inspection program 421 and the third learning result data 325 from the storage medium 94.

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

カメラCAは、製品Rを写した対象画像を取得するのに利用される。カメラCAの種類及び配置場所は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。カメラCAには、例えば、デジタルカメラ、ビデオカメラ等の公知のカメラが利用されてよい。また、カメラCAは、製品Rが搬送される製造ラインの近傍に配置されてよい。なお、カメラCAが通信インタフェースを備える場合、検査装置4は、外部インタフェース47ではなく、通信インタフェース43を介して、カメラCAに接続されてもよい。   The camera CA is used to acquire a target image of the product R. The type and location of the camera CA may not be particularly limited and may be appropriately determined according to the embodiment. As the camera CA, a known camera such as a digital camera or a video camera may be used. Further, the camera CA may be arranged in the vicinity of the manufacturing line on which the product R is conveyed. If the camera CA has a communication interface, the inspection device 4 may be connected to the camera CA via the communication interface 43 instead of the external interface 47.

なお、検査装置4の具体的なハードウェア構成に関して、実施形態に応じて、適宜、構成要素の省略、置換及び追加が可能である。例えば、制御部41は、複数のハードウェアプロセッサを含んでもよい。ハードウェアプロセッサは、マイクロプロセッサ、FPGA、DSP等で構成されてよい。記憶部42は、制御部41に含まれるRAM及びROMにより構成されてもよい。通信インタフェース43、入力装置44、出力装置45、ドライブ46及び外部インタフェース47の少なくともいずれかは省略されてもよい。検査装置4は、複数台のコンピュータで構成されてもよい。この場合、各コンピュータのハードウェア構成は、一致していてもよいし、一致していなくてもよい。また、検査装置4は、提供されるサービス専用に設計された情報処理装置の他、汎用のサーバ装置、汎用のデスクトップPC、ノートPC、タブレットPC、スマートフォンを含む携帯電話等が用いられてよい。   Regarding the specific hardware configuration of the inspection device 4, it is possible to appropriately omit, replace, and add components according to the embodiment. For example, the control unit 41 may include a plurality of hardware processors. The hardware processor may be configured by a microprocessor, FPGA, DSP or the like. The storage unit 42 may include a RAM and a ROM included in the control unit 41. At least one of the communication interface 43, the input device 44, the output device 45, the drive 46, and the external interface 47 may be omitted. The inspection device 4 may be composed of a plurality of computers. In this case, the hardware configurations of the computers may or may not match. Further, as the inspection device 4, a general-purpose server device, a general-purpose desktop PC, a notebook PC, a tablet PC, a mobile phone including a smartphone, and the like may be used in addition to the information processing device designed for the provided service.

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

学習装置1の制御部11は、記憶部12に記憶された学習プログラム121をRAMに展開する。そして、制御部11は、RAMに展開された学習プログラム121をCPUにより解釈及び実行して、各構成要素を制御する。これによって、図7に示されるとおり、本実施形態に係る学習装置1は、データ取得部111、第1学習処理部112、第2学習処理部113、及び保存処理部114をソフトウェアモジュールとして備えるコンピュータとして動作する。すなわち、本実施形態では、学習装置1の各ソフトウェアモジュールは、制御部11(CPU)により実現される。   The control unit 11 of the learning device 1 loads the learning program 121 stored in the storage unit 12 into the RAM. Then, the control unit 11 interprets and executes the learning program 121 expanded in the RAM by the CPU to control each component. As a result, as shown in FIG. 7, the learning device 1 according to the present embodiment is a computer that includes the data acquisition unit 111, the first learning processing unit 112, the second learning processing unit 113, and the storage processing unit 114 as software modules. To work as. That is, in the present embodiment, each software module of the learning device 1 is realized by the control unit 11 (CPU).

データ取得部111は、外観検査の対象となる製品Rを写した学習画像61、製品Rに含まれる欠陥の種別を示すラベル63、及び欠陥の範囲を示す境界情報65の組み合わせによりそれぞれ構成された複数の学習データセット60を取得する。第1学習処理部112は、第1の機械学習を実行することで、各学習データセット60に含まれるラベル63の入力に対して、入力されたラベル63に関連付けられた学習画像61に対応する画像を生成するように訓練された生成器50を構築する。第2学習処理部113は、第2の機械学習を実行することで、各学習データセット60に含まれる学習画像61の入力に対して、入力された学習画像61に関連付けられたラベル63及び境界情報65と一致するように、入力された学習画像61に写る製品Rに含まれる欠陥の種別及び範囲を推定するように訓練された推定器52を構築する。保存処理部114は、構築された学習済みの生成器50に関する情報、及び構築された学習済みの推定器52に関する情報を所定の記憶領域に保存する。   The data acquisition unit 111 is configured by a combination of a learning image 61 showing a product R to be subjected to an appearance inspection, a label 63 indicating a defect type included in the product R, and boundary information 65 indicating a defect range. Acquire a plurality of learning data sets 60. By executing the first machine learning, the first learning processing unit 112 corresponds to the learning image 61 associated with the input label 63 with respect to the input of the label 63 included in each learning data set 60. Construct a generator 50 trained to generate an image. By executing the second machine learning, the second learning processing unit 113, with respect to the input of the learning image 61 included in each learning data set 60, the label 63 and the boundary associated with the input learning image 61. The estimator 52 that is trained to estimate the type and range of defects included in the product R shown in the input learning image 61 is constructed so as to match the information 65. The saving processing unit 114 saves the information about the constructed learned generator 50 and the information about the constructed learned estimator 52 in a predetermined storage area.

(学習ネットワーク)
次に、図8A及び図8Bを更に用いて、本実施形態に係る生成器50及び推定器52を含む学習ネットワーク500の構成の一例について説明する。図8A及び図8Bは、生成器50を訓練する第1の機械学習及び推定器52を訓練する第2の機械学習の過程の一例を模式的に例示する。
(Learning network)
Next, an example of the configuration of the learning network 500 including the generator 50 and the estimator 52 according to the present embodiment will be described by further using FIGS. 8A and 8B. 8A and 8B schematically illustrate an example of a first machine learning process for training the generator 50 and a second machine learning process for training the estimator 52.

各図に示されるとおり、本実施形態では、エンコーダ56、生成器50、判別器54、及び推定器52により学習ネットワーク500が構成されている。第1学習処理部112及び第2学習処理部113は、この機械学習を実施する対象となる学習ネットワーク500を保持している。学習ネットワーク500では、入力側から、エンコーダ56、生成器50、並びに判別器54及び推定器52の順に配置されている。判別器54及び推定器52は出力側で並列に配置されている。エンコーダ56は、学習画像61及びラベル63の入力を受け付け、事前分布に沿う潜在変数に対応する出力値を出力するように構成される。エンコーダ56の出力は、生成器50の入力に接続されている。生成器50の出力は、推定器52の入力及び判別器54の入力に接続されている。   As shown in each drawing, in the present embodiment, the learning network 500 is configured by the encoder 56, the generator 50, the discriminator 54, and the estimator 52. The first learning processing unit 112 and the second learning processing unit 113 hold a learning network 500 that is a target for carrying out this machine learning. In the learning network 500, the encoder 56, the generator 50, the discriminator 54, and the estimator 52 are arranged in this order from the input side. The discriminator 54 and the estimator 52 are arranged in parallel on the output side. The encoder 56 is configured to receive the input of the learning image 61 and the label 63 and output the output value corresponding to the latent variable along the prior distribution. The output of encoder 56 is connected to the input of generator 50. The output of the generator 50 is connected to the input of the estimator 52 and the input of the discriminator 54.

本実施形態に係るエンコーダ56、生成器50、推定器52及び判別器54はそれぞれ、いわゆる深層学習に用いられる多層構造のニューラルネットワークにより構成されている。エンコーダ56は、入力層571、中間層(隠れ層)572、及び出力層573を備えている。生成器50は、入力層511、中間層(隠れ層)512、及び出力層513を備えている。推定器52は、入力層531、中間層(隠れ層)532、及び出力層533を備えている。判別器54は、入力層551、中間層(隠れ層)552、及び出力層553を備えている。ただし、エンコーダ56、生成器50、推定器52及び判別器54それぞれの構成は、このような例に限定されなくてもよく、実施の形態に応じて適宜設定されてよい。例えば、エンコーダ56、生成器50、推定器52及び判別器54はそれぞれ、2層以上の中間層を備えてもよい。エンコーダ56、生成器50、推定器52及び判別器54の構成はそれぞれ異なっていてよい。   The encoder 56, the generator 50, the estimator 52, and the discriminator 54 according to this embodiment are each configured by a neural network having a multilayer structure used for so-called deep learning. The encoder 56 includes an input layer 571, an intermediate layer (hidden layer) 572, and an output layer 573. The generator 50 includes an input layer 511, an intermediate layer (hidden layer) 512, and an output layer 513. The estimator 52 includes an input layer 531, an intermediate layer (hidden layer) 532, and an output layer 533. The discriminator 54 includes an input layer 551, an intermediate layer (hidden layer) 552, and an output layer 553. However, the configurations of the encoder 56, the generator 50, the estimator 52, and the discriminator 54 are not limited to such an example, and may be set appropriately according to the embodiment. For example, the encoder 56, the generator 50, the estimator 52, and the discriminator 54 may each include two or more intermediate layers. The configurations of the encoder 56, the generator 50, the estimator 52, and the discriminator 54 may be different from each other.

それぞれの各層(571〜573、511〜513、531〜533、551〜553)に含まれるニューロン(ノード)の数は、実施の形態に応じて適宜設定されてよい。隣接する層のニューロン同士は適宜結合され、各結合には重み(結合荷重)が設定されている。図8A及び図8Bの例では、各ニューロンは、隣接する層の全てのニューロンと結合されている。しかしながら、ニューロンの結合は、このような例に限定されなくてもよく、実施の形態に応じて適宜設定されてよい。各ニューロンには閾値が設定されており、基本的には、各入力と各重みとの積の和が閾値を超えているか否かによって各ニューロンの出力が決定される。   The number of neurons (nodes) included in each of the layers (571 to 573, 511 to 513, 531 to 533, 551 to 553) may be appropriately set according to the embodiment. The neurons in the adjacent layers are appropriately connected to each other, and a weight (connection weight) is set for each connection. In the example of FIGS. 8A and 8B, each neuron is connected to all neurons in the adjacent layers. However, the connection of neurons need not be limited to such an example, and may be set appropriately according to the embodiment. A threshold value is set for each neuron, and basically, the output of each neuron is determined by whether or not the sum of products of each input and each weight exceeds the threshold value.

エンコーダ56の各層571〜573に含まれる各ニューロン間の結合の重み及び各ニューロンの閾値は、演算処理に利用されるエンコーダ56のパラメータの一例である。生成器50の各層511〜513に含まれる各ニューロン間の結合の重み及び各ニューロンの閾値は、演算処理に利用される生成器50のパラメータの一例である。推定器52の各層531〜533に含まれる各ニューロン間の結合の重み及び各ニューロンの閾値は、演算処理に利用される推定器52のパラメータの一例である。判別器54の各層551〜553に含まれる各ニューロン間の結合の重み及び各ニューロンの閾値は、演算処理に利用される判別器54のパラメータの一例である。   The weights of the connections between the neurons and the thresholds of the neurons included in the layers 571 to 573 of the encoder 56 are examples of the parameters of the encoder 56 used for the arithmetic processing. The weights of the connections between the neurons and the thresholds of the neurons included in the layers 511 to 513 of the generator 50 are examples of the parameters of the generator 50 used for the arithmetic processing. The weights of the connections between the neurons and the thresholds of the neurons included in the layers 531 to 533 of the estimator 52 are examples of the parameters of the estimator 52 used for the arithmetic processing. The weights of the connections between the neurons and the thresholds of the neurons included in the layers 551 to 553 of the discriminator 54 are examples of the parameters of the discriminator 54 used in the arithmetic processing.

第1学習処理部112及び第2学習処理部113は、この学習ネットワーク500の機械学習を実施する。第1学習処理部112は、これらのうち生成器50に関する第1の機械学習を実施する。一方、第2学習処理部113は、推定器52に関する第2の機械学習を実施する。   The first learning processing unit 112 and the second learning processing unit 113 carry out machine learning of the learning network 500. The first learning processing unit 112 executes the first machine learning regarding the generator 50 among these. On the other hand, the second learning processing unit 113 carries out the second machine learning regarding the estimator 52.

本実施形態では、第1の機械学習を実施することは、次の第1〜第5訓練ステップを含む。第1訓練ステップでは、第1学習処理部112は、判別器54に入力された入力画像が、生成器50により生成された画像69であるか複数の学習データセット60から得られた学習画像61であるかを判別するように判別器54を訓練する。つまり、判別器54は、与えられた入力画像が学習データ(学習画像61)由来か生成器50由来かを判別するように訓練される。第2訓練ステップでは、第1学習処理部112は、生成器50により生成される画像69が、判別器54による判別を誤らせるようなものとなるように、生成器50を訓練する。なお、図8A及び図8Bの例では、学習データ由来であることを「真」と表現し、生成器50由来であることを「偽」と表現している。ただし、各由来を表現する方法は、このような例に限定されなくてよく、実施の形態に応じて適宜選択されてよい。   In the present embodiment, performing the first machine learning includes the following first to fifth training steps. In the first training step, the first learning processing unit 112 determines whether the input image input to the discriminator 54 is the image 69 generated by the generator 50 or the learning image 61 obtained from the plurality of learning data sets 60. The discriminator 54 is trained to discriminate whether or not That is, the discriminator 54 is trained to determine whether the given input image is derived from the learning data (learning image 61) or the generator 50. In the second training step, the first learning processing unit 112 trains the generator 50 so that the image 69 generated by the generator 50 causes the discrimination by the discriminator 54 to be erroneous. In the examples of FIGS. 8A and 8B, the fact that the learning data is derived is expressed as “true”, and the origin of the generator 50 is expressed as “false”. However, the method of expressing each origin is not limited to such an example, and may be appropriately selected according to the embodiment.

第3訓練ステップでは、第1学習処理部112は、生成器50により生成される画像69が、推定器52により画像69に写る製品Rに含まれる欠陥の種別を推定した結果が対応するラベル63と一致するようなものとなるように、生成器50を訓練する。第4訓練ステップでは、第1学習処理部112は、ラベル63及び潜在変数を生成器50に入力することで生成器50により生成された画像69が、学習画像61を復元したもの(つまり、学習画像61に対応する画像)となるように、エンコーダ56及び生成器50を訓練する。潜在変数は、ラベル63及び学習画像61をエンコーダ56に入力することでエンコーダ56から得られる出力に基づいて導出される。第5訓練ステップでは、第1学習処理部112は、エンコーダ56から得られる出力に基づいて導出される潜在変数の分布が所定の事前分布に従うようにエンコーダ56を訓練する。事前分布の種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。事前分布には、例えば、ガウス分布等の公知の分布が用いられてよい。なお、第1〜第5訓練ステップを実行する順序は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。   In the third training step, in the first learning processing unit 112, the label 63 corresponding to the result of the image 69 generated by the generator 50 estimating the type of defect included in the product R shown in the image 69 by the estimator 52. Train the generator 50 to be such that In the fourth training step, the first learning processing unit 112 inputs the label 63 and the latent variable to the generator 50, and the image 69 generated by the generator 50 is a reconstructed version of the learning image 61 (that is, learning). The encoder 56 and the generator 50 are trained to be (image corresponding to the image 61). The latent variable is derived based on the output obtained from the encoder 56 by inputting the label 63 and the learning image 61 to the encoder 56. In the fifth training step, the first learning processing unit 112 trains the encoder 56 so that the distribution of the latent variable derived based on the output obtained from the encoder 56 follows a predetermined prior distribution. The type of prior distribution may not be particularly limited and may be appropriately selected according to the embodiment. A known distribution such as a Gaussian distribution may be used as the prior distribution. The order in which the first to fifth training steps are executed may not be particularly limited, and may be appropriately determined according to the embodiment.

具体的に、図8Aに示されるとおり、第2学習処理部113は、各学習データセット60について、学習画像61を推定器52の入力層531に入力し、推定器52の演算処理を実行する。これにより、第2学習処理部113は、学習画像61に写る製品Rに含まれる欠陥の種別及び範囲を推定した結果に対応する出力値を出力層533から取得する。第2学習処理部113は、欠陥の種別を推定した結果に対応する出力値とラベル63の値との誤差(LC)を算出する。また、第2学習処理部113は、欠陥の範囲を推定した結果に対応する出力値と境界情報65の値との誤差(LBB)を算出する。誤差(LBB)の計算には、例えば、IoU(Intersection Over Union)等の公知の指標が用いられてよい。 Specifically, as shown in FIG. 8A, the second learning processing unit 113 inputs the learning image 61 into the input layer 531 of the estimator 52 for each learning data set 60, and executes the arithmetic processing of the estimator 52. . As a result, the second learning processing unit 113 acquires, from the output layer 533, an output value corresponding to the result of estimating the type and range of the defect included in the product R shown in the learning image 61. The second learning processing unit 113 calculates the error (L C ) between the output value corresponding to the result of estimating the defect type and the value of the label 63. The second learning processing unit 113 also calculates an error (L BB ) between the output value corresponding to the result of estimating the defect range and the value of the boundary information 65. A known index such as IoU (Intersection Over Union) may be used for the calculation of the error (L BB ).

また、第1学習処理部112は、各学習データセット60について、学習画像61及びラベル63をエンコーダ56の入力層571に入力し、エンコーダ56の演算処理を実行する。これにより、第1学習処理部112は、何らかの特徴量を導出した結果に対応する出力値(潜在変数)をエンコーダ56の出力層573から取得する。この出力値は、事前分布の任意の確率変数(例えば、平均及び共分散)に対応するように設定されてよい。第1学習処理部112は、この出力値と事前分布から導出された値との誤差(LKL)を算出する。 Further, the first learning processing unit 112 inputs the learning image 61 and the label 63 to the input layer 571 of the encoder 56 for each learning data set 60, and executes the arithmetic processing of the encoder 56. As a result, the first learning processing unit 112 acquires the output value (latent variable) corresponding to the result of deriving a certain feature amount from the output layer 573 of the encoder 56. This output value may be set to correspond to any random variable of the prior distribution (eg, mean and covariance). The first learning processing unit 112 calculates the error (L KL ) between this output value and the value derived from the prior distribution.

次に、第1学習処理部112は、エンコーダ56から得られた出力値及び対応するラベル63を生成器50の入力層511に入力し、生成器50の演算処理を実行する。これにより、第1学習処理部112は、各学習データセット60について、学習画像61に対応する画像をラベル63から生成した結果に対応する出力(画像69)を出力層513から取得する。   Next, the first learning processing unit 112 inputs the output value obtained from the encoder 56 and the corresponding label 63 to the input layer 511 of the generator 50, and executes the arithmetic processing of the generator 50. As a result, the first learning processing unit 112 acquires, from the output layer 513, an output (image 69) corresponding to the result of generating the image corresponding to the learning image 61 from the label 63 for each learning data set 60.

続いて、第1学習処理部112は、生成器50により生成された各画像69を判別器54の入力層551に入力し、判別器54の演算処理を実行する。これにより、第1学習処理部112は、入力画像が生成器50由来か学習データセット60由来(つまり、学習画像61そのもの)かを判別した結果に対応する出力値を出力層553から取得する。この場面では、生成器50により生成された各画像69が入力画像であるため、判別器54は、「偽」と判別するのが正解である。第1学習処理部112は、生成器50により生成された各画像69について、出力層553から得られる出力値とこの正解との誤差(LD)を算出する。 Subsequently, the first learning processing unit 112 inputs each image 69 generated by the generator 50 to the input layer 551 of the discriminator 54, and executes the arithmetic processing of the discriminator 54. As a result, the first learning processing unit 112 acquires, from the output layer 553, an output value corresponding to the result of determining whether the input image is derived from the generator 50 or the learning data set 60 (that is, the learning image 61 itself). In this scene, since each image 69 generated by the generator 50 is an input image, it is the correct answer for the discriminator 54 to determine “false”. The first learning processing unit 112 calculates an error (L D ) between the output value obtained from the output layer 553 and the correct answer for each image 69 generated by the generator 50.

同様に、第1学習処理部112は、各学習データセット60について、学習画像61を判別器54の入力層551に入力し、判別器54の演算処理を実行する。これにより、第1学習処理部112は、入力画像が生成器50由来か学習データセット60由来かを判別した結果に対応する出力値を出力層553から取得する。この場面では、学習画像61そのものが入力画像であるため、判別器54は、「真」と判別するのが正解である。第1学習処理部112は、各学習データセット60について、出力層553から得られる出力値とこの正解との誤差(LD)を算出する。 Similarly, for each learning data set 60, the first learning processing unit 112 inputs the learning image 61 to the input layer 551 of the discriminator 54 and executes the arithmetic processing of the discriminator 54. Thereby, the first learning processing unit 112 acquires the output value corresponding to the result of determining whether the input image is derived from the generator 50 or the learning data set 60 from the output layer 553. In this scene, since the learning image 61 itself is the input image, it is the correct answer for the discriminator 54 to determine “true”. The first learning processing unit 112 calculates the error (L D ) between the output value obtained from the output layer 553 and this correct answer for each learning data set 60.

また、図8Bに示されるとおり、第1学習処理部112は、生成器50により生成された各画像69を判別器54に入力することで得られた出力値について、判別器54による判別を誤らせるような画像を生成するように生成器50を訓練するための誤差(LGD)を算出する。詳細には、この生成器50の訓練では、判別器54による判別の結果を誤らせることが正解である。つまり、出力層553から得られる出力値が「真」に対応することが正解である。第1学習処理部112は、各学習データセット60について、一連の処理により出力層553から得られる出力値とこの正解(つまり、「真」)との誤差(LGD)を算出する。 Further, as shown in FIG. 8B, the first learning processing unit 112 causes the discriminator 54 to make an erroneous determination regarding the output value obtained by inputting each image 69 generated by the generator 50 to the discriminator 54. Calculate the error (L GD ) for training the generator 50 to generate such an image. Specifically, in the training of the generator 50, the correct answer is to make the discrimination result by the discriminator 54 erroneous. That is, the correct answer is that the output value obtained from the output layer 553 corresponds to “true”. The first learning processing unit 112 calculates, for each learning data set 60, an error (L GD ) between the output value obtained from the output layer 553 through a series of processes and this correct answer (that is, “true”).

次に、第1学習処理部112は、生成器50により生成された各画像69を推定器52の入力層531に入力し、推定器52の演算処理を実行する。これにより、第1学習処理部112は、各画像69に写る製品Rに含まれる欠陥の種別を推定した結果に対応する出力値を推定器52の出力層533から取得する。第1学習処理部112は、欠陥の種別を推定した結果に対応する出力値と対応するラベル63の値との誤差(LGC)を算出する。 Next, the first learning processing unit 112 inputs each image 69 generated by the generator 50 into the input layer 531 of the estimator 52, and executes the arithmetic processing of the estimator 52. Accordingly, the first learning processing unit 112 acquires the output value corresponding to the result of estimating the type of defect included in the product R shown in each image 69 from the output layer 533 of the estimator 52. The first learning processing unit 112 calculates an error (L GC ) between the output value corresponding to the result of estimating the defect type and the value of the corresponding label 63.

次に、図8Aに示されるとおり、第1学習処理部112は、各学習データセット60について、エンコーダ56の出力から学習画像61を復元するデコーダとして機能ように生成器50を訓練するための誤差を算出する。詳細には、第1学習処理部112は、各学習データセット60について、生成器50により生成された画像69と対応する学習画像61との誤差(LG)を算出する。 Next, as shown in FIG. 8A, the first learning processing unit 112, for each learning data set 60, an error for training the generator 50 to function as a decoder that restores the learning image 61 from the output of the encoder 56. To calculate. Specifically, the first learning processing unit 112 calculates the error (L G ) between the learning image 61 and the image 69 generated by the generator 50 for each learning data set 60.

そして、図8A及び図8Bに示されるとおり、第1学習処理部112及び第2学習処理部113は、算出される各誤差(LC、LBB、LKL、LD、LGD、LGC、LG)の和が小さくなるように、学習ネットワーク500の各パラメータの値を調節する。詳細には、第2学習処理部113は、算出される各誤差(LC、LBB)の和が小さくなるように、推定器52のパラメータの値を調節する。第1学習処理部112は、算出される誤差(LD)の和が小さくなるように、判別器54のパラメータの値を調節する。第1学習処理部112は、算出される各誤差(LG、LGD、LGC)の和が小さくなるように、生成器50のパラメータの値を調節する。第1学習処理部112は、算出される誤差(LKL、LG)の和が小さくなるように、エンコーダ56のパラメータの値を調節する。 Then, as shown in FIGS. 8A and 8B, the first learning processing unit 112 and the second learning processing unit 113, the error (L C calculated, L BB, L KL, L D, L GD, L GC , L G ), the value of each parameter of the learning network 500 is adjusted. Specifically, the second learning processing unit 113, the error (L C, L BB) which is calculated as the sum of the decreases, adjusting the value of the parameter estimator 52. The first learning processing unit 112 adjusts the parameter values of the discriminator 54 so that the sum of the calculated errors (L D ) becomes small. The first learning processing unit 112 adjusts the values of the parameters of the generator 50 so that the sum of the calculated errors (L G , L GD , L GC ) becomes small. The first learning processing unit 112 adjusts the parameter values of the encoder 56 so that the sum of the calculated errors (L KL , L G ) becomes small.

第1学習処理部112及び第2学習処理部113は、算出される各誤差(LC、LBB、LKL、LD、LGD、LGC、LG)の和が閾値以下になるまで、上記一連の処理により、各パラメータの値の調節を繰り返す。これにより、第1学習処理部112は、判別器54、生成器50、及びエンコーダ56それぞれを訓練し、第2学習処理部113は、推定器52を訓練する。これらのうち、各誤差(LC、LBB)の和が小さくなるように推定器52のパラメータを調節する処理が、第2の機械学習の処理の一例である。誤差(LKL)の和が小さくなるように、エンコーダ56のパラメータの値を調節する処理が、第1の機械学習の第5訓練ステップの一例である。誤差(LD)の和が小さくなるように判別器54のパラメータの値を調節する処理が、第1訓練ステップの一例である。誤差(LGD)の和が小さくなるように生成器50のパラメータの値を調節する処理が、第2訓練ステップの一例である。誤差(LGC)の和が小さくなるように生成器50のパラメータの値を調節する処理が、第3訓練ステップの一例である。誤差(LG)の和が小さくなるように生成器50及びエンコーダ56のパラメータの値を調節する処理が、第4訓練ステップの一例である。なお、パラメータの調節を繰り返す基準は、このような閾値を用いる例に限定されなくてもよい。例えば、第1学習処理部112及び第2学習処理部113は、指定された回数分、上記一連の処理により、各パラメータの値の調節を繰り返すようにしてもよい。 The first learning processing unit 112 and the second learning processing unit 113 until the sum of the calculated errors (L C , L BB , L KL , L D , L GD , L GC , L G ) becomes less than or equal to the threshold value. By the series of processes described above, the adjustment of the value of each parameter is repeated. Thereby, the first learning processing unit 112 trains each of the discriminator 54, the generator 50, and the encoder 56, and the second learning processing unit 113 trains the estimator 52. Of these, the process of adjusting parameters of the estimator 52 so that the sum is less of each error (L C, L BB) is an example of the processing of a second machine learning. The process of adjusting the parameter values of the encoder 56 so that the sum of the errors (L KL ) is small is an example of the fifth training step of the first machine learning. The process of adjusting the parameter values of the discriminator 54 so that the sum of the errors (L D ) becomes small is an example of the first training step. The process of adjusting the parameter values of the generator 50 so that the sum of the errors (L GD ) becomes small is an example of the second training step. The process of adjusting the parameter values of the generator 50 so that the sum of the errors (L GC ) becomes small is an example of the third training step. The process of adjusting the parameter values of the generator 50 and the encoder 56 so that the sum of the errors (L G ) becomes small is an example of the fourth training step. It should be noted that the criterion for repeating the parameter adjustment is not limited to the example using such a threshold value. For example, the first learning processing unit 112 and the second learning processing unit 113 may repeat the adjustment of the value of each parameter by the designated number of times by the series of processes described above.

この機械学習が完了した後、保存処理部114は、構築された生成器50の構成(例えば、ニューラルネットワークの層数、各層におけるニューロンの個数、ニューロン同士の結合関係、各ニューロンの伝達関数)、及び演算パラメータ(例えば、各ニューロン間の結合の重み、各ニューロンの閾値)を示す第1学習結果データ123を生成する。また、保存処理部114は、構築された推定器52の構成(例えば、ニューラルネットワークの層数、各層におけるニューロンの個数、ニューロン同士の結合関係、各ニューロンの伝達関数)及び演算パラメータ(例えば、各ニューロン間の結合の重み、各ニューロンの閾値)を示す第2学習結果データ125を生成する。そして、保存処理部114は、生成した第1学習結果データ123及び第2学習結果データ125を所定の記憶領域に保存する。   After this machine learning is completed, the storage processing unit 114 configures the constructed generator 50 (for example, the number of layers of the neural network, the number of neurons in each layer, the connection relationship between neurons, the transfer function of each neuron), And the first learning result data 123 indicating the calculation parameters (for example, the weight of the connection between the neurons and the threshold value of the neurons). Further, the storage processing unit 114 configures the constructed estimator 52 (for example, the number of layers of the neural network, the number of neurons in each layer, the connection relationship between neurons, the transfer function of each neuron), and the operation parameter (for example, each The second learning result data 125 indicating the weight of connection between neurons and the threshold value of each neuron is generated. Then, the storage processing unit 114 stores the generated first learning result data 123 and second learning result data 125 in a predetermined storage area.

<画像生成装置>
次に、図9を用いて、本実施形態に係る画像生成装置2のソフトウェア構成の一例について説明する。図9は、本実施形態に係る画像生成装置2のソフトウェア構成の一例を模式的に例示する。
<Image generation device>
Next, an example of the software configuration of the image generating apparatus 2 according to this embodiment will be described with reference to FIG. FIG. 9 schematically illustrates an example of the software configuration of the image generating apparatus 2 according to this embodiment.

画像生成装置2の制御部21は、記憶部22に記憶された画像生成プログラム221をRAMに展開する。そして、制御部21は、RAMに展開された画像生成プログラム221をCPUにより解釈及び実行して、各構成要素を制御する。これによって、図9に示されるとおり、本実施形態に係る画像生成装置2は、生成部211、推定部212、判定部213、及び画像保存部214をソフトウェアモジュールとして備えるコンピュータとして動作する。すなわち、本実施形態では、画像生成装置2の各ソフトウェアモジュールも、上記学習装置1と同様に、制御部21(CPU)により実現される。   The control unit 21 of the image generation device 2 loads the image generation program 221 stored in the storage unit 22 into the RAM. Then, the control unit 21 controls the components by interpreting and executing the image generation program 221 expanded in the RAM by the CPU. As a result, as shown in FIG. 9, the image generation device 2 according to the present embodiment operates as a computer including the generation unit 211, the estimation unit 212, the determination unit 213, and the image storage unit 214 as software modules. That is, in the present embodiment, each software module of the image generation device 2 is also realized by the control unit 21 (CPU) as in the learning device 1.

生成部211は、第1学習結果データ123を保持することで、学習装置1により構築された学習済みの生成器50を含んでいる。生成部211は、欠陥の種別を示す入力値71を生成器50に与えることで、欠陥を含む製品Rを写した生成画像73を生成する。本実施形態では、生成部211は、第1学習結果データ123を参照して、学習済みの生成器50の設定を行う。次に、生成部211は、所定の確率分布からノイズ(潜在変数)を取得する。所定の確率分布は、例えば、ガウス分布等であってよい。そして、生成部211は、取得したノイズ及び入力値71を生成器50の入力層511に入力し、生成器50の演算処理を実行する。これにより、生成部211は、生成器50の出力層513から生成画像73を取得する。   The generation unit 211 includes the learned generator 50 constructed by the learning apparatus 1 by holding the first learning result data 123. The generation unit 211 supplies the input value 71 indicating the type of the defect to the generator 50 to generate the generated image 73 in which the product R including the defect is copied. In the present embodiment, the generation unit 211 refers to the first learning result data 123 and sets the learned generator 50. Next, the generation unit 211 acquires noise (latent variable) from a predetermined probability distribution. The predetermined probability distribution may be, for example, a Gaussian distribution or the like. Then, the generation unit 211 inputs the acquired noise and the input value 71 to the input layer 511 of the generator 50, and executes the arithmetic processing of the generator 50. As a result, the generation unit 211 acquires the generated image 73 from the output layer 513 of the generator 50.

推定部212は、第2学習結果データ125を保持することで、学習装置1により構築された学習済みの推定器52を含んでいる。推定部212は、生成された生成画像73を推定器52に与えることで、生成画像73に写る製品Rに含まれる欠陥の種別及び範囲を推定する。本実施形態では、推定部212は、第2学習結果データ125を参照して、学習済みの推定器52の設定を行う。そして、推定部212は、生成器50により生成された生成画像73を推定器52の入力層531に入力し、推定器52の演算処理を実行する。これにより、推定部212は、生成画像73に写る製品Rに含まれる欠陥の種別及び範囲を推定した結果に対応する出力値を推定器52の出力層533から取得する。   The estimation unit 212 includes the learned estimator 52 constructed by the learning device 1 by holding the second learning result data 125. The estimation unit 212 estimates the type and range of the defect included in the product R shown in the generated image 73 by supplying the generated generated image 73 to the estimator 52. In the present embodiment, the estimation unit 212 refers to the second learning result data 125 and sets the learned estimator 52. Then, the estimation unit 212 inputs the generated image 73 generated by the generator 50 to the input layer 531 of the estimator 52, and executes the arithmetic processing of the estimator 52. Thereby, the estimation unit 212 acquires the output value corresponding to the result of estimating the type and range of the defect included in the product R shown in the generated image 73 from the output layer 533 of the estimator 52.

判定部213は、生成画像73に写る製品Rに含まれる欠陥の種別を推定した結果が入力値71により示される欠陥の種別と一致するか否かを判定する。欠陥の種別を推定した結果が入力値71により示される欠陥の種別と一致すると判定部213が判定した場合に、画像保存部214は、生成した生成画像73と欠陥の範囲を推定した結果とを関連付けて所定の記憶領域に格納する。本実施形態では、画像保存部214は、欠陥の範囲を推定した結果を示す情報を境界情報77として生成する。更に、画像保存部214は、入力値71に対応して、欠陥の種別を示す情報をラベル75として生成する。そして、画像保存部214は、生成画像73、ラベル75、及び境界情報77を組み合わせることでデータセットを生成し、生成したデータセットを所定の記憶領域に格納する。なお、これらのうち、ラベル75は省略されてもよい。   The determination unit 213 determines whether or not the result of estimating the defect type included in the product R shown in the generated image 73 matches the defect type indicated by the input value 71. When the determination unit 213 determines that the result of estimating the type of defect matches the type of defect indicated by the input value 71, the image storage unit 214 determines the generated image 73 generated and the result of estimating the range of the defect. The data is associated and stored in a predetermined storage area. In the present embodiment, the image storage unit 214 generates, as the boundary information 77, information indicating the result of estimating the defect range. Further, the image storage unit 214 generates, as the label 75, information indicating the type of defect, corresponding to the input value 71. Then, the image storage unit 214 generates a data set by combining the generated image 73, the label 75, and the boundary information 77, and stores the generated data set in a predetermined storage area. Of these, the label 75 may be omitted.

<推定器生成装置>
次に、図10を用いて、本実施形態に係る推定器生成装置3のソフトウェア構成の一例について説明する。図10は、本実施形態に係る推定器生成装置3のソフトウェア構成の一例を模式的に例示する。
<Estimator generator>
Next, an example of the software configuration of the estimator generation device 3 according to the present embodiment will be described using FIG. 10. FIG. 10 schematically illustrates an example of the software configuration of the estimator generation device 3 according to this embodiment.

推定器生成装置3の制御部31は、記憶部32に記憶された推定器生成プログラム321をRAMに展開する。そして、制御部31は、RAMに展開された推定器生成プログラム321に含まれる命令をCPUにより解釈及び実行して、各構成要素を制御する。これによって、図10に示されるとおり、本実施形態に係る推定器生成装置3は、データ取得部311、学習処理部312、及び保存処理部313をソフトウェアモジュールとして備えるコンピュータとして構成される。すなわち、本実施形態では、推定器生成装置3の各ソフトウェアモジュールも、上記学習装置1と同様に、制御部31(CPU)により実現される。   The control unit 31 of the estimator generation device 3 loads the estimator generation program 321 stored in the storage unit 32 into the RAM. Then, the control unit 31 controls the respective components by interpreting and executing the instruction included in the estimator generation program 321 expanded in the RAM by the CPU. As a result, as shown in FIG. 10, the estimator generation device 3 according to the present embodiment is configured as a computer including the data acquisition unit 311, the learning processing unit 312, and the storage processing unit 313 as software modules. That is, in the present embodiment, each software module of the estimator generation device 3 is also realized by the control unit 31 (CPU) as in the learning device 1.

データ取得部311は、製品Rを写したサンプル画像3221、製品Rに含まれ得る欠陥の種別を示すラベル3222、及び製品Rに含まれ得る欠陥の範囲を示す境界情報3223の組み合わせによりそれぞれ構成された複数の学習データセット322を取得する。サンプル画像3221は、機械学習の入力データ(訓練データ)として利用される。一方、ラベル3222及び境界情報3223は、機械学習の正解データ(教師データ)として利用される。すなわち、ラベル3222及び境界情報3223は、対応するサンプル画像3221に写る製品Rの良否を判定した結果(すなわち、正解)を示す。サンプル画像3221に写る製品Rに欠陥が含まれない場合、ラベル3222及び境界情報3223の各値は、製品Rに欠陥が含まれないことを示すように適宜設定されてよい。   The data acquisition unit 311 is configured by a combination of a sample image 3221 that shows the product R, a label 3222 that indicates the type of defects that can be included in the product R, and boundary information 3223 that indicates the range of defects that can be included in the product R. A plurality of learning data sets 322 are acquired. The sample image 3221 is used as input data (training data) for machine learning. On the other hand, the label 3222 and the boundary information 3223 are used as correct data (teaching data) for machine learning. That is, the label 3222 and the boundary information 3223 indicate the result (that is, correct answer) of the quality of the product R shown in the corresponding sample image 3221. When the product R shown in the sample image 3221 does not include a defect, each value of the label 3222 and the boundary information 3223 may be appropriately set so as to indicate that the product R does not include a defect.

ここで、上記画像生成装置2により生成されたデータセットは、学習データセット322として利用されてよい。すなわち、少なくとも一部の学習データセット322のサンプル画像3221、ラベル3222、及び境界情報3223はそれぞれ、上記生成画像73、ラベル75、及び境界情報77であってよい。また、データ取得部311は、学習データセット322を学習装置1に送信し、学習データセット322を学習データセット60として利用させて、上記機械学習の処理を学習装置1に実行させてよい。つまり、データ取得部311は、サンプル画像3221を学習画像61として利用させ、ラベル3222をラベル63として利用させ、境界情報3223を境界情報65として利用させることで、サンプル画像3221に対応する画像を生成するための生成器50、並びに生成された画像に対して製品Rに含まれる欠陥の種別及び範囲を推定するための推定器52を学習装置1に構築させてもよい。そして、データ取得部311は、構築された生成器50及び推定器52を画像生成装置2に利用させて、学習データセット322に対応する複数のデータセットを画像生成装置2に生成させてもよい。データ取得部311は、生成された複数のデータセットを学習データセット322として受信することで、機械学習に利用する学習データセット322の件数を増やすことができる。   Here, the data set generated by the image generation device 2 may be used as the learning data set 322. That is, the sample image 3221, the label 3222, and the boundary information 3223 of at least a part of the learning data set 322 may be the generated image 73, the label 75, and the boundary information 77, respectively. In addition, the data acquisition unit 311 may transmit the learning data set 322 to the learning device 1 and cause the learning data set 322 to be used as the learning data set 60 to cause the learning device 1 to execute the machine learning process. That is, the data acquisition unit 311 uses the sample image 3221 as the learning image 61, the label 3222 as the label 63, and the boundary information 3223 as the boundary information 65 to generate an image corresponding to the sample image 3221. The learning apparatus 1 may be configured to construct the generator 50 for performing the above, and the estimator 52 for estimating the type and range of the defect included in the product R with respect to the generated image. Then, the data acquisition unit 311 may cause the image generator 2 to use the constructed generator 50 and the estimator 52 to cause the image generator 2 to generate a plurality of data sets corresponding to the learning data set 322. . The data acquisition unit 311 can increase the number of learning data sets 322 used for machine learning by receiving the generated plurality of data sets as the learning data sets 322.

学習処理部312は、機械学習の対象となる推定器80を保持している。学習処理部312は、取得した各学習データセット322を利用した機械学習を実施することで、与えられた画像に写る製品Rの良否を判定する能力を習得した学習済みの推定器80を構築する。換言すると、学習処理部312は、各学習データセット322について、サンプル画像3221を入力すると、ラベル3222及び境界情報3223と一致する出力値を出力するように訓練された推定器80を構築する。保存処理部313は、構築された学習済みの推定器80に関する情報を所定の記憶領域に保存する。   The learning processing unit 312 holds the estimator 80 that is the target of machine learning. The learning processing unit 312 constructs a learned estimator 80 that has acquired the ability to determine the quality of the product R shown in a given image by performing machine learning using each acquired learning data set 322. . In other words, the learning processing unit 312 constructs the estimator 80 trained to output the output values that match the label 3222 and the boundary information 3223 when the sample image 3221 is input for each learning data set 322. The save processing unit 313 saves the constructed information about the learned estimator 80 in a predetermined storage area.

なお、学習装置2及び推定器生成装置3の間の関係において、学習処理部312は、第3学習処理部と称されてよい。上記データ取得部111及び保存処理部114はそれぞれ、第1データ取得部及び第1保存処理部と称されてよい。学習データセット60は、第1学習データセットと称されてよい。これに応じて、データ取得部311及び保存処理部313はそれぞれ、第2データ取得部及び第2保存処理部と称されてよい。学習データセット322は、第2学習データセットと称されてよい。   Note that in the relationship between the learning device 2 and the estimator generation device 3, the learning processing unit 312 may be referred to as a third learning processing unit. The data acquisition unit 111 and the storage processing unit 114 may be referred to as a first data acquisition unit and a first storage processing unit, respectively. The learning data set 60 may be referred to as a first learning data set. Accordingly, the data acquisition unit 311 and the storage processing unit 313 may be referred to as a second data acquisition unit and a second storage processing unit, respectively. The learning data set 322 may be referred to as a second learning data set.

(推定器)
次に、本実施形態に係る推定器80の構成の一例について説明する。図10に示されるとおり、本実施形態に係る推定器80は、上記生成器50等と同様に、いわゆる深層学習に用いられる多層構造のニューラルネットワークにより構成されている。具体的に、推定器80は、入力層801、中間層(隠れ層)802、及び出力層803を備えている。ただし、推定器80の構成は、このような例に限定されなくてもよく、実施の形態に応じて適宜設定されてよい。例えば、推定器80は、2層以上の中間層を備えてもよい。推定器80の構成は、上記生成器50等と異なっていてよい。
(Estimator)
Next, an example of the configuration of the estimator 80 according to this embodiment will be described. As shown in FIG. 10, the estimator 80 according to the present embodiment is configured by a neural network having a multilayer structure used for so-called deep learning, like the generator 50 and the like. Specifically, the estimator 80 includes an input layer 801, an intermediate layer (hidden layer) 802, and an output layer 803. However, the configuration of the estimator 80 is not limited to such an example, and may be set appropriately according to the embodiment. For example, the estimator 80 may include two or more intermediate layers. The configuration of the estimator 80 may be different from that of the generator 50 and the like.

各層801〜803に含まれるニューロン(ノード)の数は、実施の形態に応じて適宜設定されてよい。隣接する層のニューロン同士は適宜結合され、各結合には重み(結合荷重)が設定されている。図10の例では、各ニューロンは、隣接する層の全てのニューロンと結合されている。しかしながら、ニューロンの結合は、このような例に限定されなくてもよく、実施の形態に応じて適宜設定されてよい。各ニューロンには閾値が設定されており、基本的には、各入力と各重みとの積の和が閾値を超えているか否かによって各ニューロンの出力が決定される。各層801〜803に含まれる各ニューロン間の結合の重み及び各ニューロンの閾値は、演算処理に利用される推定器80のパラメータの一例である。   The number of neurons (nodes) included in each of the layers 801 to 803 may be set appropriately according to the embodiment. The neurons in the adjacent layers are appropriately connected to each other, and a weight (connection weight) is set for each connection. In the example of FIG. 10, each neuron is connected to all neurons in the adjacent layer. However, the connection of neurons need not be limited to such an example, and may be set appropriately according to the embodiment. A threshold value is set for each neuron, and basically, the output of each neuron is determined by whether or not the sum of products of each input and each weight exceeds the threshold value. The weights of the connections between the neurons and the thresholds of the neurons included in the layers 801 to 803 are examples of parameters of the estimator 80 used for the arithmetic processing.

学習処理部312は、各学習データセット322について、サンプル画像3221を推定器80の入力層801に入力し、推定器80の演算処理を実行する。この演算処理の結果、学習処理部312は、サンプル画像3221に写る製品Rの良否を判定した結果、換言すると、製品Rに含まれ得る欠陥の種別及び範囲を推定した結果に対応する出力値を出力層803から取得する。   The learning processing unit 312 inputs the sample image 3221 into the input layer 801 of the estimator 80 for each learning data set 322, and executes the arithmetic processing of the estimator 80. As a result of this arithmetic processing, the learning processing unit 312 determines whether the product R shown in the sample image 3221 is good or bad, in other words, outputs the output value corresponding to the result of estimating the type and range of defects that can be included in the product R. It is acquired from the output layer 803.

続いて、学習処理部312は、取得した出力値とラベル3222及び境界情報3223の各値との誤差を算出する。そして、学習処理部312は、各学習データセット322について、算出される誤差の和が小さくなるように、推定器80のパラメータの値を調節する。例えば、学習処理部312は、出力層803から得られる出力値とラベル3222及び境界情報3223の各値との誤差の和が閾値以下になるまで、上記一連の処理による推定器80のパラメータの値の調節を繰り返す。これにより、学習処理部312は、各学習データセット322について、サンプル画像3221を入力層801に入力すると、入力したサンプル画像3221に関連付けられたラベル3222及び境界情報3223と一致する出力値を出力層803から出力するように訓練された推定器80を構築することができる。なお、パラメータの調節を繰り返す基準は、このような閾値を用いる例に限定されなくてもよい。例えば、学習処理部312は、指定された回数分、上記一連の処理により、推定器80のパラメータの値の調節を繰り返すようにしてもよい。   Subsequently, the learning processing unit 312 calculates an error between the acquired output value and each value of the label 3222 and the boundary information 3223. Then, the learning processing unit 312 adjusts the value of the parameter of the estimator 80 for each learning data set 322 so that the sum of the calculated errors becomes small. For example, the learning processing unit 312 causes the value of the parameter of the estimator 80 by the series of processes described above until the sum of the errors between the output value obtained from the output layer 803 and the values of the label 3222 and the boundary information 3223 becomes equal to or less than the threshold value. Repeat the adjustment of. Accordingly, when the sample image 3221 is input to the input layer 801 for each learning data set 322, the learning processing unit 312 outputs an output value that matches the label 3222 and the boundary information 3223 associated with the input sample image 3221. An estimator 80 trained to output from 803 can be constructed. It should be noted that the criterion for repeating the parameter adjustment is not limited to the example using such a threshold value. For example, the learning processing unit 312 may repeat the adjustment of the value of the parameter of the estimator 80 by the designated number of times by the series of processes described above.

この機械学習の処理が完了した後、保存処理部313は、構築された学習済みの推定器80の構成(例えば、ニューラルネットワークの層数、各層におけるニューロンの個数、ニューロン同士の結合関係、各ニューロンの伝達関数)、及び演算パラメータ(例えば、各ニューロン間の結合の重み、各ニューロンの閾値)を示す第3学習結果データ325を生成する。そして、保存処理部313は、生成した第3学習結果データ325を所定の記憶領域に保存する。   After the machine learning process is completed, the storage processing unit 313 configures the structure of the constructed estimator 80 (for example, the number of layers of the neural network, the number of neurons in each layer, the connection relationship between neurons, each neuron). 3) and third calculation result data 325 indicating the calculation parameter (for example, the weight of connection between neurons, the threshold value of each neuron). Then, the storage processing unit 313 stores the generated third learning result data 325 in a predetermined storage area.

<検査装置>
次に、図11を用いて、本実施形態に係る検査装置4のソフトウェア構成の一例について説明する。図11は、本実施形態に係る検査装置4のソフトウェア構成の一例を模式的に例示する。
<Inspection device>
Next, an example of the software configuration of the inspection device 4 according to the present embodiment will be described with reference to FIG. FIG. 11 schematically illustrates an example of the software configuration of the inspection device 4 according to the present embodiment.

検査装置4の制御部41は、記憶部42に記憶された検査プログラム421をRAMに展開する。そして、制御部41は、RAMに展開された検査プログラム421に含まれる命令をCPUにより解釈及び実行して、各構成要素を制御する。これによって、図11に示されるとおり、本実施形態に係る検査装置4は、対象データ取得部411、良否判定部412、及び出力部413をソフトウェアモジュールとして備えるコンピュータとして構成される。本実施形態では、検査装置4の各ソフトウェアモジュールも、上記学習装置1と同様に、制御部41(CPU)により実現される。   The control unit 41 of the inspection device 4 loads the inspection program 421 stored in the storage unit 42 into the RAM. Then, the control unit 41 controls and interprets each component by causing the CPU to interpret and execute the command included in the inspection program 421 expanded in the RAM. As a result, as shown in FIG. 11, the inspection device 4 according to the present embodiment is configured as a computer including the target data acquisition unit 411, the quality determination unit 412, and the output unit 413 as software modules. In the present embodiment, each software module of the inspection device 4 is also realized by the control unit 41 (CPU) like the learning device 1.

対象データ取得部411は、外観検査の対象となる製品Rの写る対象画像422を取得する。本実施形態では、対象データ取得部411は、カメラCAにより製品Rを撮影することで、対象画像422を取得する。良否判定部412は、第3学習結果データ325を保持することで、推定器生成装置3により構築されたが学習済みの推定器80を含んでいる。良否判定部412は、学習済みの推定器80を利用して、対象画像422に写る製品Rの良否を判定する。   The target data acquisition unit 411 acquires a target image 422 of the product R that is a target of the visual inspection. In the present embodiment, the target data acquisition unit 411 acquires the target image 422 by photographing the product R with the camera CA. The pass / fail judgment unit 412 holds the third learning result data 325, and thus includes the estimator 80 that has been constructed by the estimator generation device 3 but has already been learned. The quality determination unit 412 determines the quality of the product R shown in the target image 422 using the learned estimator 80.

具体的には、良否判定部412は、第3学習結果データ325を参照して、学習済みの推定器80の設定を行う。次に、良否判定部412は、取得した対象画像422を推定器80の入力層801に入力し、推定器80の演算処理を実行する。これにより、良否判定部412は、対象画像422に写る製品Rの良否を判定した結果(詳細には、製品Rに含まれ得る欠陥の種別及び範囲を推定した結果)に対応する出力値を推定器80の出力層803から取得する。本実施形態では、この出力値を得ることが、製品Rの良否を判定することに対応する。出力部413は、製品Rの良否を判定した結果に関する情報を出力する。   Specifically, the quality determination unit 412 refers to the third learning result data 325 to set the learned estimator 80. Next, the quality determination unit 412 inputs the acquired target image 422 to the input layer 801 of the estimator 80, and executes the arithmetic processing of the estimator 80. Thereby, the quality determination unit 412 estimates the output value corresponding to the result of determining the quality of the product R shown in the target image 422 (specifically, the result of estimating the type and range of defects that may be included in the product R). From the output layer 803 of the container 80. In this embodiment, obtaining this output value corresponds to determining the quality of the product R. The output unit 413 outputs information related to the result of determining the quality of the product R.

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

§3 動作例
[学習装置]
次に、図12を用いて、本実施形態に係る学習装置1の動作例について説明する。図12は、本実施形態に係る学習装置1の処理手順の一例を示す。以下で説明する処理手順は、本発明の「学習方法」の一例である。ただし、以下で説明する処理手順は一例に過ぎず、各処理は可能な限り変更されてよい。また、以下で説明する処理手順について、実施の形態に応じて、適宜、ステップの省略、置換、及び追加が可能である。
§3 Example of operation [Learning device]
Next, an operation example of the learning device 1 according to the present embodiment will be described with reference to FIG. FIG. 12 shows an example of the processing procedure of the learning device 1 according to the present embodiment. The processing procedure described below is an example of the “learning method” of the present invention. However, the processing procedure described below is merely an example, and each processing may be changed as much as possible. Further, regarding the processing procedure described below, steps can be omitted, replaced, and added as appropriate according to the embodiment.

(ステップS101)
ステップS101では、制御部11は、データ取得部111として動作し、外観検査の対象となる製品Rを写した学習画像61、製品Rに含まれる欠陥の種別を示すラベル63、及び欠陥の範囲を示す境界情報65の組み合わせによりそれぞれ構成された複数の学習データセット60を取得する。
(Step S101)
In step S101, the control unit 11 operates as the data acquisition unit 111, and displays a learning image 61 showing a product R to be subjected to an appearance inspection, a label 63 indicating a defect type included in the product R, and a defect range. A plurality of learning data sets 60 each configured by a combination of the boundary information 65 shown are acquired.

学習データセット60を取得する方法は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、カメラ及び欠陥のある製品Rを用意し、欠陥の部分が写るように製品Rをカメラにより撮影する。これにより、学習画像61を生成することができる。次に、学習画像61に写る製品Rに含まれる欠陥の種別を示すラベル63、及び欠陥の範囲を示す境界情報65を適宜生成する。例えば、ラベル63は、欠陥の種別の一覧から対象の学習画像61に写る欠陥を選択することで生成されてよい。また、境界情報65は、学習画像61上で欠陥の範囲を含むようにバウンディングボックスを指定することで生成されてよい。そして、生成したラベル63及び境界情報65を対応する学習画像61に関連付ける。これにより、各学習データセット60を生成することができる。   The method of acquiring the learning data set 60 does not have to be particularly limited and may be appropriately determined according to the embodiment. For example, a camera and a defective product R are prepared, and the product R is photographed by the camera so that the defective portion can be seen. Thereby, the learning image 61 can be generated. Next, the label 63 indicating the type of defect included in the product R shown in the learning image 61 and the boundary information 65 indicating the range of the defect are appropriately generated. For example, the label 63 may be generated by selecting a defect that appears in the target learning image 61 from the list of defect types. The boundary information 65 may be generated by designating the bounding box so as to include the defect range on the learning image 61. Then, the generated label 63 and boundary information 65 are associated with the corresponding learning image 61. Thereby, each learning data set 60 can be generated.

この学習データセット60の生成は、コンピュータの動作により自動的に行われてもよいし、オペレータの操作により手動的に行われてもよい。また、この学習データセット60を生成する情報処理は、学習装置1において実行されてもよいし、学習装置1以外の他のコンピュータにおいて実行されてもよい。   The generation of the learning data set 60 may be automatically performed by the operation of the computer or may be manually performed by the operation of the operator. Further, the information processing for generating the learning data set 60 may be executed in the learning device 1 or may be executed in a computer other than the learning device 1.

学習データセット60を学習装置1が生成する場合、制御部11は、自動的又はオペレータの操作により手動的に上記情報処理を実行することで、複数の学習データセット60を取得する。一方、学習データセット60を他のコンピュータが生成する場合、制御部11は、例えば、ネットワーク、記憶媒体91等を介して、他のコンピュータにより生成された複数の学習データセット60を取得する。一部の学習データセット60を学習装置1が生成し、残りの学習データセット60を他のコンピュータが生成してもよい。   When the learning device 1 generates the learning data sets 60, the control unit 11 acquires a plurality of learning data sets 60 by executing the information processing automatically or manually by an operator's operation. On the other hand, when the learning data set 60 is generated by another computer, the control unit 11 acquires the plurality of learning data sets 60 generated by the other computer via, for example, the network or the storage medium 91. The learning device 1 may generate a part of the learning data set 60, and another computer may generate the remaining learning data set 60.

取得する学習データセット60の件数は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。複数の学習データセット60を取得すると、制御部11は、次のステップS102に処理を進める。   The number of learning data sets 60 to be acquired does not have to be particularly limited, and may be appropriately determined according to the embodiment. When the plurality of learning data sets 60 are acquired, the control unit 11 advances the processing to the next step S102.

(ステップS102及びS103)
ステップS102では、制御部11は、第1学習処理部112として動作し、第1の機械学習を実行することで、各学習データセット60に含まれるラベル63の入力に対して、入力されたラベル63に関連付けられた学習画像61に対応する画像を生成するように訓練された生成器50を構築する。ステップS103では、制御部11は、第2学習処理部113として動作し、第2の機械学習を実行することで、各学習データセット60に含まれる学習画像61の入力に対して、入力された学習画像61に関連付けられたラベル63及び境界情報65と一致するように、入力された学習画像61に写る製品Rに含まれる欠陥の種別及び範囲を推定するように訓練された推定器52を構築する。
(Steps S102 and S103)
In step S102, the control unit 11 operates as the first learning processing unit 112 and executes the first machine learning, so that the label 63 input to the input of the label 63 included in each learning data set 60 is input. Construct a generator 50 trained to generate an image corresponding to the training image 61 associated with 63. In step S103, the control unit 11 operates as the second learning processing unit 113 and executes the second machine learning to input the learning images 61 included in each learning data set 60. Constructs an estimator 52 trained to estimate the type and range of defects included in the product R shown in the input learning image 61 so as to match the label 63 and the boundary information 65 associated with the learning image 61. To do.

ステップS102及びS103を処理する順序は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。ステップS102及びS103の処理は、同時に実行されてもよいし、別々に実行されてもよい。本実施形態では、生成器50及び推定器52は、エンコーダ56及び判別器54と共に、学習ネットワーク500を構成している。そこで、本ステップS102及びS103では、制御部11は、学習ネットワーク500の機械学習を実施することで、生成器50及び推定器52を訓練する。   The order of processing steps S102 and S103 may not be particularly limited and may be appropriately determined according to the embodiment. The processes of steps S102 and S103 may be executed simultaneously or separately. In the present embodiment, the generator 50 and the estimator 52 constitute the learning network 500 together with the encoder 56 and the discriminator 54. Therefore, in steps S102 and S103, the control unit 11 trains the generator 50 and the estimator 52 by performing the machine learning of the learning network 500.

詳細には、まず、制御部11は、処理対象となる学習ネットワーク500を用意する。用意する学習ネットワーク500の構成、各ニューロン間の結合の重みの初期値、及び各ニューロンの閾値の初期値は、テンプレートにより与えられてもよいし、オペレータの入力により与えられてもよい。また、再学習を行う場合には、制御部11は、過去の機械学習を行うことで得られた学習結果データに基づいて、学習ネットワーク500を用意してもよい。   Specifically, first, the control unit 11 prepares the learning network 500 to be processed. The configuration of the learning network 500 to be prepared, the initial value of the connection weight between neurons, and the initial value of the threshold value of each neuron may be given by a template or may be given by an operator's input. Further, when performing re-learning, the control unit 11 may prepare the learning network 500 based on the learning result data obtained by performing the past machine learning.

次に、制御部11は、各学習データセット60の学習画像61を入力データとして利用し、対応するラベル63及び境界情報65を教師データとして利用して、推定器52の学習処理を実行する。制御部11は、各学習データセット60の学習画像61及びラベル63を入力データとして利用し、事前分布から導出された値を教師データとして利用して、エンコーダ56の学習処理を実行する。制御部11は、各学習データセット60について、エンコーダ56から得られた出力値及びラベル63を生成器50に入力し、生成器50の演算処理を実行する。これにより、制御部11は、生成器50から各画像69を取得する。制御部11は、各画像69及び各学習画像61を入力データとして利用し、各画像(61、69)の由来を教師データとして利用して、判別器54の学習処理を実行する。制御部11は、各学習データセット60について、エンコーダ56から得られた出力値及びラベル63を入力データとして利用し、判別器54に判別を誤らせることを教師データとして利用して、生成器50の学習処理を実行する。制御部11は、各学習データセット60について、エンコーダ56から得られた出力値及びラベル63を入力データとして利用し、推定器52が欠陥の種別を正しく推定することを教師データとして利用して、生成器50の学習処理を実行する。制御部11は、各学習データセット60について、学習画像61及びラベル63を入力データとして利用し、学習画像61を教師データとして利用して、エンコーダ56及び生成器50の学習処理を実行する。これらの学習処理には、確率的勾配降下法等が用いられてよい。   Next, the control unit 11 uses the learning image 61 of each learning data set 60 as input data and the corresponding label 63 and boundary information 65 as teacher data to execute the learning process of the estimator 52. The control unit 11 uses the learning image 61 and the label 63 of each learning data set 60 as input data, and uses the value derived from the prior distribution as teacher data to execute the learning process of the encoder 56. The control unit 11 inputs the output value obtained from the encoder 56 and the label 63 for each learning data set 60 to the generator 50, and executes the arithmetic processing of the generator 50. Thereby, the control unit 11 acquires each image 69 from the generator 50. The control unit 11 uses each image 69 and each learning image 61 as input data, and uses the origin of each image (61, 69) as teacher data to execute the learning process of the discriminator 54. For each learning data set 60, the control unit 11 uses the output value and the label 63 obtained from the encoder 56 as input data, and uses the discriminator 54 to make an erroneous determination as teacher data, and uses the output value and the label 63 of the generator 50. Execute the learning process. For each learning data set 60, the control unit 11 uses the output value and the label 63 obtained from the encoder 56 as input data, and uses the estimator 52 to correctly estimate the defect type as teacher data, The learning process of the generator 50 is executed. For each learning data set 60, the control unit 11 uses the learning image 61 and the label 63 as input data and the learning image 61 as teacher data to execute the learning process of the encoder 56 and the generator 50. A stochastic gradient descent method or the like may be used for these learning processes.

例えば、制御部11は、各学習データセット60に含まれる学習画像61を推定器52の入力層531に入力し、入力側から順に各層531〜533に含まれる各ニューロンの発火判定を行う。これにより、制御部11は、各学習画像61に写る製品Rに含まれる欠陥の種別及び範囲を推定した結果に対応する出力値を出力層533から取得する。制御部11は、欠陥の種別を推定した結果に対応する出力値とラベル63の値との誤差(LC)を算出する。また、制御部11は、欠陥の範囲を推定した結果に対応する出力値と境界情報65の値との誤差(LBB)を算出する。 For example, the control unit 11 inputs the learning image 61 included in each learning data set 60 to the input layer 531 of the estimator 52, and determines the firing of each neuron included in each layer 531 to 533 in order from the input side. Thereby, the control unit 11 acquires, from the output layer 533, an output value corresponding to the result of estimating the type and range of the defect included in the product R shown in each learning image 61. The control unit 11 calculates an error (L C ) between the output value corresponding to the result of estimating the defect type and the value of the label 63. The control unit 11 also calculates an error (L BB ) between the output value corresponding to the result of estimating the defect range and the value of the boundary information 65.

次に、制御部11は、各学習データセット60に含まれる学習画像61及びラベル63をエンコーダ56の入力層571に入力し、入力側から順に各層571〜573に含まれる各ニューロンの発火判定を行う。これにより、制御部11は、何らかの特徴量を導出した結果に対応する出力値(潜在変数)をエンコーダ56の出力層573から取得する。制御部11は、この出力値と事前分布から導出された値との誤差(LKL)を算出する。事前分布には、例えば、ガウス分布等であってよい。 Next, the control unit 11 inputs the learning image 61 and the label 63 included in each learning data set 60 to the input layer 571 of the encoder 56, and determines firing of each neuron included in each layer 571 to 573 in order from the input side. To do. As a result, the control unit 11 acquires the output value (latent variable) corresponding to the result of deriving some kind of characteristic amount from the output layer 573 of the encoder 56. The control unit 11 calculates the error (L KL ) between this output value and the value derived from the prior distribution. The prior distribution may be, for example, a Gaussian distribution or the like.

次に、制御部11は、エンコーダ56から得られた出力値及び対応するラベル63を生成器50の入力層511に入力し、入力側から順に各層511〜513に含まれる各ニューロンの発火判定を行う。これにより、制御部11は、各学習画像61に対応する画像をラベル63から生成した結果として各画像69を出力層513から取得する。   Next, the control unit 11 inputs the output value obtained from the encoder 56 and the corresponding label 63 to the input layer 511 of the generator 50, and determines the firing determination of each neuron included in each layer 511 to 513 in order from the input side. To do. Thereby, the control unit 11 acquires each image 69 from the output layer 513 as a result of generating the image corresponding to each learning image 61 from the label 63.

続いて、制御部11は、生成器50により生成された各画像69を判別器54の入力層551に入力し、入力側から順に各層551〜553に含まれる各ニューロンの発火判定を行う。これにより、制御部11は、入力画像が生成器50由来か学習データセット60由来(つまり、学習画像61そのもの)かを判別した結果に対応する出力値を出力層553から取得する。この場面では、生成器50により生成された各画像69が入力画像であるため、判別器54は、「偽」と判別するのが正解である。制御部11は、生成器50により生成された各画像69について、出力層553から得られる出力値とこの正解との誤差(LD)を算出する。 Subsequently, the control unit 11 inputs each image 69 generated by the generator 50 to the input layer 551 of the discriminator 54, and performs firing determination of each neuron included in each layer 551 to 553 in order from the input side. Thereby, the control unit 11 acquires from the output layer 553 an output value corresponding to the result of determining whether the input image is derived from the generator 50 or the learning data set 60 (that is, the learning image 61 itself). In this scene, since each image 69 generated by the generator 50 is an input image, it is the correct answer for the discriminator 54 to determine “false”. The control unit 11 calculates an error (L D ) between the output value obtained from the output layer 553 and the correct answer for each image 69 generated by the generator 50.

また、制御部11は、各学習データセット60に含まれる学習画像61を判別器54の入力層551に入力し、入力側から順に各層551〜553に含まれる各ニューロンの発火判定を行う。これにより、制御部11は、入力画像が生成器50由来か学習データセット60由来かを判別した結果に対応する出力値を出力層553から取得する。この場面では、学習画像61そのものが入力画像であるため、判別器54は、「真」と判別するのが正解である。制御部11は、各学習データセット60について、出力層553から得られる出力値とこの正解との誤差(LD)を算出する。 Further, the control unit 11 inputs the learning image 61 included in each learning data set 60 to the input layer 551 of the discriminator 54, and sequentially determines the firing of each neuron included in each layer 551 to 553 from the input side. Thereby, the control unit 11 acquires, from the output layer 553, an output value corresponding to the result of determining whether the input image is derived from the generator 50 or the learning data set 60. In this scene, since the learning image 61 itself is the input image, it is the correct answer for the discriminator 54 to determine “true”. The control unit 11 calculates the error (L D ) between the output value obtained from the output layer 553 and the correct answer for each learning data set 60.

次に、制御部11は、生成器50により生成された各画像69を判別器54に入力することで得られた出力値について、判別器54による判別を誤らせるような画像を生成するように生成器50を訓練するための誤差(LGD)を算出する。具体的には、生成器50により生成された各画像69を判別器54に入力したときに、判別器54から得られる出力値が「真」に対応することが正解である。制御部11は、各学習データセット60について、一連の処理により出力層553から得られる出力値とこの正解(つまり、「真」)との誤差(LGD)を算出する。 Next, the control unit 11 generates an image that causes the discrimination by the discriminator 54 to be erroneous with respect to the output value obtained by inputting each image 69 generated by the generator 50 into the discriminator 54. Calculate the error (L GD ) for training vessel 50. Specifically, it is a correct answer that the output value obtained from the discriminator 54 corresponds to “true” when each image 69 generated by the generator 50 is input to the discriminator 54. The control unit 11 calculates an error (L GD ) between the output value obtained from the output layer 553 through a series of processes and the correct answer (that is, “true”) for each learning data set 60.

次に、制御部11は、生成器50により生成された各画像69を推定器52の入力層531に入力し、入力側から順に各層531〜533に含まれる各ニューロンの発火判定を行う。これにより、制御部11は、各画像69に写る製品Rに含まれる欠陥の種別を推定した結果に対応する出力値を推定器52の出力層533から取得する。制御部11は、各学習データセット60について、一連の処理により欠陥の種別を推定した結果に対応する出力値と対応するラベル63の値との誤差(LGC)を算出する。 Next, the control unit 11 inputs each image 69 generated by the generator 50 to the input layer 531 of the estimator 52, and performs firing determination of each neuron included in each layer 531 to 533 in order from the input side. Thereby, the control unit 11 acquires the output value corresponding to the result of estimating the type of the defect included in the product R shown in each image 69 from the output layer 533 of the estimator 52. For each learning data set 60, the control unit 11 calculates an error (L GC ) between the output value corresponding to the result of estimating the defect type by a series of processes and the value of the corresponding label 63.

次に、制御部11は、各学習データセット60について、エンコーダ56の出力から学習画像61を復元するデコーダとして機能ように生成器50を訓練するための誤差を算出する。具体的には、制御部11は、各学習データセット60について、生成器50により生成された画像69と対応する学習画像61との誤差(LG)を算出する。 Next, the control unit 11 calculates, for each learning data set 60, an error for training the generator 50 to function as a decoder that restores the learning image 61 from the output of the encoder 56. Specifically, the control unit 11 calculates, for each learning data set 60, an error (L G ) between the image 69 generated by the generator 50 and the corresponding learning image 61.

そして、制御部11は、誤差逆伝播法(Back propagation)により、算出される各誤差(LC、LBB、LKL、LD、LGD、LGC、LG)を用いて、各ニューロン間の結合の重み及び各ニューロンの閾値それぞれの誤差を算出する。すなわち、制御部11は、算出される各誤差(LC、LBB)を用いて、推定器52の各ニューロン間の結合の重み及び各ニューロンの閾値それぞれの誤差を算出する。制御部11は、算出される誤差(LD)を用いて、判別器54の各ニューロン間の結合の重み及び各ニューロンの閾値それぞれの誤差を算出する。制御部11は、算出される各誤差(LG、LGD、LGC)を用いて、生成器50の各ニューロン間の結合の重み及び各ニューロンの閾値それぞれの誤差を算出する。制御部11は、算出される各誤差(LKL、LG)を用いて、エンコーダ56の各ニューロン間の結合の重み及び各ニューロンの閾値それぞれの誤差を算出する。制御部11は、算出した各誤差に基づいて、推定器52、判別器54、生成器50、及びエンコーダ56それぞれにおける各ニューロン間の結合の重み及び各ニューロンの閾値それぞれの値の更新を行う。 Then, the control unit 11, by the error backpropagation (Back propagation), the error calculated (L C, L BB, L KL, L D, L GD, L GC, L G) with, each neuron The error of each of the connection weight and the threshold value of each neuron is calculated. That is, the control unit 11 calculates the weight of the coupling between the neurons of the estimator 52 and the error of the threshold value of each neuron by using each calculated error (L C , L BB ). The control unit 11 uses the calculated error (L D ) to calculate the weight of the connection between the neurons of the discriminator 54 and the error of the threshold value of each neuron. The control unit 11 uses each calculated error (L G , L GD , L GC ) to calculate the weight of the coupling between the neurons of the generator 50 and the error of each threshold value of each neuron. The control unit 11 uses the calculated errors (L KL , L G ) to calculate the weight of the coupling between the neurons of the encoder 56 and the error of the threshold of each neuron. The control unit 11 updates the weight of the coupling between the neurons in each of the estimator 52, the discriminator 54, the generator 50, and the encoder 56 and the value of each threshold value of each neuron based on each calculated error.

制御部11は、算出される各誤差(LC、LBB、LKL、LD、LGD、LGC、LG)の和が閾値以下になるまで、上記一連の処理により、各パラメータの値の調節を繰り返す。各閾値は、実施の形態に応じて適宜設定されてよい。これにより、制御部11は、各学習データセット60について、学習画像61の入力に対して、対応するラベル63及び境界情報65と一致するように、入力された学習画像61に写る製品Rに含まれる欠陥の種別及び範囲を推定するように訓練された推定器52を構築することができる。制御部11は、入力された入力画像が、生成器50由来か学習データセット60由来かを適切に判別可能に訓練された判別器54を構築することができる。制御部11は、判別器54が判別を誤り、対応するラベル63と一致するように推定器52が欠陥の種別を推定し、かつ学習画像61に対応し得る画像69を生成可能に訓練された生成器50を構築することができる。制御部11は、各学習データセット60について、学習画像61及びラベル63の入力に対して、事前分布に従う出力値であって、学習画像61に対応する画像を生成器50に生成させることが可能な出力値を出力するように訓練されたエンコーダ56を構築することができる。この機械学習の処理が完了すると、制御部11は、次のステップS104に処理を進める。なお、パラメータの調節を繰り返す基準は、このような閾値を用いる例に限定されなくてもよい。例えば、制御部11は、指定された回数分、上記一連の処理により、各パラメータの値の調節を繰り返すようにしてもよい。 Control unit 11, the error calculated (L C, L BB, L KL, L D, L GD, L GC, L G) to the sum of less than or equal to the threshold value, the above-described series of processes, each parameter Repeat the value adjustment. Each threshold may be appropriately set according to the embodiment. As a result, the control unit 11 includes, for each learning data set 60, the product R shown in the input learning image 61 so that the input of the learning image 61 matches the corresponding label 63 and boundary information 65. An estimator 52 may be constructed that is trained to estimate the type and range of defects that will be exposed. The control unit 11 can construct a discriminator 54 that has been trained so as to be able to appropriately discriminate whether the input image input is from the generator 50 or the learning data set 60. The control unit 11 has been trained so that the discriminator 54 makes a discrimination error, the estimator 52 estimates the defect type so as to match the corresponding label 63, and can generate the image 69 that can correspond to the learning image 61. The generator 50 can be constructed. The control unit 11 can cause the generator 50 to generate an image corresponding to the learning image 61, which is an output value according to the prior distribution with respect to the inputs of the learning image 61 and the label 63 for each learning data set 60. An encoder 56 trained to output various output values can be constructed. When the machine learning process is completed, the control unit 11 advances the process to the next step S104. It should be noted that the criterion for repeating the parameter adjustment is not limited to the example using such a threshold value. For example, the control unit 11 may repeat the adjustment of the value of each parameter by the specified number of times through the series of processes described above.

(ステップS104)
ステップS104では、制御部11は、保存処理部114として動作し、構築された学習済みの生成器50に関する情報、及び構築された学習済みの推定器52に関する情報を所定の記憶領域に保存する。
(Step S104)
In step S104, the control unit 11 operates as the storage processing unit 114 and stores the information regarding the constructed learned generator 50 and the information regarding the constructed learned estimator 52 in a predetermined storage area.

本実施形態では、制御部11は、ステップS102により構築された学習済みの生成器50の構成及びパラメータを示す情報を第1学習結果データ123として生成する。また、制御部11は、ステップS103により構築された学習済みの推定器52の構成及びパラメータを示す情報を第2学習結果データ125として生成する。そして、制御部11は、生成した第1学習結果データ123及び第2学習結果データ125を所定の記憶領域に保存する。所定の記憶領域は、例えば、制御部11内のRAM、記憶部12、外部記憶装置、記憶メディア又はこれらの組み合わせであってよい。   In the present embodiment, the control unit 11 generates, as the first learning result data 123, information indicating the configuration and parameters of the learned generator 50 constructed in step S102. The control unit 11 also generates information indicating the configuration and parameters of the learned estimator 52 constructed in step S103 as the second learning result data 125. Then, the control unit 11 saves the generated first learning result data 123 and second learning result data 125 in a predetermined storage area. The predetermined storage area may be, for example, the RAM in the control unit 11, the storage unit 12, the external storage device, the storage medium, or a combination thereof.

記憶メディアは、例えば、CD、DVD等であってよく、制御部11は、ドライブ16を介して記憶メディアに第1学習結果データ123及び第2学習結果データ125を格納してもよい。外部記憶装置は、例えば、NAS(Network Attached Storage)等のデータサーバであってよい。この場合、制御部11は、ネットワークを介してデータサーバに第1学習結果データ123及び第2学習結果データ125を格納してもよい。また、外部記憶装置は、例えば、学習装置1に接続された外付けの記憶装置であってもよい。   The storage medium may be, for example, a CD, a DVD, or the like, and the control unit 11 may store the first learning result data 123 and the second learning result data 125 in the storage medium via the drive 16. The external storage device may be, for example, a data server such as NAS (Network Attached Storage). In this case, the control unit 11 may store the first learning result data 123 and the second learning result data 125 in the data server via the network. The external storage device may be, for example, an external storage device connected to the learning device 1.

なお、エンコーダ56及び判別器54の取り扱いについては、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、制御部11は、エンコーダ56及び判別器54についても、生成器50及び推定器52と同様に、それぞれの構成及びパラメータを示す情報を学習結果データとして生成し、生成した学習結果データを所定の記憶領域に保存してもよい。或いは、制御部11は、この学習結果データの生成及び保存の処理を省略してもよい。   The handling of the encoder 56 and the discriminator 54 is not particularly limited, and may be appropriately determined according to the embodiment. For example, the control unit 11 also generates information indicating the configuration and parameters of the encoder 56 and the discriminator 54, as the learning result data, as with the generator 50 and the estimator 52, and sets the generated learning result data to a predetermined value. May be stored in the storage area. Alternatively, the control unit 11 may omit the process of generating and storing the learning result data.

第1学習結果データ123及び第2学習結果データ125を保存すると、制御部11は、本動作例に係る処理を終了する。学習済みの生成器50及び推定器52を構築した後、制御部11は、生成した第1学習結果データ123及び第2学習結果データ125を任意のタイミングで画像生成装置2に転送してもよい。画像生成装置2は、学習装置1から転送を受け付けることで、第1学習結果データ123及び第2学習結果データ125を取得してもよい。画像生成装置2は、学習装置1又はデータサーバにアクセスすることで、第1学習結果データ123及び第2学習結果データ125を取得してもよい。或いは、第1学習結果データ123及び第2学習結果データ125は、画像生成装置2に予め組み込まれてもよい。   When the first learning result data 123 and the second learning result data 125 are saved, the control unit 11 ends the process according to this operation example. After constructing the learned generator 50 and the estimator 52, the control unit 11 may transfer the generated first learning result data 123 and second learning result data 125 to the image generating device 2 at arbitrary timing. . The image generation device 2 may acquire the first learning result data 123 and the second learning result data 125 by accepting the transfer from the learning device 1. The image generation device 2 may acquire the first learning result data 123 and the second learning result data 125 by accessing the learning device 1 or the data server. Alternatively, the first learning result data 123 and the second learning result data 125 may be incorporated in the image generating device 2 in advance.

また、制御部11は、上記ステップS101〜S104の処理を定期的に繰り返すことで、第1学習結果データ123及び第2学習結果データ125の少なくともいずれかを定期的に更新してもよい。この繰り返す際に、学習データセット60の変更、修正、追加、削除等が適宜実行されてよい。そして、制御部11は、更新した第1学習結果データ123及び第2学習結果データ125の少なくともいずれかを機械学習の実行毎に画像生成装置2に転送することで、画像生成装置2の保持する第1学習結果データ123及び第2学習結果データ125の少なくともいずれかを定期的に更新してもよい。   Moreover, the control unit 11 may periodically update at least one of the first learning result data 123 and the second learning result data 125 by periodically repeating the processes of steps S101 to S104. When this is repeated, the learning data set 60 may be changed, modified, added, deleted, or the like as appropriate. Then, the control unit 11 transfers the updated first learning result data 123 and / or the second learning result data 125 to the image generating apparatus 2 each time the machine learning is executed, so that the image generating apparatus 2 holds the same. At least one of the first learning result data 123 and the second learning result data 125 may be updated periodically.

[画像生成装置]
次に、図13を用いて、本実施形態に係る画像生成装置2の動作例について説明する。図13は、本実施形態に係る画像生成装置2の処理手順の一例を示す。ただし、以下で説明する処理手順は一例に過ぎず、各処理は可能な限り変更されてよい。また、以下で説明する処理手順について、実施の形態に応じて、適宜、ステップの省略、置換、及び追加が可能である。
[Image generation device]
Next, an operation example of the image generation device 2 according to the present embodiment will be described with reference to FIG. FIG. 13 shows an example of the processing procedure of the image generating apparatus 2 according to this embodiment. However, the processing procedure described below is merely an example, and each processing may be changed as much as possible. Further, regarding the processing procedure described below, steps can be omitted, replaced, and added as appropriate according to the embodiment.

(ステップS201)
ステップS201では、制御部21は、生成部211として動作し、学習装置1により構築された学習済みの生成器50を利用して、指定された欠陥を含む製品Rの写り得る生成画像73を生成する。
(Step S201)
In step S201, the control unit 21 operates as the generation unit 211, and uses the learned generator 50 constructed by the learning device 1 to generate the generated image 73 of the product R including the designated defect. To do.

本実施形態では、制御部21は、第1学習結果データ123を参照して、学習済みの生成器50の設定を行う。次に、制御部21は、所定の確率分布からノイズ(潜在変数)を取得する。所定の確率分布は、例えば、ガウス分布等であってよい。また、制御部21は、欠陥の種別を示す入力値71を適宜取得する。例えば、欠陥の種別の一覧を示す情報(不図示)が、画像生成プログラム221内、記憶部22、外部記憶装置、記憶メディア等に格納されていてよい。この場合、制御部21は、この欠陥の種別の一覧を示す情報を取得し、取得した情報を参照して、画像を生成する対象に指定する欠陥を一覧から選択することで、入力値71を取得してもよい。また、例えば、制御部21は、所定の数値範囲からランダムに入力値71を選択してもよい。そして、制御部21は、取得したノイズ及び入力値71を生成器50の入力層511に入力し、入力側から順に各層511〜513に含まれる各ニューロンの発火判定を行う。これにより、制御部21は、生成器50の出力層513から生成画像73を取得する。生成画像73の生成が完了すると、制御部21は、次のステップS202に処理を進める。   In the present embodiment, the control unit 21 refers to the first learning result data 123 and sets the learned generator 50. Next, the control unit 21 acquires noise (latent variable) from a predetermined probability distribution. The predetermined probability distribution may be, for example, a Gaussian distribution or the like. Further, the control unit 21 appropriately acquires the input value 71 indicating the type of defect. For example, information (not shown) indicating a list of defect types may be stored in the image generation program 221, the storage unit 22, the external storage device, the storage medium, or the like. In this case, the control unit 21 acquires the information indicating the list of defect types, refers to the acquired information, and selects the defect to be designated as an image generation target from the list, thereby setting the input value 71. You may get it. Further, for example, the control unit 21 may randomly select the input value 71 from a predetermined numerical range. Then, the control unit 21 inputs the acquired noise and the input value 71 to the input layer 511 of the generator 50, and determines the firing of each neuron included in each of the layers 511 to 513 in order from the input side. Thereby, the control unit 21 acquires the generated image 73 from the output layer 513 of the generator 50. When the generation of the generated image 73 is completed, the control unit 21 advances the processing to the next step S202.

(ステップS202)
ステップS202では、制御部21は、推定部212として動作し、学習装置1により構築された学習済みの推定器52を利用して、生成画像73に写り得る製品Rに含まれる欠陥の種別及び範囲を推定する。
(Step S202)
In step S202, the control unit 21 operates as the estimation unit 212 and uses the learned estimator 52 constructed by the learning device 1 to use the type and range of defects included in the product R that can be shown in the generated image 73. To estimate.

本実施形態では、制御部21は、第2学習結果データ125を参照して、学習済みの推定器52の設定を行う。そして、制御部21は、生成器50により生成された生成画像73を推定器52の入力層531に入力し、入力側から順に各層531〜533に含まれる各ニューロンの発火判定を行う。これにより、制御部21は、生成画像73に写る製品Rに含まれる欠陥の種別及び範囲を推定した結果に対応する出力値を推定器52の出力層533から取得する。欠陥の種別及び範囲の推定が完了すると、制御部21は、次のステップS203に処理を進める。   In the present embodiment, the control unit 21 sets the learned estimator 52 with reference to the second learning result data 125. Then, the control unit 21 inputs the generated image 73 generated by the generator 50 to the input layer 531 of the estimator 52, and performs firing determination of each neuron included in each layer 531 to 533 in order from the input side. Thereby, the control unit 21 acquires the output value corresponding to the result of estimating the type and range of the defect included in the product R shown in the generated image 73 from the output layer 533 of the estimator 52. When the estimation of the defect type and range is completed, the control unit 21 advances the process to the next step S203.

(ステップS203及びS204)
ステップS203では、制御部21は、判定部213として動作し、生成画像73に写る製品Rに含まれる欠陥の種別を推定した結果が入力値71により示される欠陥の種別と一致するか否かを判定する。ステップS204では、制御部21は、ステップS203の判定結果に応じて、条件分岐を処理する。
(Steps S203 and S204)
In step S <b> 203, the control unit 21 operates as the determination unit 213 and determines whether or not the result of estimating the defect type included in the product R shown in the generated image 73 matches the defect type indicated by the input value 71. judge. In step S204, the control unit 21 processes the conditional branch according to the determination result of step S203.

推定器52により欠陥の種別を推定した結果が入力値71と一致していることは、指定した欠陥を含む製品Rを写した画像(生成画像73)を生成器50により生成することができたことを示す。そのため、欠陥の種別を推定した結果が入力値71により示される欠陥の種別と一致すると判定した場合、制御部21は、この生成画像73を保存するための次のステップS205に処理を進める。   The fact that the result of estimating the defect type by the estimator 52 matches the input value 71 means that the image (generated image 73) showing the product R including the specified defect can be generated by the generator 50. Indicates that. Therefore, when it is determined that the result of estimating the defect type matches the defect type indicated by the input value 71, the control unit 21 advances the process to the next step S205 for storing the generated image 73.

一方、推定器52により欠陥の種別を推定した結果が入力値71と一致していないことは、指定した欠陥を含む製品Rを写した画像を生成器50により生成することができなかったことを示す。そのため、欠陥の種別を推定した結果が入力値71により示される欠陥の種別と一致しないと判定した場合、制御部21は、次のステップS205の処理を省略し、本動作例に係る処理を終了する。   On the other hand, the fact that the result of estimating the defect type by the estimator 52 does not match the input value 71 means that the image of the product R including the specified defect cannot be generated by the generator 50. Show. Therefore, when it is determined that the result of estimating the defect type does not match the defect type indicated by the input value 71, the control unit 21 omits the process of the next step S205 and ends the process according to the present operation example. To do.

この場合、制御部21は、ステップS201により生成した生成画像73を破棄してもよい。或いは、制御部21は、生成した生成画像73に対して欠陥の種別及び範囲の少なくとも一方の指定を受け付けてもよい。そして、制御部21は、指定された欠陥の種別及び範囲の少なくとも一方を示す情報を生成画像73に関連付けることでデータセットを生成し、生成したデータセットを所定の記憶領域に保存してもよい。所定の記憶領域は、例えば、制御部21内のRAM、記憶部22、外部記憶装置、記憶メディア又はこれらの組み合わせであってよい。   In this case, the control unit 21 may discard the generated image 73 generated in step S201. Alternatively, the control unit 21 may accept designation of at least one of the defect type and the range for the generated generated image 73. Then, the control unit 21 may generate a data set by associating information indicating at least one of the type and range of the designated defect with the generated image 73, and may store the generated data set in a predetermined storage area. . The predetermined storage area may be, for example, a RAM in the control unit 21, a storage unit 22, an external storage device, a storage medium, or a combination thereof.

(ステップS205)
ステップS205では、制御部21は、画像保存部214として動作し、生成した生成画像73と欠陥の範囲を推定した結果とを関連付けて所定の記憶領域に格納する。本実施形態では、制御部21は、欠陥の範囲を推定した結果を示す情報を境界情報77として生成する。また、制御部21は、入力値71に対応して、欠陥の種別を示す情報をラベル75として生成する。そして、制御部21は、生成画像73、ラベル75、及び境界情報77を組み合わせることでデータセットを生成し、生成したデータセットを所定の記憶領域に格納する。所定の記憶領域は、例えば、制御部21内のRAM、記憶部22、外部記憶装置、記憶メディア又はこれらの組み合わせであってよい。なお、この一連の処理において、ラベル75は省略されてもよい。すなわち、制御部21は、ラベル75の生成を省略し、生成画像73及び境界情報77を組み合わせることでデータセットを生成し、生成したデータセットを所定の記憶領域に格納してもよい。
(Step S205)
In step S205, the control unit 21 operates as the image storage unit 214 and stores the generated image 73 and the result of estimating the range of the defect in a predetermined storage area in association with each other. In the present embodiment, the control unit 21 generates, as the boundary information 77, information indicating the result of estimating the defect range. Further, the control unit 21 generates information indicating the type of defect as the label 75, corresponding to the input value 71. Then, the control unit 21 generates a data set by combining the generated image 73, the label 75, and the boundary information 77, and stores the generated data set in a predetermined storage area. The predetermined storage area may be, for example, a RAM in the control unit 21, a storage unit 22, an external storage device, a storage medium, or a combination thereof. The label 75 may be omitted in this series of processes. That is, the control unit 21 may omit the generation of the label 75, generate a data set by combining the generated image 73 and the boundary information 77, and store the generated data set in a predetermined storage area.

以上により、制御部21は、本動作例に係る処理を終了する。制御部21は、上記ステップS201〜S205を繰り返し実行することで、複数のデータセットを生成してもよい。生成するデータセットの数は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。また、制御部21は、生成したデータセットを学習データセット322として利用させるために、生成したデータセットを推定器生成装置3に転送してもよい。   As described above, the control unit 21 ends the process according to this operation example. The control unit 21 may generate a plurality of data sets by repeatedly executing the above steps S201 to S205. The number of data sets to be generated does not have to be particularly limited and may be appropriately determined according to the embodiment. Further, the control unit 21 may transfer the generated data set to the estimator generation device 3 in order to use the generated data set as the learning data set 322.

[推定器生成装置]
次に、図14を用いて、本実施形態に係る推定器生成装置3の動作例について説明する。図14は、本実施形態に係る推定器生成装置3の処理手順の一例を例示するフローチャートである。ただし、以下で説明する処理手順は一例に過ぎず、各処理は可能な限り変更されてよい。また、以下で説明する処理手順について、実施の形態に応じて、適宜、ステップの省略、置換、及び追加が可能である。
[Estimator generator]
Next, an operation example of the estimator generation device 3 according to the present embodiment will be described using FIG. 14. FIG. 14 is a flowchart illustrating an example of the processing procedure of the estimator generation device 3 according to this embodiment. However, the processing procedure described below is merely an example, and each processing may be changed as much as possible. Further, regarding the processing procedure described below, steps can be omitted, replaced, and added as appropriate according to the embodiment.

(ステップS301)
ステップS301では、制御部31は、データ取得部311として動作し、製品Rを写したサンプル画像3221、製品Rに含まれ得る欠陥の種別を示すラベル3222、及び製品Rに含まれ得る欠陥の範囲を示す境界情報3223の組み合わせによりそれぞれ構成された複数の学習データセット322を取得する。
(Step S301)
In step S301, the control unit 31 operates as the data acquisition unit 311 and a sample image 3221 showing the product R, a label 3222 indicating the type of defect that can be included in the product R, and a range of defects that can be included in the product R. A plurality of learning data sets 322 each constituted by a combination of boundary information 3223 indicating

学習データセット322を取得する方法は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、カメラ及び製品Rを用意し、欠陥のある又は欠陥のない製品Rをカメラにより撮影する。これにより、サンプル画像3221を生成することができる。次に、サンプル画像3221に写る製品Rに含まれ得る欠陥の種別を示すラベル3222、及び欠陥の範囲を示す境界情報3223を適宜生成する。ラベル3222及び境界情報3223を生成する方法は、上記ラベル63及び境界情報65を生成する方法と同様であってよい。境界情報3223は、バウンディングボックスにより欠陥の範囲を示すように適宜生成されてよい。また、サンプル画像3221に写る製品Rに欠陥が含まれない場合、ラベル3222及び境界情報3223の各値は、製品Rに欠陥が含まれないことを示すように適宜設定されてよい。そして、生成したラベル3222及び境界情報3223を対応するサンプル画像3221に関連付ける。これにより、各学習データセット322を生成することができる。   The method for acquiring the learning data set 322 may not be particularly limited and may be appropriately determined according to the embodiment. For example, a camera and a product R are prepared, and a defective or non-defective product R is photographed by the camera. Thereby, the sample image 3221 can be generated. Next, a label 3222 indicating the type of defect that can be included in the product R shown in the sample image 3221 and boundary information 3223 indicating the range of the defect are appropriately generated. The method of generating the label 3222 and the boundary information 3223 may be the same as the method of generating the label 63 and the boundary information 65. The boundary information 3223 may be appropriately generated by the bounding box so as to indicate the range of the defect. Further, when the product R shown in the sample image 3221 does not include a defect, each value of the label 3222 and the boundary information 3223 may be appropriately set so as to indicate that the product R does not include a defect. Then, the generated label 3222 and boundary information 3223 are associated with the corresponding sample image 3221. Thereby, each learning data set 322 can be generated.

この学習データセット322の生成は、コンピュータの動作により自動的に行われてもよいし、オペレータの操作により手動的に行われてもよい。また、この学習データセット322を生成する情報処理は、推定器生成装置3において実行されてもよいし、推定器生成装置3以外の他のコンピュータにより行われてもよい。   The generation of the learning data set 322 may be automatically performed by the operation of the computer or may be manually performed by the operation of the operator. The information processing for generating the learning data set 322 may be executed by the estimator generation device 3 or may be performed by a computer other than the estimator generation device 3.

学習データセット322を推定器生成装置3が生成する場合、制御部31は、自動的又はオペレータの操作により手動的に上記情報処理を実行することで、複数の学習データセット322を取得する。一方、学習データセット322を他のコンピュータが生成する場合、制御部31は、例えば、ネットワーク、記憶媒体93等を介して、他のコンピュータにより生成された複数の学習データセット322を取得する。一部の学習データセット322を推定器生成装置3が生成し、残りの学習データセット322を他のコンピュータが生成してもよい。   When the estimator generation device 3 generates the learning data sets 322, the control unit 31 acquires the plurality of learning data sets 322 by executing the above information processing automatically or manually by the operation of the operator. On the other hand, when the learning data set 322 is generated by another computer, the control unit 31 acquires the plurality of learning data sets 322 generated by the other computer via, for example, the network, the storage medium 93, or the like. The estimator generation device 3 may generate a part of the learning data set 322, and the remaining learning data set 322 may be generated by another computer.

ここで、取得される学習データセット322の少なくとも一部は、画像生成装置2により生成されたデータセットであってよい。すなわち、少なくとも一部の学習データセット322のサンプル画像3221、ラベル3222、及び境界情報3223はそれぞれ、上記生成画像73、ラベル75、及び境界情報77であってよい。制御部31は、ネットワーク、記憶媒体93等を介して、画像生成装置2により生成されたデータセットを学習データセット322として取得してもよい。   Here, at least a part of the acquired learning data set 322 may be a data set generated by the image generation device 2. That is, the sample image 3221, the label 3222, and the boundary information 3223 of at least a part of the learning data set 322 may be the generated image 73, the label 75, and the boundary information 77, respectively. The control unit 31 may acquire the data set generated by the image generation device 2 as the learning data set 322 via the network, the storage medium 93, or the like.

取得する学習データセット322の件数は、特に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。複数の学習データセット322を取得すると、制御部31は、次のステップS302に処理を進める。   The number of learning data sets 322 to be acquired does not have to be particularly limited, and may be appropriately determined according to the embodiment. After acquiring the plurality of learning data sets 322, the control unit 31 advances the processing to the next step S302.

(ステップS302)
ステップS302では、制御部31は、学習処理部312として動作し、複数の学習データセット322を利用して、推定器80の機械学習を実施する。この機械学習では、制御部31は、各学習データセット322について、サンプル画像3221を入力層801に入力すると、対応するラベル3222及び境界情報3223と一致する出力値を出力層803から出力するように推定器80を訓練する。これにより、制御部31は、製品Rの良否を判定する能力を習得した学習済みの推定器80を構築する。
(Step S302)
In step S302, the control unit 31 operates as the learning processing unit 312, and uses the plurality of learning data sets 322 to perform the machine learning of the estimator 80. In this machine learning, when the sample image 3221 is input to the input layer 801 for each learning data set 322, the control unit 31 outputs an output value that matches the corresponding label 3222 and boundary information 3223 from the output layer 803. Train the estimator 80. As a result, the control unit 31 builds a learned estimator 80 that has acquired the ability to determine the quality of the product R.

この機械学習の処理は、基本的には、上記学習装置1による機械学習の処理と同様に実行されてよい。すなわち、制御部31は、処理対象となる推定器80を用意する。用意する推定器80の構成、各ニューロン間の結合の重みの初期値、及び各ニューロンの閾値の初期値は、テンプレートにより与えられてもよいし、オペレータの入力により与えられてもよい。また、再学習を行う場合には、制御部31は、過去の機械学習を行うことで得られた学習結果データに基づいて、推定器80を用意してもよい。   This machine learning process may be basically executed in the same manner as the machine learning process by the learning device 1. That is, the control unit 31 prepares the estimator 80 to be processed. The configuration of the estimator 80 to be prepared, the initial value of the connection weight between the neurons, and the initial value of the threshold value of each neuron may be given by a template or may be given by an operator's input. When performing re-learning, the control unit 31 may prepare the estimator 80 based on the learning result data obtained by performing the past machine learning.

次に、制御部31は、ステップS301で取得した各学習データセット322に含まれるサンプル画像3221を入力データとして利用し、対応するラベル3222及び境界情報3223を教師データとして利用して、推定器80の学習処理を実行する。この学習処理には、確率的勾配降下法等が用いられてよい。   Next, the control unit 31 uses the sample image 3221 included in each learning data set 322 acquired in step S301 as input data, uses the corresponding label 3222 and boundary information 3223 as teacher data, and uses the estimator 80. The learning process of is executed. A stochastic gradient descent method or the like may be used for this learning processing.

例えば、制御部31は、各学習データセット322について、サンプル画像3221を入力層801に入力し、入力側から順に各層801〜803に含まれる各ニューロンの発火判定を行う。これにより、制御部31は、サンプル画像3221に写る製品Rに含まれ得る欠陥の種別及び範囲を推定した結果に対応する出力値を出力層803から取得する。次に、制御部31は、各結果に対応する出力値とラベル3222及び境界情報3223の各値との誤差を算出する。続いて、制御部31は、誤差逆伝播法により、算出した出力値の誤差を用いて、推定器80における各ニューロン間の結合の重み及び各ニューロンの閾値それぞれの誤差を算出する。そして、制御部31は、算出した各誤差に基づいて、推定器80における各ニューロン間の結合の重み及び各ニューロンの閾値それぞれの値の更新を行う。   For example, the control unit 31 inputs the sample image 3221 to the input layer 801 for each learning data set 322, and determines the firing of each neuron included in each layer 801 to 803 in order from the input side. As a result, the control unit 31 acquires from the output layer 803 an output value corresponding to the result of estimating the type and range of defects that can be included in the product R shown in the sample image 3221. Next, the control unit 31 calculates an error between the output value corresponding to each result and each value of the label 3222 and the boundary information 3223. Subsequently, the control unit 31 uses the error of the calculated output value by the error back propagation method to calculate the weight of the coupling between the neurons in the estimator 80 and the error of the threshold value of each neuron. Then, the control unit 31 updates the weight of the coupling between the neurons in the estimator 80 and the value of the threshold value of each neuron based on each calculated error.

制御部31は、上記一連の処理を繰り返すことで、各学習データセット322について、サンプル画像3221を入力すると、対応するラベル3222及び境界情報3223と一致する出力値を出力するように、推定器80のパラメータの値を調節する。例えば、制御部31は、各学習データセット322について、出力層803から得られる出力値とラベル3222及び境界情報3223の各値との誤差の和が閾値以下になるまで、上記一連の処理による推定器80のパラメータの値の調節を繰り返す。閾値は、実施の形態に応じて適宜設定されてよい。これにより、制御部31は、各学習データセット322について、サンプル画像3221を入力層801に入力すると、対応するラベル3222及び境界情報3223と一致する出力値を出力層803から出力するように訓練された推定器80を構築することができる。この推定器80の機械学習の処理が完了すると、制御部31は、次のステップS303に処理を進める。なお、パラメータの調節を繰り返す基準は、このような閾値を用いる例に限定されなくてもよい。例えば、制御部31は、、指定された回数分、上記一連の処理により、推定器80のパラメータの値の調節を繰り返すようにしてもよい。   The control unit 31 repeats the series of processes described above, and when the sample image 3221 is input for each learning data set 322, the estimator 80 outputs the output value that matches the corresponding label 3222 and the boundary information 3223. Adjust the value of the parameter. For example, the control unit 31 performs estimation by the above series of processes until the sum of the errors between the output value obtained from the output layer 803 and the respective values of the label 3222 and the boundary information 3223 becomes equal to or less than the threshold value for each learning data set 322. The adjustment of the parameter values of the container 80 is repeated. The threshold value may be appropriately set according to the embodiment. Accordingly, the control unit 31 is trained to output the output values that match the corresponding label 3222 and the boundary information 3223 from the output layer 803 when the sample image 3221 is input to the input layer 801 for each learning data set 322. The estimator 80 can be constructed. When the machine learning process of the estimator 80 is completed, the control unit 31 advances the process to the next step S303. It should be noted that the criterion for repeating the parameter adjustment is not limited to the example using such a threshold value. For example, the control unit 31 may repeat the adjustment of the value of the parameter of the estimator 80 by the above-described series of processes for the designated number of times.

(ステップS303)
ステップS303では、制御部31は、保存処理部313として動作し、構築された学習済みの推定器80に関する情報を所定の記憶領域に保存する。本実施形態では、制御部31は、ステップS302により構築された学習済みの推定器80の構成及びパラメータを示す情報を第3学習結果データ325として生成する。そして、制御部31は、生成した第3学習結果データ325を所定の記憶領域に保存する。所定の記憶領域は、例えば、制御部31内のRAM、記憶部32、外部記憶装置(例えば、NAS等のデータサーバ)、記憶メディア又はこれらの組み合わせであってよい。これにより、制御部31は、本動作例に係る処理を終了する。
(Step S303)
In step S303, the control unit 31 operates as the storage processing unit 313, and stores the constructed information about the learned estimator 80 in a predetermined storage area. In the present embodiment, the control unit 31 generates information indicating the configuration and parameters of the learned estimator 80 constructed in step S302 as the third learning result data 325. Then, the control unit 31 saves the generated third learning result data 325 in a predetermined storage area. The predetermined storage area may be, for example, a RAM in the control unit 31, a storage unit 32, an external storage device (for example, a data server such as NAS), a storage medium, or a combination thereof. As a result, the control unit 31 ends the process according to this operation example.

なお、学習済みの推定器80を構築した後、制御部31は、生成した第3学習結果データ325を任意のタイミングで検査装置4に転送してもよい。検査装置4は、推定器生成装置3から転送を受け付けることで第3学習結果データ325を取得してもよいし、推定器生成装置3又はデータサーバにアクセスすることで第3学習結果データ325を取得してもよい。第3学習結果データ325は、検査装置4に予め組み込まれてもよい。   In addition, after constructing the learned estimator 80, the control unit 31 may transfer the generated third learning result data 325 to the inspection device 4 at an arbitrary timing. The inspection apparatus 4 may acquire the third learning result data 325 by accepting the transfer from the estimator generation apparatus 3, or may access the third learning result data 325 by accessing the estimator generation apparatus 3 or the data server. You may get it. The third learning result data 325 may be incorporated in the inspection device 4 in advance.

また、制御部31は、上記ステップS301〜303の処理を定期的に繰り返すことで、第3学習結果データ325を定期的に更新してもよい。この繰り返す際には、学習データセット322の変更、修正、追加、削除等が適宜実行されてよい。そして、制御部31は、更新した第3学習結果データ325を機械学習の実行毎に検査装置4に転送することで、検査装置4の保持する第3学習結果データ325を定期的に更新してもよい。   In addition, the control unit 31 may periodically update the third learning result data 325 by repeating the processes of steps S301 to S303. When repeating this, the learning data set 322 may be appropriately changed, modified, added, deleted, or the like. Then, the control unit 31 transfers the updated third learning result data 325 to the inspection device 4 each time the machine learning is performed, thereby periodically updating the third learning result data 325 held by the inspection device 4. Good.

更に、制御部31は、評価用データセットを利用して、構築した推定器80の判定性能を評価してもよい。評価用データセットは、上記各学習データセット322と同様に構成可能である。すなわち、評価用データセットは、製品Rを写したサンプル画像、製品Rに含まれ得る欠陥の種別を示すラベル、及び製品Rに含まれ得る欠陥の範囲を示す境界情報の組み合わせにより構成されてよい。制御部31は、後述するステップS402と同様に、推定器80を利用して、評価用データセットのサンプル画像に写る製品Rの良否を判定する。制御部31は、この判定結果とラベル及び境界情報により示される正解とを照合することで、推定器80の判定性能を評価することができる。   Furthermore, the control unit 31 may evaluate the determination performance of the constructed estimator 80 using the evaluation data set. The evaluation data set can be configured in the same manner as each learning data set 322 described above. That is, the evaluation data set may be configured by a combination of a sample image of the product R, a label indicating the type of defects that can be included in the product R, and boundary information that indicates the range of defects that can be included in the product R. . The control unit 31 uses the estimator 80 to determine the quality of the product R shown in the sample image of the evaluation data set, as in step S402 described below. The control unit 31 can evaluate the determination performance of the estimator 80 by collating the determination result with the correct answer indicated by the label and the boundary information.

この推定器80の判定性能が所定の基準以下である(例えば、正答率が閾値以下である)場合には、制御部31は、複数の学習データセット322から選択した1又は複数の学習データセット322を学習装置1に送信してもよい。次に、制御部31は、送信した学習データセット322を学習データセット60として利用させて、生成器50及び推定器52の機械学習の処理を学習装置1に実行させてよい。これにより、サンプル画像3221に対応する画像を生成するための生成器50、並びに生成された画像に対して製品Rに含まれる欠陥の種別及び範囲を推定するための推定器52を学習装置1に構築させることができる。制御部31は、学習装置1に学習済みの生成器50及び推定器52を画像生成装置2へ転送させてもよい。そして、制御部31は、学習済みの生成器50及び推定器52を利用して、生成画像73、ラベル75、及び境界情報77の組み合わせによりそれぞれ構成された1又は複数のデータセットを生成する処理を画像生成装置2に実行させてもよい。   When the determination performance of the estimator 80 is less than or equal to a predetermined reference (for example, the correct answer rate is less than or equal to a threshold), the control unit 31 selects one or more learning data sets selected from the plurality of learning data sets 322. 322 may be transmitted to the learning device 1. Next, the control unit 31 may cause the transmitted learning data set 322 to be used as the learning data set 60 and cause the learning device 1 to execute the machine learning process of the generator 50 and the estimator 52. As a result, the learning device 1 includes the generator 50 for generating an image corresponding to the sample image 3221 and the estimator 52 for estimating the type and range of the defect included in the product R with respect to the generated image. Can be built. The controller 31 may cause the learning device 1 to transfer the learned generator 50 and the estimator 52 to the image generating device 2. Then, the control unit 31 uses the learned generator 50 and the estimator 52 to generate one or a plurality of data sets each configured by the combination of the generated image 73, the label 75, and the boundary information 77. May be executed by the image generating device 2.

これに応じて、制御部31は、画像生成装置2により生成された1又は複数のデータセットを学習データセット322として取得してもよい。そして、制御部31は、取得した1又は複数の学習データセット322を元の学習データ群に追加してもよい。これにより、制御部31は、機械学習に利用する学習データセット322の件数を増やすことができる。制御部31は、この新たな学習データ群を利用して、推定器80の機械学習を再度実施してもよい。この一連の再学習の処理により、構築された学習済みの推定器80の判定性能を高めることができる。   In response to this, the control unit 31 may acquire one or a plurality of data sets generated by the image generation device 2 as the learning data set 322. Then, the control unit 31 may add the acquired one or more learning data sets 322 to the original learning data group. Accordingly, the control unit 31 can increase the number of learning data sets 322 used for machine learning. The control unit 31 may perform the machine learning of the estimator 80 again using this new learning data group. By this series of re-learning processing, the determination performance of the constructed estimator 80 that has been learned can be improved.

[検査装置]
次に、図15を用いて、本実施形態に係る検査装置4の動作例について説明する。図15は、本実施形態に係る検査装置4の処理手順の一例を例示するフローチャートである。ただし、以下で説明する処理手順は一例に過ぎず、各処理は可能な限り変更されてよい。また、以下で説明する処理手順について、実施の形態に応じて、適宜、ステップの省略、置換、及び追加が可能である。
[Inspection equipment]
Next, an operation example of the inspection device 4 according to the present embodiment will be described with reference to FIG. FIG. 15 is a flowchart illustrating an example of the processing procedure of the inspection device 4 according to the present embodiment. However, the processing procedure described below is merely an example, and each processing may be changed as much as possible. Further, regarding the processing procedure described below, steps can be omitted, replaced, and added as appropriate according to the embodiment.

(ステップS401)
ステップS401では、制御部41は、対象データ取得部411として動作し、外観検査の対象となる製品Rの写る対象画像422を取得する。本実施形態では、検査装置4は、外部インタフェース47を介してカメラCAに接続している。そのため、制御部41は、カメラCAから対象画像422を取得する。この対象画像422は、動画像データであってもよいし、静止画像データであってもよい。対象画像422を取得すると、制御部41は、次のステップS402に処理を進める。
(Step S401)
In step S401, the control unit 41 operates as the target data acquisition unit 411 and acquires the target image 422 of the product R that is the target of the visual inspection. In the present embodiment, the inspection device 4 is connected to the camera CA via the external interface 47. Therefore, the control unit 41 acquires the target image 422 from the camera CA. The target image 422 may be moving image data or still image data. When the target image 422 is acquired, the control unit 41 advances the processing to the next step S402.

ただし、対象画像422を取得する経路は、このような例に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、検査装置4とは異なる他の情報処理装置が、カメラCAに接続されていてもよい。この場合、制御部41は、他の情報処理装置を介して対象画像422を取得してもよい。   However, the route for acquiring the target image 422 may not be limited to such an example, and may be appropriately selected according to the embodiment. For example, another information processing device different from the inspection device 4 may be connected to the camera CA. In this case, the control unit 41 may acquire the target image 422 via another information processing device.

(ステップS402)
ステップS402では、制御部41は、良否判定部412として動作し、学習済みの推定器80を利用して、対象画像422に写る製品Rの良否を判定する。
(Step S402)
In step S402, the control unit 41 operates as the quality determination unit 412 and determines the quality of the product R shown in the target image 422 using the learned estimator 80.

具体的には、制御部41は、第3学習結果データ325を参照して、学習済みの推定器80の設定を行う。次に、良否判定部412は、取得した対象画像422を推定器80の入力層801に入力し、入力側から順に各層801〜803に含まれる各ニューロンの発火判定を行う。これにより、制御部41は、対象画像422に写る製品Rに含まれ得る欠陥の種別及び範囲を推定した結果に対応する出力値を推定器80の出力層803から取得する。   Specifically, the control unit 41 sets the learned estimator 80 with reference to the third learning result data 325. Next, the quality determination unit 412 inputs the acquired target image 422 to the input layer 801 of the estimator 80, and determines the firing of each neuron included in each layer 801 to 803 in order from the input side. Accordingly, the control unit 41 acquires, from the output layer 803 of the estimator 80, an output value corresponding to the result of estimating the types and ranges of defects that can be included in the product R shown in the target image 422.

これにより、制御部41は、推定器80から取得した出力値に基づいて、対象画像422に写る製品Rの良否を判定する。推定器80から取得した出力値が製品Rに欠陥が含まれることを示す場合、制御部41は、この出力値から、製品Rは良品ではない(すなわち、欠陥を含む)と判定することができる。この場合、制御部41は、推定器80から取得した出力値から、その欠陥の種別及び範囲を特定することができる。欠陥の範囲は、バウンディングボックスにより示される。一方、推定器80から取得した出力値が製品Rに欠陥が含まれないことを示す場合、制御部41は、この出力値から、製品Rは良品である(すなわち、欠陥を含まない)と判定することができる。   Thereby, the control unit 41 determines the quality of the product R shown in the target image 422 based on the output value acquired from the estimator 80. When the output value acquired from the estimator 80 indicates that the product R includes a defect, the control unit 41 can determine from the output value that the product R is not a good product (that is, includes a defect). . In this case, the control unit 41 can specify the type and range of the defect from the output value acquired from the estimator 80. The extent of the defect is indicated by the bounding box. On the other hand, when the output value acquired from the estimator 80 indicates that the product R does not include a defect, the control unit 41 determines from the output value that the product R is a good product (that is, does not include a defect). can do.

なお、この良否の判定は、推定器80の出力形式に応じて適宜行われてもよい。例えば、推定器80は、欠陥の各種別に応じて、その欠陥の発生確率を出力するように構成されてもよい。この場合、制御部41は、推定器80の出力値と閾値とを比較することで、製品Rの良否を判定することができる。すなわち、閾値を超える(又は以上の)出力値が存在する場合に、制御部41は、製品Rは良品ではなく、その出力値に対応する種別の欠陥が製品Rに含まれていると判定することができる。他方、そうではない場合に、制御部41は、製品Rは良品であると判定することができる。   Note that this pass / fail determination may be appropriately performed according to the output format of the estimator 80. For example, the estimator 80 may be configured to output the probability of occurrence of a defect according to each type of defect. In this case, the control unit 41 can determine the quality of the product R by comparing the output value of the estimator 80 and the threshold value. That is, when there is an output value that exceeds (or is greater than) the threshold value, the control unit 41 determines that the product R is not a non-defective product and that the product R contains a defect of the type corresponding to the output value. be able to. On the other hand, if not, the control unit 41 can determine that the product R is a non-defective product.

また、例えば、推定器80は、欠陥の種別(欠陥を含まないことを含む)に対応するクラスを出力するように構成されてもよい。この場合、検査装置4は、推定器80から得られる出力値と欠陥の種別とを対応付けたテーブル形式等の参照情報(不図示)を記憶部42に保持していてもよい。これに応じて、制御部41は、参照情報を参照することにより、推定器80から得られた出力値に応じて、対象画像422に写る製品Rの良否を判定することができる。   Further, for example, the estimator 80 may be configured to output the class corresponding to the type of defect (including not including the defect). In this case, the inspection device 4 may store reference information (not shown) in a table format or the like in which the output value obtained from the estimator 80 and the defect type are associated with each other in the storage unit 42. In response to this, the control unit 41 can determine the quality of the product R shown in the target image 422 according to the output value obtained from the estimator 80 by referring to the reference information.

以上により、制御部41は、推定器80を利用して、対象画像422に写る製品Rの良否を判定することができる。製品Rの良否の判定が完了すると、制御部41は、次のステップS403に処理を進める。   As described above, the control unit 41 can determine the quality of the product R shown in the target image 422 by using the estimator 80. When the determination of the quality of the product R is completed, the control unit 41 advances the processing to the next step S403.

(ステップS403)
ステップS403では、制御部41は、出力部413として動作し、ステップS402により製品Rの良否を判定した結果を出力する。
(Step S403)
In step S403, the control unit 41 operates as the output unit 413, and outputs the result of determining the quality of the product R in step S402.

製品Rの良否を判定した結果の出力形式は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、制御部41は、製品Rの良否を判定した結果をそのまま出力装置45に出力してもよい。更に、ステップS402において、製品Rに欠陥があると判定した場合、制御部41は、欠陥を発見したことを知らせるための警告を本ステップS403の出力処理として行ってもよい。このとき、制御部41は、発見した欠陥の存在する範囲をバウンディングボックスにより示すことができる。   The output format of the result of determining the quality of the product R is not particularly limited and may be appropriately selected according to the embodiment. For example, the control unit 41 may directly output the result of the quality determination of the product R to the output device 45. Further, when it is determined in step S402 that the product R has a defect, the control unit 41 may issue a warning for notifying that the defect is found as the output process of step S403. At this time, the control unit 41 can indicate the range in which the found defect exists by a bounding box.

また、制御部41は、本ステップS403の出力処理として、製品Rの良否を判定した結果に応じた所定の制御処理を実行してもよい。具体例として、検査装置4は、製品の搬送を行う製造ラインに接続されていてもよい。この場合に、制御部41は、製品Rに欠陥があると判定したときに、欠陥のある製品Rを欠陥のない製品とは異なる経路で搬送する指令を製造ラインに送信する処理を本ステップ403の出力処理として行ってもよい。   Further, the control unit 41 may execute a predetermined control process according to the result of the quality determination of the product R as the output process of step S403. As a specific example, the inspection device 4 may be connected to a manufacturing line that conveys products. In this case, when it is determined that the product R has a defect, the control unit 41 performs a process of transmitting to the manufacturing line a command to convey the defective product R through a route different from that of the product having no defect (step 403). May be performed as the output processing of.

製品Rの良否を判定した結果の出力処理が完了すると、制御部41は、本動作例に係る処理を終了する。なお、制御部41は、製造ライン上を搬送される製品RがカメラCAの撮影範囲に入る度に、ステップS401〜S403の一連の処理を実行してもよい。これにより、検査装置4は、製造ライン上を搬送される製品Rの外観検査を行うことができる。   When the output process of the result of determining the quality of the product R is completed, the control unit 41 ends the process according to this operation example. The control unit 41 may execute a series of processes of steps S401 to S403 each time the product R conveyed on the manufacturing line enters the photographing range of the camera CA. Thereby, the inspection device 4 can perform the appearance inspection of the product R conveyed on the manufacturing line.

[特徴]
以上のとおり、本実施形態に係る学習装置1は、ステップS102及びS103の処理により、学習画像61に対応する画像を生成するように訓練された生成器50を構築すると共に、学習画像61に写る欠陥の種別及び範囲を推定するように訓練された推定器52を構築することができる。これらのうち、生成器50を利用することで、指定した欠陥を含む製品の写り得るサンプル画像を自動的に生成することができる。加えて、推定器52を利用することで、生成されたサンプル画像に写る製品Rに含まれる欠陥の範囲を推定し、推定した欠陥の範囲を示す情報を境界情報としてサンプル画像に自動的に付与することができる。したがって、本実施形態によれば、学習データを用意する際に、サンプル画像内において欠陥の範囲を手動で指定する手間を省略することができる。そのため、欠陥の範囲を検出する能力を習得させるための機械学習に利用する学習データを用意するのにかかるコストを低減することができる。
[Characteristic]
As described above, the learning device 1 according to the present embodiment constructs the generator 50 trained to generate the image corresponding to the learning image 61 by the processing of steps S102 and S103, and also appears in the learning image 61. An estimator 52 trained to estimate the defect type and range can be constructed. Of these, by using the generator 50, it is possible to automatically generate a sample image in which a product including the designated defect can be captured. In addition, by using the estimator 52, the range of defects included in the product R shown in the generated sample image is estimated, and information indicating the estimated range of defects is automatically added to the sample image as boundary information. can do. Therefore, according to the present embodiment, when preparing the learning data, it is possible to omit the trouble of manually specifying the defect range in the sample image. Therefore, it is possible to reduce the cost required to prepare learning data used for machine learning for acquiring the ability to detect the range of defects.

また、本実施形態に係る画像生成装置2では、ステップS201〜S205の一連の処理により、学習装置1により構築された生成器50及び推定器52を利用することで、欠陥の範囲を手動で指定する手間を省略した上で、欠陥の範囲を検出する能力を習得させるための機械学習に利用可能なデータセットを生成することができる。加えて、本実施形態では、画像生成装置2により生成されたデータセットを学習データセット322として利用することができる。これにより、本実施形態に係る推定器生成装置3では、上記ステップS301において、学習データセット322を収集するコストを低減することができる。更に、本実施形態では、画像生成装置2にデータセットを生成させることで、推定器80の機械学習に利用する学習データセット322の件数を増やすことができる。これにより、本実施形態に係る検査装置4では、製品Rの良否を判定する精度を高めることができる。   Further, in the image generation device 2 according to the present embodiment, the defect range is manually designated by using the generator 50 and the estimator 52 constructed by the learning device 1 through the series of processes of steps S201 to S205. It is possible to generate a data set that can be used for machine learning to acquire the ability to detect the range of defects while omitting the work to be performed. In addition, in the present embodiment, the data set generated by the image generation device 2 can be used as the learning data set 322. As a result, in the estimator generation device 3 according to the present embodiment, the cost of collecting the learning data set 322 in step S301 can be reduced. Furthermore, in the present embodiment, the number of learning data sets 322 used for machine learning of the estimator 80 can be increased by causing the image generation device 2 to generate a data set. As a result, in the inspection device 4 according to the present embodiment, the accuracy with which the quality of the product R is determined can be increased.

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

<4.1>
上記実施形態では、生成器50、推定器52、判別器54、エンコーダ56、及び推定器80それぞれには、いわゆる多層構造の全結合ニューラルネットワークが用いられている。しかしながら、生成器50、推定器52、判別器54、エンコーダ56、及び推定器80それぞれを構成するニューラルネットワークの構造及び種類は、このような例に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。例えば、生成器50、推定器52、判別器54、エンコーダ56、及び推定器80それぞれには、畳み込みニューラルネットワークが利用されてもよい。
<4.1>
In the above embodiment, the generator 50, the estimator 52, the discriminator 54, the encoder 56, and the estimator 80 each use a so-called multilayer fully-connected neural network. However, the structures and types of the neural networks forming the generator 50, the estimator 52, the discriminator 54, the encoder 56, and the estimator 80 may not be limited to such an example, and may depend on the embodiment. May be appropriately selected. For example, a convolutional neural network may be used for each of the generator 50, the estimator 52, the discriminator 54, the encoder 56, and the estimator 80.

また、上記実施形態では、生成器50、推定器52、及び推定器80を構成する学習モデルとしてニューラルネットワークが用いられている。しかしながら、生成器50、推定器52、及び推定器80それぞれを構成する学習モデルは、画像の機械学習を実施可能であれば、その種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。   Further, in the above-described embodiment, a neural network is used as a learning model forming the generator 50, the estimator 52, and the estimator 80. However, the types of the learning models constituting the generator 50, the estimator 52, and the estimator 80 are not particularly limited as long as the machine learning of the image can be implemented, and the learning model is not limited to the embodiment. May be appropriately selected.

<4.2>
上記実施形態では、第1学習結果データ123は、生成器50の構成を示す情報を含んでいる。第2学習結果データ125は、推定器52の構成を示す情報を含んでいる。第3学習結果データ325は、推定器80の構成を示す情報を含んでいる。しかしながら、各学習結果データ(123、125、325)の構成は、このような例に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、それぞれに利用するニューラルネットワークの構成が各装置で共通化されている場合には、各学習結果データ(123、125、325)は、ニューラルネットワークの構成を示す情報を含んでいなくてもよい。
<4.2>
In the above embodiment, the first learning result data 123 includes information indicating the configuration of the generator 50. The second learning result data 125 includes information indicating the configuration of the estimator 52. The third learning result data 325 includes information indicating the configuration of the estimator 80. However, the structure of each learning result data (123, 125, 325) is not limited to such an example, and may be appropriately determined according to the embodiment. For example, when the configuration of the neural network used for each is common to each device, each learning result data (123, 125, 325) does not need to include information indicating the configuration of the neural network. Good.

<4.3>
上記実施形態では、境界情報(65、77、3223)は、バウンディングボックスにより欠陥の範囲を示す。しかしながら、欠陥の範囲を示す方法は、このような例に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。欠陥の範囲は、バウンディングボックス以外の形式で示されてもよい。
<4.3>
In the above embodiment, the boundary information (65, 77, 3223) indicates the range of the defect by the bounding box. However, the method of indicating the defect range is not limited to such an example, and may be appropriately selected according to the embodiment. Defect extents may be indicated in formats other than bounding boxes.

<4.4>
上記実施形態では、推定器生成装置3は、ラベル3222及び境界情報3223を教師データとして利用することで、画像に写る製品Rに含まれ得る欠陥の種別及び範囲を推定するように訓練された推定器80を構築している。しかしながら、推定器80に習得される能力は、このような例に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。例えば、この一連の処理から、ラベル3222は省略されてよい。これにより、推定器生成装置3は、欠陥の範囲のみを推定するように訓練された推定器80を構築することができる。
<4.4>
In the above-described embodiment, the estimator generation device 3 uses the label 3222 and the boundary information 3223 as teacher data to estimate the type and range of defects that can be included in the product R shown in the image. The container 80 is constructed. However, the ability learned by the estimator 80 is not limited to such an example, and may be appropriately determined according to the embodiment. For example, the label 3222 may be omitted from this series of processes. Thereby, the estimator generation device 3 can construct the estimator 80 trained to estimate only the range of defects.

<4.5>
上記実施形態に係る学習ネットワーク500では、エンコーダ56の出力が生成器50の入力に接続されており、生成器50の出力が推定器52の入力及び判別器54の入力に接続されている。そして、機械学習の処理では、算出される各誤差(LC、LBB、LKL、LD、LGD、LGC、LG)の和が小さくなるように、学習ネットワーク500の各パラメータの値が調節される。しかしながら、学習ネットワーク500の構成は、このような例に限定されなくてもよく、実施の形態に応じて適宜設定されてよい。各機械学習の処理は、生成器50及び推定器52の構成に応じて適宜選択されてよい。生成器50及び推定器52はそれぞれ単独で訓練されてもよい。
<4.5>
In the learning network 500 according to the above embodiment, the output of the encoder 56 is connected to the input of the generator 50, and the output of the generator 50 is connected to the input of the estimator 52 and the input of the discriminator 54. Then, in the process of machine learning, the error is calculated as (L C, L BB, L KL, L D, L GD, L GC, L G) is the sum of the decreases, the learning network 500 for each parameter The value is adjusted. However, the configuration of the learning network 500 is not limited to such an example, and may be set appropriately according to the embodiment. The processing of each machine learning may be appropriately selected according to the configurations of the generator 50 and the estimator 52. The generator 50 and the estimator 52 may each be trained independently.

図16は、本変形例に係る学習ネットワーク500Aを保持する学習装置1のソフトウェア構成の一例を模式的に例示する。上記実施形態に係る学習ネットワーク500が学習ネットワーク500Aに置き換わる点を除き、本変形例に係る学習装置1は、上記実施形態と同様に構成されている。   FIG. 16 schematically illustrates an example of the software configuration of the learning device 1 that holds the learning network 500A according to the present modification. The learning device 1 according to the present modification is configured similarly to the above embodiment, except that the learning network 500 according to the above embodiment is replaced with the learning network 500A.

本変形例に係る学習ネットワーク500Aは、生成器50A及び判別器54Aを含んでいる。生成器50Aの出力は、判別器54Aの入力に接続されている。一方、推定器52Aは、生成器50Aには接続されておらず、学習ネットワーク500Aから切り離されている。本変形例では、推定器52Aは、個別に訓練される。   The learning network 500A according to this modification includes a generator 50A and a discriminator 54A. The output of the generator 50A is connected to the input of the discriminator 54A. On the other hand, the estimator 52A is not connected to the generator 50A but is disconnected from the learning network 500A. In this modification, the estimator 52A is individually trained.

次に、図17A〜図17Cを更に用いて、生成器50A及び推定器52Aの機械学習の過程の一例について説明する。図17A及び図17Bは、生成器50Aを含む学習ネットワーク500Aの機械学習の過程の一例を模式的に例示する。図17Cは、推定器52Aの機械学習の過程の一例を模式的に例示する。   Next, an example of a machine learning process of the generator 50A and the estimator 52A will be described with reference to FIGS. 17A to 17C. 17A and 17B schematically illustrate an example of a machine learning process of the learning network 500A including the generator 50A. FIG. 17C schematically illustrates an example of the machine learning process of the estimator 52A.

本変形例では、第1学習処理部112は、学習ネットワーク500Aの機械学習を行う。この学習ネットワーク500Aの機械学習を行うことは、判別器54Aを訓練する第1訓練ステップ及び生成器50Aを訓練する第2訓練ステップを交互に行うことを含む。本変形例に係る生成器50A及び判別器54Aそれぞれの構成は、上記実施形態に係る生成器50及び判別器54それぞれと同様であってよい。本変形例に係る第1訓練ステップ及び第2訓練ステップはそれぞれ、上記実施形態に係る第1訓練ステップ及び第2訓練ステップとほぼ同様である。すなわち、第1訓練ステップでは、第1学習処理部112は、判別器54Aに入力された入力画像が、生成器50Aにより生成された画像69であるか複数の学習データセット60から得られた学習画像61であるかを判別するように、判別器54Aを訓練する。第2訓練ステップでは、第1学習処理部112は、生成器50Aにより生成される画像69が、判別器54Aによる判別を誤らせるようなものとなるように、生成器50Aを訓練する。   In this modification, the first learning processing unit 112 performs machine learning of the learning network 500A. Performing machine learning of the learning network 500A includes alternating first training steps for training the discriminator 54A and second training steps for training the generator 50A. The configurations of the generator 50A and the discriminator 54A according to the present modification may be the same as those of the generator 50 and the discriminator 54 according to the above embodiment. The first training step and the second training step according to the present modification are substantially the same as the first training step and the second training step according to the above embodiment, respectively. That is, in the first training step, the first learning processing unit 112 learns whether the input image input to the discriminator 54A is the image 69 generated by the generator 50A or is obtained from a plurality of learning data sets 60. The discriminator 54A is trained so as to discriminate whether or not it is the image 61. In the second training step, the first learning processing unit 112 trains the generator 50A so that the image 69 generated by the generator 50A causes the discrimination by the discriminator 54A to be erroneous.

具体的には、図17Aに示されるとおり、第1訓練ステップでは、第1学習処理部112は、所定の確率分布からノイズ(潜在変数)を抽出し、抽出したノイズと各ラベル63とを組み合わせて、複数の第1データセットを生成する。所定の確率分布は、例えば、ガウス分布、一様分布等であってよい。ノイズの抽出には、任意の確率分布が利用されてよい。続いて、第1学習処理部112は、各第1データセット(各ラベル63及びノイズ)を生成器50Aに入力し、生成器50Aの演算処理を実行する。これにより、第1学習処理部112は、各ラベル63から画像を生成した結果に対応する出力(画像69)を生成器50Aから取得する。第1学習処理部112は、生成された各画像69と各ラベル63とを組み合わせることで、複数の第2データセットを生成する。   Specifically, as shown in FIG. 17A, in the first training step, the first learning processing unit 112 extracts noise (latent variable) from a predetermined probability distribution and combines the extracted noise and each label 63. To generate a plurality of first data sets. The predetermined probability distribution may be, for example, a Gaussian distribution, a uniform distribution, or the like. An arbitrary probability distribution may be used to extract noise. Subsequently, the first learning processing unit 112 inputs each first data set (each label 63 and noise) to the generator 50A, and executes the arithmetic processing of the generator 50A. As a result, the first learning processing unit 112 acquires an output (image 69) corresponding to the result of generating an image from each label 63 from the generator 50A. The first learning processing unit 112 generates a plurality of second data sets by combining the generated images 69 and the labels 63.

次に、第1学習処理部112は、各第2データセット(生成器50Aの生成した各画像69及び各ラベル63)を判別器54Aに入力し、判別器54Aの演算処理を実行する。これにより、第1学習処理部112は、入力画像が生成器50A由来か学習データセット60由来かを判別した結果に対応する出力値を判別器54Aから取得する。この場面では、生成器50Aにより生成された各画像69が入力画像であるため、判別器54Aは、「偽」と判別するのが正解である。第1学習処理部112は、各第2データセットについて、判別器54Aから得られる出力値とこの正解との誤差(LDA)を算出する。 Next, the first learning processing unit 112 inputs each second data set (each image 69 and each label 63 generated by the generator 50A) to the discriminator 54A, and executes the arithmetic processing of the discriminator 54A. Accordingly, the first learning processing unit 112 acquires, from the discriminator 54A, an output value corresponding to the result of discriminating whether the input image is derived from the generator 50A or the learning data set 60. In this scene, since each image 69 generated by the generator 50A is an input image, it is the correct answer for the discriminator 54A to determine “false”. The first learning processing unit 112 calculates the error (L DA ) between the output value obtained from the discriminator 54A and this correct answer for each second data set.

同様に、第1学習処理部112は、各学習データセット60に含まれる学習画像61及びラベル63を判別器54Aに入力し、判別器54Aの演算処理を実行する。これにより、第1学習処理部112は、入力画像が生成器50A由来か学習データセット60由来かを判別した結果に対応する出力値を判別器54Aから取得する。この場面では、各学習画像61が入力画像であるため、判別器54Aは、「真」と判別するのが正解である。第1学習処理部112は、各学習データセット60について、判別器54Aから得られる出力値とこの正解との誤差(LDA)を算出する。 Similarly, the first learning processing unit 112 inputs the learning image 61 and the label 63 included in each learning data set 60 to the discriminator 54A, and executes the arithmetic processing of the discriminator 54A. Accordingly, the first learning processing unit 112 acquires, from the discriminator 54A, an output value corresponding to the result of discriminating whether the input image is derived from the generator 50A or the learning data set 60. In this scene, since each learning image 61 is an input image, it is the correct answer for the discriminator 54A to determine “true”. The first learning processing unit 112 calculates the error (L DA ) between the output value obtained from the discriminator 54A and this correct answer for each learning data set 60.

そして、第1学習処理部112は、算出される誤差(LDA)の和が小さくなるように、判別器54Aのパラメータの値を調節する。例えば、判別器54から得られる出力値と真偽の正解との誤差の和が閾値以下になるまで、第1学習処理部112は、上記一連の処理により、判別器54Aのパラメータの値の調節を繰り返す。これにより、第1訓練ステップでは、第1学習処理部112は、判別器54Aに入力された入力画像が、生成器50Aにより生成された画像69であるか複数の学習データセット60から得られた学習画像61であるかを判別するように、判別器54Aを訓練する。 Then, the first learning processing unit 112 adjusts the parameter values of the discriminator 54A so that the sum of the calculated errors (L DA ) becomes small. For example, the first learning processing unit 112 adjusts the value of the parameter of the discriminator 54A through the series of processes until the sum of the errors between the output value obtained from the discriminator 54 and the true / false correct answer becomes equal to or less than the threshold value. repeat. As a result, in the first training step, the first learning processing unit 112 obtains the input image input to the discriminator 54A is the image 69 generated by the generator 50A or is obtained from the plurality of learning data sets 60. The discriminator 54A is trained to discriminate whether or not it is the learning image 61.

図17Bに示されるとおり、第2訓練ステップでは、第1学習処理部112は、所定の確率分布からノイズ(潜在変数)を抽出し、抽出したノイズと各ラベル63とを組み合わせて、複数のデータセットを生成する。各データセットは、上記第1データセットと同じでもよいし、異なっていてもよい。続いて、第1学習処理部112は、各データセット(各ラベル63及びノイズ)を生成器50Aに入力し、生成器50Aの演算処理を実行する。これにより、第1学習処理部112は、各ラベル63から画像を生成した結果に対応する出力(画像69)を生成器50Aから取得する。   As shown in FIG. 17B, in the second training step, the first learning processing unit 112 extracts noise (latent variable) from a predetermined probability distribution, combines the extracted noise and each label 63, and outputs a plurality of data. Generate a set. Each data set may be the same as or different from the first data set. Subsequently, the first learning processing unit 112 inputs each data set (each label 63 and noise) to the generator 50A, and executes the arithmetic processing of the generator 50A. As a result, the first learning processing unit 112 acquires an output (image 69) corresponding to the result of generating an image from each label 63 from the generator 50A.

次に、第1学習処理部112は、生成された各画像69及び対応する各ラベル63の組み合わせを判別器54Aに入力し、判別器54Aの演算処理を実行する。これにより、第1学習処理部112は、入力画像が生成器50A由来か学習データセット60由来かを判別した結果に対応する出力値を判別器54Aから取得する。この生成器50Aの訓練では、判別器54Aによる判別の結果が誤ることが正解である。つまり、判別器54Aから得られる出力値が「真」に対応することが正解である。第1学習処理部112は、各データセットについて、一連の処理により判別器54Aから得られる出力値とこの正解(つまり、「真」)との誤差(LGDA)を算出する。 Next, the first learning processing unit 112 inputs the generated combination of the images 69 and the corresponding labels 63 to the discriminator 54A, and executes the arithmetic processing of the discriminator 54A. Accordingly, the first learning processing unit 112 acquires, from the discriminator 54A, an output value corresponding to the result of discriminating whether the input image is derived from the generator 50A or the learning data set 60. In the training of the generator 50A, the correct answer is that the discrimination result by the discriminator 54A is incorrect. That is, the correct answer is that the output value obtained from the discriminator 54A corresponds to "true". The first learning processing unit 112 calculates an error (L GDA ) between the output value obtained from the discriminator 54A and the correct answer (that is, “true”) by a series of processes for each data set.

そして、第1学習処理部112は、算出される誤差(LGDA)の和が小さくなるように、生成器50Aのパラメータの値を調節する。例えば、各データセットについて、判別器54Aから得られる出力値と「真」との誤差の和が閾値以下になるまで、第1学習処理部112は、上記一連の処理により、生成器50Aのパラメータの値の調節を繰り返す。これにより、第2訓練ステップでは、第1学習処理部112は、生成器50Aにより生成される画像69が、判別器54Aによる判別を誤らせるようなものとなるように、生成器50Aを訓練する。 Then, the first learning processing unit 112 adjusts the value of the parameter of the generator 50A so that the sum of the calculated errors (L GDA ) becomes small. For example, for each data set, the first learning processing unit 112 performs the above series of processes until the sum of the error between the output value obtained from the discriminator 54A and the “true” becomes equal to or less than the threshold, and the parameters of the generator 50A are processed. Repeat the adjustment of the value of. As a result, in the second training step, the first learning processing unit 112 trains the generator 50A so that the image 69 generated by the generator 50A causes the discrimination by the discriminator 54A to be erroneous.

本変形例では、第1学習処理部112は、上記第1訓練ステップ及び第2訓練ステップを交互に繰り返すことで、各学習データセット60に含まれるラベル63の入力に対して、入力されたラベル63に関連付けられた学習画像61に対応する画像を生成するように訓練された生成器50Aを構築する。保存処理部114は、構築された生成器50Aの構成及びパラメータを示す第1学習結果データ123Aを生成し、生成した第1学習結果データ123Aを所定の記憶領域に保存する。   In the present modification, the first learning processing unit 112 alternately repeats the first training step and the second training step, so that the input label for the label 63 included in each learning data set 60 is input. Construct a generator 50A trained to generate an image corresponding to the training image 61 associated with 63. The storage processing unit 114 generates first learning result data 123A indicating the configuration and parameters of the constructed generator 50A, and stores the generated first learning result data 123A in a predetermined storage area.

一方、図17Cに示されるとおり、本変形例に係る推定器52Aは、いわゆる畳み込みニューラルネットワークにより構成されている。具体的に、本変形例に係る推定器52Aは、1又は複数の畳み込み層524、領域提案ネットワーク(region proposal network, RPN)525、ROI(region of interest)プーリング層526、1又は複数の全結合層527、分類部528、及び回帰部529を備えている。   On the other hand, as shown in FIG. 17C, the estimator 52A according to the present modification is configured by a so-called convolutional neural network. Specifically, the estimator 52A according to the present modification includes one or more convolutional layers 524, a region proposal network (RPN) 525, an ROI (region of interest) pooling layer 526, and one or more total combinations. The layer 527, the classification unit 528, and the regression unit 529 are provided.

畳み込み層524は、画像の畳み込み演算を行う層である。画像の畳み込みとは、画像と所定のフィルタとの相関を算出する処理に相当する。推定器52Aが複数の畳み込み層524を含む場合、最も入力側に配置された畳み込み層524に入力画像が入力され、最も出力側に配置された畳み込み層524の出力が領域提案ネットワーク525及びROIプーリング層526に接続される。   The convolutional layer 524 is a layer that performs a convolutional operation on an image. The convolution of an image corresponds to the process of calculating the correlation between the image and a predetermined filter. When the estimator 52A includes a plurality of convolutional layers 524, the input image is input to the convolutional layer 524 arranged on the most input side, and the output of the convolutional layer 524 arranged on the most output side is the region proposal network 525 and the ROI pooling. Connected to layer 526.

領域提案ネットワーク525は、最も出力側に配置される畳み込み層524から出力される特徴マップの局所領域毎に、物体らしさを示すスコアの付与された複数のバウンディングボックスを提案するように構成される。領域提案ネットワーク525は、例えば、1又は複数の全結合層、バウンディングボックスのパラメータ(位置及びアスペクト比)を予測する回帰ネットワーク、及び物体の有無を予測する分類ネットワークにより構成される。1又は複数の全結合層は、入力側に配置される。最も出力側に配置される全結合層の出力が、回帰ネットワーク及び分類ネットワークに接続される。回帰ネットワーク及び分類ネットワークはそれぞれ、例えば、1又は複数の全結合層により構成される。   The area proposal network 525 is configured to propose a plurality of bounding boxes to which a score indicating the object-likeness is given for each local area of the feature map output from the convolutional layer 524 arranged on the most output side. The area proposal network 525 is configured by, for example, one or more fully connected layers, a regression network that predicts parameters (position and aspect ratio) of the bounding box, and a classification network that predicts the presence or absence of an object. One or more fully coupled layers are located on the input side. The outputs of the most connected layers located on the most output side are connected to the regression network and the classification network. The regression network and the classification network are each composed of, for example, one or a plurality of fully connected layers.

ROIプーリング層526は、畳み込み層524から出力された特徴マップにおいて、領域提案ネットワーク525の出力に基づいて提案された任意サイズの物体領域候補をプーリングすることで、一定の大きさのベクトルに変換するように構成される。ROIプーリング層526の出力は、(最も入力側に配置された)全結合層527に接続される。   The ROI pooling layer 526 pools the object region candidates of arbitrary size proposed based on the output of the region proposal network 525 in the feature map output from the convolutional layer 524, thereby converting the object region candidate into a vector of a fixed size. Is configured as follows. The output of the ROI pooling layer 526 is connected to the fully coupled layer 527 (located on the most input side).

全結合層527は、隣接する層の間のニューロン全てを結合した層である。推定器52Aが複数の全結合層527を含む場合、最も出力側に配置された全結合層527の出力が分類部528及び回帰部529に接続される。分類部528は、最も出力側に配置された全結合層527の出力から画像に写る製品Rに含まれる欠陥の種別を分類するように構成される。分類部528は、例えば、全結合層により構成される。回帰部529は、最も出力側に配置された全結合層527の出力から画像に写る製品Rに含まれる欠陥の範囲(例えば、バウンディングボックス)を回帰するように構成される。回帰部529は、例えば、全結合層により構成される。   The fully connected layer 527 is a layer in which all neurons between adjacent layers are connected. When the estimator 52A includes a plurality of fully-connected layers 527, the output of the most-connected fully-connected layer 527 is connected to the classification unit 528 and the regression unit 529. The classifying unit 528 is configured to classify the types of defects included in the product R shown in the image from the output of the full coupling layer 527 arranged on the most output side. The classification unit 528 includes, for example, a fully connected layer. The regression unit 529 is configured to regress a range of defects (for example, a bounding box) included in the product R shown in the image from the output of the fully coupled layer 527 arranged closest to the output side. The regression unit 529 is composed of, for example, a fully connected layer.

第2の機械学習では、第2学習処理部113は、領域提案ネットワーク525を訓練する第1訓練ステップとそれ以外の部分を訓練する第2訓練ステップとを交互に実行する。第1訓練ステップでは、第2学習処理部113は、物体の有無の分類に関する誤差とバウンディングボックスの位置及びアスペクト比に関する誤差とが小さくなるように、領域提案ネットワーク525のパラメータの値を調節する。第2訓練ステップでは、第2学習処理部113は、学習済みの領域提案ネットワーク525を利用して、上記実施形態と同様に、各誤差(LC、LBB)が小さくなるように、各パラメータの値を調節する。 In the second machine learning, the second learning processing unit 113 alternately executes the first training step for training the area proposal network 525 and the second training step for training the other portions. In the first training step, the second learning processing unit 113 adjusts the parameter values of the region proposal network 525 so that the error regarding the classification of the presence or absence of the object and the error regarding the position and aspect ratio of the bounding box are small. In the second training step, the second learning processing unit 113 uses the learned region suggestion network 525 to set each parameter so that each error (L C , L BB ) becomes small as in the above embodiment. Adjust the value of.

本変形例では、第2学習処理部113は、上記第1訓練ステップ及び第2訓練ステップを交互に繰り返すことで、各学習データセット60に含まれる学習画像61の入力に対して、入力された学習画像61に関連付けられたラベル63及び境界情報65と一致するように、入力された学習画像61に写る製品Rに含まれる欠陥の種別及び範囲を推定するように訓練された推定器52Aを構築する。保存処理部114は、構築された推定器52Aの構成及びパラメータを示す第2学習結果データ125Aを生成し、生成した第2学習結果データ125Aを所定の記憶領域に保存する。ただし、推定器52Aの構成は、このような例に限定されなくてもよく、実施の形態に応じて適宜決定されてよい。推定器52Aの構成は、上記推定器52と同様であってもよい。   In this modification, the second learning processing unit 113 alternately inputs the learning image 61 included in each learning data set 60 by repeating the first training step and the second training step. Construct an estimator 52A trained to estimate the type and range of defects included in the product R shown in the input learning image 61 so as to match the label 63 and the boundary information 65 associated with the learning image 61. To do. The storage processing unit 114 generates second learning result data 125A indicating the configuration and parameters of the constructed estimator 52A, and stores the generated second learning result data 125A in a predetermined storage area. However, the configuration of the estimator 52A may not be limited to such an example, and may be appropriately determined according to the embodiment. The configuration of the estimator 52A may be the same as that of the estimator 52.

(動作例)
次に、本変形例に係る学習装置1の動作例について説明する。本変形例に係る学習装置1は、各機械学習の処理過程の一部が上記実施形態と異なる点を除き、上記実施形態と同様に動作することができる。すなわち、ステップS101では、制御部11は、複数の学習データセット60を取得する。次のステップS102では、制御部11は、第1学習処理部112として動作し、生成器50Aに関する第1の機械学習を実行する。
(Operation example)
Next, an operation example of the learning device 1 according to this modification will be described. The learning device 1 according to the present modification can operate in the same manner as in the above-described embodiment, except that a part of the processing process of each machine learning is different from that in the above-described embodiment. That is, in step S101, the control unit 11 acquires a plurality of learning data sets 60. In the next step S102, the control unit 11 operates as the first learning processing unit 112 and executes the first machine learning regarding the generator 50A.

図18を更に用いて、第1の機械学習の処理手順の一例について説明する。図18は、本変形例に係る第1の機械学習の処理手順の一例を例示する。本変形例に係る第1の機械学習を行うことは、以下のステップS601〜S603を含む。ただし、以下で説明する処理手順は一例に過ぎず、各処理は可能な限り変更されてよい。また、以下で説明する処理手順について、実施の形態に応じて、適宜、ステップの省略、置換、及び追加が可能である。   An example of the processing procedure of the first machine learning will be described further using FIG. FIG. 18 illustrates an example of a processing procedure of the first machine learning according to the present modification. Performing the first machine learning according to the present modification includes the following steps S601 to S603. However, the processing procedure described below is merely an example, and each processing may be changed as much as possible. Further, regarding the processing procedure described below, steps can be omitted, replaced, and added as appropriate according to the embodiment.

ステップS601を実行する前に、制御部11は、上記実施形態と同様に、処理対象となる生成器50A及び判別器54Aを用意する。ステップS601では、制御部11は、上記のとおり、算出される誤差(LDA)の和が小さくなるように、判別器54Aのパラメータの値を調節する。これにより、制御部11は、判別器54Aに入力された入力画像が、生成器50Aにより生成された画像69であるか複数の学習データセット60から得られた学習画像61であるかを判別するように、判別器54Aを訓練する。 Before executing step S601, the control unit 11 prepares the generator 50A and the discriminator 54A to be processed, as in the above embodiment. In step S601, the control unit 11 adjusts the value of the parameter of the discriminator 54A so that the sum of the calculated errors (L DA ) becomes small as described above. Accordingly, the control unit 11 determines whether the input image input to the discriminator 54A is the image 69 generated by the generator 50A or the learning image 61 obtained from the plurality of learning data sets 60. Thus, the discriminator 54A is trained.

ステップS602では、制御部11は、上記のとおり、算出される誤差(LGDA)の和が小さくなるように、生成器50Aのパラメータの値を調節する。これにより、制御部11は、生成器50Aにより生成される画像69が、判別器54Aによる判別を誤らせるようなものとなるように、生成器50Aを訓練する。なお、各ステップS601及びS602におけるパラメータの値の調節は、上記実施形態と同様に処理されてよい。 In step S602, the control unit 11 adjusts the value of the parameter of the generator 50A so that the sum of the calculated errors (L GDA ) becomes small as described above. As a result, the control unit 11 trains the generator 50A so that the image 69 generated by the generator 50A causes the discrimination by the discriminator 54A to be erroneous. Note that the adjustment of the parameter values in steps S601 and S602 may be processed in the same manner as in the above embodiment.

ステップS603では、制御部11は、ステップS602及びS603の訓練ステップの実行を繰り返すか否かを判定する。訓練ステップの実行を繰り返す基準は、実施の形態に応じて適宜決定されてよい。例えば、ステップS602及びS603の訓練ステップを実行する回数が予め設定されていてもよい。この場合、制御部11は、ステップS602及びS603の訓練ステップを実行した回数が設定回数に到達したか否かを判定する。ステップS602及びS603の訓練ステップを実行した回数が設定回数に到達していないと判定した場合には、制御部11は、ステップS601に処理を戻す。一方、ステップS602及びS603の訓練ステップを実行した回数が設定回数に到達したと判定した場合には、制御部11は、本変形例に係る第1の機械学習の処理を完了し、次のステップS103に処理を進める。これにより、制御部11は、各学習データセット60に含まれるラベル63の入力に対して、入力されたラベル63に関連付けられた学習画像61に対応する画像を生成するように訓練された生成器50を構築する。   In step S603, the control unit 11 determines whether to repeat the execution of the training steps of steps S602 and S603. The criterion for repeating the execution of the training step may be appropriately determined depending on the embodiment. For example, the number of times to execute the training steps of steps S602 and S603 may be set in advance. In this case, the control unit 11 determines whether the number of times the training steps of steps S602 and S603 have been executed has reached the set number. When determining that the number of times the training steps of steps S602 and S603 have been executed has not reached the set number of times, the control unit 11 returns the process to step S601. On the other hand, when it is determined that the number of times the training steps of steps S602 and S603 have been executed has reached the set number, the control unit 11 completes the first machine learning process according to this modification, and the next step The process proceeds to S103. Thereby, the control unit 11 is trained to generate an image corresponding to the learning image 61 associated with the input label 63, for the input of the label 63 included in each learning data set 60. Build 50.

ステップS103では、制御部11は、第2学習処理部113として動作し、推定器52Aに関する第2の機械学習を実行する。第2の機械学習では、制御部11は、上記のとおり、領域提案ネットワーク525を訓練する第1訓練ステップとそれ以外の部分を訓練する第2訓練ステップとを交互に実行する。第1訓練ステップでは、制御部11は、物体の有無の分類に関する誤差とバウンディングボックスの位置及びアスペクト比に関する誤差とが小さくなるように、領域提案ネットワーク525のパラメータの値を調節する。第2訓練ステップでは、制御部11は、学習済みの領域提案ネットワーク525を利用して、各誤差(LC、LBB)が小さくなるように、各パラメータの値を調節する。各ステップにおけるパラメータの値の調節は、上記実施形態と同様に処理されてよい。これにより、制御部11は、各学習データセット60について、学習画像61の入力に対して、対応するラベル63及び境界情報65と一致するように、入力された学習画像61に写る製品Rに含まれる欠陥の種別及び範囲を推定するように訓練された推定器52を構築する。 In step S103, the control unit 11 operates as the second learning processing unit 113 and executes the second machine learning regarding the estimator 52A. In the second machine learning, as described above, the control unit 11 alternately executes the first training step for training the area proposal network 525 and the second training step for training other portions. In the first training step, the control unit 11 adjusts the value of the parameter of the region proposal network 525 so that the error regarding the classification of the presence or absence of the object and the error regarding the position and aspect ratio of the bounding box become small. In the second training step, the control unit 11 uses the learned region proposed network 525, each error (L C, L BB) so decrease, adjusting the value of each parameter. The adjustment of the parameter value in each step may be processed in the same manner as in the above embodiment. As a result, the control unit 11 includes, for each learning data set 60, the product R shown in the input learning image 61 so that the input of the learning image 61 matches the corresponding label 63 and boundary information 65. Construct an estimator 52 that has been trained to estimate the type and extent of the defect to be treated.

次のステップS104では、制御部11は、上記実施形態と同様に、構築された学習済みの生成器50Aに関する情報、及び構築された学習済みの推定器52Aに関する情報を所定の記憶領域に保存する。以上により、本変形例では、学習装置1は、上記実施形態に係る生成器50及び推定器52と同様の機能を有する生成器50A及び推定器52Aを生成することができる。   In the next step S104, the control unit 11 saves the information about the constructed learned generator 50A and the constructed information about the learned estimator 52A in a predetermined storage area, as in the above embodiment. . As described above, in the present modification, the learning device 1 can generate the generator 50A and the estimator 52A having the same functions as the generator 50 and the estimator 52 according to the above-described embodiment.

<4.6>
上記実施形態では、画像に写る製品Rの外観検査を実施する場面に本発明を適用した例を示している。しかしながら、本発明の適用範囲は、このような外観検査の例に限られる訳ではない。本発明は、与えられた画像内で何らかの対象物の写る範囲を推定するあらゆる場面に適用可能である。製品Rの写る画像から何らかの対象物の写る画像に検査システム100で取り扱う画像を変更することで、与えられた画像内で何らかの対象物の写る範囲を推定する推定システムを構成することができる。
<4.6>
The above embodiment shows an example in which the present invention is applied to a scene in which the appearance inspection of the product R shown in the image is performed. However, the scope of application of the present invention is not limited to such an example of the visual inspection. INDUSTRIAL APPLICABILITY The present invention can be applied to all situations in which the range in which an object appears in a given image is estimated. By changing the image handled by the inspection system 100 from the image in which the product R appears to the image in which some object appears, it is possible to configure an estimation system that estimates the range in which some object appears in the given image.

図19は、本変形例に係る推定システム100Bの適用場面の一例を模式的に例示する。図19に示されるとおり、本変形例に係る推定システム100Bは、ネットワークを介して接続される学習装置1B、画像生成装置2B、推定器生成装置3B、及び推定装置4Bを備えている。製品Rの写る画像から何らかの対象物の写る画像に取り扱う画像を変更する点を除き、各装置1B〜4Bのハードウェア構成及びソフトウェア構成は、上記実施形態に係る各装置1〜4のハードウェア構成及びソフトウェア構成と同じであってよい。また、各装置1B〜4Bは、上記実施形態に係る各装置1〜4と同様に動作してよい。   FIG. 19 schematically illustrates an example of an application scene of the estimation system 100B according to this modification. As shown in FIG. 19, the estimation system 100B according to the present modification includes a learning device 1B, an image generation device 2B, an estimator generation device 3B, and an estimation device 4B that are connected via a network. The hardware configuration and software configuration of each of the devices 1B to 4B are the same as the hardware configuration of each of the devices 1 to 4 according to the above-described embodiment, except that the image to be handled is changed from the image of the product R to the image of some object. And the software configuration may be the same. Further, each of the devices 1B to 4B may operate similarly to each of the devices 1 to 4 according to the above-described embodiment.

すなわち、本変形例に係る学習装置1Bは、対象物RBを写した学習画像61B、対象物RBの種別を示すラベル63B、及び学習画像61B内における対象物RBの範囲を示す境界情報65Bの組み合わせによりそれぞれ構成された複数の学習データセット60Bを取得する。次に、学習装置1Bは、第1の機械学習を行うことで、各学習データセット60Bに含まれるラベル63Bの入力に対して、入力されたラベル63Bに関連付けられた学習画像61Bに対応する画像を生成するように訓練された生成器50Bを構築する。また、学習装置1Bは、第2の機械学習を行うことで、各学習データセット60Bに含まれる学習画像61Bの入力に対して、入力された学習画像61Bに関連付けられたラベル63B及び境界情報65Bと一致するように、入力された学習画像61Bに写る対象物RBの種別及び範囲を推定するように訓練された推定器52Bを構築する。生成器50B及び推定器52Bの構成は、上記生成器50及び推定器52と同じであってよい。また、生成器50B及び推定器52Bの機械学習の処理は、上記生成器50及び推定器52の機械学習の処理と同様であってよい。   That is, the learning device 1B according to the present modification is a combination of the learning image 61B that shows the target RB, the label 63B that indicates the type of the target RB, and the boundary information 65B that indicates the range of the target RB in the learning image 61B. A plurality of learning data sets 60B each configured by are acquired. Next, the learning device 1B performs the first machine learning, and with respect to the input of the label 63B included in each learning data set 60B, the image corresponding to the learning image 61B associated with the input label 63B. Construct a generator 50B trained to generate Further, the learning device 1B performs the second machine learning, so that for the input of the learning image 61B included in each learning data set 60B, the label 63B and the boundary information 65B associated with the input learning image 61B. The estimator 52B trained to estimate the type and range of the object RB appearing in the input learning image 61B is constructed so as to match The configurations of the generator 50B and the estimator 52B may be the same as the generator 50 and the estimator 52 described above. The machine learning process of the generator 50B and the estimator 52B may be the same as the machine learning process of the generator 50 and the estimator 52.

これに対して、画像生成装置2Bは、学習装置1Bにより構築された生成器50Bに、対象物RBの種別を示す入力値71Bを与えることで、対象物RBを含み得る生成画像73Bを生成する。次に、画像生成装置2Bは、学習装置1Bにより構築された推定器52Bに生成された生成画像73Bを与えることで、生成画像73Bに写り得る対象物RBの種別及び範囲を推定する。続いて、画像生成装置2Bは、生成画像73Bに写る対象物RBの種別を推定した結果が入力値71Bにより示される対象物RBの種別と一致するか否かを判定する。そして、画像生成装置2Bは、対象物RBの種別を推定した結果が入力値71Bにより示される対象物RBの種別と一致すると判定した場合に、生成した生成画像73Bと対象物RBの範囲を推定した結果とを関連付けて所定の記憶領域に格納する。   On the other hand, the image generation device 2B generates the generated image 73B that may include the target RB by giving the input value 71B indicating the type of the target RB to the generator 50B constructed by the learning device 1B. . Next, the image generation device 2B estimates the type and range of the target object RB that can be reflected in the generated image 73B by giving the generated image 73B to the estimator 52B constructed by the learning device 1B. Subsequently, the image generation device 2B determines whether or not the result of estimating the type of the target object RB shown in the generated image 73B matches the type of the target object RB indicated by the input value 71B. Then, when the image generation device 2B determines that the result of estimating the type of the target object RB matches the type of the target object RB indicated by the input value 71B, it estimates the range of the generated generated image 73B and the target object RB. The result is stored in a predetermined storage area in association with the result.

また、推定器生成装置3Bは、対象物RBを含み得るサンプル画像3221B、対象物RBの種別を示すラベル3222B、及び対象物RBの範囲を示す境界情報3223Bの組み合わせによりそれぞれ構成された複数の学習データセット322Bを取得する。次に、推定器生成装置3Bは、複数の学習データセット322Bを利用して、推定器80Bの機械学習を実施する。推定器80Bの構成は、上記推定器80と同じであってよい。また、推定器80Bの機械学習の処理は、上記推定器80の機械学習の処理と同様であってよい。これにより、推定器生成装置3Bは、サンプル画像3221Bを入力すると、対応するラベル3222B及び境界情報3223Bと一致する出力値を出力するように訓練された推定器80Bを構築することができる。そして、推定器生成装置3Bは、学習済みの推定器80Bの構成及びパラメータを示す情報を学習結果データ325Bとして生成する。なお、推定器生成装置3Bは、画像生成装置2Bにより生成されたデータセットを学習データセット322Bとして利用することができる。   Further, the estimator generation device 3B includes a plurality of learning images each configured by a combination of a sample image 3221B that may include the target RB, a label 3222B that indicates the type of the target RB, and boundary information 3223B that indicates the range of the target RB. Acquire the data set 322B. Next, the estimator generation device 3B performs machine learning of the estimator 80B using the plurality of learning data sets 322B. The configuration of the estimator 80B may be the same as that of the estimator 80. The machine learning process of the estimator 80B may be the same as the machine learning process of the estimator 80. Accordingly, the estimator generation device 3B can construct the estimator 80B that has been trained to output the output value that matches the corresponding label 3222B and the boundary information 3223B when the sample image 3221B is input. Then, the estimator generation device 3B generates information indicating the configuration and parameters of the learned estimator 80B as learning result data 325B. Note that the estimator generation device 3B can use the data set generated by the image generation device 2B as the learning data set 322B.

図20は、本変形例に係る推定装置4Bのソフトウェア構成の一例を模式的に例示する。本変形例に係る推定装置4Bは、対象物RBの写り得る対象画像422Bを取得する。本変形例では、推定装置4BにはカメラCAが接続されている。推定装置4Bは、このカメラCAにより対象物RBの存在し得る範囲を撮影することで対象画像422Bを取得する。次に、推定装置4Bの制御部は、推定部412Bとして動作し、学習結果データ325Bを参照して、学習済みの推定器80Bの設定を行う。続いて、推定装置4Bは、取得した対象画像422Bを学習済みの推定器80Bに入力し、学習済みの推定器80Bの演算処理を実行する。これにより、推定装置4Bは、対象物RBの種別及び範囲を推定した結果(すなわち、対象物RBを検出した結果)に対応する出力値を推定器80Bから取得する。そして、推定装置4Bは、推定器80Bから得られた出力値に基づいて対象物RBを検出した結果に関する情報を出力する。これにより、本変形例に係る推定システム100Bは、与えられた画像内で対象物RBの写る範囲を推定するように構成される。   FIG. 20 schematically illustrates an example of the software configuration of the estimation device 4B according to this modification. The estimation device 4B according to the present modification acquires a target image 422B that can capture the target RB. In this modification, a camera CA is connected to the estimation device 4B. The estimation device 4B acquires the target image 422B by capturing a range in which the target RB can exist with the camera CA. Next, the control unit of the estimation device 4B operates as the estimation unit 412B, refers to the learning result data 325B, and sets the learned estimator 80B. Subsequently, the estimation device 4B inputs the acquired target image 422B to the learned estimator 80B, and executes the arithmetic processing of the learned estimator 80B. As a result, the estimation device 4B acquires an output value corresponding to the result of estimating the type and range of the target object RB (that is, the result of detecting the target object RB) from the estimator 80B. Then, the estimation device 4B outputs information related to the result of detecting the object RB based on the output value obtained from the estimator 80B. Thereby, the estimation system 100B according to the present modification is configured to estimate the range in which the target object RB appears in the given image.

なお、対象物RBは、画像から検出する対象となり得るものであれば、その種類は、特に限定されなくてもよく、実施の形態に応じて適宜選択されてよい。対象物RBは、例えば、上記外観検査の対象となる製品、人物、人物の身体部位(例えば、顔等)等であってよい。また、道路交通の監視に本変形例を利用する場合、対象物RBは、例えば、車、歩行者、標識等であってもよい。   It should be noted that the type of the object RB is not particularly limited as long as it can be an object to be detected from the image, and may be appropriately selected according to the embodiment. The target object RB may be, for example, a product, a person, a body part of the person (for example, a face or the like) which is a target of the visual inspection. When using this modification for monitoring road traffic, the object RB may be, for example, a car, a pedestrian, a sign, or the like.

100…検査システム、
1…学習装置、
11…制御部、12…記憶部、13…通信インタフェース、
14…入力装置、15…出力装置、16…ドライブ、
111…(第1)データ取得部、112…第1学習処理部、
113…第2学習処理部、114…(第1)保存処理部、
121…学習プログラム、123…第1学習結果データ、
125…第2学習結果データ、
2…画像生成装置、
21…制御部、22…記憶部、23…通信インタフェース、
24…入力装置、25…出力装置、26…ドライブ、
211…生成部、212…推定部、213…判定部、
214…画像保存部、
221…画像生成プログラム、
50…生成器、52…推定器、54…判別器、
56…エンコーダ、
60…(第1)学習データセット、
61…学習画像、63…ラベル、65…境界情報、
71…入力値、73…生成画像、75…ラベル、
77…境界情報、
3…推定器生成装置、
31…制御部、32…記憶部、33…通信インタフェース、
34…入力装置、35…出力装置、36…ドライブ、
311…(第2)データ取得部、
312…(第3)学習処理部、
313…(第2)保存処理部、
321…推定器生成プログラム、
322…(第2)学習データセット、
3221…サンプル画像、3222…ラベル、
3223…境界情報、
325…第3学習結果データ、
4…検査装置(推定装置)、
41…制御部、42…記憶部、43…通信インタフェース、
44…入力装置、45…出力装置、46…ドライブ、
47…外部インタフェース、
411…対象データ取得部、412…良否判定部、
413…出力部、
421…検査プログラム、
80…推定器、
91・92・93・94…記憶媒体
100 ... inspection system,
1 ... learning device,
11 ... Control unit, 12 ... Storage unit, 13 ... Communication interface,
14 ... Input device, 15 ... Output device, 16 ... Drive,
111 ... (first) data acquisition unit, 112 ... first learning processing unit,
113 ... Second learning processing unit, 114 ... (First) storage processing unit,
121 ... Learning program, 123 ... First learning result data,
125 ... Second learning result data,
2 ... Image generation device,
21 ... Control unit, 22 ... Storage unit, 23 ... Communication interface,
24 ... Input device, 25 ... Output device, 26 ... Drive,
211 ... Generation unit, 212 ... Estimation unit, 213 ... Judgment unit,
214 ... an image storage unit,
221 ... Image generation program,
50 ... Generator, 52 ... Estimator, 54 ... Discriminator,
56 ... Encoder,
60 ... (first) learning data set,
61 ... Learning image, 63 ... Label, 65 ... Boundary information,
71 ... Input value, 73 ... Generated image, 75 ... Label,
77 ... boundary information,
3 ... Estimator generation device,
31 ... Control unit, 32 ... Storage unit, 33 ... Communication interface,
34 ... Input device, 35 ... Output device, 36 ... Drive,
311 ... (second) data acquisition unit,
312 ... (Third) learning processing unit,
313 ... (Second) storage processing unit,
321 ... Estimator generation program,
322 ... (Second) learning data set,
3221 ... sample image, 3222 ... label,
3223 ... boundary information,
325 ... Third learning result data,
4 ... Inspection device (estimation device),
41 ... Control unit, 42 ... Storage unit, 43 ... Communication interface,
44 ... Input device, 45 ... Output device, 46 ... Drive,
47 ... external interface,
411 ... Target data acquisition unit, 412 ... Pass / fail judgment unit,
413 ... Output unit,
421 ... inspection program,
80 ... Estimator,
91, 92, 93, 94 ... Storage medium

Claims (8)

外観検査の対象となる製品を写した学習画像、前記製品に含まれる欠陥の種別を示すラベル、及び前記欠陥の範囲を示す境界情報の組み合わせによりそれぞれ構成された複数の学習データセットを取得するデータ取得部と、
第1の機械学習を行うことで、前記各件の学習データセットに含まれる前記ラベルの入力に対して、入力された前記ラベルに関連付けられた前記学習画像に対応する画像を生成するように訓練された生成器を構築する第1学習処理部と、
第2の機械学習を行うことで、前記各件の学習データセットに含まれる前記学習画像の入力に対して、入力された前記学習画像に関連付けられた前記ラベル及び前記境界情報と一致するように、入力された前記学習画像に写る前記製品に含まれる前記欠陥の種別及び範囲を推定するように訓練された推定器を構築する第2学習処理部と、
を備える、
学習装置。
Data for acquiring a plurality of learning data sets each configured by a combination of a learning image showing a product to be subjected to visual inspection, a label indicating the type of defect included in the product, and boundary information indicating the range of the defect. The acquisition part,
Training to generate an image corresponding to the learning image associated with the input label for the input of the label included in each of the learning data sets by performing the first machine learning. A first learning processing unit for constructing the generated generator,
By performing the second machine learning, the input of the learning image included in the learning data set of each case is matched with the label and the boundary information associated with the input learning image. A second learning processing unit that constructs an estimator trained to estimate the type and range of the defect included in the product captured in the input learning image,
With
Learning device.
前記生成器の入力は、エンコーダの出力に接続され、
前記生成器の出力は、前記推定器の入力及び判別器の入力に接続され、
前記第1の機械学習を行うことは、
前記判別器に入力された入力画像が、前記生成器により生成された前記画像であるか前記複数の学習データセットから得られた前記学習画像であるかを判別するように前記判別器を訓練する第1訓練ステップと、
前記生成器により生成される前記画像が、前記判別器による前記判別を誤らせるようなものとなるように、前記生成器を訓練する第2訓練ステップと、
前記生成器により生成される前記画像が、前記推定器により前記画像に写る製品に含まれる欠陥の種別を推定した結果が前記ラベルと一致するようなものとなるように、前記生成器を訓練する第3訓練ステップと、
前記ラベル及び潜在変数を前記生成器に入力することで前記生成器により生成された前記画像が、前記学習画像を復元したものとなるように、前記エンコーダ及び前記生成器を訓練する第4訓練ステップであって、前記潜在変数は、前記ラベル及び前記学習画像を前記エンコーダに入力することで前記エンコーダから得られる出力に基づいて導出される、第4訓練ステップと、
前記エンコーダから得られる出力に基づいて導出される前記潜在変数の分布が所定の事前分布に従うように前記エンコーダを訓練する第5訓練ステップと、
を含む、
請求項1に記載の学習装置。
The input of the generator is connected to the output of the encoder,
The output of the generator is connected to the input of the estimator and the input of the discriminator,
Performing the first machine learning is
Train the discriminator to discriminate whether the input image input to the discriminator is the image generated by the generator or the learning image obtained from the plurality of learning data sets. A first training step,
A second training step of training the generator such that the image generated by the generator is such that the discrimination by the discriminator is erroneous;
Train the generator so that the image generated by the generator is such that the result of estimating the type of defect contained in the product shown in the image by the estimator matches the label. A third training step,
A fourth training step of training the encoder and the generator such that the image generated by the generator by inputting the label and the latent variable to the generator is a reconstructed version of the learning image. Wherein the latent variable is derived based on an output obtained from the encoder by inputting the label and the learning image to the encoder, a fourth training step,
A fifth training step of training the encoder such that the distribution of the latent variable derived based on the output obtained from the encoder follows a predetermined prior distribution;
including,
The learning device according to claim 1.
前記生成器の出力は、判別器の入力に接続され、
前記第1の機械学習を行うことは、
前記判別器に入力された入力画像が、前記生成器により生成された前記画像であるか前記複数の学習データセットから得られた前記学習画像であるかを判別するように、前記判別器を訓練する第1訓練ステップと、
前記生成器により生成される前記画像が、前記判別器による前記判別を誤らせるようなものとなるように、前記生成器を訓練する第2訓練ステップと、
を交互に行うことを含む、
請求項1に記載の学習装置。
The output of the generator is connected to the input of the discriminator,
Performing the first machine learning is
The discriminator is trained so as to discriminate whether the input image input to the discriminator is the image generated by the generator or the learning image obtained from the plurality of learning data sets. A first training step to
A second training step of training the generator such that the image generated by the generator is such that the discrimination by the discriminator is erroneous;
Including alternating
The learning device according to claim 1.
前記欠陥の範囲は、バウンディングボックスにより表される、
請求項1から3のいずれか1項に記載の学習装置。
The range of the defect is represented by a bounding box,
The learning device according to any one of claims 1 to 3.
請求項1から4のいずれか1項に記載の学習装置により構築された前記生成器に、前記欠陥の種別を示す入力値を与えることで、前記欠陥を含む前記製品を写した生成画像を生成する生成部と、
前記学習装置により構築された前記推定器に生成された前記生成画像を与えることで、前記生成画像に写る前記製品に含まれる前記欠陥の種別及び範囲を推定する推定部と、
前記生成画像に写る前記製品に含まれる前記欠陥の種別を推定した結果が前記入力値により示される前記欠陥の種別と一致するか否かを判定する判定部と、
前記欠陥の種別を推定した結果が前記入力値により示される前記欠陥の種別と一致すると前記判定部が判定した場合に、生成した前記生成画像と前記欠陥の範囲を推定した結果とを関連付けて所定の記憶領域に格納する画像保存部と、
を備える、
画像生成装置。
An input value indicating the type of the defect is given to the generator constructed by the learning device according to any one of claims 1 to 4 to generate a generated image in which the product including the defect is copied. A generator that
An estimation unit that estimates the type and range of the defect included in the product shown in the generated image by giving the generated image generated to the estimator constructed by the learning device,
A determination unit that determines whether the result of estimating the type of the defect included in the product shown in the generated image matches the type of the defect indicated by the input value,
When the determination unit determines that the result of estimating the type of the defect matches the type of the defect indicated by the input value, the generated image generated and the result of estimating the range of the defect are associated with each other and predetermined. Image storage unit to store in the storage area of
With
Image generation device.
コンピュータが、
外観検査の対象となる製品を写した学習画像、前記製品に含まれる欠陥の種別を示すラベル、及び前記欠陥の範囲を示す境界情報の組み合わせによりそれぞれ構成された複数の学習データセットを取得するステップと、
第1の機械学習を行うことで、前記各件の学習データセットに含まれる前記ラベルの入力に対して、入力された前記ラベルに関連付けられた前記学習画像に対応する画像を生成するように訓練された生成器を構築するステップと、
第2の機械学習を行うことで、前記各件の学習データセットに含まれる前記学習画像の入力に対して、入力された前記学習画像に関連付けられた前記ラベル及び前記境界情報と一致するように、入力された前記学習画像に写る前記製品に含まれる前記欠陥の種別及び範囲を推定するように訓練された推定器を構築するステップと、
を実行する、
学習方法。
Computer
A step of acquiring a plurality of learning data sets each formed by a combination of a learning image showing a product to be subjected to a visual inspection, a label indicating a type of defect included in the product, and boundary information indicating a range of the defect. When,
Training to generate an image corresponding to the learning image associated with the input label for the input of the label included in each of the learning data sets by performing the first machine learning. Constructing the generated generator,
By performing the second machine learning, the input of the learning image included in the learning data set of each case is matched with the label and the boundary information associated with the input learning image. Constructing an estimator trained to estimate the type and range of the defect contained in the product in the input learning image,
Run the
Learning method.
コンピュータに、
外観検査の対象となる製品を写した学習画像、前記製品に含まれる欠陥の種別を示すラベル、及び前記欠陥の範囲を示す境界情報の組み合わせによりそれぞれ構成された複数の学習データセットを取得するステップと、
第1の機械学習を行うことで、前記各件の学習データセットに含まれる前記ラベルの入力に対して、入力された前記ラベルに関連付けられた前記学習画像に対応する画像を生成するように訓練された生成器を構築するステップと、
第2の機械学習を行うことで、前記各件の学習データセットに含まれる前記学習画像の入力に対して、入力された前記学習画像に関連付けられた前記ラベル及び前記境界情報と一致するように、入力された前記学習画像に写る前記製品に含まれる前記欠陥の種別及び範囲を推定するように訓練された推定器を構築するステップと、
を実行させるための、
学習プログラム。
On the computer,
A step of acquiring a plurality of learning data sets each formed by a combination of a learning image showing a product to be subjected to a visual inspection, a label indicating a type of defect included in the product, and boundary information indicating a range of the defect. When,
Training to generate an image corresponding to the learning image associated with the input label for the input of the label included in each of the learning data sets by performing the first machine learning. Constructing the generated generator,
By performing the second machine learning, the input of the learning image included in the learning data set of each case is matched with the label and the boundary information associated with the input learning image. Constructing an estimator trained to estimate the type and range of the defect contained in the product in the input learning image,
To execute
Learning program.
対象物を写した学習画像、前記対象物の種別を示すラベル、及び前記学習画像内における前記対象物の範囲を示す境界情報の組み合わせによりそれぞれ構成された複数の学習データセットを取得するデータ取得部と、
第1の機械学習を行うことで、前記各件の学習データセットに含まれる前記ラベルの入力に対して、入力された前記ラベルに関連付けられた前記学習画像に対応する画像を生成するように訓練された生成器を構築する第1学習処理部と、
第2の機械学習を行うことで、前記各件の学習データセットに含まれる前記学習画像の入力に対して、入力された前記学習画像に関連付けられた前記ラベル及び前記境界情報と一致するように、入力された前記学習画像に写る前記対象物の種別及び範囲を推定するように訓練された推定器を構築する第2学習処理部と、
を備える、
学習装置。
A data acquisition unit that acquires a plurality of learning data sets each configured by a combination of a learning image that captures an object, a label that indicates the type of the object, and boundary information that indicates the range of the object in the learning image. When,
Training to generate an image corresponding to the learning image associated with the input label for the input of the label included in each of the learning data sets by performing the first machine learning. A first learning processing unit for constructing the generated generator,
By performing the second machine learning, the input of the learning image included in the learning data set of each case is matched with the label and the boundary information associated with the input learning image. A second learning processing unit that constructs an estimator trained to estimate the type and range of the object shown in the input learning image,
With
Learning device.
JP2018190514A 2018-10-05 2018-10-05 Learning device, image generator, learning method, and learning program Active JP7059883B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018190514A JP7059883B2 (en) 2018-10-05 2018-10-05 Learning device, image generator, learning method, and learning program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018190514A JP7059883B2 (en) 2018-10-05 2018-10-05 Learning device, image generator, learning method, and learning program

Publications (2)

Publication Number Publication Date
JP2020060879A true JP2020060879A (en) 2020-04-16
JP7059883B2 JP7059883B2 (en) 2022-04-26

Family

ID=70219891

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018190514A Active JP7059883B2 (en) 2018-10-05 2018-10-05 Learning device, image generator, learning method, and learning program

Country Status (1)

Country Link
JP (1) JP7059883B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112489218A (en) * 2020-11-30 2021-03-12 江苏科技大学 Single-view three-dimensional reconstruction system and method based on semi-supervised learning
JPWO2021210413A1 (en) * 2020-04-17 2021-10-21
JP2022012465A (en) * 2020-07-01 2022-01-17 株式会社東芝 Learning apparatus, method, program, and inference device
WO2022024178A1 (en) * 2020-07-27 2022-02-03 日本電気株式会社 Learning system, object detection system, learning method, and computer program
JP2022094124A (en) * 2020-12-14 2022-06-24 株式会社神戸製鋼所 Machine learning device and method therefor, and film adhesion evaluation device and method therefor
CN115447853A (en) * 2022-09-28 2022-12-09 厦门烟草工业有限责任公司 Defective cigarette packet recognition device and recognition method, rejection device and cigarette processing system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006337152A (en) * 2005-06-01 2006-12-14 Sharp Corp Method and apparatus for forming teaching image, method and apparatus for forming image processing algorithm, image inspecting method, image inspecting device, program and recording medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006337152A (en) * 2005-06-01 2006-12-14 Sharp Corp Method and apparatus for forming teaching image, method and apparatus for forming image processing algorithm, image inspecting method, image inspecting device, program and recording medium

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2021210413A1 (en) * 2020-04-17 2021-10-21
WO2021210413A1 (en) * 2020-04-17 2021-10-21 株式会社Roxy Discrimination target classification method, program employed in same, and discriminating device
JP2022012465A (en) * 2020-07-01 2022-01-17 株式会社東芝 Learning apparatus, method, program, and inference device
JP7419178B2 (en) 2020-07-01 2024-01-22 株式会社東芝 Learning devices, methods and programs
WO2022024178A1 (en) * 2020-07-27 2022-02-03 日本電気株式会社 Learning system, object detection system, learning method, and computer program
JP7396497B2 (en) 2020-07-27 2023-12-12 日本電気株式会社 Learning system, object detection system, learning method, and computer program
CN112489218A (en) * 2020-11-30 2021-03-12 江苏科技大学 Single-view three-dimensional reconstruction system and method based on semi-supervised learning
CN112489218B (en) * 2020-11-30 2024-03-19 江苏科技大学 Single-view three-dimensional reconstruction system and method based on semi-supervised learning
JP2022094124A (en) * 2020-12-14 2022-06-24 株式会社神戸製鋼所 Machine learning device and method therefor, and film adhesion evaluation device and method therefor
JP7393321B2 (en) 2020-12-14 2023-12-06 株式会社神戸製鋼所 Machine learning device and method, and film adhesion evaluation device and method
CN115447853A (en) * 2022-09-28 2022-12-09 厦门烟草工业有限责任公司 Defective cigarette packet recognition device and recognition method, rejection device and cigarette processing system

Also Published As

Publication number Publication date
JP7059883B2 (en) 2022-04-26

Similar Documents

Publication Publication Date Title
JP7059883B2 (en) Learning device, image generator, learning method, and learning program
US11715190B2 (en) Inspection system, image discrimination system, discrimination system, discriminator generation system, and learning data generation device
TWI557650B (en) System and method for identifying defects in a material
JP6844563B2 (en) Inspection equipment, image identification equipment, identification equipment, inspection method, and inspection program
JP2015041164A (en) Image processor, image processing method and program
CN111758117B (en) Inspection system, recognition system, and learning data generation device
CN111259710B (en) Parking space structure detection model training method adopting parking space frame lines and end points
JP2021086379A (en) Information processing apparatus, information processing method, program, and method of generating learning model
CN115830004A (en) Surface defect detection method, device, computer equipment and storage medium
JP2022003495A (en) Inspection device, unit selection device, inspection method, and inspection program
JP7056259B2 (en) Inspection system, identification system, and classifier evaluation device
US20220405586A1 (en) Model generation apparatus, estimation apparatus, model generation method, and computer-readable storage medium storing a model generation program
JP7059889B2 (en) Learning device, image generator, learning method, and learning program
CN114821346B (en) Radar image intelligent identification method and system based on embedded platform
CN113139932B (en) Deep learning defect image identification method and system based on ensemble learning
CN114841255A (en) Detection model training method, device, equipment, storage medium and program product
JP7070308B2 (en) Estimator generator, inspection device, estimator generator method, and estimator generator
JP7321452B2 (en) Program, information processing device, information processing method, and method for generating learned model
CN113837173A (en) Target object detection method and device, computer equipment and storage medium
Kim et al. CECvT: Initial Diagnosis of Anomalies in Thermal Images
CN117474915B (en) Abnormality detection method, electronic equipment and storage medium
WO2022196433A1 (en) Model generation device, sorting device, data generation device, model generation method, and model generation program
WO2023166776A1 (en) Appearance analysis system, appearance analysis method, and program
CN114626452A (en) Model training method, model detection method, robot, and storage medium
JP2024016551A (en) Method, system, and program for detecting abnormality of inspection target

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201214

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20211125

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20211130

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220124

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: 20220315

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220328

R150 Certificate of patent or registration of utility model

Ref document number: 7059883

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150