JP2021135903A - Defective product image generation program and quality determination device - Google Patents

Defective product image generation program and quality determination device Download PDF

Info

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
Application number
JP2020033423A
Other languages
Japanese (ja)
Inventor
清悟 福井
Seigo Fukui
清悟 福井
宗太 村田
Sota Murata
宗太 村田
圭佑 藤田
Keisuke Fujita
圭佑 藤田
文久 神谷
Fumihisa KAMIYA
文久 神谷
裕希 山口
Hiroki Yamaguchi
裕希 山口
雅樹 青野
Masaki Aono
雅樹 青野
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.)
Toyohashi University of Technology NUC
Musashi Seimitsu Industry Co Ltd
Original Assignee
Toyohashi University of Technology NUC
Musashi Seimitsu Industry Co Ltd
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 Toyohashi University of Technology NUC, Musashi Seimitsu Industry Co Ltd filed Critical Toyohashi University of Technology NUC
Priority to JP2020033423A priority Critical patent/JP2021135903A/en
Publication of JP2021135903A publication Critical patent/JP2021135903A/en
Pending legal-status Critical Current

Links

Images

Abstract

To generate a defective product image that is closer to a real article from a non-defective product image and a partial image including a defective portion.SOLUTION: A defective product image generation program causes a computer to execute: first acquisition processing of acquiring a non-defective product image of an industrial product and a composite image obtained by combining a partial image including a defective portion with the non-defective product image; and first image generation processing of generating a defective product image by repeatedly executing an image updating model on the basis of the input image, the non-defective product image and the composite image. The image updating model inputs the input image (the composite image in the first time, the output image that is output in the previous time from the image updating model in the second or subsequent time) and the non-defective product image to a convolution neural network that has been learned in advance, inputs the input image and the composite image to an edge extraction filter, and updates and outputs the input image so as to minimize the totalized loss obtained by totalizing the first loss function obtained with the convolution neural network and the second loss function obtained with the edge extraction filter.SELECTED DRAWING: Figure 7

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.

特開平5−149728号公報Japanese Unexamined Patent Publication No. 5-149728

上述した人為的な編集により不良品画像を生成する従来の技術では、人為的に編集して不良品画像を生成するため、不自然な不良品画像が生成されたりする、という課題がある。 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.

本実施形態における良品検査システム10の概略構成を示す説明図Explanatory drawing which shows the schematic structure of the non-defective product inspection system 10 in this embodiment. ベースライン画像生成処理の内容を示すフローチャートFlowchart showing the contents of the baseline image generation process マスク画像生成処理の内容を示すフローチャートFlowchart showing the contents of mask image generation processing ベースライン画像生成処理におけるベベルギヤWの画像の変化を示す説明図Explanatory drawing which shows the change of the image of the bevel gear W in the baseline image generation processing. 彩度調整処理の内容を示すフローチャートFlowchart showing the contents of the saturation adjustment process 画像最適化処理の内容を示すフローチャートFlowchart showing the contents of image optimization processing 画像更新モデル141の概要を示す説明図Explanatory drawing which shows the outline of image update model 141 FIDスコアによる各画像の評価結果を示す説明図Explanatory drawing which shows evaluation result of each image by FID score

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 transfer robot 16, an image processing device 100, and a quality determination device 200.

回転ステージ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 imaging unit 12 is arranged at a position where the bevel gear W placed on the table of the rotating stage 14 can be imaged from the side, for example. The transfer robot 16 grips the bevel gears W sequentially manufactured on the production line one by one and places them on the table of the rotating stage 14, for example, a bevel gear W determined to be a non-defective product and a bevel gear W determined to be a defective product. And to different locations. The image pickup unit 12, the rotation stage 14, and the transfer robot 16 are communicably connected to the control unit 210 of the quality determination device 200 described below via the interface unit 250, and the image pickup unit 12, the rotation stage 14, and the rotation stage 14 are connected to each other. Each operation with the transfer robot 16 is controlled by the control unit 210. Further, the image processing device 100 and the quality determination device 200 are connected to each other so as to be able to communicate with each other. The image processing device 100 and the quality determination device 200 do not need to be provided on the same production line as the image pickup unit 12, the rotation stage 14, and the transfer robot 16, and are not required to be provided in a predetermined network (for example, a public line such as the Internet or a dedicated line). Etc.) may be provided in a cloud environment where communication is possible.

A−1−1.画像処理装置100の構成
画像処理装置100は、制御部110と、記憶部120と、表示部130と、操作入力部140と、インターフェース部150と、を備える。これらの各部は、バス190を介して互いに通信可能に接続されている。
A-1-1. Configuration of Image Processing Device 100 The image processing device 100 includes a control unit 110, a storage unit 120, a display unit 130, an operation input unit 140, and an interface unit 150. Each of these parts is communicably connected to each other via a bus 190.

表示部130は、例えば液晶ディスプレイ等により構成され、各種の画像や情報を表示する。操作入力部140は、例えばキーボードやマウス、ボタン、マイク等により構成され、人の操作や指示を受け付ける。なお、本実施形態では、表示部130がタッチパネルを備えることにより、操作入力部140として機能する。また、インターフェース部150は、例えばLANインターフェースやUSBインターフェース等により構成され、有線または無線により他の装置との通信を行う。 The display unit 130 is composed of, for example, a liquid crystal display or the like, and displays various images and information. The operation input unit 140 is composed of, for example, a keyboard, a mouse, a button, a microphone, or the like, and receives human operations and instructions. In the present embodiment, the display unit 130 is provided with a touch panel to function as an operation input unit 140. Further, the interface unit 150 is composed of, for example, a LAN interface, a USB interface, or the like, and communicates with another device by wire or wirelessly.

記憶部120は、例えばROMやRAM、ハードディスクドライブ(HDD)等により構成され、各種のデータ、プログラムやモデルを記憶したり、各種のプログラムやモデルを実行する際の作業領域やデータの一時的な記憶領域として利用されたりする。 The storage unit 120 is composed of, for example, a ROM, a RAM, a hard disk drive (HDD), or the like, and stores various data, programs, or models, or temporarily executes a work area or data when executing various programs or models. It is used as a storage area.

具体的には、記憶部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 storage unit 120 stores a dent image DB 121, a non-defective image DB 122, a defective image DB 123, and a baseline image DB 124. A plurality of patterns of dent images K (see FIG. 4) are stored in the dent image DB 121. The dent image K is a partial image including dents in the captured image of the defective product of the actual bevel gear W. In the present embodiment, it is a divided image obtained by extracting a specific region of the bevel gear W from the captured image of the defective product. In the present embodiment, a plurality of patterns (for example, about 30) of dent images K are acquired based on captured images of defective products of the plurality of bevel gears W. In the present embodiment, the dent image K is assumed to be a grayscale image. The non-defective product image DB 122 stores a pre-captured captured image of a plurality of patterns of the non-defective product of the bevel gear W (hereinafter, referred to as “non-defective product image GY”). In the defective product image DB 123, an image of a defective product of a plurality of patterns of the bevel gear W imaged in advance and an image of a defective product of the bevel gear W generated by executing the defective product image generation PGM 131 described below (hereinafter, “defective product”). Image GX ") is sequentially stored. The dent image K is an example of a partial image within the scope of claims. The baseline image DB 124 sequentially stores the baseline image GB generated in the execution process of the defective image generation PGM131.

また、記憶部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 image generation PGM 131 is stored in the storage unit 120. The defective image generation PGM131 is a computer program for executing a process for generating a defective image GX. The defective image generation PGM 131 includes a baseline image generation PGM 133 and an image optimization PGM 134. The baseline image generation PGM 133 is a computer program for executing the baseline image generation process (see FIG. 2) described later, and the image optimization PGM 134 is for executing the image optimization process (see FIG. 6) described later. Computer program. These programs are provided in a state of being stored in a computer-readable recording medium (not shown) such as a CD-ROM, a DVD-ROM, or a USB memory, and can be installed in the image processing apparatus 100 to store the programs. It is stored in 120. The storage unit 120 also stores an image update model 141, which will be described later.

制御部110は、例えばCPU等により構成され、記憶部120から読み出したコンピュータプログラムを実行することにより、画像処理装置100の動作を制御する。例えば、制御部110は、記憶部120から不良品画像生成PGM131を読み出して実行することにより、後述の不良品画像GXを生成するための処理(ベースライン画像生成処理、画像最適化処理)を実行する。制御部110は、ベースライン画像生成処理を実行する際、第2の取得部113と指定部114と第2の画像生成部115として機能し、画像最適化処理を実行する際、第1の取得部111と第1の画像生成部112として機能する。これら各部の機能については、後述の各種の処理の説明に合わせて説明する。 The control unit 110 is composed of, for example, a CPU or the like, and controls the operation of the image processing device 100 by executing a computer program read from the storage unit 120. For example, the control unit 110 reads a defective image generation PGM 131 from the storage unit 120 and executes it to execute a process (baseline image generation process, image optimization process) for generating a defective image GX, which will be described later. do. The control unit 110 functions as a second acquisition unit 113, a designation unit 114, and a second image generation unit 115 when executing the baseline image generation processing, and the first acquisition unit 110 when executing the image optimization processing. It functions as a unit 111 and a first image generation unit 112. The functions of each of these parts will be described in accordance with the description of various processes described later.

A−1−2.良否判定装置200の構成
良否判定装置200は、制御部210と、記憶部220と、表示部230と、操作入力部240と、インターフェース部250と、を備える。これらの各部は、バス290を介して互いに通信可能に接続されている。
A-1-2. Configuration of Pass / Fail Judgment Device 200 The pass / fail determination device 200 includes a control unit 210, a storage unit 220, a display unit 230, an operation input unit 240, and an interface unit 250. Each of these parts is communicably connected to each other via bus 290.

表示部230は、例えば液晶ディスプレイ等により構成され、各種の画像や情報を表示する。操作入力部240は、例えばキーボードやマウス、ボタン、マイク等により構成され、人の操作や指示を受け付ける。なお、本実施形態では、表示部230がタッチパネルを備えることにより、操作入力部240として機能する。また、インターフェース部250は、例えばLANインターフェースやUSBインターフェース等により構成され、有線または無線により他の装置との通信を行う。 The display unit 230 is composed of, for example, a liquid crystal display or the like, and displays various images and information. The operation input unit 240 is composed of, for example, a keyboard, a mouse, a button, a microphone, or the like, and receives human operations and instructions. In the present embodiment, the display unit 230 functions as the operation input unit 240 by providing the touch panel. Further, the interface unit 250 is composed of, for example, a LAN interface, a USB interface, or the like, and communicates with other devices by wire or wirelessly.

記憶部220は、例えばROMやRAM、ハードディスクドライブ(HDD)等により構成され、各種のデータ、プログラムやモデルを記憶したり、各種のプログラムやモデルを実行する際の作業領域やデータの一時的な記憶領域として利用されたりする。 The storage unit 220 is composed of, for example, a ROM, a RAM, a hard disk drive (HDD), or the like, and stores various data, programs, or models, or temporarily executes a work area or data when executing various programs or models. It is used as a storage area.

具体的には、記憶部220には、良否判定PGM232が格納されている。良否判定PGM232は、ベベルギヤWの撮像画像における不良箇所の有無に基づきベベルギヤWの良否を判定するためのプログラムである。このプログラムは、例えば、CD−ROMやDVD−ROM、USBメモリ等のコンピュータによって読み取り可能な記録媒体(不図示)に格納された状態で提供され、良否判定装置200にインストールすることにより記憶部220に格納される。また、記憶部220には、後述の画像認識モデル242も格納されている。 Specifically, the storage unit 220 stores the pass / fail determination PGM232. The quality determination PGM232 is a program for determining the quality of the bevel gear W based on the presence or absence of defective parts in the captured image of the bevel gear W. This program is provided in a state of being stored in a recording medium (not shown) readable by a computer such as a CD-ROM, a DVD-ROM, or a USB memory, and is installed in the quality determination device 200 to store the storage unit 220. Stored in. The storage unit 220 also stores an image recognition model 242, which will be described later.

制御部210は、例えばCPU等により構成され、記憶部220から読み出したコンピュータプログラムを実行することにより、良否判定装置200の動作を制御する。例えば、制御部210は、記憶部220から良否判定PGM232を読み出して実行することにより、後述の良否判定処理を実行する。このとき、制御部210は、学習部226と判定部227として機能する。これら各部の機能については、後述の処理の説明に合わせて説明する。 The control unit 210 is composed of, for example, a CPU or the like, and controls the operation of the quality determination device 200 by executing a computer program read from the storage unit 220. For example, the control unit 210 reads the pass / fail determination PGM232 from the storage unit 220 and executes it to execute the pass / fail determination process described later. At this time, the control unit 210 functions as a learning unit 226 and a determination unit 227. The functions of each of these parts will be described in accordance with the description of the processing described later.

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 image processing apparatus 100 of the present embodiment will be described.

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 dent image DB 121 with the non-defective image GY stored in the non-defective image DB 122 to generate the baseline image GB.

ベースライン画像生成処理が開始されると、図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 non-defective image DB 122 by a uniform random number. Good product image GY (see FIG. 4A) is selected and acquired (S110). The process of S110 is an example of a second acquisition process within the scope of claims. The next processing after S112 may be performed on the non-defective image GY, or may be performed on the processed non-defective image GY in which a part of the non-defective image GY is trimmed. In the present embodiment, as shown in FIG. 4A, the processing after S112 is performed on the image in which the peripheral portion of the non-defective image GY where no dents cannot exist is trimmed. Hereinafter, for the sake of brevity of description, the good product image GY after trimming is also simply referred to as a good product image GY. Further, the non-defective image GY is assumed to be image data in RGB space.

次に、指定部114は、取得された良品画像GYに対してマスク画像生成処理を行う(S112)。マスク画像生成処理は、ベースライン画像GBを生成する際、良品画像GYのうち、実際に打痕が生じ得ない画像領域(以下、「マスク画像領域」という)への打痕画像Kの配置を回避し、実際に打痕が生じ得る特定画像領域R1に打痕が配置されるようにするための処理である。具体的には、マスク画像生成処理は、良品画像GYのうち、特定画像領域R1を指定するための処理である。S112の処理は、特許請求の範囲における指定処理の一例であり、特定画像領域R1は、上述の特定領域に対応する領域であり、特許請求の範囲における第1の画像領域の一例である。 Next, the designation unit 114 performs a mask image generation process on the acquired non-defective image GY (S112). In the mask image generation process, when the baseline image GB is generated, the dented image K is arranged in an image area (hereinafter, referred to as “mask image area”) in which dents cannot actually occur in the non-defective image GY. This is a process for avoiding the dents and arranging the dents in the specific image area R1 where the dents may actually occur. Specifically, the mask image generation process is a process for designating a specific image region R1 in the non-defective image GY. The processing of S112 is an example of the designation processing in the claims, the specific image area R1 is the area corresponding to the above-mentioned specific area, and is an example of the first image area in the claims.

マスク画像生成処理が開始されると、図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 designation unit 114 applies grayscale conversion to the non-defective image GY to generate a grayscale image GY1 (see FIG. 4B). (S210). Next, the designation unit 114 applies a differential filter (for example, a first-order differential filter) to the grayscale image GY1 to extract the edge portion (contour) of the bevel gear W (see FIG. 4C). ) Is generated (S212). Next, the designation unit 114 applies a median filter (for example, window 5 × 5) to the edge image GY2 to generate an edge image GY3 (see FIG. 4D) with reduced noise (S214). A binarization process (for example, Otsu's binarization process) is applied to the edge image GY3 to generate a binarized image GY4 (see FIG. 4E) (S216). In the binarized image GY4, the edge portion and the peripheral portion of the bevel gear W are mainly white regions, and a part of the tooth bottom is also a white region.

本実施形態では、さらに、指定部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 designation unit 114 further applies a shrinkage processing and smoothing filter (for example, a median filter) of a window (for example, 3 × 3) smaller than that at the time of processing of S214 to the binarized image GY4. Alternatively, it is applied a plurality of times to generate a mask image GM (see FIG. 4 (g)) (S218). By applying the median filter, the binarized image GY4 is smoothed and noise is removed. By applying the shrinkage treatment, noise in an isolated region (for example, the tooth bottom of the bevel gear W) away from the edge portion is removed in the binarized image GY4. In FIG. 4, the binarized image GY4 is subjected to the shrinkage treatment and the median filter once to generate the binarized image GY5 (see FIG. 4 (f)), and further, the binarized image GY5 is generated. An example is shown in which the shrinkage treatment and the median filter are applied once to obtain a mask image GM (see FIG. 4 (g)). In this way, by applying the shrinkage treatment and the median filter to the binarized image GY4 a plurality of times, noise can be removed more effectively. The “noise” referred to here is, in particular, a white region remaining on the tooth bottom of the bevel gear W. As shown in FIGS. 4 (e) to 4 (g), it can be seen that the white region remaining on the tooth bottom of the bevel gear W is reduced according to the number of times the shrinkage treatment and the median filter are applied. As will be described later, the white region is a region for designating the specific image region R1 in the non-defective image GY.

マスク画像生成処理を終了すると、第2の画像生成部115は、良品画像GYのうち、特定画像領域R1を対象とし、特定画像領域R1中の任意の位置に、打痕画像Kを合成してベースライン画像GBを生成する。この処理は、特許請求の範囲における第2の画像生成処理の一例であり、ベースライン画像GBは、特許請求の範囲における合成画像の一例である。 When the mask image generation process is completed, the second image generation unit 115 targets the specific image area R1 of the non-defective image GY, and synthesizes the dent image K at an arbitrary position in the specific image area R1. Generate a baseline image GB. This process is an example of a second image generation process in the claims, and the baseline image GB is an example of a composite image in the claims.

具体的には、図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 dent image DB 121. Randomly select and acquire one or a plurality of patterns of dent images K (S114). Next, the second image generation unit 115 overwrites the dent image K at a position randomly selected by a uniform random number in the specific image area R1 (the area corresponding to the white area of the mask image GM) of the non-defective image GY. Then, an image GD with dents (see FIG. 4 (h)) is generated (S116).

次に、第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 image generation unit 115 executes the saturation adjustment process on the dented image GD (S118). The saturation adjustment process is a process for reflecting the saturation of the non-defective image GY on the dented image K in the dented image GD. When the saturation adjustment process is started, as shown in FIG. 5, the second image generation unit 115 sets each of the dented image GD and the non-defective image GY before the dent image K is synthesized. , The image in the RGB space is converted into an image in a color space in which the saturation can be adjusted (for example, HSV space, HLS space, L * a * b space, YCbCr space, YUV space, etc.) (S310). Next, the second image generation unit 115 corrects the saturation of the dented image GD after the color conversion based on the saturation of the non-defective image GY after the color conversion (S320), and strikes after the saturation correction. The marked image GD is converted into an image in RGB space, a baseline image GB is generated (S330), the image is stored in the baseline image DB 124 of the storage unit 120, and the baseline image generation process is completed. As a result, the baseline image GB (see FIG. 4 (i)) in which the saturation of the non-defective image GY is reflected is also generated for the composite portion of the dented image K in the dented image GD.

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 image update model 141. The image optimization process is a process for bringing the baseline image GB generated by the baseline image generation process closer to a defective image that is closer to the real thing (more natural).

画像最適化処理が開始されると、図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 first acquisition unit 111 acquires the baseline image GB and the non-defective image GY that is the basis of the baseline image GB from the storage unit 120. (S410). The processing of S410 is an example of the first acquisition processing within the scope of claims. Next, the first image generation unit 112 repeatedly executes the image update model 141 based on the input image GS, the baseline image GB, and the non-defective image GY to generate the defective image GX (S420). The process of S420 is an example of the first image generation process within the scope of claims.

具体的には、図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)(F(GY)−F(GS))
:ImageNetであり、VGG19モデルのi番目のConvLayerの出力である。
コンテンツ損失L1では、良品画像GYを真値としている。このため、コンテンツ損失L1を最小化することは、良品画像GYの特徴に近づくように入力画像GSが更新されることを意味する。なお、「入力画像GSが更新される」とは、入力画像GSの画素値が更新されることを意味する(以下、同じ)。コンテンツ損失L1は、特許請求の範囲における第1の損失関数の一例である。
Specifically, as shown in FIG. 7, in the image update model 141, the input image GS (however, the first time is the baseline image GB, the second and subsequent times is the output image previously output from the image update model 141), and a good product. The image GY and the image GY are input to the pre-trained convolutional neural network M11 to obtain the content loss L1 (S510). The convolutional neural network M11 is a learning model that classifies images based on the feature amount of the image, and is, for example, a VGG19 model. The convolutional neural network M11 is not limited to this, and may be any learning model trained by ImageNet, and may be, for example, a VGG16 model, AlexNet, ResNet34, ResNet50, InceptionV3, or the like.
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 image update model 141 as a loss function, and is represented by, for example, the following equation 1.
<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))
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))
cnn:打痕の有無を判定する打痕分類モデルであり、打痕無しの画像に対して「0」を出力し、打痕有りの画像に対して「1」を出力する。
打痕判定損失L3では、「1」を真値としている。このため、打痕判定損失L3を最小化することは、打痕分類モデルが打痕有りと判定する方向に入力画像GSが更新されることを意味する。打痕分類モデルM13は、特許請求の範囲における不良判定モデルの一例であり、打痕判定損失L3は、特許請求の範囲における第3の損失関数の一例である。
Further, in the image update model 141, the input image GS is input to the dent classification model M13 to obtain a dent determination loss L3 (S530). The dent classification model M13 uses a pre-learned convolutional neural network as a classifier, and by performing transfer learning on a plurality of divided images of the bevel gear W described above, the presence or absence of dents in the image It is a model for discriminating, for example, ResNet50. The dent classification model M13 is not limited to this, and may be a learning model trained by ImageNet, and may be, for example, a VGG16 model, a VGG19 model, AlexNet, ResNet34, InceptionV3, or the like. The dent determination loss L3 is represented by the following equation 3.
<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 image update model 141, the total loss (= α ・ L1 + β ・ L2 + γ ・ L3) obtained by adding the obtained content loss L1, the Laplacian loss L2, and the dent determination loss L3 is calculated (S540), and the total loss is calculated (S540). The input image GS is updated so that is minimized, and the output image is output (S550). The constant term (α, β, γ) of the total loss can be changed as appropriate.

次に、第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 re-image update model 141. Repeat the execution of. On the other hand, when the first image generation unit 112 determines that the output image satisfies the optimum condition (S430: YES), it is assumed that the defective image GX with high accuracy is generated, and the latest output image is the defective image GX. The image is stored in the defective image DB 123 of the storage unit 120 (S450), and the image optimization process is completed.

A−2−3.評価結果
本実施形態では、ベースライン画像GBと不良品画像GXとのそれぞれについて、FID(Frechet Inception Distance)スコアを用いて、本物の打痕画像(例えば1000枚)との比較による評価を行った。FIDスコアは、2つの画像データセットに対して、ImageNet学習済みのInceptionV3モデルに画像を入力して得られる特徴表現の平均と分散の距離を評価する尺度である。FIDスコアは、以下に式4により定義される。
<式4>
=|m−m+Tr(C+C−2(C1/2
:画像データセット1をInceptionV3モデルに入力したときのモデルの最後の平均プーリング層の出力である。
:画像データセット2をInceptionV3モデルに入力したときのモデルの最後の平均プーリング層の出力である。
Tr:行列のトレースである。
:画像データセット1を入力としたInceptionV3モデルの出力2048次元ベクトルに対する共分散行列である。
:画像データセット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 quality determination device 200 of the present embodiment will be described. This process is a process for determining the quality of the bevel gear W based on the presence or absence of defective portions in the captured image of the bevel gear W by using the image recognition model 242 that recognizes the image by machine learning.

上述した不良品画像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 product image DB 123 of the storage unit 120 by the process for generating the defective product image GX described above, the learning unit 226 of the quality determination device 200 receives the defective product image GX. Using the plurality of patterns of non-defective image GY stored in the non-defective image DB 122 of the image processing device 100 and the plurality of patterns of defective image GX stored in the defective image DB 123 as teacher data, the quality of the bevel gear W is determined. Machine learning is performed to generate or update the image recognition model 242. The image recognition model 242 can be generated by controlling the weighting coefficient of the model formula prepared in advance, but the specific model formula used to generate the image recognition model 242 is not limited, and any model formula can be used. Applicable.

良否判定処理が開始されると、判定部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 determination unit 227 rotates the table of the rotation stage 14 and causes the image pickup unit 12 to take an image of the entire circumference of the bevel gear W placed on the table. As a result, a plurality of captured images in which different angles of one bevel gear W are captured are generated. Specifically, for example, 36 captured images are generated for one bevel gear W, and each captured image is divided into, for example, eight to generate a total of 36 × 8 = 288 determination target data. Next, the determination unit 227 determines the quality (presence / absence of defective portion) using the image recognition model 242 for each determination target data. That is, for one bevel gear W, quality determination is performed for 288 types of determination target data. The number of determination target data per bevel gear W is arbitrary.

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 image update model 141 is used in the image optimization process (S420 in FIG. 6). The image update model 141 is a model that updates and outputs the input image GS so that the total loss of the content loss L1 and the Laplacian loss L2 is minimized (see FIG. 7). Here, the content loss L1 is an error between the input image GS obtained by the convolutional neural network M11 and the non-defective image GY, and updating the input image GS so that the content loss L1 is minimized is the non-defective image GY. It means that the input image GS is updated so as to approach the feature. The Laplacian loss L2 is an error between the input image GS obtained by the edge extraction filter (Laplacian filter M12) and the baseline image GB, and updating the input image GS so that the Laplacian loss L2 is minimized is the base. It means that the input image GS is updated so as to approach the feature (defective part) of the line image GB. Therefore, updating the input image GS so as to minimize the total loss means that the input image GS is updated so as to approach the characteristics of the non-defective image GY while maintaining the characteristics of the defective portion of the baseline image GB. means. As a result, according to the present embodiment, it is possible to generate a defective image GX that is closer to the real thing from the non-defective image GY and the dent image K.

本実施形態では、画像最適化処理において、入力画像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 quality determination device 200 of the present embodiment, the quality is determined by inputting the captured image of the product to be determined (bevel gear W) into the image recognition model 242 trained by using the above-mentioned defective product image GX as teacher data. .. As a result, by using the image recognition model 242 learned based on the defective product image GX that is closer to the real thing, it is possible to accurately determine whether or not the product to be determined is a defective product.

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 storage unit 120 of the image processing device 100 and at least a part of the storage unit 220 of the quality determination device 200 may be stored in an external device (for example, a cloud server). Further, the operations of the imaging unit 12, the rotating stage 14, and the transfer robot 16 may be controlled not by the quality determination device 200 but by a dedicated control device (programmable logic controller or the like).

上記実施形態では、工業製品として、ベベルギヤ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 dent image DB 121 may be image data in the same color space (RGB color space) as the non-defective image GY. Further, the non-defective image GY may be image data in a color space other than the RGB space. Further, in S110 of the baseline image generation process, the non-defective image GYs selected in a predetermined order may be acquired, or one non-defective image GY may always be acquired. Further, in S114, the dent images K selected in a predetermined order may be acquired, or one dent image K may always be acquired.

ベースライン画像生成処理において、マスク画像生成処理(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 image processing device 100 receives the result. May be good. In the baseline image generation process, the specific image area R1 may be designated by a human input operation. In the mask image generation process, at least one of the processes S214 to S218 may not be executed.

画像最適化処理において、画像更新モデル141による実行処理の少なくとも一部を外部装置に実行させて結果を良否判定装置200が受信するとしてもよい。 In the image optimization process, at least a part of the execution process by the image update model 141 may be executed by an external device, and the pass / fail determination device 200 may receive the result.

ベベルギヤWの良否を判定するための処理において、画像認識モデル242を生成または更新する処理の少なくとも一部を外部装置に実行させて結果を良否判定装置200が受信するとしてもよい。 In the process for determining the quality of the bevel gear W, the quality determination device 200 may receive the result by causing an external device to execute at least a part of the process of generating or updating the image recognition model 242.

上記実施形態において、ハードウェアによって実現されている構成の一部をソフトウェアに置き換えるようにしてもよく、反対に、ソフトウェアによって実現されている構成の一部をハードウェアに置き換えるようにしてもよい。 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: Image processing device 110, 210: Control unit (computer) 111: First acquisition unit 112: First image generation unit 113: Second acquisition unit 114: Designation unit 115: Second image generation unit 131: Defective product image generation program 141: Image update model 200: Good / bad product image 227: Judgment unit 242: Image recognition model GB: Baseline image (composite image) GS: Input image GX: Defective product image GY: Good product image K: Imprint Image (partial image) L1: Content loss (first loss function) L2: Laplacian loss (second loss function) M11: Convolutional neural network M12: Laplacian filter (edge extraction filter) M13: Dimple classification model (defective) Judgment model) R1: Specific image area (first image area) W: Bevel gear (industrial product, judgment target product)

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に記載の不良品画像生成プログラムであって、
前記画像更新モデルは、
さらに、前記入力画像を、画像中における不良箇所の有無を判定する不良判定モデルに入力し、
前記第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.
請求項1または請求項2に記載の不良品画像生成プログラムであって、
前記コンピュータに、
前記工業製品の良品画像と、前記工業製品における前記不良箇所を含む部分画像と、を取得する第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.
請求項3に記載の不良品画像生成プログラムであって、
前記工業製品は歯車であり、
前記第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.
請求項3または請求項4に記載の不良品画像生成プログラムであって、
前記工業製品は歯車であり、
前記第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.
請求項4または請求項5に記載の不良品画像生成プログラムであって、
前記指定処理では、前記良品画像に対するエッジ抽出処理により抽出されたエッジ部の位置に基づき前記第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.
請求項3から請求項6までのいずれか一項に記載の不良品画像生成プログラムであって、
前記第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.
JP2020033423A 2020-02-28 2020-02-28 Defective product image generation program and quality determination device Pending JP2021135903A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (6)

* Cited by examiner, † Cited by third party
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