JP2021135903A - Defective product image generation program and quality determination device - Google Patents
Defective product image generation program and quality determination device Download PDFInfo
- Publication number
- JP2021135903A JP2021135903A JP2020033423A JP2020033423A JP2021135903A JP 2021135903 A JP2021135903 A JP 2021135903A JP 2020033423 A JP2020033423 A JP 2020033423A JP 2020033423 A JP2020033423 A JP 2020033423A JP 2021135903 A JP2021135903 A JP 2021135903A
- Authority
- JP
- Japan
- Prior art keywords
- image
- defective
- product
- input
- defective product
- 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.)
- Pending
Links
Images
Abstract
Description
本発明は、工業製品の不良品画像生成プログラムおよび良否判定装置に関する。 The present invention relates to a defective image generation program for industrial products and a quality determination device.
ディープラーニング等の機械学習により画像を認識する画像認識モデルを用いて、工業製品の撮像画像における不良箇所の有無に基づき工業製品の良否を判定する良否判定技術が知られている。このような画像認識モデルを用いる良否判定技術において、工業製品の良否の判定精度を向上させるためには、画像認識モデルに工業製品の良品画像および不良品画像を大量に入力して学習させることが必要である。しかし、工業製品の製造過程において、不良品の発生確率は、良品の発生確率に比べて極めて低いため、工業製品の不良品画像を機械学習に十分な量だけ収集することが事実上困難である。 There is known a quality determination technique for determining the quality of an industrial product based on the presence or absence of defective parts in the captured image of the industrial product using an image recognition model that recognizes the image by machine learning such as deep learning. In the quality judgment technology using such an image recognition model, in order to improve the quality judgment accuracy of an industrial product, it is necessary to input a large amount of good and defective images of the industrial product into the image recognition model for learning. is necessary. However, in the manufacturing process of industrial products, the probability of occurrence of defective products is extremely low compared to the probability of occurrence of non-defective products, so it is practically difficult to collect a sufficient amount of images of defective products of industrial products for machine learning. ..
そこで、従来、工業製品の一のサンプル画像を人為的に編集して複数の不良品画像を生成する技術が知られている(例えば、特許文献1参照)。具体的には、不良箇所を含む不良パターン画像が複数パターン、予め取得されており、人による入力装置の操作により、サンプル画像に任意の不良パターン画像を合成する編集処理が行われる。なお、人による入力装置の操作により、サンプル画像における不良パターン画像の位置や回転角等を編集することも可能である。 Therefore, conventionally, a technique has been known in which a sample image of one industrial product is artificially edited to generate a plurality of defective image images (see, for example, Patent Document 1). Specifically, a plurality of defective pattern images including defective portions are acquired in advance, and an editing process for synthesizing an arbitrary defective pattern image with a sample image is performed by operating an input device by a person. It is also possible to edit the position, rotation angle, etc. of the defective pattern image in the sample image by operating the input device by a person.
上述した人為的な編集により不良品画像を生成する従来の技術では、人為的に編集して不良品画像を生成するため、不自然な不良品画像が生成されたりする、という課題がある。 In the conventional technique of generating a defective product image by the above-mentioned artificial editing, there is a problem that an unnatural defective product image is generated because the defective product image is generated by artificially editing.
本発明は、上述した課題を解決することが可能な不良品画像生成プログラム、および、不良品画像生成プログラムにより生成された不良品画像を用いて良否を判定する良否判定装置を提供することを目的とする。 An object of the present invention is to provide a defective product image generation program capable of solving the above-mentioned problems, and a quality determination device for determining quality using a defective product image generated by the defective product image generation program. And.
上記目的を達成するために、本発明の不良品画像生成プログラムは、不良箇所の存在により不良品であると判定される工業製品の不良品画像を生成する不良品画像生成プログラムであって、コンピュータに、前記工業製品の良品画像と、前記不良箇所を含む部分画像を前記良品画像に合成した合成画像と、を取得する第1の取得処理と、入力画像と前記良品画像と前記合成画像とに基づき、画像更新モデルを繰り返し実行して前記不良品画像を生成する第1の画像生成処理と、を実行させ、前記画像更新モデルは、前記入力画像(ただし、初回は前記合成画像、2回目以降は前記画像更新モデルから前回出力された出力画像)と、前記良品画像と、を事前学習済みの畳み込みニューラルネットワークに入力し、前記入力画像と、前記合成画像と、をエッジ抽出用フィルタに入力し、前記畳み込みニューラルネットワークにより得られる第1の損失関数と、前記エッジ抽出用フィルタにより得られる第2の損失関数と、を合算した合算損失が最小になるように前記入力画像を更新して出力するモデルである。 In order to achieve the above object, the defective product image generation program of the present invention is a defective product image generation program that generates a defective product image of an industrial product determined to be a defective product due to the presence of defective parts, and is a computer. In addition, a first acquisition process for acquiring a non-defective product image of the industrial product and a composite image in which a partial image including the defective portion is combined with the non-defective product image, and an input image, the non-defective product image, and the composite image Based on this, the image update model is repeatedly executed to execute the first image generation process for generating the defective product image, and the image update model is the input image (however, the first time is the composite image, the second and subsequent times). Is the output image previously output from the image update model) and the non-defective image are input to the pre-trained convolutional neural network, and the input image and the composite image are input to the edge extraction filter. , The input image is updated and output so that the total loss obtained by adding the first loss function obtained by the convolutional neural network and the second loss function obtained by the edge extraction filter is minimized. It is a model.
本不良品画像生成プログラムでは、画像更新モデルが用いられる。画像更新モデルは、第1の損失関数と第2の損失関数とを合算した合算損失が最小になるように入力画像を更新して出力するモデルである。ここで、第1の損失関数は、畳み込みニューラルネットワークにより得られる入力画像と良品画像との誤差であり、第1の損失関数が最小になるように入力画像を更新することは、良品画像の特徴に近づくように入力画像が更新されることを意味する。第2の損失関数は、エッジ抽出用フィルタにより得られる入力画像と合成画像との誤差であり、第2の損失関数が最小になるように入力画像を更新することは、合成画像の特徴(不良箇所)に近づくように入力画像が更新されることを意味する。したがって、合算損失が最小になるように入力画像を更新することは、合成画像の不良箇所の特徴を保ちつつ、良品画像の特徴に近づくように入力画像が更新されることを意味する。これにより、本不良品画像生成プログラムによれば、良品画像と部分画像とから、より本物に近い不良品画像を生成することができる。 In this defective product image generation program, an image update model is used. The image update model is a model that updates and outputs an input image so that the total loss of the sum of the first loss function and the second loss function is minimized. Here, the first loss function is the error between the input image obtained by the convolutional neural network and the non-defective image, and updating the input image so that the first loss function is minimized is a feature of the non-defective image. It means that the input image is updated so as to approach. The second loss function is the error between the input image obtained by the edge extraction filter and the composite image, and updating the input image so that the second loss function is minimized is a feature (defectiveness) of the composite image. It means that the input image is updated so as to approach the place). Therefore, updating the input image so that the total loss is minimized means that the input image is updated so as to approach the characteristics of the non-defective image while maintaining the characteristics of the defective portion of the composite image. As a result, according to the defective product image generation program, it is possible to generate a defective product image closer to the real thing from the non-defective product image and the partial image.
上記不良品画像生成プログラムにおいて、前記画像更新モデルは、さらに、前記入力画像を、画像中における不良箇所の有無を判定する不良判定モデルに入力し、前記第1の損失関数および前記第2の損失関数に、さらに、前記不良判定モデルにより得られる第3の損失関数を合算して前記合算損失とする。第3の損失関数は、不良判定モデルにより得られる不良箇所有り判定基準と判定結果との誤差であり、第3の損失関数が最小になるように入力画像を更新することは、不良判定モデルで不良箇所有りと判定される画像に近づくように入力画像が更新されることを意味する。これにより、本不良品画像生成プログラムによれば、不良判定モデルを用いない場合に比べて、より本物に近い不良品画像を生成することができる。 In the defective product image generation program, the image update model further inputs the input image into a defect determination model for determining the presence or absence of a defective portion in the image, and the first loss function and the second loss. Further, the third loss function obtained by the defect determination model is added to the function to obtain the total loss. The third loss function is an error between the judgment criterion with a defect and the judgment result obtained by the defect judgment model, and updating the input image so that the third loss function is minimized is a defect judgment model. This means that the input image is updated so as to approach the image determined to have a defective part. As a result, according to the defective product image generation program, it is possible to generate a defective product image closer to the real thing as compared with the case where the defective product determination model is not used.
上記不良品画像生成プログラムにおいて、前記コンピュータに、前記工業製品の良品画像と、前記工業製品における前記不良箇所を含む部分画像と、を取得する第2の取得処理と、前記工業製品の良品画像の一部である第1の画像領域を指定する指定処理と、前記良品画像のうち、前記第1の画像領域を対象とし、前記第1の画像領域中の任意の位置に、前記部分画像を合成して前記合成画像を生成する第2の画像生成処理と、を実行させる構成としてもよい。即ち、良品画像のうち、予め指定された第1の画像領域を対象に部分画像が合成される構成としてもよい。これにより、本不良品画像生成プログラムによれば、不良箇所が不自然な位置に配置された合成画像の生成が抑制され、より本物に近い不良品画像を生成することができる。 In the defective product image generation program, a second acquisition process for acquiring a non-defective product image of the industrial product and a partial image including the defective portion of the industrial product on the computer, and a non-defective product image of the industrial product. A designation process for designating a first image area that is a part of the image, and a combination of the partial image at an arbitrary position in the first image area, targeting the first image area of the non-defective image. The second image generation process for generating the composite image may be executed. That is, the partial image may be combined with the first image region designated in advance among the non-defective images. As a result, according to the defective product image generation program, the generation of a composite image in which the defective portion is arranged at an unnatural position is suppressed, and a defective product image closer to the real thing can be generated.
上記不良品画像生成プログラムにおいて、前記工業製品は歯車であり、前記第1の画像領域は、前記歯車における歯のエッジ部と前記エッジ部の周辺部である構成としてもよい。即ち、特にエッジ部とその周辺部(以下、「エッジ部等」という)に不良箇所が存在する合成画像が生成される構成としてもよい。エッジ部等に存在する不良箇所は、特に、互いに噛み合う他の歯車との接触により異音を発する等、歯車の機能に影響しやすい。そこで、本不良品画像生成プログラムでは、第1の画像領域を歯のエッジ部等とすることにより、より有用な不良品画像を精度良く生成することができる。 In the defective product image generation program, the industrial product may be a gear, and the first image region may be configured to be an edge portion of a tooth in the gear and a peripheral portion of the edge portion. That is, a composite image in which defective portions are present in particular at the edge portion and its peripheral portion (hereinafter, referred to as “edge portion or the like”) may be generated. Defective parts existing on the edge portion and the like are likely to affect the function of the gears, such as making an abnormal noise due to contact with other gears that mesh with each other. Therefore, in the present defective product image generation program, a more useful defective product image can be generated with high accuracy by setting the first image region as the edge portion of the tooth or the like.
上記不良品画像生成プログラムにおいて、前記工業製品は歯車であり、前記第1の画像領域は、前記歯車における歯底とは異なる領域である構成としてもよい。即ち、不良箇所が歯底だけに存在する合成画像が生成されない構成としてもよい。歯車における歯底は、互いに噛み合う他の歯車と接触せず、仮に歯底に不良箇所が存在しても歯車の機能に影響しない可能性が高い。そこで、本不良品画像生成プログラムでは、第1の画像領域を歯車の歯底とは異なる領域とすることにより、より有用な不良品画像を精度良く生成することができる。 In the defective product image generation program, the industrial product may be a gear, and the first image region may be a region different from the tooth bottom of the gear. That is, a composite image in which the defective portion exists only in the tooth bottom may not be generated. The tooth bottom of the gear does not come into contact with other gears that mesh with each other, and even if there is a defective portion on the tooth bottom, there is a high possibility that the function of the gear will not be affected. Therefore, in the present defective product image generation program, a more useful defective product image can be generated with high accuracy by setting the first image region to a region different from the tooth bottom of the gear.
上記不良品画像生成プログラムにおいて、前記指定処理では、前記良品画像に対するエッジ抽出処理により抽出されたエッジ部の位置に基づき前記第1の画像領域を指定する構成としてもよい。これにより、本不良品画像生成プログラムによれば、良品画像から抽出されるエッジ部の位置に基づき第1の画像領域を自動で指定することができる。 In the defective product image generation program, in the designation process, the first image region may be designated based on the position of the edge portion extracted by the edge extraction process with respect to the non-defective product image. As a result, according to the defective product image generation program, the first image area can be automatically specified based on the position of the edge portion extracted from the non-defective product image.
上記不良品画像生成プログラムにおいて、前記第2の画像生成処理では、前記良品画像に前記部分画像を合成した画像の彩度を、前記部分画像を合成する前の前記良品画像の彩度に基づき補正して前記合成画像を生成する構成としてもよい。これにより、本不良品画像生成プログラムによれば、部分画像に対しても、良品画像の彩度が反映された合成画像が生成されるため、より本物に近い不良品画像を生成することができる。 In the defective image generation program, in the second image generation process, the saturation of the image obtained by synthesizing the partial image with the non-defective image is corrected based on the saturation of the non-defective image before synthesizing the partial image. Then, the composite image may be generated. As a result, according to the defective product image generation program, a composite image reflecting the saturation of the non-defective product image is generated even for the partial image, so that a defective product image closer to the real thing can be generated. ..
本発明の良否判定装置は、判定対象製品の撮像画像における不良箇所の有無に基づき前記判定対象製品の良否を判定する良否判定装置であって、上記記載の不良品画像生成プログラムにより生成された前記不良品画像を教師データとして用いて学習させた画像認識モデルに前記判定対象製品の撮像画像を入力して前記判定対象製品の良否を判定する。本良否判定装置によれば、より本物に近い不良品画像に基づき学習した画像認識モデルを用いることにより、判定対象製品が不良品であるか否かを精度よく判定することができる。 The quality determination device of the present invention is a quality determination device that determines the quality of the judgment target product based on the presence or absence of defective parts in the captured image of the judgment target product, and is generated by the defective product image generation program described above. The quality of the judgment target product is judged by inputting the captured image of the judgment target product into the image recognition model trained by using the defective product image as the teacher data. According to the quality determination device, it is possible to accurately determine whether or not the product to be determined is a defective product by using an image recognition model learned based on a defective product image that is closer to the real thing.
なお、本発明の不良品画像生成プログラムは、例えば、不良品画像生成装置、不良品画像生成方法、不良品画像生成プログラムを記録した一時的でない記録媒体等の他の形態で実現することも可能である。 The defective image generation program of the present invention can also be realized in other forms such as a defective image generator, a defective image generation method, and a non-temporary recording medium on which the defective image generation program is recorded. Is.
A.実施形態:
A−1.良品検査システム10の構成:
図1は、本実施形態における良品検査システム10の概略構成を示す説明図である。良品検査システム10は、例えば製造ラインにおける品質検査工程において、順次作製される工業製品(工業部品でもよい)について外観検査を行うことにより、工業製品が良品であるか不良品であるかを判定するためのシステムである。以下の説明では、工業製品は、例えば差動歯車装置に用いられるベベルギヤWであるとする。また、ベベルギヤWの良品とは、ベベルギヤWのうち、ベベルギヤWの機能に影響する特定領域に不良箇所が存在しないものをいい、ベベルギヤWの不良品とは、ベベルギヤWのうち、該特定領域に不良箇所が存在するものをいう。特定領域は、例えば、歯のエッジ部(特に歯先稜線および歯形稜線)やその周辺部(歯先面および歯面))である。不良箇所とは、工業製品における損傷や打痕である。以下、「打痕」を例に挙げて説明する。
A. Embodiment:
A-1. Configuration of non-defective product inspection system 10:
FIG. 1 is an explanatory diagram showing a schematic configuration of a non-defective product inspection system 10 according to the present embodiment. The non-defective product inspection system 10 determines whether an industrial product is a non-defective product or a defective product by performing a visual inspection on industrial products (which may be industrial parts) that are sequentially manufactured, for example, in a quality inspection process on a production line. It is a system for. In the following description, it is assumed that the industrial product is a bevel gear W used in, for example, a differential gear device. Further, a non-defective product of the bevel gear W means a bevel gear W in which there is no defective portion in a specific region affecting the function of the bevel gear W, and a defective product of the bevel gear W is a defective product of the bevel gear W in the specific region of the bevel gear W. It means that there is a defective part. The specific region is, for example, an edge portion of a tooth (particularly a tooth tip ridge line and a tooth profile ridge line) and a peripheral portion thereof (tooth tip surface and tooth surface). A defective part is a damage or a dent in an industrial product. Hereinafter, "dents" will be described as an example.
図1に示すように、良品検査システム10は、撮像部12(例えばデジタルカメラ)と、回転ステージ14と、搬送ロボット16と、画像処理装置100と、良否判定装置200と、を備える。
As shown in FIG. 1, the non-defective product inspection system 10 includes an imaging unit 12 (for example, a digital camera), a rotating stage 14, a
回転ステージ14は、ベベルギヤWが載置されるテーブルが回転可能に支持された構成を備える。撮像部12は、回転ステージ14のテーブル上に載置されたベベルギヤWを例えば側方から撮像可能な位置に配置されている。搬送ロボット16は、製造ラインで順次製造されるベベルギヤWを1つずつ把持して回転ステージ14のテーブル上に載置し、例えば良品と判定されたベベルギヤWと、不良品と判定されたベベルギヤWとを別々の場所に搬送する。なお、撮像部12と回転ステージ14と搬送ロボット16とは、次述する良否判定装置200の制御部210にインターフェース部250を介して通信可能に接続されており、撮像部12と回転ステージ14と搬送ロボット16とのそれぞれの動作は制御部210により制御される。また、画像処理装置100と良否判定装置200とは、互いに通信可能に接続されている。なお、画像処理装置100と良否判定装置200とは、撮像部12と回転ステージ14と搬送ロボット16と同一の製造ラインに設けられる必要はなく、所定のネットワーク(例えばインターネット等の公衆回線や専用回線等)を介して通信可能なクラウド環境下に設けられていてもよい。
The rotary stage 14 has a configuration in which a table on which the bevel gear W is placed is rotatably supported. The
A−1−1.画像処理装置100の構成
画像処理装置100は、制御部110と、記憶部120と、表示部130と、操作入力部140と、インターフェース部150と、を備える。これらの各部は、バス190を介して互いに通信可能に接続されている。
A-1-1. Configuration of
表示部130は、例えば液晶ディスプレイ等により構成され、各種の画像や情報を表示する。操作入力部140は、例えばキーボードやマウス、ボタン、マイク等により構成され、人の操作や指示を受け付ける。なお、本実施形態では、表示部130がタッチパネルを備えることにより、操作入力部140として機能する。また、インターフェース部150は、例えばLANインターフェースやUSBインターフェース等により構成され、有線または無線により他の装置との通信を行う。
The
記憶部120は、例えばROMやRAM、ハードディスクドライブ(HDD)等により構成され、各種のデータ、プログラムやモデルを記憶したり、各種のプログラムやモデルを実行する際の作業領域やデータの一時的な記憶領域として利用されたりする。
The
具体的には、記憶部120には、打痕画像DB121と、良品画像DB122と、不良品画像DB123と、ベースライン画像DB124と、が格納されている。打痕画像DB121には、複数パターンの打痕画像K(図4参照)が記憶されている。打痕画像Kは、実際のベベルギヤWの不良品の撮像画像のうち、打痕を含む部分画像である。本実施形態では、不良品の撮像画像のうち、ベベルギヤWの特定領域を抽出した分割画像である。本実施形態では、複数のベベルギヤWの不良品の撮像画像に基づき、複数パターン(例えば約30個)の打痕画像Kが取得されている。なお、本実施形態では、打痕画像Kは、グレイスケール画像であるものとする。良品画像DB122には、予め撮像されたベベルギヤWの複数パターンの良品の撮像画像(以下、「良品画像GY」という)が記憶されている。不良品画像DB123には、予め撮像されたベベルギヤWの複数パターンの不良品の撮像画像や次述する不良品画像生成PGM131の実行により生成されるベベルギヤWの不良品の画像(以下、「不良品画像GX」という)が順次記憶される。打痕画像Kは、特許請求の範囲における部分画像の一例である。ベースライン画像DB124には、不良品画像生成PGM131の実行過程で生成されるベースライン画像GBが順次記憶される。
Specifically, the
また、記憶部120には、不良品画像生成PGM131が格納されている。不良品画像生成PGM131は、不良品画像GXを生成するための処理を実行するためのコンピュータプログラムである。不良品画像生成PGM131は、ベースライン画像生成PGM133と、画像最適化PGM134とを含む。ベースライン画像生成PGM133は、後述のベースライン画像生成処理(図2参照)を実行するためのコンピュータプログラムであり、画像最適化PGM134は、後述の画像最適化処理(図6参照)を実行するためのコンピュータプログラムである。これらのプログラムは、例えば、CD−ROMやDVD−ROM、USBメモリ等のコンピュータによって読み取り可能な記録媒体(不図示)に格納された状態で提供され、画像処理装置100にインストールすることにより記憶部120に格納される。また、記憶部120には、後述の画像更新モデル141も格納されている。
In addition, the defective product
制御部110は、例えばCPU等により構成され、記憶部120から読み出したコンピュータプログラムを実行することにより、画像処理装置100の動作を制御する。例えば、制御部110は、記憶部120から不良品画像生成PGM131を読み出して実行することにより、後述の不良品画像GXを生成するための処理(ベースライン画像生成処理、画像最適化処理)を実行する。制御部110は、ベースライン画像生成処理を実行する際、第2の取得部113と指定部114と第2の画像生成部115として機能し、画像最適化処理を実行する際、第1の取得部111と第1の画像生成部112として機能する。これら各部の機能については、後述の各種の処理の説明に合わせて説明する。
The
A−1−2.良否判定装置200の構成
良否判定装置200は、制御部210と、記憶部220と、表示部230と、操作入力部240と、インターフェース部250と、を備える。これらの各部は、バス290を介して互いに通信可能に接続されている。
A-1-2. Configuration of Pass /
表示部230は、例えば液晶ディスプレイ等により構成され、各種の画像や情報を表示する。操作入力部240は、例えばキーボードやマウス、ボタン、マイク等により構成され、人の操作や指示を受け付ける。なお、本実施形態では、表示部230がタッチパネルを備えることにより、操作入力部240として機能する。また、インターフェース部250は、例えばLANインターフェースやUSBインターフェース等により構成され、有線または無線により他の装置との通信を行う。
The
記憶部220は、例えばROMやRAM、ハードディスクドライブ(HDD)等により構成され、各種のデータ、プログラムやモデルを記憶したり、各種のプログラムやモデルを実行する際の作業領域やデータの一時的な記憶領域として利用されたりする。
The
具体的には、記憶部220には、良否判定PGM232が格納されている。良否判定PGM232は、ベベルギヤWの撮像画像における不良箇所の有無に基づきベベルギヤWの良否を判定するためのプログラムである。このプログラムは、例えば、CD−ROMやDVD−ROM、USBメモリ等のコンピュータによって読み取り可能な記録媒体(不図示)に格納された状態で提供され、良否判定装置200にインストールすることにより記憶部220に格納される。また、記憶部220には、後述の画像認識モデル242も格納されている。
Specifically, the
制御部210は、例えばCPU等により構成され、記憶部220から読み出したコンピュータプログラムを実行することにより、良否判定装置200の動作を制御する。例えば、制御部210は、記憶部220から良否判定PGM232を読み出して実行することにより、後述の良否判定処理を実行する。このとき、制御部210は、学習部226と判定部227として機能する。これら各部の機能については、後述の処理の説明に合わせて説明する。
The
A−2.不良品画像GXを生成するための処理:
次に、本実施形態の画像処理装置100により実行される不良品画像GXを生成するための各種の処理について説明する。
A-2. Processing to generate defective image GX:
Next, various processes for generating the defective image GX executed by the
A−2−1.ベースライン画像生成処理
図2は、ベースライン画像生成処理の内容を示すフローチャートであり、図3は、マスク画像生成処理の内容を示すフローチャートであり、図4は、ベースライン画像生成処理におけるベベルギヤWの画像の変化を示す説明図である。図5は、彩度調整処理の内容を示すフローチャートである。ベースライン画像生成処理は、良品画像DB122に記憶された良品画像GYに、打痕画像DB121に記憶された打痕画像Kを合成してベースライン画像GBを生成する処理である。
A2-1. Baseline image generation processing FIG. 2 is a flowchart showing the contents of the baseline image generation processing, FIG. 3 is a flowchart showing the contents of the mask image generation processing, and FIG. 4 is a bevel gear W in the baseline image generation processing. It is explanatory drawing which shows the change of the image of. FIG. 5 is a flowchart showing the contents of the saturation adjustment process. The baseline image generation process is a process of synthesizing the dent image K stored in the
ベースライン画像生成処理が開始されると、図2に示すように、第2の取得部113は、良品画像DB122に記憶された複数の良品画像GYの中から、一様乱数によりランダムに1枚の良品画像GY(図4(a)参照)を選択して取得する(S110)。S110の処理は、特許請求の範囲における第2の取得処理の一例である。なお、次のS112以降の処理を、良品画像GYに対して行ってもよいし、良品画像GYのうち、一部をトリミングした加工後の良品画像GYに対して行ってもよい。本実施形態では、図4(a)に示すように、良品画像GYのうち、打痕が存在し得ない周縁部分をトリミングした画像に対してS112以降の処理が行われる。以下、説明の簡略のため、トリミング後の良品画像GYも、単に良品画像GYと呼ぶ。また、良品画像GYは、RGB空間の画像データであるものとする。
When the baseline image generation process is started, as shown in FIG. 2, the second acquisition unit 113 randomly selects one of the plurality of non-defective image GYs stored in the
次に、指定部114は、取得された良品画像GYに対してマスク画像生成処理を行う(S112)。マスク画像生成処理は、ベースライン画像GBを生成する際、良品画像GYのうち、実際に打痕が生じ得ない画像領域(以下、「マスク画像領域」という)への打痕画像Kの配置を回避し、実際に打痕が生じ得る特定画像領域R1に打痕が配置されるようにするための処理である。具体的には、マスク画像生成処理は、良品画像GYのうち、特定画像領域R1を指定するための処理である。S112の処理は、特許請求の範囲における指定処理の一例であり、特定画像領域R1は、上述の特定領域に対応する領域であり、特許請求の範囲における第1の画像領域の一例である。
Next, the
マスク画像生成処理が開始されると、図3に示すように、指定部114は、良品画像GYに対してグレイスケール変換を適用して、グレイスケール画像GY1(図4(b)参照)を生成する(S210)。次に、指定部114は、グレイスケール画像GY1に対して微分フィルタ(例えば一次微分フィルタ)を適用して、ベベルギヤWのエッジ部分(輪郭)が抽出されたエッジ画像GY2(図4(c)参照)を生成する(S212)。次に、指定部114は、エッジ画像GY2に対してメディアンフィルタ(例えばウインドウ5×5)を適用して、ノイズを低減したエッジ画像GY3(図4(d)参照)を生成し(S214)、そのエッジ画像GY3に対して二値化処理(例えば大津の二値化処理)を適用して、二値化画像GY4(図4(e)参照)を生成する(S216)。二値化画像GY4では、主として、ベベルギヤWにおけるエッジ部とその周辺部が白色領域となっており、また、歯底の一部も白色領域になっている。
When the mask image generation process is started, as shown in FIG. 3, the
本実施形態では、さらに、指定部114は、二値化画像GY4に対して、S214の処理時よりも小さいウインドウ(例えば3×3)の収縮処理および平滑化フィルタ(例えばメディアンフィルタ)を、1または複数回適用して、マスク画像GM(図4(g)参照)を生成する(S218)。メディアンフィルタの適用により、二値化画像GY4が平滑化されノイズが除去される。収縮処理の適用により、二値化画像GY4において、エッジ部から離れた孤立領域(例えばベベルギヤWの歯底)におけるノイズが除去される。なお、図4では、二値化画像GY4に対して収縮処理およびメディアンフィルタを1回適用して二値化画像GY5(図4(f)参照)を生成し、さらに、その二値化画像GY5に対して収縮処理およびメディアンフィルタを1回適用してマスク画像GM(図4(g)参照)を得る例が示されている。このように、二値化画像GY4に対して収縮処理およびメディアンフィルタを複数回適用することにより、ノイズをより効果的に除去することができる。ここでいう「ノイズ」とは、特に、ベベルギヤWの歯底に残存する白色領域である。図4(e)〜(g)に示すように、収縮処理およびメディアンフィルタの適用回数に応じて、ベベルギヤWの歯底に残存する白色領域が低減していることが分かる。なお、後述するように、白色領域は、良品画像GYにおける上記特定画像領域R1を指定するための領域である。
In the present embodiment, the
マスク画像生成処理を終了すると、第2の画像生成部115は、良品画像GYのうち、特定画像領域R1を対象とし、特定画像領域R1中の任意の位置に、打痕画像Kを合成してベースライン画像GBを生成する。この処理は、特許請求の範囲における第2の画像生成処理の一例であり、ベースライン画像GBは、特許請求の範囲における合成画像の一例である。
When the mask image generation process is completed, the second
具体的には、図2に示すように、第2の取得部113は、打痕画像DB121に記憶された複数パターンの打痕画像K(図4(l)参照)の中から、一様乱数によりランダムに1または複数のパターンの打痕画像Kを選択して取得する(S114)。次に、第2の画像生成部115は、良品画像GYの特定画像領域R1(マスク画像GMの白色領域に対応する領域)に、一様乱数によりランダムに選択した位置に打痕画像Kを上書きして打痕付画像GD(図4(h)参照)を生成する(S116)。
Specifically, as shown in FIG. 2, the second acquisition unit 113 is a uniform random number from a plurality of patterns of dent images K (see FIG. 4 (l)) stored in the
次に、第2の画像生成部115は、打痕付画像GDに対して彩度調整処理を実行する(S118)。彩度調整処理は、打痕付画像GDにおける打痕画像Kに対して、良品画像GYの彩度を反映させるための処理である。彩度調整処理が開始されると、図5に示すように、第2の画像生成部115は、打痕付画像GDと、打痕画像Kが合成される前の良品画像GYとのそれぞれを、RGB空間の画像から、彩度を調整可能な色空間(例えばHSV空間、HLS空間、L*a*b空間、YCbCr空間、YUV空間など)の画像に変換する(S310)。次に、第2の画像生成部115は、色変換後の打痕付画像GDの彩度を、色変換後の良品画像GYの彩度に基づき補正し(S320)、彩度補正後の打痕付画像GDを、RGB空間の画像に変換し、ベースライン画像GBを生成し(S330)、記憶部120のベースライン画像DB124に記憶し、本ベースライン画像生成処理を終了する。これにより、打痕付画像GDのうち、打痕画像Kの合成部分に対しても、良品画像GYの彩度が反映されたベースライン画像GB(図4(i)参照)が生成される。
Next, the second
A−2−2.画像最適化処理
図6は、画像最適化処理の内容を示すフローチャートであり、図7は、画像更新モデル141の概要を示す説明図である。画像最適化処理は、ベースライン画像生成処理で生成されたベースライン画像GBを、より本物に近い(より自然な)不良品画像に近づけるための処理である。
A-2-2. Image optimization processing FIG. 6 is a flowchart showing the contents of the image optimization processing, and FIG. 7 is an explanatory diagram showing an outline of the
画像最適化処理が開始されると、図6に示すように、第1の取得部111は、ベースライン画像GBとそのベースライン画像GBの元になった良品画像GYとを記憶部120から取得する(S410)。S410の処理は、特許請求の範囲における第1の取得処理の一例である。次に、第1の画像生成部112は、入力画像GSとベースライン画像GBと良品画像GYとに基づき、画像更新モデル141を繰り返し実行して不良品画像GXを生成する(S420)。S420の処理は、特許請求の範囲における第1の画像生成処理の一例である。
When the image optimization process is started, as shown in FIG. 6, the
具体的には、図7に示すように、画像更新モデル141では、入力画像GS(ただし、初回はベースライン画像GB、2回目以降は画像更新モデル141から前回出力された出力画像)と、良品画像GYと、を事前学習済みの畳み込みニューラルネットワークM11に入力し、コンテンツ損失L1を得る(S510)。畳み込みニューラルネットワークM11は、画像の特徴量に基づき画像を分類する学習モデルであり、例えばVGG19モデルである。なお、畳み込みニューラルネットワークM11は、これに限らず、ImageNetで訓練された学習モデルであればよく、例えば、VGG16モデル、AlexNet、ResNet34、ResNet50、InceptionV3等であってもよい。
コンテンツ損失L1は、画像更新モデル141から出力される入力画像GSと良品画像GYとの特徴量の二乗誤差を損失関数としたものであり、例えば、次の式1で示される。
<式1>
コンテンツ損失L1=(1/2)(Fi(GY)−Fi(GS))2
Fi:ImageNetであり、VGG19モデルのi番目のConvLayerの出力である。
コンテンツ損失L1では、良品画像GYを真値としている。このため、コンテンツ損失L1を最小化することは、良品画像GYの特徴に近づくように入力画像GSが更新されることを意味する。なお、「入力画像GSが更新される」とは、入力画像GSの画素値が更新されることを意味する(以下、同じ)。コンテンツ損失L1は、特許請求の範囲における第1の損失関数の一例である。
Specifically, as shown in FIG. 7, in the
The content loss L1 is a loss function obtained by using the squared error of the feature amount between the input image GS and the non-defective image GY output from the
<Equation 1>
Content loss L1 = (1/2) (F i (GY) -F i (GS)) 2
F i: a ImageNet, which is the output of the i-th ConvLayer of VGG19 model.
In the content loss L1, the non-defective image GY is set as the true value. Therefore, minimizing the content loss L1 means that the input image GS is updated so as to approach the characteristics of the non-defective image GY. In addition, "the input image GS is updated" means that the pixel value of the input image GS is updated (hereinafter, the same applies). The content loss L1 is an example of the first loss function in the claims.
また、画像更新モデルでは、入力画像GSとベースライン画像GBとをラプラシアンフィルタM12に入力し、ラプラシアン損失L2を得る(S520)。ラプラシアン損失L2は、ラプラシアンフィルタM12から出力される入力画像GSとベースライン画像GBとの二乗誤差を損失関数としたものであり、例えば、次の式2で示される。
<式2>
ラプラシアン損失L2=(1/2)(L(GB)−L(GS))2
L:ラプラシアンフィルタM12の出力である。
ラプラシアンフィルタM12は、画像のエッジを抽出するフィルタであり、ラプラシアン損失L2では、ベースライン画像GBを真値としている。このため、ラプラシアン損失L2を最小化することは、ベースライン画像GBの特徴(特に打痕画像Kの輪郭)に近づくように入力画像GSが更新されることを意味する。ラプラシアン損失L2は、特許請求の範囲における第2の損失関数の一例である。
Further, in the image update model, the input image GS and the baseline image GB are input to the Laplacian filter M12 to obtain the Laplacian loss L2 (S520). The Laplacian loss L2 uses the squared error between the input image GS output from the Laplacian filter M12 and the baseline image GB as a loss function, and is represented by, for example, the following equation 2.
<Equation 2>
Laplacian loss L2 = (1/2) (L (GB) -L (GS)) 2
L: This is the output of the Laplacian filter M12.
The Laplacian filter M12 is a filter that extracts edges of an image, and the Laplacian loss L2 has the baseline image GB as a true value. Therefore, minimizing the Laplacian loss L2 means that the input image GS is updated so as to approach the characteristics of the baseline image GB (particularly the contour of the dent image K). The Laplacian loss L2 is an example of a second loss function in the claims.
さらに、画像更新モデル141では、入力画像GSを、打痕分類モデルM13に入力し、打痕判定損失L3を得る(S530)。打痕分類モデルM13は、事前学習済みの畳み込みニューラルネットワークを分類器として利用するものであり、上述したベベルギヤWの複数の分割画像に対して転移学習を行うことより、画像中の打痕の有無を判別するモデルであり、例えばResNet50である。なお、打痕分類モデルM13は、これに限らず、ImageNetで訓練された学習モデルであればよく、例えば、VGG16モデル、VGG19モデル、AlexNet、ResNet34、InceptionV3等であってもよい。打痕判定損失L3は、次の式3で示される。
<式3>
打痕判定損失L3=(1/2)(1−cnn(GS))2
cnn:打痕の有無を判定する打痕分類モデルであり、打痕無しの画像に対して「0」を出力し、打痕有りの画像に対して「1」を出力する。
打痕判定損失L3では、「1」を真値としている。このため、打痕判定損失L3を最小化することは、打痕分類モデルが打痕有りと判定する方向に入力画像GSが更新されることを意味する。打痕分類モデルM13は、特許請求の範囲における不良判定モデルの一例であり、打痕判定損失L3は、特許請求の範囲における第3の損失関数の一例である。
Further, in the
<Equation 3>
Dust determination loss L3 = (1/2) (1-cnn (GS)) 2
cnn: A dent classification model for determining the presence or absence of dents, which outputs "0" for an image without dents and outputs "1" for an image with dents.
In the dent determination loss L3, "1" is set as the true value. Therefore, minimizing the dent determination loss L3 means that the input image GS is updated in the direction in which the dent classification model determines that there is a dent. The dent classification model M13 is an example of a defect determination model in the claims, and the dent determination loss L3 is an example of a third loss function in the claims.
次に、画像更新モデル141では、得られたコンテンツ損失L1とラプラシアン損失L2と打痕判定損失L3とを合算した合算損失(=α・L1+β・L2+γ・L3)を算出し(S540)、合算損失が最小になるように入力画像GSを更新して出力画像を出力する(S550)。なお、合算損失の定数項(α,β,γ)は、適宜変更可能である。
Next, in the
次に、第1の画像生成部112は、出力画像が所定の最適条件を満たすか否かを判断する(S430)。最適条件は、例えば、エポック数が所定値(例えば20)に達したことである。なお、最適条件は、これに限らず、例えば、上記合算損失が所定値以下になったことであってもよい。第1の画像生成部112は、出力画像が最適条件を満たさないと判断した場合(S430:NO)、その出力画像を入力画像GSとして設定し(S440)、S420に戻って再び画像更新モデル141の実行を繰り返す。一方、第1の画像生成部112は、出力画像が最適条件を満たすと判断した場合(S430:YES)、精度の高い不良品画像GXが生成されたとして、直近の出力画像を不良品画像GXとして記憶部120の不良品画像DB123に記憶し(S450)、本画像最適化処理を終了する。
Next, the first image generation unit 112 determines whether or not the output image satisfies a predetermined optimum condition (S430). The optimum condition is, for example, that the number of epochs has reached a predetermined value (for example, 20). The optimum condition is not limited to this, and may be, for example, that the total loss is equal to or less than a predetermined value. When the first image generation unit 112 determines that the output image does not satisfy the optimum conditions (S430: NO), sets the output image as the input image GS (S440), returns to S420, and
A−2−3.評価結果
本実施形態では、ベースライン画像GBと不良品画像GXとのそれぞれについて、FID(Frechet Inception Distance)スコアを用いて、本物の打痕画像(例えば1000枚)との比較による評価を行った。FIDスコアは、2つの画像データセットに対して、ImageNet学習済みのInceptionV3モデルに画像を入力して得られる特徴表現の平均と分散の距離を評価する尺度である。FIDスコアは、以下に式4により定義される。
<式4>
d2=|m1−m2|2+Tr(C1+C2−2(C1C2)1/2)
m1:画像データセット1をInceptionV3モデルに入力したときのモデルの最後の平均プーリング層の出力である。
m2:画像データセット2をInceptionV3モデルに入力したときのモデルの最後の平均プーリング層の出力である。
Tr:行列のトレースである。
C1:画像データセット1を入力としたInceptionV3モデルの出力2048次元ベクトルに対する共分散行列である。
C2:画像データセット2を入力としたInceptionV3モデルの出力2048次元ベクトルに対する共分散行列である。
A-2-3. Evaluation Results In the present embodiment, each of the baseline image GB and the defective image GX was evaluated by comparison with a real dent image (for example, 1000 images) using a FID (Frechet Information Distance) score. .. The FID score is a measure for evaluating the distance between the mean and variance of the feature expression obtained by inputting an image into an ImageNet trained Inception V3 model for two image data sets. The FID score is defined below by Equation 4.
<Equation 4>
d 2 = | m 1 -m 2 | 2 + Tr (C 1 + C 2 -2 (C 1 C 2) 1/2)
m 1 : Output of the last average pooling layer of the model when the image data set 1 is input to the InputV3 model.
m 2 : Output of the last average pooling layer of the model when the image data set 2 is input to the InputV3 model.
Tr: Matrix trace.
C 1 : A covariance matrix for the output 2048-dimensional vector of the InputV3 model with the image data set 1 as the input.
C 2 : A covariance matrix for the output 2048-dimensional vector of the InputV3 model with the image data set 2 as the input.
図8は、FIDスコアによる各画像の評価結果を示す説明図である。図8中の不良品画像GX(打痕判定モデル無し)は、上記画像最適化処理(図6)のS420において、合算損失に打痕判定損失L3を合算せず、コンテンツ損失L1とラプラシアン損失L2とのみを合算して生成された不良品画像GXを意味し、不良品画像GX(打痕判定モデル有り)は、合算損失にコンテンツ損失L1とラプラシアン損失L2と打痕判定損失L3とを合算して生成された不良品画像GXを意味する。図8に示すように、不良品画像GX(打痕判定モデル無し)では、ベースライン画像GBに比べて、本物の打痕画像に近い評価結果となっており、不良品画像GX(打痕判定モデル有り)では、不良品画像GX(打痕判定モデル無し)に比べて、本物の打痕画像にさらに近い評価結果となった。 FIG. 8 is an explanatory diagram showing the evaluation results of each image based on the FID score. The defective image GX in FIG. 8 (without the dent determination model) does not add the dent determination loss L3 to the total loss in S420 of the image optimization process (FIG. 6), and the content loss L1 and the Laplacian loss L2. It means the defective image GX generated by summing only with, and the defective image GX (with a dent judgment model) is the sum of the content loss L1, the Laplacian loss L2, and the dent judgment loss L3. It means the defective product image GX generated in the above. As shown in FIG. 8, the defective product image GX (without the dent determination model) has an evaluation result closer to the real dent image than the baseline image GB, and the defective product image GX (dent determination). In the case of (with model), the evaluation result was closer to that of the real dent image as compared with the defective image GX (without the dent determination model).
A−3.ベベルギヤWの良否を判定するための処理:
次に、本実施形態の良否判定装置200により実行されるベベルギヤWの良否を判定するための処理について説明する。この処理は、機械学習により画像を認識する画像認識モデル242を用いて、ベベルギヤWの撮像画像における不良箇所の有無に基づきベベルギヤWの良否を判定するための処理である。
A-3. Process for determining the quality of the bevel gear W:
Next, a process for determining the quality of the bevel gear W executed by the
上述した不良品画像GXを生成するための処理により、機械学習に十分な量の不良品画像GXが記憶部120の不良品画像DB123に記憶されると、良否判定装置200の学習部226は、画像処理装置100の良品画像DB122に記憶された複数パターンの良品画像GYと、不良品画像DB123に記憶された複数パターンの不良品画像GXとを、教師データとして用いて、ベベルギヤWの良否を判定するための機械学習を行って画像認識モデル242を生成または更新する。画像認識モデル242は、予め用意したモデル式の重み係数等を制御することにより生成できるが、画像認識モデル242を生成するのに用いる具体的なモデル式については限定されず、任意のモデル式を適用可能である。
When the defective product image GX in a sufficient amount for machine learning is stored in the defective
良否判定処理が開始されると、判定部227は、回転ステージ14のテーブルを回転させつつ、撮像部12にテーブル上に載置されたベベルギヤWの全周を撮像させる。これにより、1つのベベルギヤWの互いに異なる角度が撮像された複数の撮像画像が生成される。具体的には、1つのベベルギヤWについて例えば36枚の撮像画像を生成し、各撮像画像を例えば8分割して、計36×8=288個の判定対象データを生成する。次に、判定部227は、判定対象データごとに、画像認識モデル242を用いて良否(不良箇所の有無)を判定する。すなわち、1つのベベルギヤWについて、288種類の判定対象データに対する良否判定を行うことになる。なお、1つのベベルギヤW当たりの判定対象データの数は任意である。
When the quality determination process is started, the
A−4.本実施形態の効果:
以上説明したように、本実施形態の不良品画像生成PGM131では、画像最適化処理において、画像更新モデル141が用いられる(図6のS420)。画像更新モデル141は、コンテンツ損失L1とラプラシアン損失L2とを合算した合算損失が最小になるように入力画像GSを更新して出力するモデルである(図7参照)。ここで、コンテンツ損失L1は、畳み込みニューラルネットワークM11により得られる入力画像GSと良品画像GYとの誤差であり、コンテンツ損失L1が最小になるように入力画像GSを更新することは、良品画像GYの特徴に近づくように入力画像GSが更新されることを意味する。ラプラシアン損失L2は、エッジ抽出用フィルタ(ラプラシアンフィルタM12)により得られる入力画像GSとベースライン画像GBとの誤差であり、ラプラシアン損失L2が最小になるように入力画像GSを更新することは、ベースライン画像GBの特徴(不良箇所)に近づくように入力画像GSが更新されることを意味する。したがって、合算損失が最小になるように入力画像GSを更新することは、ベースライン画像GBの不良箇所の特徴を保ちつつ、良品画像GYの特徴に近づくように入力画像GSが更新されることを意味する。これにより、本実施形態によれば、良品画像GYと打痕画像Kとから、より本物に近い不良品画像GXを生成することができる。
A-4. Effect of this embodiment:
As described above, in the defective image generation PGM131 of the present embodiment, the
本実施形態では、画像最適化処理において、入力画像GSが打痕分類モデルM13に入力され、合算損失が最小になり、かつ、打痕分類モデルM13にて不良箇所有りと判定されるように入力画像GSが更新される(図7参照)。これにより、本実施形態によれば、打痕分類モデルM13を用いない場合に比べて、より本物に近い不良品画像GXを生成することができる。 In the present embodiment, in the image optimization process, the input image GS is input to the dent classification model M13 so that the total loss is minimized and the dent classification model M13 determines that there is a defective portion. The image GS is updated (see FIG. 7). As a result, according to the present embodiment, it is possible to generate a defective image GX that is closer to the real thing than when the dent classification model M13 is not used.
本実施形態では、ベースライン画像生成処理において、良品画像GYのうち、予め指定された特定画像領域R1を対象に打痕画像Kが合成される(図2のS116)。これにより、不良箇所が不自然な位置に配置されたベースライン画像GBの生成が抑制され、より本物に近い不良品画像GXを生成することができる。ここで、NST(Neural Style Transfer)技術を用いて、良品画像をコンテンツ画像とし、不良箇所を含む画像をスタイル画像として画風変換を行って不良品画像を生成する方法が考えられる。しかし、このNST技術を用いる方法では、不良箇所の位置が全体としての画風に応じて変換されるため、不良品画像における不良箇所の位置を制御することができない。その結果、例えば不良箇所が存在し得ない位置に配置されるなど、不自然な不良品画像が生成される可能性が高い。これに対して、本実施形態では、予め特定画像領域R1を指定することにより、不良品画像GXにおける不良箇所の位置を制御することができる。このため、より本物に近い不良品画像GXを生成することができる。 In the present embodiment, in the baseline image generation process, the dent image K is synthesized with respect to the specific image region R1 designated in advance among the non-defective image GY (S116 in FIG. 2). As a result, the generation of the baseline image GB in which the defective portion is arranged at an unnatural position is suppressed, and the defective product image GX closer to the real thing can be generated. Here, a method is conceivable in which a non-defective product image is used as a content image and an image including a defective portion is used as a style image to perform style conversion to generate a defective product image by using NST (Neural Style Transfer) technology. However, in the method using this NST technique, the position of the defective portion is converted according to the overall style of painting, so that the position of the defective portion in the defective product image cannot be controlled. As a result, there is a high possibility that an unnatural defective product image is generated, for example, the defective portion is arranged at a position where it cannot exist. On the other hand, in the present embodiment, the position of the defective portion in the defective product image GX can be controlled by designating the specific image area R1 in advance. Therefore, it is possible to generate a defective image GX that is closer to the real thing.
また、本実施形態では、特にエッジ部とその周辺部(以下、「エッジ部等」という)に不良箇所が存在するベースライン画像GBが生成される。エッジ部等に存在する不良箇所は、特に、互いに噛み合う他の歯車との接触により異音を発する等、歯車の機能に影響しやすい。そこで、本実施形態では、特定画像領域R1を歯のエッジ部等とすることにより、より有用な不良品画像GXを精度良く生成することができる。 Further, in the present embodiment, a baseline image GB in which a defective portion exists particularly in an edge portion and a peripheral portion thereof (hereinafter, referred to as “edge portion or the like”) is generated. Defective parts existing on the edge portion and the like are likely to affect the function of the gears, such as making an abnormal noise due to contact with other gears that mesh with each other. Therefore, in the present embodiment, by setting the specific image region R1 as the edge portion of the tooth or the like, a more useful defective image GX can be generated with high accuracy.
また、本実施形態では、不良箇所が歯底だけに存在するベースライン画像GBが生成されにくい。歯車における歯底は、互いに噛み合う他の歯車と接触せず、仮に歯底に不良箇所が存在しても歯車の機能に影響しない可能性が高い。そこで、本実施形態では、特定画像領域R1を歯車の歯底とは異なる領域とすることにより、より有用な不良品画像GXを精度良く生成することができる。 Further, in the present embodiment, it is difficult to generate the baseline image GB in which the defective portion exists only in the tooth bottom. The tooth bottom of the gear does not come into contact with other gears that mesh with each other, and even if there is a defective portion on the tooth bottom, there is a high possibility that the function of the gear will not be affected. Therefore, in the present embodiment, by setting the specific image region R1 to a region different from the tooth bottom of the gear, a more useful defective image GX can be generated with high accuracy.
本実施形態では、マスク画像生成処理(図2および図3参照)において、良品画像GYに対するエッジ抽出処理(図3のS212)により抽出されたエッジ部の位置に基づき特定画像領域R1が指定される。これにより、良品画像GYから抽出されるエッジ部の位置に基づき特定画像領域R1を自動で指定することができる。 In the present embodiment, in the mask image generation process (see FIGS. 2 and 3), the specific image area R1 is designated based on the position of the edge portion extracted by the edge extraction process (S212 in FIG. 3) for the non-defective image GY. .. Thereby, the specific image area R1 can be automatically specified based on the position of the edge portion extracted from the non-defective image GY.
本実施形態では、彩度調整処理(図5参照)において、良品画像GYに打痕画像Kを合成した画像の彩度を、打痕画像Kを合成する前の良品画像GYの彩度に基づき補正してベースライン画像GBが生成される。これにより、打痕画像Kに対しても、良品画像GYの彩度が反映されたベースライン画像GBが生成されるため、より本物に近い不良品画像GXを生成することができる。 In the present embodiment, in the saturation adjustment process (see FIG. 5), the saturation of the image obtained by synthesizing the dent image K with the good image GY is based on the saturation of the good image GY before synthesizing the dent image K. The baseline image GB is generated after correction. As a result, the baseline image GB that reflects the saturation of the non-defective image GY is generated for the dent image K as well, so that the defective image GX that is closer to the real thing can be generated.
本実施形態の良否判定装置200では、上述した不良品画像GXを教師データとして用いて学習させた画像認識モデル242に、判定対象製品(ベベルギヤW)の撮像画像を入力して良否が判定される。これにより、より本物に近い不良品画像GXに基づき学習した画像認識モデル242を用いることにより、判定対象製品が不良品であるか否かを精度よく判定することができる。
In the
B.変形例:
本発明は、上述の実施形態に限られるものではなく、その要旨を逸脱しない範囲において種々の形態に変形することができ、例えば次のような変形も可能である。
B. Modification example:
The present invention is not limited to the above-described embodiment, and can be transformed into various forms without departing from the gist thereof. For example, the following modifications are also possible.
上記実施形態における良品検査システム10の構成は、あくまで一例であり、種々変形可能である。例えば画像処理装置100の記憶部120の少なくとも一部および良否判定装置200の記憶部220の少なくとも一部は、外部装置(例えばクラウドサーバ等)に記憶された構成であってもよい。また、撮像部12と回転ステージ14と搬送ロボット16とのそれぞれの動作を、良否判定装置200ではなく、専用の制御装置(プログラマブルロジックコントローラ等)により制御するとしてもよい。
The configuration of the non-defective product inspection system 10 in the above embodiment is merely an example and can be variously modified. For example, at least a part of the
上記実施形態では、工業製品として、ベベルギヤWを例示したが、他の歯車(例えばヘルカルギヤ等)でもよく、また、歯車以外の工業製品(シャフトやねじ等)でもよい。工業製品は、例えば、金型で金属材料等をプレスした鍛造物や金型に金属材料等を流し込んで成形した鋳造物等であり、形状やサイズ、材料なども任意であり、金属だけでなく、樹脂等で形成されたものでもよい。 In the above embodiment, the bevel gear W is exemplified as an industrial product, but other gears (for example, a helical gear or the like) may be used, or an industrial product other than the gear (such as a shaft or a screw) may be used. Industrial products are, for example, forged products obtained by pressing a metal material or the like with a mold or castings formed by pouring a metal material or the like into a mold, and the shape, size, material, etc. are arbitrary, and not only metal but also metal. , Resin or the like may be used.
上記実施形態における各種の処理の内容は、あくまで一例であり、種々変形可能である。例えば、ベースライン画像生成処理において、打痕画像DB121に記憶された打痕画像Kは、良品画像GYと同じ色空間(RGB色空間)の画像データであってもよい。また、良品画像GYは、RGB空間以外の色空間の画像データであってもよい。また、ベースライン画像生成処理のS110において、予め定められた順番で選択された良品画像GYが取得されるとしてもよいし、一の良品画像GYを常に取得するとしてもよい。また、S114において、予め定められた順番で選択された打痕画像Kが取得されるとしてもよいし、一の打痕画像Kを常に取得するとしてもよい。
The contents of various processes in the above embodiment are merely examples and can be variously modified. For example, in the baseline image generation process, the dent image K stored in the
ベースライン画像生成処理において、マスク画像生成処理(S112)と彩度調整処理(S118)の少なくとも1つを実行しないとしてもよいし、外部装置に実行させて結果を画像処理装置100が受信するとしてもよい。ベースライン画像生成処理において、特定画像領域R1を人の入力操作により指定するとしてもよい。マスク画像生成処理において、S214からS218の処理の少なくとも1つを実行しないとしてもよい。
In the baseline image generation process, at least one of the mask image generation process (S112) and the saturation adjustment process (S118) may not be executed, or an external device may execute the result and the
画像最適化処理において、画像更新モデル141による実行処理の少なくとも一部を外部装置に実行させて結果を良否判定装置200が受信するとしてもよい。
In the image optimization process, at least a part of the execution process by the
ベベルギヤWの良否を判定するための処理において、画像認識モデル242を生成または更新する処理の少なくとも一部を外部装置に実行させて結果を良否判定装置200が受信するとしてもよい。
In the process for determining the quality of the bevel gear W, the
上記実施形態において、ハードウェアによって実現されている構成の一部をソフトウェアに置き換えるようにしてもよく、反対に、ソフトウェアによって実現されている構成の一部をハードウェアに置き換えるようにしてもよい。 In the above embodiment, a part of the configuration realized by the hardware may be replaced with software, and conversely, a part of the configuration realized by the software may be replaced with hardware.
100:画像処理装置 110,210:制御部(コンピュータ) 111:第1の取得部 112:第1の画像生成部 113:第2の取得部 114:指定部 115:第2の画像生成部 131:不良品画像生成プログラム 141:画像更新モデル 200:良否判定装置 227:判定部 242:画像認識モデル GB:ベースライン画像(合成画像) GS:入力画像 GX:不良品画像 GY:良品画像 K:打痕画像(部分画像) L1:コンテンツ損失(第1の損失関数) L2:ラプラシアン損失(第2の損失関数) M11:畳み込みニューラルネットワーク M12:ラプラシアンフィルタ(エッジ抽出用フィルタ) M13:打痕分類モデル(不良判定モデル) R1:特定画像領域(第1の画像領域) W:ベベルギヤ(工業製品、判定対象製品)
100:
Claims (8)
コンピュータに、
前記工業製品の良品画像と、前記不良箇所を含む部分画像を前記良品画像に合成した合成画像と、を取得する第1の取得処理と、
入力画像と前記良品画像と前記合成画像とに基づき、画像更新モデルを繰り返し実行して前記不良品画像を生成する第1の画像生成処理と、を実行させ、
前記画像更新モデルは、
前記入力画像(ただし、初回は前記合成画像、2回目以降は前記画像更新モデルから前回出力された出力画像)と、前記良品画像と、を事前学習済みの畳み込みニューラルネットワークに入力し、
前記入力画像と、前記合成画像と、をエッジ抽出用フィルタに入力し、
前記畳み込みニューラルネットワークにより得られる第1の損失関数と、前記エッジ抽出用フィルタにより得られる第2の損失関数と、を合算した合算損失が最小になるように前記入力画像を更新して出力するモデルである、
不良品画像生成プログラム。 It is a defective product image generation program that generates a defective product image of an industrial product that is determined to be a defective product due to the presence of defective parts.
On the computer
A first acquisition process for acquiring a non-defective image of the industrial product and a composite image obtained by synthesizing a partial image including the defective portion with the non-defective image.
Based on the input image, the non-defective product image, and the composite image, the image update model is repeatedly executed to execute the first image generation process for generating the defective product image.
The image update model is
The input image (however, the first time is the composite image, the second and subsequent times is the output image previously output from the image update model) and the non-defective image are input to the pre-trained convolutional neural network.
The input image and the composite image are input to the edge extraction filter, and the input image is input to the edge extraction filter.
A model in which the input image is updated and output so that the total loss obtained by adding the first loss function obtained by the convolutional neural network and the second loss function obtained by the edge extraction filter is minimized. Is,
Defective product image generation program.
前記画像更新モデルは、
さらに、前記入力画像を、画像中における不良箇所の有無を判定する不良判定モデルに入力し、
前記第1の損失関数および前記第2の損失関数に、さらに、前記不良判定モデルにより得られる第3の損失関数を合算して前記合算損失とする、
不良品画像生成プログラム。 The defective image generation program according to claim 1.
The image update model is
Further, the input image is input to a defect determination model for determining the presence or absence of a defective portion in the image, and the input image is input to the defect determination model.
The first loss function and the second loss function are further added to the third loss function obtained by the defect determination model to obtain the total loss.
Defective product image generation program.
前記コンピュータに、
前記工業製品の良品画像と、前記工業製品における前記不良箇所を含む部分画像と、を取得する第2の取得処理と、
前記工業製品の良品画像の一部である第1の画像領域を指定する指定処理と、
前記良品画像のうち、前記第1の画像領域を対象とし、前記第1の画像領域中の任意の位置に、前記部分画像を合成して前記合成画像を生成する第2の画像生成処理と、
を実行させる、不良品画像生成プログラム。 The defective image generation program according to claim 1 or 2.
On the computer
A second acquisition process for acquiring a non-defective image of the industrial product and a partial image including the defective portion of the industrial product.
A designation process for designating a first image area that is a part of a non-defective image of the industrial product, and
A second image generation process of targeting the first image region of the non-defective image and synthesizing the partial image at an arbitrary position in the first image region to generate the composite image.
Defective product image generation program to execute.
前記工業製品は歯車であり、
前記第1の画像領域は、前記歯車における歯のエッジ部と前記エッジ部の周辺部である、
不良品画像生成プログラム。 The defective image generation program according to claim 3.
The industrial product is a gear
The first image region is an edge portion of a tooth in the gear and a peripheral portion of the edge portion.
Defective product image generation program.
前記工業製品は歯車であり、
前記第1の画像領域は、前記歯車における歯底とは異なる領域である、
不良品画像生成プログラム。 The defective image generation program according to claim 3 or 4.
The industrial product is a gear
The first image region is a region different from the tooth bottom in the gear.
Defective product image generation program.
前記指定処理では、前記良品画像に対するエッジ抽出処理により抽出されたエッジ部の位置に基づき前記第1の画像領域を指定する、
不良品画像生成プログラム。 The defective image generation program according to claim 4 or 5.
In the designation process, the first image area is designated based on the position of the edge portion extracted by the edge extraction process on the non-defective image.
Defective product image generation program.
前記第2の画像生成処理では、前記良品画像に前記部分画像を合成した画像の彩度を、前記部分画像を合成する前の前記良品画像の彩度に基づき補正して前記合成画像を生成する、
不良品画像生成プログラム。 The defective product image generation program according to any one of claims 3 to 6.
In the second image generation process, the saturation of the image obtained by synthesizing the partial image with the good product image is corrected based on the saturation of the good product image before synthesizing the partial image to generate the composite image. ,
Defective product image generation program.
請求項1から請求項7までのいずれか一項に記載の不良品画像生成プログラムにより生成された前記不良品画像を教師データとして用いて学習させた画像認識モデルに前記判定対象製品の撮像画像を入力して前記判定対象製品の良否を判定する、
良否判定装置。 It is a quality judgment device that judges the quality of the judgment target product based on the presence or absence of defective parts in the captured image of the judgment target product.
The captured image of the product to be determined is applied to an image recognition model trained by using the defective image generated by the defective image generation program according to any one of claims 1 to 7 as teacher data. Input to judge the quality of the product to be judged.
Pass / fail judgment device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020033423A JP2021135903A (en) | 2020-02-28 | 2020-02-28 | Defective product image generation program and quality determination device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020033423A JP2021135903A (en) | 2020-02-28 | 2020-02-28 | Defective product image generation program and quality determination device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2021135903A true JP2021135903A (en) | 2021-09-13 |
Family
ID=77661387
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2020033423A Pending JP2021135903A (en) | 2020-02-28 | 2020-02-28 | Defective product image generation program and quality determination device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2021135903A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113916899A (en) * | 2021-10-11 | 2022-01-11 | 四川科伦药业股份有限公司 | Method, system and device for detecting large soft infusion bag product based on visual identification |
WO2023100336A1 (en) * | 2021-12-02 | 2023-06-08 | 日本電信電話株式会社 | Learning model construction device, estimation device, learning model construction method, estimation method, and program |
CN116481461A (en) * | 2022-11-24 | 2023-07-25 | 广州帕卡汽车零部件有限公司 | Method for detecting roughness of hole forming and notch of sound and heat insulation spare and accessory parts of automobile |
WO2023182794A1 (en) * | 2022-03-23 | 2023-09-28 | 주식회사 엘지경영개발원 | Memory-based vision testing device for maintaining testing performance, and method therefor |
-
2020
- 2020-02-28 JP JP2020033423A patent/JP2021135903A/en active Pending
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113916899A (en) * | 2021-10-11 | 2022-01-11 | 四川科伦药业股份有限公司 | Method, system and device for detecting large soft infusion bag product based on visual identification |
CN113916899B (en) * | 2021-10-11 | 2024-04-19 | 四川科伦药业股份有限公司 | Method, system and device for detecting large transfusion soft bag product based on visual identification |
WO2023100336A1 (en) * | 2021-12-02 | 2023-06-08 | 日本電信電話株式会社 | Learning model construction device, estimation device, learning model construction method, estimation method, and program |
WO2023182794A1 (en) * | 2022-03-23 | 2023-09-28 | 주식회사 엘지경영개발원 | Memory-based vision testing device for maintaining testing performance, and method therefor |
CN116481461A (en) * | 2022-11-24 | 2023-07-25 | 广州帕卡汽车零部件有限公司 | Method for detecting roughness of hole forming and notch of sound and heat insulation spare and accessory parts of automobile |
CN116481461B (en) * | 2022-11-24 | 2023-09-22 | 广州帕卡汽车零部件有限公司 | Method for detecting roughness of hole forming and notch of sound and heat insulation spare and accessory parts of automobile |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2021135903A (en) | Defective product image generation program and quality determination device | |
WO2020048271A1 (en) | Gan network-based vehicle damage image enhancement method and apparatus | |
CA3114650C (en) | Method and apparatus for generating three-dimensional model, device, and storage medium | |
KR100532635B1 (en) | Image processing method for appearance inspection | |
JP5144506B2 (en) | Determination method of skeletal maturity | |
JP6786497B2 (en) | Systems and methods for adding surface details to digital crown models formed using statistical techniques | |
JP6972047B2 (en) | Machining condition analysis device, laser machining device, laser machining system and machining condition analysis method | |
CN110689524B (en) | No-reference online image definition evaluation method and system | |
CN113436734B (en) | Tooth health assessment method, equipment and storage medium based on face structure positioning | |
CN109239082A (en) | Tobacco structure quality online test method and system based on machine vision technique | |
US20220222910A1 (en) | Method for generating a model of a dental arch | |
CN107590512A (en) | The adaptive approach and system of parameter in a kind of template matches | |
CN112884669A (en) | Image restoration method based on multi-scale content attention mechanism, storage medium and terminal | |
Marzan et al. | Automated tobacco grading using image processing techniques and a convolutional neural network | |
CN113012093A (en) | Training method and training system for glaucoma image feature extraction | |
CN115641323A (en) | Method and device for automatically labeling medical images | |
CN111383759A (en) | Automatic pneumonia diagnosis system | |
CN111814852A (en) | Image detection method, image detection device, electronic equipment and computer-readable storage medium | |
Kanca et al. | Learning hand-crafted features for k-NN based skin disease classification | |
CN113140309A (en) | Traditional Chinese medicine complexion diagnosis method and device | |
JP7240199B2 (en) | Parameter determination method, parameter determination device, and program | |
CN111968087A (en) | Plant disease area detection method | |
US20220122244A1 (en) | Defect image generation method for deep learning and system therefor | |
JP2022155038A (en) | Appearance determination apparatus, appearance determination method, and program | |
JP2022147713A (en) | Image generation device, learning device, and image generation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20200310 |
|
A80 | Written request to apply exceptions to lack of novelty of invention |
Free format text: JAPANESE INTERMEDIATE CODE: A80 Effective date: 20200323 |