JP2023077051A - Setting device and setting method - Google Patents

Setting device and setting method Download PDF

Info

Publication number
JP2023077051A
JP2023077051A JP2021190169A JP2021190169A JP2023077051A JP 2023077051 A JP2023077051 A JP 2023077051A JP 2021190169 A JP2021190169 A JP 2021190169A JP 2021190169 A JP2021190169 A JP 2021190169A JP 2023077051 A JP2023077051 A JP 2023077051A
Authority
JP
Japan
Prior art keywords
image
defective
defective product
machine learning
learning network
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
JP2021190169A
Other languages
Japanese (ja)
Inventor
新亮 趙
Xinliang Zhao
京佑 俵
Kyosuke Tawara
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.)
Keyence Corp
Original Assignee
Keyence Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Keyence Corp filed Critical Keyence Corp
Priority to JP2021190169A priority Critical patent/JP2023077051A/en
Publication of JP2023077051A publication Critical patent/JP2023077051A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

To obtain a machine learning network which reduces user's labor at learning time of a machine learning network, excludes dependency on individual skills, and has high detection performance.SOLUTION: A setting device comprises: a display control unit which displays an image to be learned by a machine learning network on a display unit; an input unit which receives defective information inputted by either formula of a first annotation formula which assigns a label indicating that it is a non-defective article image or a defective article image, and a second annotation formula which designates a defective part when the image displayed on the display unit is the defective article image, with respect to the image displayed on the display unit; and a processor which makes the machine learning network learn both of the non-defective article image or the defective article image to which the label was assigned by the first annotation formula, and the defective article image having the defective information inputted by the second annotation formula.SELECTED DRAWING: Figure 3

Description

本開示は、外観検査装置の設定装置及び設定方法に関する。 The present disclosure relates to a setting device and a setting method for a visual inspection apparatus.

例えば特許文献1には、コンピュータによる機械学習を用いて、ワークが良品であるか不良品であるかの判定を行う処理装置が開示されている。特許文献1の処理装置は、良品データを対象とした教師ありの機械学習を行って良品学習モデルを生成するとともに、不良品データを対象とした教師ありの機械学習を行って不良品学習モデルを生成した後、判定対象となるワークのデータを入力し、良品学習モデル及び不良品学習モデルによってワークが良品であるか不良品であるかの判定が行えるように構成されており、このような装置はワークの外観検査装置とも呼ばれている。 For example, Patent Literature 1 discloses a processing device that uses computer-based machine learning to determine whether a work is good or bad. The processing device of Patent Document 1 performs supervised machine learning on non-defective product data to generate a non-defective product learning model, and performs supervised machine learning on defective product data to generate a defective product learning model. After generation, the data of the work to be judged is input, and it is configured to be able to judge whether the work is a good product or a defective product by the non-defective product learning model and the defective product learning model. is also called a work visual inspection device.

特開2019-204321号公報JP 2019-204321 A

ところで、不良品データを対象とした教師あり学習を行う場合、そのワークのどこが不良箇所であるかをユーザ自身が明示する作業、いわゆるアノテーションが必要になる。不良品学習によって生成された不良品学習モデルによる判定性能は、アノテーションを詳細に行うほど向上する傾向にあるので、アノテーションをより詳細に行いたい。 By the way, when supervised learning is performed on defective product data, it is necessary for the user to clearly indicate which part of the work is defective, that is, so-called annotation. Since the judgment performance of the defective product learning model generated by defective product learning tends to improve as the annotation is performed in detail, it is desirable to perform the annotation in more detail.

しかしながら、不良箇所は単純な形状であるとは限らず、様々な形状であったり、ワークの様々な位置にあることが多く、そのような不良箇所に対応する領域を不良品画像上で正確に指定する作業は難しい。不良箇所に対応する領域の指定が不正確であった場合には、不良品学習モデルによる判定性能の低下を招く結果となる。また、人間がアノテーションを行っている以上、不良箇所としてアノテーションするべき領域であるか否かを不良品画像上で判断に迷う場合や、不良箇所に対応する領域よりも大きな領域をアノテーションしてしまう場合、反対に、不良箇所に対応する領域よりも小さな領域をアノテーションしてしまう場合等も考えられる。このようなユーザによるアノテーションの違いは、最終的に生成された不良品学習モデルの性能に差を生じさせる結果となり得る。つまり、アノテーションを詳細にするのが理想であるが、詳細にすればするほど属人性が現れてしまい、結果として良好な判定性能を持った不良品学習モデルが得られなくなるおそれがある。 However, the defective part is not always a simple shape, and often has various shapes and is located at various positions on the workpiece. The task of specifying is difficult. If the designation of the area corresponding to the defective portion is inaccurate, this results in deterioration of the determination performance of the defective product learning model. In addition, as long as humans are annotating, there are cases where it is difficult to judge whether an area should be annotated as a defective part on the defective product image, or an area larger than the area corresponding to the defective part is annotated. In some cases, on the contrary, it is conceivable that an area smaller than the area corresponding to the defective portion is annotated. Such differences in annotations by users can result in differences in the performance of the finally generated defective product learning model. In other words, it is ideal to make the annotations more detailed, but the more the annotations are made, the more dependent the annotation becomes, and as a result, there is a risk that a defective product learning model with good judgment performance cannot be obtained.

また、不良品学習モデルを生成するに当たっては、例えば数十枚、数百枚の不良品画像が必要になるが、これほどの枚数の不良品画像の全てに正確にアノテーションを行おうとすると、ユーザに大きな時間的負担を強いることになり、このことも問題であった。 In addition, in order to generate a defective product learning model, for example, dozens or hundreds of defective product images are required. This was also a problem.

本開示は、かかる点に鑑みたものであり、その目的とするところは、機械学習ネットワークの学習時におけるユーザの手間を削減するとともに、属人性を排除しながらも、高い検出性能を持った機械学習ネットワークが得られるようにすることにある。 The present disclosure has been made in view of this point, and its purpose is to reduce the user's time and effort when learning a machine learning network, and to eliminate the dependence on individuals, while having a machine with high detection performance. The object is to obtain a learning network.

上記目的を達成するために、本開示の一態様では、良品に対応する良品画像と、不良品に対応する不良品画像とを学習することにより生成された機械学習ネットワークに、検査対象のワークを撮像したワーク画像を入力し、当該ワーク画像の良否判定を行う外観検査装置の設定を行う設定装置を前提とすることができる。設定装置は、前記機械学習ネットワークに学習させるための画像を表示部に表示させる表示制御部と、前記表示部に表示された画像に対し、良品画像または不良品画像であることを示すラベルを付与する第1アノテーション方式と、前記表示部に表示された画像が不良品画像である場合に不良箇所を指定する第2アノテーション方式とのいずれかの方式で入力された不良情報を受け付ける入力部と、プロセッサとを備えている。プロセッサは、前記第1アノテーション方式でラベルが付与された良品画像または不良品画像と、前記第2アノテーション方式で入力された不良情報を有する不良品画像との両方を前記機械学習ネットワークに学習させて、当該機械学習ネットワークのパラメータを調整することができる。 In order to achieve the above object, in one aspect of the present disclosure, a machine learning network generated by learning a non-defective product image corresponding to a non-defective product and a defective product image corresponding to a defective product is provided with a work to be inspected. It is possible to presuppose a setting device for inputting a photographed work image and setting a visual inspection device for determining the quality of the work image. The setting device includes a display control unit that causes a display unit to display an image for learning by the machine learning network, and a label indicating that the image displayed on the display unit is a non-defective product image or a defective product image. an input unit that receives defect information input by either a first annotation method that specifies a defective part when the image displayed on the display unit is a defective product image; with a processor. The processor causes the machine learning network to learn both the non-defective product image or the defective product image labeled by the first annotation method and the defective product image having the defect information input by the second annotation method. , the parameters of the machine learning network can be adjusted.

この構成によれば、第1アノテーション方式では、表示部に表示された画像をラベル指定によって良品画像と不良品画像に振り分けることができるので、全体的に不良であると判定すべき不良品画像のアノテーションが可能になる。一方、第2アノテーション方式では、不良品画像上で不良箇所を指定できるので、第1アノテーション方式に比べて不良箇所を詳細に指定するアノテーションが可能になる。つまり、不良品画像には、ラベルを付与するだけで不良であると判定が可能な不良品画像と、不良箇所を明確に指定しないと不良であると判定ができない不良品画像とが含まれている場合があり、前者の場合は、ユーザの手間をかけずに容易にアノテーションが行え、一方、後者の場合はユーザが詳細にアノテーションすることが可能になる。 According to this configuration, in the first annotation method, images displayed on the display unit can be sorted into non-defective product images and defective product images by label designation. Annotation becomes possible. On the other hand, in the second annotation method, since the defective part can be specified on the defective product image, it is possible to make an annotation that specifies the defective part in more detail than in the first annotation method. In other words, the defective product image includes a defective product image that can be determined as defective simply by attaching a label, and a defective product image that cannot be determined as defective unless the defective part is clearly specified. In the former case, the annotation can be easily performed without the user's trouble, while in the latter case, the user can annotate in detail.

他の態様に係る入力部は、前記第2アノテーション方式として、不良品画像の不良箇所を囲むことで当該不良箇所を指定する領域指定方式と、不良品画像の不良箇所をなぞることで当該不良箇所を自由形状で指定する精密指定方式とが選択可能に構成されている。 The input unit according to another aspect includes, as the second annotation method, a region specification method of specifying the defective portion by enclosing the defective portion of the defective product image, and a defective portion specifying method of tracing the defective portion of the defective product image. can be selected from a precise designation method that designates in a free form.

この構成によれば、領域指定方式を選択した場合には、不良箇所を囲む枠を例えばポインティングデバイス等によって生成することで、不良箇所を容易に指定することができる。また、不良箇所が例えば自由形状である場合には、精密指定方式を選択することで、自由形状の不良箇所を精密に指定することができる。つまり、不良箇所の大まかな指定と精密な指定とを必要に応じて切り替えることができるので、ユーザの手間を削減しながら、不良品画像を用いた機械学習ネットワークの学習を効果的に行うことができる。 According to this configuration, when the region designation method is selected, the defective portion can be easily designated by generating a frame surrounding the defective portion using, for example, a pointing device. Further, when the defective portion is, for example, a free-form, the precise designation method can be selected to precisely designate the free-form defective portion. In other words, since it is possible to switch between rough designation and precise designation of defective parts as needed, it is possible to effectively learn a machine learning network using defective product images while reducing the user's labor. can.

他の態様に係る入力部は、不良品画像の不良箇所と当該不良箇所の周囲とを囲むことによって指定された領域内で当該不良箇所を自動抽出する自動抽出方式を実行できるものである。 An input unit according to another aspect can execute an automatic extraction method for automatically extracting a defective portion within a designated area by enclosing a defective portion of a defective product image and the periphery of the defective portion.

この構成によれば、ユーザが不良箇所とその周囲を大まかに囲むだけで、自動的に不良箇所が抽出されるので、ユーザの手間をより一層削減できる。 According to this configuration, the user can automatically extract the defective portion simply by encircling the defective portion and its surroundings, thereby further reducing the user's trouble.

他の態様に係る入力部は、前記自動抽出方式の実行後、当該自動抽出方式で自動抽出された領域の形状の修正を受け付けることができるので、例えば、自動抽出された領域が不良箇所の形状から外れていた場合に、自動抽出された領域の形状が不良箇所の形状と一致するように、自動抽出された領域の形状をユーザが修正することで、より精密なアノテーションが可能になる。 Since the input unit according to another aspect can accept correction of the shape of the region automatically extracted by the automatic extraction method after the execution of the automatic extraction method, for example, the automatically extracted region can change the shape of the defective part The user can correct the shape of the automatically extracted area so that it matches the shape of the defective area, thereby enabling more precise annotation.

他の態様に係るプロセッサは、前記第1アノテーション方式でラベルが付与された良品画像または不良品画像と、前記第2アノテーション方式で不良箇所が指定された不良品画像とを単一の前記機械学習ネットワークに入力し、当該機械学習ネットワークのパラメータを調整することができるので、異なる方式でアノテーションが実行された複数の不良品画像で単一の機械学習ネットワークの学習が行える。 A processor according to another aspect performs a single machine learning process on a non-defective product image or a defective product image labeled by the first annotation method and a defective product image on which a defective portion is designated by the second annotation method. Inputs to the network and parameters of the machine learning network can be adjusted so that a single machine learning network can be trained on multiple defective images annotated in different ways.

他の態様に係るプロセッサは、不良品画像を学習することにより生成された前記機械学習ネットワークに、検証用画像データを入力して当該検証用画像データの良否判定を実行する検証処理が行える。プロセッサは、前記検証処理後、不良品に対応する前記検証用画像データであるにも関わらず不良として判定されなかった場合、不良箇所が前記第2アノテーション方式により指定された前記検証用画像データを前記機械学習ネットワークに学習させて当該機械学習ネットワークのパラメータを更新する更新処理を実行することができる。 A processor according to another aspect can perform a verification process of inputting verification image data to the machine learning network generated by learning defective product images and determining whether the verification image data is good or bad. After the verification process, if the verification image data corresponding to a defective product is not determined to be defective, the processor outputs the verification image data in which a defective portion is designated by the second annotation method. An update process can be performed for causing the machine learning network to learn and updating the parameters of the machine learning network.

すなわち、不良品に対応する検証用画像データを不良として判定しない機械学習ネットワークは更なる学習の余地があるということである。このような機械学習ネットワークに対して、不良箇所が第2アノテーション方式により精密に指定された検証用画像データを学習させることで、機械学習ネットワークの判定性能をより一層向上させることができる。 In other words, there is room for further learning for a machine learning network that does not determine verification image data corresponding to defective products as defective. By allowing such a machine learning network to learn the verification image data in which the defective portion is precisely specified by the second annotation method, the judgment performance of the machine learning network can be further improved.

他の態様では、前記表示制御部は、前記第1アノテーション方式で不良品画像のラベルが付与された画像の中で、不良として判定されなかった画像の一覧を前記表示部に表示させることができる。前記入力部は、前記表示部に一覧表示された画像の中から前記第2アノテーション方式で不良箇所の指定を行う画像の選択入力を受け付け、選択された画像に対して前記第2アノテーション方式で不良箇所の指定を受け付ける。 In another aspect, the display control unit can cause the display unit to display a list of images that are not determined to be defective among images labeled as defective product images by the first annotation method. . The input unit accepts a selection input of an image for which a defective portion is to be designated by the second annotation method from among the images displayed as a list on the display unit, and determines whether the selected image is defective by the second annotation method. Accept designation of location.

すなわち、不良品画像のラベルが付与された画像の中で、不良として判定されなかった画像があるということは、機械学習ネットワークに更なる学習の余地があるということである。このような場合、不良として判定されなかった画像を機械学習ネットワークに学習させることが考えられるが、そのまま学習させたのでは学習効果は殆ど向上しない。本構成では、不良品画像のラベルが付与された画像であるにも関わらず、不良として判定されなかった画像を表示部に表示させることでユーザに提示することができ、ユーザは、その画像の中から、第2アノテーション方式により精密に不良箇所を指定するのに適した画像を選択し、精密に不良箇所を指定した画像で機械学習ネットワークを学習させることができ、学習効果が向上する。 In other words, the fact that there are images that are not determined as defective among the images labeled as defective images means that there is room for further learning in the machine learning network. In such a case, it is conceivable to let the machine learning network learn images that have not been judged as defective, but if the machine learning network is allowed to learn them as they are, the learning effect will hardly improve. In this configuration, an image that is not determined to be defective despite being labeled as a defective product image can be presented to the user by displaying it on the display unit. An image suitable for precisely specifying the defective portion can be selected from among them by the second annotation method, and the machine learning network can be trained with the image in which the defective portion is precisely specified, thereby improving the learning effect.

他の態様では、前記プロセッサは、機械学習ネットワークに、複数の互いに異なる検証用画像データを入力して当該各検証用画像データの良否判定を実行し、表示制御部は、前記プロセッサが取得した前記判定結果を前記表示部に表示してユーザに提示することができる。 In another aspect, the processor inputs a plurality of verification image data different from each other to a machine learning network to determine whether each verification image data is good or bad; The determination result can be displayed on the display unit and presented to the user.

この構成によれば、複数の検証用画像データの良否判定を機械学習ネットワークに実行させることでプロセッサは判定結果を取得できる。この判定結果が表示部に表示されるので、ユーザは、良品、不良品と指定されている画像が分離できているかを把握できる。良品画像であると判定された判定結果と、不良品画像であると判定された判定結果とが分離できている場合には、機械学習ネットワークの学習が十分に行われているとユーザ側で判断でき、また、きれいに分離できていない場合には、機械学習ネットワークの学習が不十分であって更なる学習が必要であるとユーザ側で判断できる。 According to this configuration, the processor can acquire the determination result by causing the machine learning network to perform the pass/fail determination of the plurality of verification image data. Since this determination result is displayed on the display unit, the user can grasp whether the images designated as non-defective products and defective products are separated. If the determination result that the image is determined to be a non-defective product can be separated from the determination result that the image is determined to be a defective product, the user can determine that the machine learning network has sufficiently learned. If it can be separated, the user can judge that the learning of the machine learning network is insufficient and further learning is necessary.

他の態様では、良品画像であると判定された度数と不良品画像であると判定された度数とに基づく累積ヒストグラムを生成して表示部に表示させるものである。 In another aspect, a cumulative histogram based on the number of times the image is determined to be a non-defective image and the number of times the image is determined to be a defective image is generated and displayed on the display unit.

この構成によれば、検証用画像データを機械学習ネットワークで良否判定した結果として、良品画像であると判定された度数と不良品画像であると判定された度数とに基づくヒストグラムをユーザに提示することができる。これにより、良品、不良品と指定されている画像が分離できているか否かをユーザが容易に判断できる。 According to this configuration, as a result of pass/fail judgment of the verification image data by the machine learning network, the user is presented with a histogram based on the number of times the image data for verification is judged to be a non-defective image and the number of times the image is judged to be a defective image. be able to. This allows the user to easily determine whether or not the images designated as non-defective products and defective products are separated.

他の態様に係るプロセッサは、良品情報を有する画像の異常度マップと不良品情報を有する画像の異常度マップとの距離を所定以上離す処理を実行可能に構成されている。 A processor according to another aspect is configured to be capable of executing a process of increasing a distance between an abnormality degree map of an image having non-defective product information and an abnormality degree map of an image having defective product information by a predetermined distance or more.

この構成によれば、良品情報を有する画像と、不良品情報を有する画像とを用いた学習効果がより一層向上する。 According to this configuration, the learning effect using the image having non-defective product information and the image having defective product information is further improved.

他の態様に係るプロセッサは、良品情報を有する画像同士の異常度マップ間の距離を近づける処理と、不良品情報を有する画像同士の異常度マップ間の距離を近づける処理との少なくとも一方を実行可能に構成されている。 A processor according to another aspect can execute at least one of a process of reducing the distance between the abnormality maps of images having non-defective product information and the process of reducing the distance between the abnormality maps of images having defective product information. is configured to

この構成によれば、良品情報を有する複数の画像を用いた学習効果、不良品情報を有する複数の画像を用いた学習効果がより一層向上する。 According to this configuration, the learning effect using a plurality of images having non-defective product information and the learning effect using a plurality of images having defective product information are further improved.

他の態様に係るプロセッサは、第1アノテーション方式で入力された良品情報を有する良品画像を前記機械学習ネットワークに入力して生成された異常度マップ内の各画素値が0となるように当該機械学習ネットワークのパラメータを調整することができる。 A processor according to another aspect, the machine so that each pixel value in the degree of anomaly map generated by inputting a non-defective product image having non-defective product information input by the first annotation method into the machine learning network is 0 Parameters of the learning network can be adjusted.

他の態様に係るプロセッサは、前記第2アノテーション方式で入力された不良品情報を有する不良品画像を前記機械学習ネットワークに入力して生成された異常度マップ内において、前記第2アノテーション方式で指定された不良箇所以外に対応する部分の画素値が0となるように当該機械学習ネットワークのパラメータを調整することができる。 A processor according to another aspect specifies, in an anomaly map generated by inputting a defective product image having defective product information input by the second annotation method into the machine learning network, by the second annotation method The parameters of the machine learning network can be adjusted so that the pixel value of the portion corresponding to the non-defective portion is 0.

以上説明したように、良品画像または不良品画像であることを示すラベルを付与する第1アノテーション方式と、不良品画像の不良箇所を指定する第2アノテーション方式とのいずれかの方式で不良情報を入力し、その不良情報に基づいて機械学習ネットワークのパラメータを調整することができるので、学習時におけるユーザの手間を削減するとともに、属人性を排除しながらも、高い検出性能を持った機械学習ネットワークを得ることができる。 As described above, defect information is obtained by either the first annotation method, which assigns a label indicating whether the image is a non-defective product image or the defective product image, or the second annotation method, which designates the defective part of the defective product image. It is possible to input and adjust the parameters of the machine learning network based on the defect information, reducing the user's labor during learning, eliminating the dependence on individuality, and having high detection performance. can be obtained.

本発明の実施形態に係る外観検査装置の設定装置の構成を示す模式図である。1 is a schematic diagram showing the configuration of a setting device for an appearance inspection apparatus according to an embodiment of the present invention; FIG. 前記設定装置のハードウエア構成を示すブロック図である。3 is a block diagram showing the hardware configuration of the setting device; FIG. アノテーションの手順の一例を示すフローチャートである。10 is a flow chart showing an example of an annotation procedure; FIG.4Aは第1アノテーション方式で不良品画像にラベルを付与する場合を示し、FIG.4Bは第1アノテーション方式で良品画像にラベルを付与する場合を示している。FIG. 4A shows a case where a label is given to a defective product image by the first annotation method, FIG. 4B shows a case where a label is added to a non-defective product image by the first annotation method. 第2アノテーション方式で不良品画像の不良箇所を指定した例を示す図である。It is a figure which shows the example which designated the defective part of the defective product image by the 2nd annotation method. FIG.6Aは、3つの点を通る円形状の枠で不良箇所を囲む例を示し、FIG.6Bは、中心点の指定によって生成した円形状の枠で不良箇所を囲む例を示し、FIG.6Cは、ポリゴンで不良箇所を囲む例を示し、FIG.6Dは、フリーハンドツールによって生成した枠で不良箇所を囲む例を示す図である。FIG. 6A shows an example of enclosing a defective portion with a circular frame passing through three points, and FIG. 6B shows an example of enclosing a defective portion with a circular frame generated by designating a center point; FIG. 6C shows an example of enclosing a defective portion with a polygon, and FIG. 6D is a diagram showing an example of enclosing a defective portion with a frame generated by a freehand tool. 第2アノテーション方式の詳細を説明する図である。It is a figure explaining the detail of a 2nd annotation method. 一の例に係る不良箇所を第1アノテーション方式及び第2アノテーション方式で指定する場合を説明する図である。FIG. 10 is a diagram illustrating a case of designating a defective portion according to an example using a first annotation method and a second annotation method; 別の例に係る不良箇所を第1アノテーション方式及び第2アノテーション方式で指定する場合を説明する図である。FIG. 10 is a diagram illustrating another example of designating a defective portion by a first annotation method and a second annotation method; 機械学習ネットワークのパラメータ調整手順の第1の例を示すフローチャートである。Fig. 10 is a flow chart showing a first example of a parameter adjustment procedure for a machine learning network; 学習パラメータ分析の結果を表示したユーザーインターフェース画面の一例を示す図である。FIG. 10 is a diagram showing an example of a user interface screen displaying the results of learning parameter analysis; 不良として判定されなかった不良品画像を表示したユーザーインターフェース画面の一例を示す図である。FIG. 10 is a diagram showing an example of a user interface screen displaying images of defective products that have not been determined as defective; 第2アノテーション方式を実行するユーザーインターフェース画面の一例を示す図である。FIG. 10 is a diagram showing an example of a user interface screen for executing the second annotation method; パラメータ更新後のユーザーインターフェース画面の一例を示す図である。FIG. 10 is a diagram showing an example of a user interface screen after updating parameters; 機械学習ネットワークのパラメータ調整手順の第2の例を示すフローチャートである。FIG. 10 is a flow chart showing a second example of a parameter adjustment procedure for a machine learning network; FIG. 異常抽出用のニューラルネットワークから出力される出力画像の例を示す図である。FIG. 10 is a diagram showing an example of an output image output from a neural network for anomaly extraction; 学習方法の説明図である。It is explanatory drawing of a learning method. 学習方法の説明図である。It is explanatory drawing of a learning method.

以下、本発明の実施形態を図面に基づいて詳細に説明する。尚、以下の好ましい実施形態の説明は、本質的に例示に過ぎず、本発明、その適用物或いはその用途を制限することを意図するものではない。 BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, embodiments of the present invention will be described in detail based on the drawings. It should be noted that the following description of preferred embodiments is essentially merely illustrative, and is not intended to limit the invention, its applications, or its uses.

図1は、本発明の実施形態に係る外観検査装置の設定装置(以下、単に設定装置という)1の構成を示す模式図である。設定装置1は、外観検査装置の各種設定(詳細は後述する)をユーザが行えるようにするための装置である。外観検査装置は、例えば各種部品や製品等のような検査対象であるワークを撮像して取得されたワーク画像の良否判定を行うための装置であり、工場等の生産現場等で使用することができる。具体的には、外観検査装置の内部には機械学習ネットワークが構築されており、この機械学習ネットワークは、良品に対応する良品画像と、不良品に対応する不良品画像とを学習することにより生成されている。生成された機械学習ネットワークに、検査対象のワークを撮像したワーク画像を入力し、当該ワーク画像の良否判定を機械学習ネットワークによって行うことができるようになっている。 FIG. 1 is a schematic diagram showing the configuration of a setting device (hereinafter simply referred to as a setting device) 1 for an appearance inspection apparatus according to an embodiment of the present invention. The setting device 1 is a device that enables a user to make various settings (details of which will be described later) of the visual inspection apparatus. A visual inspection device is a device for judging the quality of a work image obtained by imaging a work to be inspected, such as various parts and products, and can be used at a production site such as a factory. can. Specifically, a machine learning network is built inside the visual inspection device, and this machine learning network is generated by learning a non-defective product image corresponding to a non-defective product and a defective product image corresponding to a defective product. It is A work image obtained by imaging a work to be inspected is input to the generated machine learning network, and the machine learning network can judge whether the work image is good or bad.

ワークは、それ全体が検査対象であってもよいし、ワークの一部のみが検査対象であってもよい。また、1つのワークに複数の検査対象が含まれていてもよい。また、ワーク画像には、複数のワークが含まれていてもよい。 The entire workpiece may be inspected, or only part of the workpiece may be inspected. Also, one workpiece may include a plurality of inspection targets. Also, the workpiece image may include a plurality of workpieces.

設定装置1は、装置本体となる制御ユニット2と、撮像ユニット3と、表示装置(表示部)4と、パーソナルコンピュータ5とを備えている。パーソナルコンピュータ5は、必須なものではなく、省略することもできる。表示装置4の代わりにパーソナルコンピュータ5を使用して各種情報や画像を表示させることもできるし、パーソナルコンピュータ5の機能を制御ユニット2に組み込むことや、表示装置4に組み込むことができる。 The setting device 1 includes a control unit 2 serving as a device main body, an imaging unit 3 , a display device (display section) 4 and a personal computer 5 . The personal computer 5 is not essential and can be omitted. The personal computer 5 can be used instead of the display device 4 to display various information and images, and the functions of the personal computer 5 can be incorporated into the control unit 2 or into the display device 4 .

図1では、設定装置1の構成例の一例として、制御ユニット2、撮像ユニット3、表示装置4及びパーソナルコンピュータ5を記載しているが、これらのうち、任意の複数を組み合わせて一体化することもできる。例えば、制御ユニット2と撮像ユニット3を一体化することや、制御ユニット2と表示装置4を一体化することもできる。また、制御ユニット2を複数のユニットに分割して一部を撮像ユニット3や表示装置4に組み込むことや、撮像ユニット3を複数のユニットに分割して一部を他のユニットに組み込むこともできる。 In FIG. 1, a control unit 2, an imaging unit 3, a display device 4, and a personal computer 5 are shown as an example of the configuration of the setting device 1, but any plurality of these may be combined and integrated. can also For example, the control unit 2 and the imaging unit 3 can be integrated, or the control unit 2 and the display device 4 can be integrated. Also, the control unit 2 can be divided into a plurality of units and some of them can be incorporated into the imaging unit 3 and the display device 4, or the imaging unit 3 can be divided into a plurality of units and some of them can be incorporated into other units. .

また、設定装置1のハードウエアと、外観検査装置のハードウエアとは共通する部分が多いので、設定装置1に外観検査装置の各機能を実現するためのプログラムを組み込んで外観検査機能を有する設定装置1としてもよいし、外観検査装置に設定装置1の各機能を実現するためのプログラムを組み込んで後述する設定機能を有する外観検査装置としてもよい。また、設定装置1と、外観検査装置とは互いに分離された装置であってもよく、この場合、設定装置1と外観検査装置とを相互に通信可能に接続して使用することができる。 Since the hardware of the setting device 1 and the hardware of the visual inspection device have many parts in common, the setting device 1 can be set to have the visual inspection function by incorporating a program for realizing each function of the visual inspection device. The apparatus 1 may be used, or a program for realizing each function of the setting apparatus 1 may be installed in the appearance inspection apparatus to provide an appearance inspection apparatus having a setting function, which will be described later. Moreover, the setting device 1 and the appearance inspection device may be devices separated from each other. In this case, the setting device 1 and the appearance inspection device can be used by connecting them so as to be able to communicate with each other.

(撮像ユニット3の構成)
図2に示すように、撮像ユニット3は、カメラモジュール(撮像部)14と、照明モジュール(照明部)15とを備えており、ワーク画像の取得を実行するユニットである。カメラモジュール14は、撮像光学系を駆動するAF用モータ141と、撮像基板142とを備えている。AF用モータ141は、撮像光学系のレンズを駆動することにより、自動でピント調整を実行する部分であり、従来から周知のコントラストオートフォーカス等の手法によってピント調整を行うことができる。撮像基板142は、撮像光学系から入射した光を受光する受光素子としてCMOSセンサ143を備えている。CMOSセンサ143は、カラー画像を取得することができるように構成された撮像センサである。CMOSセンサ143の代わりに、例えばCCDセンサ等の受光素子を用いることもできる。
(Configuration of imaging unit 3)
As shown in FIG. 2, the imaging unit 3 includes a camera module (imaging section) 14 and an illumination module (illumination section) 15, and is a unit that acquires a workpiece image. The camera module 14 includes an AF motor 141 that drives an imaging optical system, and an imaging board 142 . The AF motor 141 is a part that automatically performs focus adjustment by driving the lens of the imaging optical system, and can perform focus adjustment by conventionally known methods such as contrast autofocus. The imaging substrate 142 includes a CMOS sensor 143 as a light receiving element that receives light incident from the imaging optical system. The CMOS sensor 143 is an imaging sensor configured to acquire a color image. Instead of the CMOS sensor 143, for example, a light receiving element such as a CCD sensor can also be used.

照明モジュール15は、ワークを含む撮像領域を照明する発光体としてのLED(発光ダイオード)151と、LED151を制御するLEDドライバ152とを備えている。LED151による発光タイミング、発光時間、発光量は、LEDドライバ152によって任意に制御することができる。LED151は、撮像ユニット3に一体に設けてもよいし、撮像ユニット3とは別体として外部照明ユニットとして設けてもよい。 The illumination module 15 includes LEDs (light emitting diodes) 151 as light emitters that illuminate an imaging area including a workpiece, and an LED driver 152 that controls the LEDs 151 . The light emission timing, light emission time, and light emission amount of the LED 151 can be arbitrarily controlled by the LED driver 152 . The LED 151 may be provided integrally with the imaging unit 3, or may be provided separately from the imaging unit 3 as an external illumination unit.

(表示装置4の構成)
表示装置4は、例えば液晶パネルや有機ELパネル等からなる表示パネルを有している。制御ユニット2から出力されたワーク画像やユーザーインターフェース画像等は表示装置4に表示される。また、パーソナルコンピュータ5が表示パネルを有している場合、パーソナルコンピュータ5の表示パネルを表示装置4の代わりとして利用することができる。
(Configuration of display device 4)
The display device 4 has a display panel such as a liquid crystal panel or an organic EL panel. A work image, a user interface image, and the like output from the control unit 2 are displayed on the display device 4 . Moreover, when the personal computer 5 has a display panel, the display panel of the personal computer 5 can be used as a substitute for the display device 4 .

(操作機器)
設定装置1をユーザが操作するための操作機器としては、例えば、パーソナルコンピュータ5が有するキーボード51やマウス52等を挙げることができるが、これらに限られるものではなく、ユーザによる各種操作を受付可能に構成された機器であればよい。例えば、表示装置4が有するタッチパネル41のようなポインティングデバイスも操作機器に含まれる。
(operating device)
The operation device for the user to operate the setting device 1 includes, for example, the keyboard 51 and the mouse 52 of the personal computer 5, but is not limited to these, and can accept various operations by the user. Any device that is configured to For example, a pointing device such as the touch panel 41 of the display device 4 is also included in the operating device.

キーボード51やマウス52のユーザによる操作は制御ユニット2で検出可能になっている。また、タッチパネル41は、例えば感圧センサを搭載した従来から周知のタッチ式操作パネルであり、ユーザのタッチ操作は制御ユニット2で検出可能になっている。他のポインティングデバイスを用いた場合も同様である。 The user's operation of the keyboard 51 and mouse 52 can be detected by the control unit 2 . Further, the touch panel 41 is a conventionally well-known touch-type operation panel equipped with, for example, a pressure-sensitive sensor, and the user's touch operation can be detected by the control unit 2 . The same is true when using other pointing devices.

(制御ユニット2の構成)
制御ユニット2は、メイン基板13と、コネクタ基板16と、通信基板17と、電源基板18とを備えている。メイン基板13には、表示制御部13aと、画像の不良情報を受け付ける入力部13bと、プロセッサ13cとが設けられている。表示制御部13a及び入力部13bは、例えば、メイン基板13に実装された演算処理装置によって構成することができる。また、1つの演算処理装置によって表示制御部13a、入力部13b及びプロセッサ13cが構成されていてもよいし、別々の演算処理装置によって表示制御部13a、入力部13b及びプロセッサ13cが構成されていてもよい。
(Configuration of control unit 2)
The control unit 2 includes a main board 13 , a connector board 16 , a communication board 17 and a power supply board 18 . The main substrate 13 is provided with a display control section 13a, an input section 13b for receiving image defect information, and a processor 13c. The display control unit 13a and the input unit 13b can be configured by an arithmetic processing device mounted on the main substrate 13, for example. Further, the display control unit 13a, the input unit 13b, and the processor 13c may be configured by one arithmetic processing unit, or the display control unit 13a, the input unit 13b, and the processor 13c may be configured by separate arithmetic processing units. good too.

表示制御部13a、入力部13b及びプロセッサ13cは、接続されている各基板及びモジュールの動作を制御する。例えば、プロセッサ13cは、照明モジュール15のLEDドライバ152に対してLED151の点灯/消灯を制御する照明制御信号を出力する。LEDドライバ152は、プロセッサ13cからの照明制御信号に応じて、LED151の点灯/消灯の切替及び点灯時間の調整を行うとともに、LED151の光量等を調整する。 The display control unit 13a, the input unit 13b, and the processor 13c control the operations of the connected substrates and modules. For example, the processor 13 c outputs a lighting control signal for controlling lighting/lighting out of the LED 151 to the LED driver 152 of the lighting module 15 . The LED driver 152 adjusts the light amount of the LED 151 and the like while switching between lighting/lighting out of the LED 151 and adjusting the lighting time according to the lighting control signal from the processor 13c.

また、プロセッサ13cは、カメラモジュール14の撮像基板142に、CMOSセンサ143を制御する撮像制御信号を出力する。CMOSセンサ143は、プロセッサ13cからの撮像制御信号に応じて、撮像を開始するとともに、露光時間を任意の時間に調整して撮像を行う。すなわち、撮像ユニット3は、プロセッサ13cから出力される撮像制御信号に応じてCMOSセンサ143の視野範囲内を撮像し、視野範囲内にワークがあれば、ワークを撮像することになるが、ワーク以外の物が視野範囲内にあれば、それも撮像することができる。例えば、設定装置1は、機械学習ネットワークの学習用の画像として、撮像ユニット3により、良品に対応する良品画像と不良品に対応する不良品画像とを撮像することができる。学習用の画像は、撮像ユニット3で撮像された画像でなくてもよく、他のカメラ等で撮像された画像であってもよい。 The processor 13c also outputs an imaging control signal for controlling the CMOS sensor 143 to the imaging board 142 of the camera module 14 . The CMOS sensor 143 starts imaging in response to an imaging control signal from the processor 13c, adjusts the exposure time to an arbitrary time, and performs imaging. That is, the imaging unit 3 captures an image within the visual field range of the CMOS sensor 143 according to the imaging control signal output from the processor 13c. If an object is within the field of view, it can also be imaged. For example, the setting device 1 can capture a non-defective product image corresponding to a non-defective product and a defective product image corresponding to a defective product using the imaging unit 3 as images for learning a machine learning network. The learning image may not be an image captured by the imaging unit 3, but may be an image captured by another camera or the like.

一方、外観検査装置の運用時には、撮像ユニット3により、ワークを撮像することができる。また、CMOSセンサ143は、ライブ画像、即ち現在の撮像された画像を短いフレームレートで随時出力することができるように構成されている。 On the other hand, during operation of the visual inspection apparatus, the image of the work can be imaged by the imaging unit 3 . In addition, the CMOS sensor 143 is configured so as to be able to output a live image, that is, a currently captured image at a short frame rate at any time.

CMOSセンサ143による撮像が終わると、撮像ユニット3から出力された画像信号は、メイン基板13のプロセッサ13cに入力されて処理されるとともに、メイン基板13のメモリ13dに記憶されるようになっている。メイン基板13のプロセッサ13cによる具体的な処理内容の詳細については後述する。尚、メイン基板13には、FPGAやDSP等の処理装置が設けられていてもよい。FPGAやDSP等の処理装置が統合されたプロセッサ13cであってもよい。 When the CMOS sensor 143 finishes capturing an image, the image signal output from the imaging unit 3 is input to the processor 13c of the main substrate 13, processed, and stored in the memory 13d of the main substrate 13. . Details of specific processing contents by the processor 13c of the main board 13 will be described later. Note that the main board 13 may be provided with a processing device such as FPGA or DSP. A processor 13c integrated with a processing device such as FPGA or DSP may be used.

コネクタ基板16は、電源インターフェース161に設けてある電源コネクタ(図示せず)を介して外部から電力の供給を受ける部分である。電源基板18は、コネクタ基板16で受けた電力を各基板及びモジュール等に分配する部分であり、具体的には、照明モジュール15、カメラモジュール14、メイン基板13、及び通信基板17に電力を分配する。電源基板18は、AF用モータドライバ181を備えている。AF用モータドライバ181は、カメラモジュール14のAF用モータ141に駆動電力を供給し、オートフォーカスを実現している。AF用モータドライバ181は、メイン基板13のプロセッサ13cからのAF制御信号に応じて、AF用モータ141に供給する電力を調整する。 The connector board 16 is a part that receives power supply from the outside via a power connector (not shown) provided on the power interface 161 . The power supply board 18 is a part that distributes the power received by the connector board 16 to each board and modules. do. The power supply board 18 has an AF motor driver 181 . The AF motor driver 181 supplies drive power to the AF motor 141 of the camera module 14 to achieve autofocus. The AF motor driver 181 adjusts power supplied to the AF motor 141 according to an AF control signal from the processor 13c of the main board 13. FIG.

通信基板17は、メイン基板13と表示装置4及びパーソナルコンピュータ5との通信、メイン基板13と外部制御機器(図示せず)との通信等を実行する部分である。外部制御機器は、例えばプログラマブルロジックコントローラ等を挙げることができる。通信は、有線であってもよいし、無線であってもよく、いずれの通信形態も、従来から周知の通信モジュールによって実現することができる。 The communication board 17 is a part that executes communication between the main board 13 and the display device 4 and the personal computer 5, communication between the main board 13 and an external control device (not shown), and the like. The external control device can be, for example, a programmable logic controller or the like. Communication may be wired or wireless, and either form of communication can be realized by conventionally known communication modules.

制御ユニット2には、例えばソリッドステートドライブ、ハードディスクドライブ等からなる記憶装置(記憶部)19が設けられている。記憶装置19には、後述する各制御及び処理を上記ハードウエアによって実行可能にするためのプログラムファイル80や設定ファイル等(ソフトウエア)が記憶されている。プログラムファイル80や設定ファイルは、例えば光ディスク等の記憶媒体90に格納しておき、この記憶媒体90に格納されたプログラムファイル80や設定ファイルを制御ユニット2にインストールすることができる。プログラムファイル80は、外部サーバから通信回線を利用してダウンロードされるものであってもよい。また、記憶装置19には、例えば、上記画像データや、外観検査装置の機械学習ネットワークを構築するためのパラメータ等を記憶させておくこともできる。 The control unit 2 is provided with a storage device (storage section) 19 such as a solid state drive, a hard disk drive, or the like. The storage device 19 stores program files 80, setting files, and the like (software) for enabling the hardware to execute various controls and processes, which will be described later. The program files 80 and setting files can be stored in a storage medium 90 such as an optical disk, for example, and the program files 80 and setting files stored in this storage medium 90 can be installed in the control unit 2 . The program file 80 may be downloaded from an external server using a communication line. The storage device 19 can also store, for example, the image data, parameters for constructing a machine learning network of the visual inspection apparatus, and the like.

(アノテーション)
設定装置1は、外観検査装置の機械学習ネットワークに、良品に対応する良品画像と不良品に対応する不良品画像とを入力して学習させることにより、当該機械学習ネットワークのパラメータを調整する。例えば、機械学習ネットワークのパラメータの初期値を無作為に決定しておき、機械学習ネットワークから出力される画像認識の誤差をフィードバックしながらパラメータを調整していく手法を採用できる。
(annotation)
The setting device 1 adjusts the parameters of the machine learning network of the visual inspection apparatus by inputting a non-defective product image corresponding to a non-defective product and a defective product image corresponding to a defective product to the machine learning network. For example, it is possible to adopt a method of randomly determining the initial values of the parameters of the machine learning network, and adjusting the parameters while feeding back the image recognition error output from the machine learning network.

ユーザは、機械学習ワークの学習に先立ち、機械学習ネットワークに入力する画像が良品画像であるか、不良品画像であるか、また、機械学習ネットワークに入力する画像が不良品画像である場合にどこが不良箇所であるかを指定する必要がある。これがユーザ自身によるアノテーションであり、本実施形態では、第1アノテーション方式と、第2アノテーション方式を含む複数の方式でアノテーションの実行が可能になっている。 Prior to learning the machine learning work, the user determines whether the image input to the machine learning network is a good product image or a defective product image, and if the image input to the machine learning network is a defective product image, where is it? It is necessary to specify whether it is a defective part. This is the annotation by the user himself/herself, and in this embodiment, annotation can be executed by a plurality of methods including the first annotation method and the second annotation method.

図3に示すように、ユーザによるアノテーションの実行開始操作が行われると、ステップSA1に進み、アノテーションを行う画像をユーザが選択する。例えば図4に示すようなワークWを含む画像を設定装置1に複数記憶させておき、その中からユーザが所望の画像を選択する。その後、ステップSA2に進むと、図4のFIG.4A及びFIG.4Bにそれぞれ示すように、表示制御部13aは、アノテーション実行用ユーザーインターフェース画面200を生成し、表示装置4に表示させる。アノテーション実行用ユーザーインターフェース画面200には、機械学習ネットワークに学習させるための画像を表示するための画像表示領域201が設けられている。FIG.4Aには、画像表示領域201に不良品画像202が表示されている場合を示しており、黒丸の部分が不良箇所202aである。またFIG.4Bには、画像表示領域201に良品画像203が表示されている場合を示している。これが表示ステップである。つまり、ユーザがアノテーションを実行する前段階で、表示制御部13aが機械学習ネットワークに学習させるための画像を表示装置4に表示させることで、ユーザは表示装置4に表示されている画像を見ながら、アノテーションを実行することができる。 As shown in FIG. 3, when the user performs an annotation execution start operation, the process proceeds to step SA1, where the user selects an image to be annotated. For example, a plurality of images including a workpiece W as shown in FIG. 4 are stored in the setting device 1, and the user selects a desired image from among them. After that, when proceeding to step SA2, FIG. 4A and FIG. As shown in 4B, the display control unit 13a generates an annotation execution user interface screen 200 and causes the display device 4 to display it. An annotation execution user interface screen 200 is provided with an image display area 201 for displaying an image for learning by the machine learning network. FIG. 4A shows the case where the defective product image 202 is displayed in the image display area 201, and the black circled portion is the defective portion 202a. Also, FIG. 4B shows a case where a non-defective product image 203 is displayed in the image display area 201. FIG. This is the display step. That is, before the user executes the annotation, the display control unit 13a causes the display device 4 to display an image for the machine learning network to learn, so that the user can , annotation can be performed.

次いでステップSA3に進み、第1アノテーション方式によるアノテーションをユーザが行う。第1アノテーション方式では、表示装置4に表示された画像に対し、良品画像または不良品画像であることを示すラベルを付与する。具体的には、図4のFIG.4Aでは、不良品画像202が表示されているので、その不良品画像202には、右側に示すように不良品画像であることを示すラベルとして例えば「NG」等と記載された不良品ラベルA1を付与する。この不良品ラベルA1が第1アノテーション方式で入力された不良情報である。 Next, in step SA3, the user makes an annotation according to the first annotation method. In the first annotation method, the image displayed on the display device 4 is labeled as a non-defective product image or a defective product image. Specifically, FIG. In 4A, a defective product image 202 is displayed. As shown on the right side, the defective product image 202 has a defective product label A1 with, for example, "NG" as a label indicating that it is a defective product image. to give This defective product label A1 is defective information input by the first annotation method.

一方、図4のFIG.4Bでは、良品画像203が表示されているので、その画像203には、右側に示すように良品画像であることを示すラベルとして例えば「OK」等と記載された良品ラベルA2を付与する。この良品ラベルA2が第1アノテーション方式で入力された良品情報である。ユーザによるラベルの付与方法はどのような方法であってもよく、例えば「NG」と表示されたボタン及び「OK」と表示されたボタンをアノテーション実行用ユーザーインターフェース画面200に設けておき、このボタンの操作によって所望のラベルA1、A2を付与するようにしてもよい。 On the other hand, FIG. In 4B, a non-defective product image 203 is displayed, so the image 203 is given a non-defective product label A2 indicating that it is a non-defective product image, for example, "OK", as shown on the right side. This non-defective item label A2 is the non-defective item information input by the first annotation method. Any labeling method may be used by the user. For example, a button labeled "NG" and a button labeled "OK" may be provided on the annotation execution user interface screen 200, and these buttons desired labels A1 and A2 may be given by the operation of .

第1アノテーション方式によるラベルの付与方法としては、画像に1枚ずつ付与してもよいし、例えば複数の不良品画像を特定のフォルダに保存しておき、そのフォルダ内の不良品画像に対して一括して不良品ラベルA1を付与してもよい。また、良品画像についても同様に複数の良品画像を特定のフォルダに保存しておき、そのフォルダ内の良品画像に対して一括して良品ラベルA2を付与してもよい。 As a labeling method according to the first annotation method, labels may be attached to images one by one. The defective product label A1 may be given collectively. Also, as for non-defective product images, a plurality of non-defective product images may be similarly stored in a specific folder, and the non-defective product images in the folder may collectively be given the non-defective product label A2.

良品画像203の場合は、図3に示すフローチャートのステップSA4及びSA5を省略してステップSA6に進む。ステップSA6では、入力部13bが、第1アノテーション方式で入力された良品情報を受け付ける。入力部13bは、表示装置4に表示されている良品画像203と、良品情報(ラベルA2)とを関連付けた状態で、記憶装置19に記憶させておくことができる。 In the case of the non-defective product image 203, steps SA4 and SA5 in the flow chart shown in FIG. 3 are omitted and the process proceeds to step SA6. At step SA6, the input unit 13b receives non-defective item information input by the first annotation method. The input unit 13b can store the non-defective product image 203 displayed on the display device 4 and the non-defective product information (label A2) in the storage device 19 in association with each other.

不良品画像202の場合は、図3に示すフローチャートのステップSA4及びSA5を省略してステップSA6に進んでもよいし、ステップSA4及びSA5を実行してステップSA6に進んでもよい。ステップSA4及びSA5を省略する場合、ステップSA6では、入力部13bが、第1アノテーション方式で入力された不良情報を受け付ける。入力部13bは、表示装置4に表示されている不良品画像202と、不良情報(不良品ラベルA1)とを関連付けた状態で、記憶装置19に記憶させておくことができる。 In the case of the defective product image 202, steps SA4 and SA5 of the flowchart shown in FIG. 3 may be skipped and the process may proceed to step SA6, or steps SA4 and SA5 may be executed and the process may proceed to step SA6. When steps SA4 and SA5 are omitted, in step SA6, the input unit 13b receives defect information input by the first annotation method. The input unit 13b can cause the storage device 19 to store the defective product image 202 displayed on the display device 4 and the defective product information (the defective product label A1) in association with each other.

ステップSA4及びステップSA5は、表示装置4に表示された画像が不良品画像202である場合に不良箇所を指定する第2アノテーション方式の例である。ステップSA4及びステップSA5の一方のみ実行してもよいし、両方を実行してもよい。ステップSA3からステップSA4またはステップSA5に進む場合には、ユーザが所定の操作を行うようにしてもよいし、不良ラベルA2が付与されたことを検知し、自動で進むようにしてもよい。 Steps SA4 and SA5 are an example of a second annotation method for designating a defective portion when the image displayed on the display device 4 is the defective product image 202 . Only one of step SA4 and step SA5 may be executed, or both may be executed. When proceeding from step SA3 to step SA4 or step SA5, the user may perform a predetermined operation, or the application of the defective label A2 may be detected and the process may proceed automatically.

ステップSA4は、表示装置4に表示された不良品画像202の不良箇所202aを囲むことで当該不良箇所202aを指定する領域指定方式の例であり、またステップSA5は、表示装置4に表示された不良品画像202の不良箇所202aをなぞることで当該不良箇所202aを自由形状で指定する精密指定方式の例である。ユーザは、領域指定方式と、精密指定方式のどちらでも選択することができる。 Step SA4 is an example of a method of specifying the defective part 202a by enclosing the defective part 202a of the defective product image 202 displayed on the display device 4. This is an example of a precise designation method in which the defective portion 202a of the defective product image 202 is traced to designate the defective portion 202a in a free form. The user can select either the area specification method or the precise specification method.

ステップSA3の後、図5に示すように、表示制御部13aは、アノテーション実行用ユーザーインターフェース画面200を表示装置4に表示させ、画像表示領域201には不良品ラベルA1が付与された不良品画像202を表示させる。アノテーション実行用ユーザーインターフェース画面200には、指定方式選択ウインドウ204が表示される。指定方式選択ウインドウ204には、領域指定方式を選択するための第1ボタン204aと、精密指定方式を選択するための第2ボタン204bと、消しゴムツールを選択するための第3ボタン204cとが設けられている。第1ボタン204aがユーザによって操作されたことを検出すると図3に示すフローチャートのステップSA4に進み、第2ボタン204bがユーザによって操作されたことを検出するとステップSA5に進む。尚、第3ボタン204cを操作すると、領域指定方式や精密指定方式による指定操作の少なくとも一部を取り消したり、指定した領域の一部を消したりすることができる。 After step SA3, as shown in FIG. 5, the display control unit 13a causes the display device 4 to display a user interface screen 200 for annotation execution, and an image display area 201 displays a defective product image with a defective product label A1. 202 is displayed. A designation method selection window 204 is displayed on the annotation execution user interface screen 200 . The designation method selection window 204 is provided with a first button 204a for selecting an area designation method, a second button 204b for selecting a precise designation method, and a third button 204c for selecting an eraser tool. It is When it is detected that the first button 204a has been operated by the user, the process proceeds to step SA4 of the flowchart shown in FIG. 3, and when it is detected that the second button 204b has been operated by the user, the process proceeds to step SA5. By operating the third button 204c, it is possible to cancel at least part of the specifying operation by the area specifying method or the precise specifying method, or to erase part of the specified area.

ステップSA4では、表示装置4に表示されているマウス52のポインタ205(図5に示す)やマウス52のクリックボタン(図示せず)をユーザが操作して不良品画像202の不良箇所202aを囲む。図5に示す例では、ユーザがマウス52のポインタ205及びクリックボタンを操作し、不良箇所202aを囲む大きさの矩形状の枠206を生成した例である。矩形状の枠206を生成する際には、例えば左上の頂点に対応する位置にポインタ205を置いて斜め右下にドラッグすることで、所望の位置に所望の大きさ及び形状の枠206を生成できる。枠206の大きさや位置はマウス52の操作によって変更可能になっている。 In step SA4, the user operates the pointer 205 (shown in FIG. 5) of the mouse 52 and the click button (not shown) of the mouse 52 displayed on the display device 4 to surround the defective part 202a of the defective product image 202. . In the example shown in FIG. 5, the user operates the pointer 205 and the click button of the mouse 52 to generate a rectangular frame 206 having a size surrounding the defective portion 202a. When generating the rectangular frame 206, for example, by placing the pointer 205 at the position corresponding to the upper left vertex and dragging it diagonally to the lower right, the frame 206 of the desired size and shape is generated at the desired position. can. The size and position of the frame 206 can be changed by operating the mouse 52 .

また、図6のFIG.6Aに示すように、不良品画像202上でポインタ205によって3つの点207を指定し、これら3つの点207を通る円形の枠208を生成し、この枠208で不良箇所202aを囲むようにしてもよい。また、図6のFIG.6Bに示すように、不良品画像202上でポインタ205によって点210を指定し、この点210を中心とする円形の枠211を生成し、この枠211で不良箇所202aを囲むようにしてもよい。 Also, FIG. As shown in 6A, three points 207 may be designated by a pointer 205 on the defective product image 202, a circular frame 208 passing through these three points 207 may be generated, and the defective portion 202a may be surrounded by this frame 208. . Also, FIG. As shown in 6B, a point 210 may be designated on the defective product image 202 by a pointer 205, a circular frame 211 centered on this point 210 may be generated, and the defective portion 202a may be surrounded by this frame 211. FIG.

また、図6のFIG.6Cに示すように、不良品画像202上でポインタ205によって複数の点212を指定し、この点212を繋ぐ形状の枠213を生成し、この枠213で不良箇所202aを囲むようにしてもよい。また、図6のFIG.6Dに示すように、不良品画像202上で不良箇所202aを囲むようにポインタ205を動かして自由形状の枠214を生成し、この枠214で不良箇所202aを囲むようにしてもよい。FIG.6Dに示す例では、いわゆるフリーハンドツールによる自由描画によって領域を指定する方法である。どの指定方法にするかは、不良箇所202aの形状や大きさによって決定すればよい。 Also, FIG. As shown in 6C, a plurality of points 212 may be designated by a pointer 205 on the defective product image 202, a frame 213 shaped to connect the points 212 may be generated, and the frame 213 may surround the defective portion 202a. Also, FIG. As shown in 6D, a free-form frame 214 may be generated by moving the pointer 205 on the defective product image 202 so as to surround the defective portion 202a, and the frame 214 may surround the defective portion 202a. FIG. The example shown in 6D is a method of designating an area by free drawing using a so-called freehand tool. Which designation method to use may be determined according to the shape and size of the defective portion 202a.

以上のようにしてステップSA4では、不良情報として不良箇所202aを囲む枠206、208、211、213、214の位置、形状及び大きさが取得される。例えば、図5に示す枠206の中心座標と、縦辺及び横辺の長さとを取得することで、不良品画像202における不良箇所202aを特定することができる。図6に示す場合も同様に枠208、211、213、214の情報を取得することで、不良品画像202における不良箇所202aを特定することができる。この不良箇所202aを特定する情報が不良情報である。 As described above, in step SA4, the positions, shapes, and sizes of frames 206, 208, 211, 213, and 214 surrounding the defective portion 202a are acquired as defect information. For example, by acquiring the center coordinates and the lengths of the vertical and horizontal sides of the frame 206 shown in FIG. Similarly, in the case shown in FIG. 6, by obtaining information on frames 208, 211, 213, and 214, the defective portion 202a in the defective product image 202 can be identified. The information specifying the defective portion 202a is the defect information.

ステップSA4でユーザが不良箇所202aを指定すると、ステップSA6に進む。ステップSA6では、入力部13bが、ステップSA4で入力された不良情報を受け付ける。入力部13bは、表示装置4に表示されている不良品画像202と、ステップSA4で入力された不良情報とを関連付けた状態で、記憶装置19に記憶させておくことができる。 When the user designates the defective portion 202a in step SA4, the process proceeds to step SA6. At step SA6, the input unit 13b receives the defect information input at step SA4. The input unit 13b can cause the storage device 19 to store the defective product image 202 displayed on the display device 4 in association with the defective product information input in step SA4.

図5に示すアノテーション実行用ユーザーインターフェース画面200上の指定方式選択ウインドウ204でユーザが第2ボタン204bを操作してステップSA5に進むと、図7のFIG.7Aに示すように、塗り潰しツール220がアノテーション実行用ユーザーインターフェース画面200に表示される。ユーザがマウス52を操作することによって塗り潰しツール220を自由に動かすことができる。ユーザは、不良品画像202における不良箇所202aをなぞるように塗り潰しツール220を動かすことで、不良箇所202aを自由形状で指定することができる。塗り潰しツール220によって不良箇所202aをなぞることで、不良箇所202a以外の部分が含まれにくくなるので、ステップSA4の領域指定方式に比べて精密なアノテーションが可能になる。塗り潰しツール220によって塗りつぶされた領域の位置及び形状、大きさを取得することで、不良品画像202における不良箇所202aを特定することができる。この不良箇所202aを特定する情報が不良情報である。 When the user operates the second button 204b in the designation method selection window 204 on the annotation execution user interface screen 200 shown in FIG. 5 to proceed to step SA5, FIG. As shown in 7A, a fill tool 220 is displayed on the annotation-performing user interface screen 200 . The fill tool 220 can be freely moved by the user operating the mouse 52 . The user can specify the defective portion 202a in a free form by moving the paint tool 220 so as to trace the defective portion 202a in the defective product image 202. FIG. By tracing the defective portion 202a with the paint-out tool 220, portions other than the defective portion 202a are less likely to be included, enabling more precise annotation than the region designation method in step SA4. By obtaining the position, shape, and size of the region filled with the filling tool 220, the defective portion 202a in the defective product image 202 can be identified. The information specifying the defective portion 202a is the defect information.

図3に示すフローチャートのステップSA5でユーザが塗り潰しツール220によって不良箇所202aを指定すると、ステップSA6に進む。ステップSA6では、入力部13bが、ステップSA5で入力された不良情報を受け付ける。入力部13bは、表示装置4に表示されている不良品画像202と、ステップSA5で入力された不良情報とを関連付けた状態で、記憶装置19に記憶させておくことができる。 When the user designates the defective portion 202a with the painting tool 220 at step SA5 of the flowchart shown in FIG. 3, the process proceeds to step SA6. At step SA6, the input unit 13b receives the defect information input at step SA5. The input unit 13b can cause the storage device 19 to store the defective product image 202 displayed on the display device 4 in association with the defective product information input in step SA5.

ステップSA5では、上述した塗り潰しツール220以外にも、例えば図7のFIG.7Bに示すようなマグネットツール221で不良箇所202aを指定してもよい。マグネットツール221は、マウス52の操作で移動させることができ、不良箇所202aの近傍まで移動させると、不良箇所202aへ自動的に吸い付けられるように移動する。複数のマグネットツール221を繋ぐ枠222内に不良箇所202aが入るので、ユーザの負担を軽減しながら不良箇所202aの精密な指定を行うことができる。枠222の位置及び形状、大きさが不良情報である。 In step SA5, for example, FIG. The defective portion 202a may be specified with a magnet tool 221 as shown in 7B. The magnet tool 221 can be moved by operating the mouse 52, and when moved to the vicinity of the defective portion 202a, it moves so as to be automatically attracted to the defective portion 202a. Since the defective portion 202a is contained within the frame 222 that connects the plurality of magnet tools 221, the defective portion 202a can be specified precisely while reducing the burden on the user. The position, shape, and size of the frame 222 are defect information.

また、ステップSA5では、例えば図7のFIG.7Cに示すようなGrabCutツール223で不良箇所202aを指定してもよい。GrabCutツール223によって不良箇所202aと当該不良箇所202aの周囲とを囲むと、その領域が指定され、指定された領域内で当該不良箇所202aを自動抽出する自動抽出方式を実行する。自動抽出方式では、不良箇所202aのみが指定され、不良箇所202aの周囲の領域が指定されないので、右に白丸で示すように不良箇所202aの精密指定が自動的に行われる。これにより、ユーザの負担を軽減できる。 Further, in step SA5, for example, FIG. A GrabCut tool 223, such as that shown in 7C, may be used to designate the defect location 202a. When the defective portion 202a and the periphery of the defective portion 202a are enclosed by the GrabCut tool 223, the area is designated, and an automatic extraction method is executed to automatically extract the defective portion 202a within the designated region. In the automatic extraction method, only the defective portion 202a is specified, and the surrounding area of the defective portion 202a is not specified. Therefore, the defective portion 202a is automatically precisely specified as indicated by the white circle on the right. This reduces the burden on the user.

ただし、GrabCutツール223の場合、不良箇所202aの精密指定が失敗する場合があり、この場合、不良箇所202aの周囲の領域まで含まれてしまう。精密指定が失敗した場合をFIG.7Cの下に示しており、この例では円形の不良箇所202aが矩形に近い形状であると誤って指定されている。このような場合、自動抽出方式の実行後、ストローク修正を行うか、クリック修正を行うことにより、前景背景をユーザが細かく指定していき、GrabCutツール223によって自動抽出された領域の形状の修正を入力部13bが受け付ける。 However, in the case of the GrabCut tool 223, the precise designation of the defective portion 202a may fail, and in this case, the area around the defective portion 202a is also included. FIG. 7C, in which the circular defect 202a is incorrectly specified to be nearly rectangular in this example. In such a case, after the execution of the automatic extraction method, the user finely specifies the foreground and background by correcting the stroke or correcting the click, and the shape of the area automatically extracted by the GrabCut tool 223 is corrected. The input unit 13b accepts.

また、AI Assisted指定によって不良箇所202aを指定してもよい。AI Assisted指定の場合、不良箇所202aの輪郭を大まかに指定して抽出した後、その抽出箇所の内部をFillツール等で指定する。これにより、不良箇所202aを自動抽出することができる。不良箇所202aを自動抽出した後、微修正することも可能である。 Alternatively, the defective portion 202a may be designated by AI Assisted designation. In the case of AI Assisted designation, after roughly designating and extracting the contour of the defective portion 202a, the inside of the extracted portion is designated by a Fill tool or the like. Thereby, the defective portion 202a can be automatically extracted. After automatically extracting the defective portion 202a, it is also possible to make minor corrections.

ステップSA6の後、ステップSA7に進み、アノテーションを行った画像の数が必要数に達したか否かを判定する。NOと判定されて必要数に満たない場合にはステップSA1に進む。一方、YESと判定されて必要数のアノテーションが完了すると、アノテーションを終了する。ステップSA1~SA7は、第1アノテーション方式と第2アノテーション方式とのいずれかの方式で入力された不良情報を受け付ける入力ステップである。 After step SA6, the process proceeds to step SA7 to determine whether or not the number of annotated images has reached the required number. If the determination is NO and the required number is not reached, the process proceeds to step SA1. On the other hand, when the determination is YES and the required number of annotations is completed, the annotation is terminated. Steps SA1 to SA7 are input steps for receiving defect information input by either the first annotation method or the second annotation method.

(アノテーションの具体例)
図8のFIG.8Aは、不良品画像202に1本の線状の不良箇所202aが存在する場合を示している。FIG.8Bは、ステップSA3の第1アノテーション方式によって不良品ラベルA1が付与された状態を示している。FIG.8Cは、ステップSA4の領域指定方式で矩形状の枠206を生成し、生成した枠206で不良箇所202aを囲むことによって当該不良箇所202aを指定した場合を示している。FIG.8Dは、ステップSA4の領域指定方式で複数の点を繋ぐ枠213を生成し、生成した枠213で不良箇所202aを囲むことによって当該不良箇所202aを指定した場合を示している。FIG.8Eは、ステップSA5の精密指定方式でフリーハンドツールを使用して不良箇所202aを囲む枠230を生成し、この枠230によって不良箇所202aを指定した場合を示している。ユーザは、第1アノテーション方式の後、領域指定方式によるアノテーションを行ってもよいし、精密指定方式によるアノテーションを行ってもよい。領域指定方式によるアノテーション後、当該領域指定方式によるアノテーションを取り消してから、精密指定方式によるアノテーションを行ってもよい。
(Specific example of annotation)
FIG. 8A shows the case where the defective product image 202 has one linear defective portion 202a. FIG. 8B shows the state in which the defective product label A1 is given by the first annotation method in step SA3. FIG. 8C shows a case where a rectangular frame 206 is generated by the region designation method of step SA4, and the defective portion 202a is designated by enclosing the defective portion 202a with the generated frame 206. FIG. FIG. 8D shows a case where a frame 213 connecting a plurality of points is generated by the region designation method of step SA4, and the defective portion 202a is designated by enclosing the defective portion 202a with the generated frame 213. FIG. FIG. 8E shows a case where a frame 230 surrounding the defective portion 202a is generated using a freehand tool in the precise designation method of step SA5, and the defective portion 202a is designated by this frame 230. FIG. After the first annotation method, the user may perform annotation by the region designation method or may perform annotation by the precise designation method. After the annotation by the region designation method, the annotation by the region designation method may be canceled and then the annotation by the precise designation method may be performed.

図9のFIG.9Aは、不良品画像202に、互いに交わる2本の線状の不良箇所202aが存在する場合を示している。FIG.9Bは、ステップSA3の第1アノテーション方式によって不良品ラベルA1が付与された状態を示している。FIG.9Cは、ステップSA4の領域指定方式で矩形状の枠206を生成し、生成した枠206で不良箇所202aを囲むことによって当該不良箇所202aを指定した場合を示している。FIG.9Dは、ステップSA4の領域指定方式で複数の点を繋ぐ枠213を生成し、生成した枠213で不良箇所202aを囲むことによって当該不良箇所202aを指定した場合を示している。FIG.9Eは、ステップSA5の精密指定方式でフリーハンドツールを使用して不良箇所202aを囲む枠230を生成し、この枠230によって不良箇所202aを指定した場合を示している。FIG.9D及びFIG.9Eに示す例では、FIG.9Cに示す例に比べて不良箇所202aの精密指定が可能になる。 FIG. 9A shows the case where the defective product image 202 has two linear defective portions 202a that intersect with each other. FIG. 9B shows the state in which the defective product label A1 is given by the first annotation method in step SA3. FIG. 9C shows a case where a rectangular frame 206 is generated by the area designation method of step SA4, and the defective portion 202a is designated by enclosing the defective portion 202a with the generated frame 206. FIG. FIG. 9D shows a case where a frame 213 connecting a plurality of points is generated by the region designation method of step SA4, and the defective portion 202a is designated by enclosing the defective portion 202a with the generated frame 213. FIG. FIG. 9E shows a case where a frame 230 surrounding the defective portion 202a is generated using a freehand tool in the precise designation method of step SA5, and the defective portion 202a is designated by this frame 230. FIG. FIG. 9D and FIG. In the example shown in FIG. 9E, FIG. As compared with the example shown in 9C, it becomes possible to specify the defective portion 202a precisely.

FIG.9Fは、ステップSA4の領域指定方式で矩形状の枠206を2つ生成し、2つの枠206で不良箇所202aを指定した場合を示している。FIG.9Gは、ステップSA4の領域指定方式で矩形状の枠206と、複数の点を繋ぐ枠213とを生成し、枠206、213で不良箇所202aを指定した場合を示している。このように、複数種の枠206、213を組み合わせて不良箇所202aを指定してもよい。 FIG. 9F shows the case where two rectangular frames 206 are generated by the area designation method of step SA4 and the defective portion 202a is designated by the two frames 206. FIG. FIG. 9G shows a case where a rectangular frame 206 and a frame 213 connecting a plurality of points are generated by the region designation method of step SA4, and the defective portion 202a is designated by the frames 206 and 213. FIG. In this way, the defective portion 202a may be designated by combining a plurality of types of frames 206 and 213. FIG.

(機械学習ネットワークのパラメータ調整手順の第1の例)
プロセッサ13cは、第1アノテーション方式で入力された不良情報を有する不良品画像202と、第2アノテーション方式で入力された不良情報を有する不良品画像202との両方を機械学習ネットワークに学習させる。すなわち、第1アノテーション方式で不良品画像202であることを示す不良品ラベルA1が付与された不良品画像202と、第2アノテーション方式で不良箇所202aが指定された不良品画像202とを単一の前記機械学習ネットワークに入力し、各不良品画像202の不良情報に基づいて当該機械学習ネットワークのパラメータを調整するように構成されている。
(First example of parameter adjustment procedure for machine learning network)
The processor 13c causes the machine learning network to learn both the defective product image 202 having the defect information input by the first annotation method and the defective product image 202 having the defect information input by the second annotation method. That is, the defective product image 202 to which the defective product label A1 indicating that it is a defective product image 202 by the first annotation method and the defective product image 202 to which the defective part 202a is specified by the second annotation method are combined into a single image. and adjust the parameters of the machine learning network based on the defect information of each defective product image 202 .

以下、図10に示すフローチャートに基づいて、機械学習ネットワークのパラメータ調整手順の第1の例について具体的に説明する。機械学習ネットワークのパラメータ調整は、ユーザが行ってもよいし、設定装置1を製造するメーカが行ってもよいし、クラウド上でおこなってもよい。 A first example of the parameter adjustment procedure of the machine learning network will be specifically described below based on the flowchart shown in FIG. The parameter adjustment of the machine learning network may be performed by the user, by the manufacturer of the setting device 1, or on the cloud.

スタート後のステップSB1では、第1アノテーション方式によるアノテーションを行う。ステップSB2では、プロセッサ13cが、第1アノテーション方式で良品ラベルA2が付与された良品画像203と、第1アノテーション方式で不良品ラベルA1が付与された不良品画像202を機械学習ネットワークに学習させる。すなわち、プロセッサ13cは、各良品画像203の良品情報と、各不良品画像202の不良情報とに基づいて機械学習ネットワークのパラメータを調整する。ステップSB2で機械学習ネットワークに学習させる良品画像203及び不良品画像202の枚数は任意の枚数に設定することができる。ステップSB2は、不良品画像の不良情報に基づいて機械学習ネットワークのパラメータを調整する調整ステップである。 At step SB1 after the start, annotation is performed according to the first annotation method. At step SB2, the processor 13c causes the machine learning network to learn the non-defective product image 203 to which the non-defective product label A2 is assigned by the first annotation method and the defective product image 202 to which the defective product label A1 is assigned by the first annotation method. That is, the processor 13c adjusts the parameters of the machine learning network based on the non-defective product information of each non-defective product image 203 and the defective product information of each defective product image 202 . The number of non-defective product images 203 and defective product images 202 to be learned by the machine learning network in step SB2 can be set to any number. Step SB2 is an adjustment step for adjusting the parameters of the machine learning network based on the defect information of the defective product image.

その後、ステップSB3に進み、プロセッサ13cが検証処理を実行する。具体的には、第1アノテーション方式で不良品画像202であることを示す不良品ラベルA1が付与された不良品画像202を学習することにより生成された機械学習ネットワークに、プロセッサ13cが複数の互いに異なる検証用画像データを入力して当該検証用画像データの良否判定を機械学習ネットワークに実行させる。ステップSB3では、プロセッサ13cが図11に示すようなユーザーインターフェース画面300を生成し、表示制御部13aが表示装置4に表示させる。ステップSB3は、パラメータが調整された後の機械学習ネットワークに検証用画像データを入力して当該検証用画像データの良否判定を実行する検証ステップである。 After that, the process proceeds to step SB3, and the processor 13c executes verification processing. Specifically, the processor 13c adds a plurality of mutual Different verification image data is input and a machine learning network is made to determine the quality of the verification image data. At step SB3, the processor 13c generates a user interface screen 300 as shown in FIG. Step SB3 is a verification step of inputting the verification image data to the machine learning network after the parameters have been adjusted and executing quality judgment of the verification image data.

ユーザーインターフェース画面300には、検証用画像データを表示する検証用画像データ表示領域301が設けられている。検証用画像データ表示領域301には、プロセッサ13cが機械学習ネットワークに入力した検証用画像データが一覧形式で表示される。「OK」と付されている検証用画像データは良品画像であり、「NG」と付されている検証用画像データは不良品画像である。 The user interface screen 300 is provided with a verification image data display area 301 for displaying verification image data. In the verification image data display area 301, the verification image data input to the machine learning network by the processor 13c is displayed in a list format. Verification image data marked with "OK" is a non-defective product image, and verification image data marked with "NG" is a defective product image.

ユーザーインターフェース画面300には、拡大画像表示領域302が設けられている。検証用画像データ表示領域301に表示されている検証用画像データのうち、ユーザが選択した検証用画像データが拡大画像表示領域302に拡大表示される。 A user interface screen 300 is provided with an enlarged image display area 302 . Among the verification image data displayed in the verification image data display area 301 , the verification image data selected by the user is enlarged and displayed in the enlarged image display area 302 .

ユーザーインターフェース画面300には、学習パラメータ分析領域303が設けられている。すなわち、プロセッサ13cは、複数の検証用画像データの良否判定を機械学習ネットワークに実行させることにより、複数の判定結果を取得する。表示制御部13aは、プロセッサ13cが取得した複数の判定結果を表示装置4に学習パラメータ分析領域303として表示させることで、ユーザは機械学習ネットワークの推論性能がどの程度であるかを把握できる。 A learning parameter analysis area 303 is provided on the user interface screen 300 . In other words, the processor 13c obtains a plurality of determination results by causing the machine learning network to determine the quality of the plurality of verification image data. The display control unit 13a causes the display device 4 to display a plurality of determination results acquired by the processor 13c as the learning parameter analysis area 303, so that the user can grasp the degree of inference performance of the machine learning network.

本例では、判定結果の表示形態として累積ヒストグラムを表示させる場合について説明する。この場合、例えば、プロセッサ13cは、判定結果として、良品画像であると判定された度数と、不良品画像であると判定された度数とを取得する。プロセッサ13cは、良品画像であると判定された度数と、不良品画像であると判定された度数とに基づく累積ヒストグラムを生成する。表示制御部13aは、プロセッサ13cが生成した累積ヒストグラムを表示装置4に表示させる。図11に示す学習パラメータ分析領域303には、良品画像の度数分布と、不良品画像の度数分布とがグラフ形式で表示される。図11に示すグラフでは、良品画像の領域(図中にOKと記載された領域)と不良品画像の領域(図中にNGと記載された領域)とが分離できていない。このような場合には、機械学習ネットワークの推論性能が不十分であると考えられるので、ステップSB4において、ステップSB2のパラメータ調整で望ましい結果が得られていないと判断する。一方、ステップSB4で望ましい結果が得られたと判断される場合には、ステップSB5に進む。「望ましい結果が得られたと判断される場合」については後述する。ステップSB5の「運用」とは、外観検査装置を運用可能な状態することであり、直ちに運用を開始してもよいし、待機状態であってもよい。 In this example, a case will be described in which a cumulative histogram is displayed as the display form of the determination result. In this case, for example, the processor 13c acquires, as the determination results, the number of times the image is determined to be a non-defective image and the number of times the image is determined to be a defective image. The processor 13c generates a cumulative histogram based on the number of times an image is determined to be a good image and the number of times an image is determined to be a defective image. The display control unit 13a causes the display device 4 to display the cumulative histogram generated by the processor 13c. In the learning parameter analysis area 303 shown in FIG. 11, the frequency distribution of non-defective product images and the frequency distribution of defective product images are displayed in graph format. In the graph shown in FIG. 11, the area of the non-defective product image (area indicated as OK in the figure) and the area of the defective product image (area indicated as NG in the figure) cannot be separated. In such a case, it is considered that the inference performance of the machine learning network is insufficient, so in step SB4 it is determined that the parameter adjustment in step SB2 has not yielded the desired result. On the other hand, if it is determined in step SB4 that the desired result has been obtained, the process proceeds to step SB5. "When it is determined that a desired result has been obtained" will be described later. "Operation" in step SB5 means putting the appearance inspection apparatus into an operable state, and the operation may be started immediately or may be in a standby state.

ステップSB4でNOと判定されて進んだステップSB6では、ユーザに対して第2アノテーションの実行を促す。すなわち、図11に示すユーザーインターフェース画面300には、メッセージ表示領域304が設けられている。この例では、良品画像の領域と不良品画像の領域とが分離できておらず、機械学習ネットワークの推論性能が不十分であると考えられるので、メッセージ表示領域304には、機械学習ネットワークの推論性能を向上させる方法をプロセッサ13cが生成し、表示制御部13aが表示装置4に表示させる。機械学習ネットワークの推論性能を向上させる方法としては、例えば「特徴サイズを見直す」、「画像の変動を考慮する」、「アノテーションを詳細化する」等である。 At Step SB6, to which the determination at Step SB4 is NO, the user is urged to perform the second annotation. That is, a message display area 304 is provided on the user interface screen 300 shown in FIG. In this example, the area of the non-defective product image and the area of the defective product image cannot be separated, and it is considered that the inference performance of the machine learning network is insufficient. A method for improving performance is generated by the processor 13c and displayed on the display device 4 by the display control unit 13a. Methods for improving the inference performance of the machine learning network include, for example, "reviewing the feature size", "considering image variations", and "refining annotations".

上述したように第2アノテーション方式は第1アノテーション方式に比べて詳細なアノテーションが可能である。よって、「アノテーションを詳細化する」という表示をメッセージ表示領域304に表示することは、ユーザに対して第2アノテーション方式の実行を促すこと、または機械学習ネットワークの推論性能の向上させる方法の選択肢として第2アノテーションがあることをユーザに提示することである。 As described above, the second annotation method enables more detailed annotation than the first annotation method. Therefore, displaying the display "refine the annotation" in the message display area 304 prompts the user to execute the second annotation method, or as an option for improving the inference performance of the machine learning network. It is to present to the user that there is a second annotation.

図11に示すユーザーインターフェース画面300には、画像数表示領域305が設けられている。画像数表示領域305には、表が表示されており、その表には「ラベル指定」の欄が設けられている。「ラベル指定」の欄には、第1アノテーション方式で不良品ラベルA1が付与された不良品画像202のうち、不良品画像として検出できた画像数と、不良品画像として検出できなかった画像数とが表示される。本例では、不良品画像として検出できた画像数が「80」であり、不良品画像として検出できなかった画像数が「6」である。つまり、検証処理での良否判定の結果、不良品に対応する検証用画像データであるにも関わらず不良として判定されなかった画像が6枚あるということは、機械学習ネットワークの推論性能が不十分であると判断できる。尚、仮に、不良品画像として検出できなかった画像数が「0」であった場合、機械学習ネットワークの推論性能が十分であると判断できるので、その機械学習ネットワークで運用を開始すればよい。 A user interface screen 300 shown in FIG. 11 is provided with an image number display area 305 . A table is displayed in the number-of-images display area 305, and the table is provided with a column of "label designation". In the "label specification" column, the number of images that could be detected as defective images and the number of images that could not be detected as defective images among the defective product images 202 to which the defective product label A1 was assigned by the first annotation method. is displayed. In this example, the number of images that could be detected as defective images is "80", and the number of images that could not be detected as defective images is "6". In other words, as a result of the pass/fail judgment in the verification process, there are six images that were not judged as defective even though they are verification image data corresponding to defective products, which means that the inference performance of the machine learning network is insufficient. can be determined to be If the number of images that could not be detected as defective images is "0", it can be determined that the inference performance of the machine learning network is sufficient, and operation can be started with that machine learning network.

ユーザは、画像数表示領域305に表示されている表のうち、不良品画像として検出できなかった画像数を示している数字「6」をマウス52でクリックすることが可能である。数字「6」をマウス52でクリックすると、図12に示すように、表示制御部13aは、不良品に対応する検証用画像データであるにも関わらず不良として判定されなかった6枚の画像を表示装置4に表示させる。具体的には、上記6枚の画像をユーザーインターフェース画面300の検証用画像データ表示領域301に一覧で表示する。画像の枚数が多い場合には、上下や左右のスクロールを利用して全ての画像をユーザが閲覧可能にしておく。 The user can use the mouse 52 to click the number “6” indicating the number of images that could not be detected as defective images in the table displayed in the image number display area 305 . When the number "6" is clicked with the mouse 52, as shown in FIG. 12, the display control unit 13a displays the six images that were not determined as defective despite being verification image data corresponding to defective products. Displayed on the display device 4 . Specifically, the six images are displayed as a list in the verification image data display area 301 of the user interface screen 300 . When the number of images is large, all the images can be browsed by the user by scrolling up and down or left and right.

ユーザが第2アノテーションを実行する場合には、図12に示すユーザーインターフェース画面300の検証用画像データ表示領域301に表示されている上記6枚の画像の中から所望の画像を選択する。この選択操作は、例えばマウス52等の操作機器によって可能である。つまり、入力部13bは、表示装置4に一覧表示された画像の中から第2アノテーション方式で不良箇所の指定を行う画像の選択入力を受け付ける。 When the user executes the second annotation, a desired image is selected from the six images displayed in the verification image data display area 301 of the user interface screen 300 shown in FIG. This selection operation can be performed by an operating device such as the mouse 52, for example. In other words, the input unit 13b receives a selection input of an image for which a defective portion is specified by the second annotation method from among the images displayed as a list on the display device 4. FIG.

入力部13bが画像の選択入力を受け付けると、図13に示すように、表示制御部13aは、選択された画像をユーザーインターフェース画面300の拡大画像表示領域302に表示させるとともに、上述した指定方式選択ウインドウ204も表示させる。ユーザは、指定方式選択ウインドウ204のツールを使用して、領域指定方式によるアノテーションや、精密指定方式によるアノテーションを実行する。このようにして、入力部13bは、選択された画像に対して第2アノテーション方式で不良箇所の指定を受け付け、受け付けた結果は、画像と共に記憶装置19に記憶される。1枚の画像に対する第2アノテーション方式での指定が終わると、別の画像を選択し、その別の画像に対して第2アノテーション方式で不良箇所の指定をおこなってもよい。以上が図10に示すフローチャートのステップSB6の処理である。 When the input unit 13b receives an image selection input, the display control unit 13a causes the selected image to be displayed in the enlarged image display area 302 of the user interface screen 300 as shown in FIG. Window 204 is also displayed. The user uses the tools in the designation method selection window 204 to perform annotation by the area designation method and annotation by the precise designation method. In this manner, the input unit 13b accepts designation of a defective portion for the selected image by the second annotation method, and the accepted result is stored in the storage device 19 together with the image. After completing the designation of one image by the second annotation method, another image may be selected, and the defective portion may be designated by the second annotation method on the other image. The above is the processing of step SB6 in the flowchart shown in FIG.

ステップSB6の後、ステップSB7に進む。ステップSB7では、ステップSB6において不良箇所が第2アノテーション方式により指定された検証用画像データを機械学習ネットワークに学習させて当該機械学習ネットワークのパラメータを更新する更新処理を実行する。学習を実行する際には、ユーザがユーザーインターフェース画面300の実行ボタン306を操作すればよい。すなわち、第1アノテーション方式よりも詳細な第2アノテーション方式によって不良箇所を指定した画像を機械学習ネットワークに学習させることで、機械学習ネットワークのパラメータが変更される。これにより、機械学習ネットワークの推論性能が向上する。 After step SB6, the process proceeds to step SB7. At Step SB7, an update process is executed to update the parameters of the machine learning network by learning the verification image data in which the defective portion was designated by the second annotation method at Step SB6. When executing learning, the user may operate the execution button 306 on the user interface screen 300 . That is, the parameters of the machine learning network are changed by causing the machine learning network to learn the image in which the defective portion is designated by the second annotation method, which is more detailed than the first annotation method. This improves the inference performance of the machine learning network.

機械学習ネットワークの推論性能が十分であるか否か、即ち、望ましい結果が得られたと判断される場合であるか否かは、図14に示すユーザーインターフェース画面300の学習パラメータ分析領域303に表示されているグラフを見ることで確認できる。図14に示すグラフでは、良品画像の領域と不良品画像の領域とが完全に分離できており、良品画像と不良品画像とを明確に判別可能な推論性能を機械学習ネットワークが持っていることが分かる。 Whether or not the inference performance of the machine learning network is sufficient, that is, whether or not it is determined that a desired result has been obtained is displayed in the learning parameter analysis area 303 of the user interface screen 300 shown in FIG. This can be confirmed by looking at the graph shown. In the graph shown in FIG. 14, the region of the non-defective product image and the region of the defective product image can be completely separated, and the machine learning network has the inference performance that can clearly distinguish between the non-defective product image and the defective product image. I understand.

また、図14に示すように、画像数表示領域305に表示されている表には「四角領域指定」の欄と、「詳細指定」の欄とが設けられている。「四角領域指定」とは、領域指定方式によるアノテーションを行った後に不良品画像として検出できた画像数と、不良品画像として検出できなかった画像数とを示す欄である。不良品画像として検出できた画像数が「87」となっているので、不良品画像として検出すべき画像の全てを、不良品画像として検出できていることが分かる。また、「詳細指定」とは、精密指定方式によるアノテーションを行った後に不良品画像として検出できた画像数と、不良品画像として検出できなかった画像数とを示す欄である。例えば、「四角領域指定」の欄で、不良品画像として検出できなかった画像数が「0」以外である場合には、ユーザが精密指定方式によるアノテーションを行えばよい。「詳細指定」の欄で、不良品画像として検出できなかった画像数を「0」にすることができる。 In addition, as shown in FIG. 14, the table displayed in the image number display area 305 is provided with a column of "specify square area" and a column of "specify details". “Rectangular area specification” is a field indicating the number of images that could be detected as defective images and the number of images that could not be detected as defective images after annotation by the area specification method. Since the number of images detected as defective images is "87", it can be seen that all images that should be detected as defective images have been detected as defective images. Further, "detailed designation" is a field indicating the number of images that could be detected as defective images and the number of images that could not be detected as defective images after annotation by the precise designation method. For example, if the number of images that could not be detected as defective images is other than "0" in the "Rectangle Area Designation" column, the user may perform annotation using the precise designation method. The number of images that could not be detected as defective images can be set to "0" in the "detailed specification" column.

以上が設定装置1を使用した設定方法の説明である。第1アノテーション方式のみで十分な推論性能が得られる場合には、第2アノテーション方式を実行することなく、運用に移行することができるので、ユーザに無用な負担を強いることはない。また、第1アノテーション方式のみで十分な推論性能が得られない場合には、第2アノテーション方式のうち、比較的負担の少ない領域指定方式でアノテーションを行って推論性能を確認することができる。その結果、十分な推論性能が得られていない場合には、必要な画像についてのみ、精密指定方式によるアノテーションを実行すればよいので、ユーザの負担が軽減される。 The above is the description of the setting method using the setting device 1 . If sufficient inference performance can be obtained with only the first annotation method, the system can be put into operation without executing the second annotation method, thus not imposing an unnecessary burden on the user. Also, if sufficient inference performance cannot be obtained with only the first annotation method, the region designation method, which is relatively less burdensome, can be used for annotation to confirm the inference performance. As a result, when sufficient inference performance is not obtained, annotation by the precise designation method can be executed only for necessary images, thus reducing the user's burden.

(機械学習ネットワークのパラメータ調整手順の第2の例)
図15に示すフローチャートに基づいて、機械学習ネットワークのパラメータ調整手順の第2の例について具体的に説明する。スタート後のステップSC1は図10に示すフローチャートのステップSB1と同じである。その後、ステップSC2では、第2アノテーション方式によるアノテーションを行う。ステップSC3では、プロセッサ13cが、第1アノテーション方式で良品ラベルA2が付与された良品画像203と、第1アノテーション方式で不良品ラベルA1が付与された不良品画像202と、第2アノテーション方式で不良箇所が指定された画像とを機械学習ネットワークに学習させる。すなわち、プロセッサ13cは、各良品画像203の良品情報と、各不良品画像202の不良情報とに基づいて機械学習ネットワークのパラメータを調整する。
(Second example of parameter adjustment procedure for machine learning network)
A second example of the parameter adjustment procedure of the machine learning network will be specifically described based on the flowchart shown in FIG. 15 . Step SC1 after the start is the same as step SB1 in the flow chart shown in FIG. After that, in step SC2, annotation is performed according to the second annotation method. At step SC3, the processor 13c generates a non-defective product image 203 to which the non-defective product label A2 is assigned by the first annotation method, a defective product image 202 to which the defective product label A1 is assigned by the first annotation method, and a defective product image 202 which is assigned the defective product label A1 by the first annotation method. A machine learning network is trained on images with specified locations. That is, the processor 13c adjusts the parameters of the machine learning network based on the non-defective product information of each non-defective product image 203 and the defective product information of each defective product image 202 .

その後、ステップSC4に進み、プロセッサ13cが検証処理を実行する。具体的には、ステップSC3で生成された機械学習ネットワークに、プロセッサ13cが複数の互いに異なる検証用画像データを入力して当該検証用画像データの良否判定を機械学習ネットワークに実行させる。ステップSC5、SC6は図10に示すフローチャートのステップSB4、SB5と同じである。 After that, the process proceeds to step SC4, and the processor 13c executes verification processing. Specifically, the processor 13c inputs a plurality of verification image data different from each other to the machine learning network generated in step SC3, and causes the machine learning network to determine whether the verification image data is good or bad. Steps SC5 and SC6 are the same as steps SB4 and SB5 in the flowchart shown in FIG.

ステップSC5でNOと判定されて進んだステップSC7では、ユーザに対して再アノテーションの実行を促す。例えば、ある画像に対して第2アノテーション方式で領域指定方式しか実行していない場合には、その画像に対して精密指定方式によるアノテーションを実行するように促す。また、精密指定方式によるアノテーションをより精密に実行するように促してもよい。 At Step SC7, to which Step SC5 is judged as NO, the user is prompted to re-annotate. For example, if only the region specification method is performed on a certain image by the second annotation method, the user is prompted to perform annotation by the precise specification method on that image. In addition, the user may be prompted to perform annotation using the precise specification method more precisely.

ステップSC7の後、ステップSC8に進む。ステップSC8では、ステップSC7において再アノテーションされた検証用画像データを機械学習ネットワークに学習させて当該機械学習ネットワークのパラメータを更新する更新処理を実行する。再アノテーションによって不良箇所を指定した画像を機械学習ネットワークに学習させることで、機械学習ネットワークのパラメータが変更される。これにより、機械学習ネットワークの推論性能が向上する。 After step SC7, the process proceeds to step SC8. In step SC8, an update process is executed to update the parameters of the machine learning network by learning the verification image data re-annotated in step SC7. The parameters of the machine learning network are changed by having the machine learning network learn images in which the defect locations are specified by re-annotation. This improves the inference performance of the machine learning network.

(異常抽出用のニューラルネットワークの詳細)
上記機械学習ネットワークは、例えば図16に概念図として示すような異常抽出用のニューラルネットワークで構成されている。異常抽出用のニューラルネットワークは、入力画像を構成している各画素が異常であるかを表す異常度をヒートマップ(異常度マップ)として出力する。このヒートマップが出力画像になる。したがって、良品画像を入力画像とした場合、出力画像は全てが同じ画素値の画素で構成された異常度マップとなる一方、不良品画像を入力画像とした場合、出力画像は不良箇所(異常箇所)の画素だけ他の画素と画素値が異なる異常度マップとなる。
(Details of neural network for anomaly extraction)
The machine learning network is composed of, for example, a neural network for anomaly extraction as conceptually shown in FIG. The anomaly extraction neural network outputs an anomaly degree as a heat map (abnormality degree map) indicating whether each pixel forming the input image is abnormal. This heatmap becomes the output image. Therefore, when a non-defective product image is used as an input image, the output image is an anomaly degree map in which all pixels with the same pixel value are configured. ) becomes an abnormality degree map in which pixel values differ from those of other pixels.

本実施形態では、第2アノテーション方式による精密指定でなくても、さらに、第1アノテーション方式と第2アノテーション方式のように複数アノテーション方式が混在している状態でも、不良箇所だけを抽出可能な学習方法を採用している。すなわち、図17に示すように、プロセッサ13cは、第1アノテーション方式で入力された良品情報を有する良品画像と不良品情報を有する不良品画像との両方を含み、かつ互いに異なる少なくとも3枚の画像を機械学習ネットワークに入力して異常度マップを生成する。図17に示す例では、第1入力画像、第2入力画像及び第3入力画像を1つのグループとして同一の機械学習ネットワークに入力している。第1入力画像及び第2入力画像は良品画像であり、第3入力画像は不良品画像である。第1入力画像、第2入力画像及び第3入力画像には、第1アノテーション方式によってラベルA1、A2が付与されている。 In this embodiment, even if the second annotation method is not used for precise designation, and even if multiple annotation methods are mixed such as the first annotation method and the second annotation method, learning that can extract only the defective part is performed. method is adopted. That is, as shown in FIG. 17, the processor 13c generates at least three different images including both a non-defective product image having non-defective product information and a defective product image having defective product information input by the first annotation method. is input to a machine learning network to generate an anomaly map. In the example shown in FIG. 17, the first input image, the second input image, and the third input image are input to the same machine learning network as one group. The first input image and the second input image are good product images, and the third input image is a bad product image. Labels A1 and A2 are given to the first input image, the second input image, and the third input image by the first annotation method.

プロセッサ13cは、第1アノテーション方式で入力された良品情報を有する良品画像を機械学習ネットワークに入力して生成された異常度マップ内の各画素値が0となるように当該機械学習ネットワークのパラメータを調整する。本例では、第1入力画像及び第2入力画像が良品画像であることから、第1出力画像及び第2出力画像内の各画素値が0となるように制限をかける。 The processor 13c inputs the non-defective product image having the non-defective product information input by the first annotation method to the machine learning network, and sets the parameters of the machine learning network so that each pixel value in the abnormality map generated is 0. adjust. In this example, since the first input image and the second input image are non-defective images, each pixel value in the first output image and the second output image is restricted to zero.

また、プロセッサ13cは、良品情報を有する画像同士の異常度マップ間の距離を近づける処理と、不良品情報を有する画像同士の異常度マップ間の距離を近づける処理との少なくとも一方を実行可能に構成されている。本例では、第1入力画像及び第2入力画像が良品画像であることから、第1出力画像及び第2出力画像の異常度マップ間の距離を近づける処理を行う。尚、第1入力画像及び第2入力画像が不良品画像であった場合には、第1出力画像及び第2出力画像の異常度マップ間の距離を近づける処理を行う。 In addition, the processor 13c is configured to be capable of executing at least one of a process of reducing the distance between the images having non-defective product information and the process of reducing the distance between the abnormality maps of the images having defective product information. It is In this example, since the first input image and the second input image are non-defective images, processing is performed to reduce the distance between the abnormality degree maps of the first output image and the second output image. If the first input image and the second input image are defective images, processing is performed to reduce the distance between the abnormality degree maps of the first output image and the second output image.

また、プロセッサ13cは、良品情報を有する画像の異常度マップと、不良品情報を有する画像の異常度マップとの距離を所定以上離す処理を実行可能に構成されている。本例では、第2入力画像が良品画像であり、第3入力画像が不良品画像であることから、第2出力画像と第3出力画像の異常度マップを所定以上離す処理を行う。 In addition, the processor 13c is configured to be able to execute a process of increasing the distance between the abnormality degree map of the image having non-defective product information and the abnormality degree map of the image having defective product information by a predetermined distance or more. In this example, since the second input image is a non-defective product image and the third input image is a defective product image, the abnormality degree maps of the second output image and the third output image are separated by a predetermined amount or more.

具体的には、以下の計算式及び考え方(例えば下記演算方法1、2)を適用することができる。まず、Loss関数の定義を行う。各入力画像の対応異常度マップの画素値平均は以下の式で計算できる。 Specifically, the following calculation formulas and ideas (for example, calculation methods 1 and 2 below) can be applied. First, the Loss function is defined. The pixel value average of the corresponding abnormality degree map of each input image can be calculated by the following formula.

Figure 2023077051000002
Figure 2023077051000002

尚、nは異常度マップHの画素数、x、yは異常度マップHの画素座標値である。 In addition, n is the number of pixels of the abnormality degree map H, and x and y are pixel coordinate values of the abnormality degree map H.

異常度マップの画素値平均を使用し、異常度マップ間の距離を画素値平均の差の絶対値に定義する。 The average pixel values of the anomaly maps are used, and the distance between the anomaly maps is defined as the absolute value of the difference between the average pixel values.

Figure 2023077051000003
Figure 2023077051000003

演算方法1(異常度マップ間距離を直接に制限する方法)

Figure 2023077051000004
Calculation method 1 (Method of directly limiting the distance between anomaly degree maps)
Figure 2023077051000004

αは距離マージンを表すハイパーパラメータであり、λは異常度マップの良品対応部分のLoss制限の強さを表すハイパーパラメータである。 α is a hyperparameter that represents the distance margin, and λ is a hyperparameter that represents the strength of the Loss restriction for the non-defective part of the anomaly degree map.

演算方法2(異常度マップ間距離を間接に制限する方法)

Figure 2023077051000005
Calculation method 2 (Method of indirectly limiting the distance between the anomaly degree maps)
Figure 2023077051000005

尚、異常度マップ間の距離は異常度マップを一次元ベクトルにし、ベクトル間のユークリッド距離として定義することも可能である。また、Loss関数を最小化することで学習が行える。 It should be noted that the distance between the anomaly maps can also be defined as the Euclidean distance between the vectors by converting the anomaly maps into one-dimensional vectors. Also, learning can be performed by minimizing the Loss function.

以上は、第1アノテーション方式によってラベルが付与されている画像を学習する場合であるが、第2アノテーション方式によって不良箇所が指定されている画像についても学習できる。すなわち、プロセッサ13cは、第2アノテーション方式で入力された不良品情報を有する不良品画像を機械学習ネットワークに入力して生成された異常度マップ内において、第2アノテーション方式で指定された不良箇所以外に対応する部分の画素値が0となるように当該機械学習ネットワークのパラメータを調整する。 The above is the case of learning images labeled by the first annotation method, but learning can also be performed on images with defect locations designated by the second annotation method. That is, the processor 13c inputs the defective product image having the defective product information input by the second annotation method to the machine learning network, and in the abnormality degree map generated by the machine learning network, The parameters of the machine learning network are adjusted so that the pixel value of the portion corresponding to is 0.

図18に基づいて具体的に説明する。図18は、第3入力画像に対して第2アノテーション方式により不良箇所が指定されている場合を示している。本例では、領域指定方式で不良箇所を囲む枠206を生成した場合を示しているが、精密指定方式で不良箇所を指定してもよい。第3入力画像の下にマスク画像として示すように、枠206外に対応する領域の画素値を0にする。第3出力画像では、不良箇所として指定された領域以外の部分の画素値を0にする。 A specific description will be given based on FIG. FIG. 18 shows a case where a defective portion is designated by the second annotation method for the third input image. In this example, the case where the frame 206 surrounding the defective portion is generated by the area designation method is shown, but the defective portion may be designated by the precise designation method. As shown as a mask image under the third input image, the pixel values of the area corresponding to the outside of the frame 206 are set to 0. In the third output image, the pixel values are set to 0 in areas other than the area specified as the defective area.

Loss関数の定義については上述したとおりであるが、第3入力画像に対して、アノテーション領域内外の画素平均値をそれぞれ計算する。 The definition of the Loss function is as described above, but the pixel average values inside and outside the annotation region are calculated for the third input image.

Figure 2023077051000006
Figure 2023077051000006

また、異常度マップの画素値平均を使用し、マップ間距離を画素値平均の差の絶対値に定義する。 Also, the average pixel values of the anomaly degree maps are used, and the distance between maps is defined as the absolute value of the difference between the average pixel values.

Figure 2023077051000007
Figure 2023077051000007

演算方法1(異常度マップ間距離を直接に制限する方法)

Figure 2023077051000008
Calculation method 1 (Method of directly limiting the distance between anomaly degree maps)
Figure 2023077051000008

演算方法2(異常度マップ間距離を間接に制限する方法)

Figure 2023077051000009
Calculation method 2 (Method of indirectly limiting the distance between the anomaly degree maps)
Figure 2023077051000009

(実施形態の作用効果)
以上説明したように、本実施形態によれば、第1アノテーション方式では、表示装置4に表示された画像をラベル指定によって良品画像と不良品画像に振り分けることができるので、全体的に不良であると判定すべき不良品画像のアノテーションが可能になる。一方、第2アノテーション方式では、不良品画像上で不良箇所の位置や形状を具体的に指定できるので、第1アノテーション方式に比べて不良箇所を明確に指定することが可能になる。これにより、全体的に不良であると判定すべき不良品画像はユーザの手間をかけずにアノテーションを行いつつ、不良箇所を明確に指定すべき不良品画像についてはユーザが詳細にアノテーションを行うことができる。これにより、機械学習ネットワークの学習時におけるユーザの手間を削減しながら、属人性を排除し、高い検出性能を持った機械学習ネットワークを得ることができる。
(Action and effect of the embodiment)
As described above, according to the present embodiment, in the first annotation method, images displayed on the display device 4 can be sorted into non-defective product images and defective product images by label designation. It is possible to annotate a defective product image that should be determined as. On the other hand, in the second annotation method, since the position and shape of the defective portion can be specifically specified on the defective product image, it is possible to specify the defective portion more clearly than in the first annotation method. As a result, the user can annotate a defective product image that should be determined to be defective as a whole without requiring the user's trouble, and the user can annotate the defective product image that should clearly specify the defective part. can be done. As a result, it is possible to obtain a machine learning network with high detection performance by eliminating individual dependence while reducing the user's labor at the time of learning the machine learning network.

上述の実施形態はあらゆる点で単なる例示に過ぎず、限定的に解釈してはならない。さらに、特許請求の範囲の均等範囲に属する変形や変更は、全て本発明の範囲内のものである。 The above-described embodiments are merely examples in all respects and should not be construed in a restrictive manner. Furthermore, all modifications and changes within the equivalent scope of claims are within the scope of the present invention.

以上説明したように、本発明は、例えばワークの外観を検査する外観検査装置の設定を行う場合に利用できる。 INDUSTRIAL APPLICABILITY As described above, the present invention can be used, for example, when setting an appearance inspection apparatus for inspecting the appearance of a work.

1 設定装置
13a 表示制御部
13b 入力部
13c プロセッサ
1 setting device 13a display control unit 13b input unit 13c processor

Claims (15)

良品に対応する良品画像と、不良品に対応する不良品画像とを学習することにより生成された機械学習ネットワークに、検査対象のワークを撮像したワーク画像を入力し、当該ワーク画像の良否判定を行う外観検査装置の設定を行う設定装置であって、
前記機械学習ネットワークに学習させるための画像を表示部に表示させる表示制御部と、
前記表示部に表示された画像に対し、良品画像または不良品画像であることを示すラベルを付与する第1アノテーション方式と、前記表示部に表示された画像が不良品画像である場合に不良箇所を指定する第2アノテーション方式とのいずれかの方式で入力された不良情報を受け付ける入力部と、
前記第1アノテーション方式でラベルが付与された良品画像または不良品画像と、前記第2アノテーション方式で入力された不良情報を有する不良品画像との両方を前記機械学習ネットワークに学習させて、当該機械学習ネットワークのパラメータを調整するプロセッサとを備える、外観検査装置の設定装置。
A work image of a work to be inspected is input to a machine learning network generated by learning non-defective product images corresponding to non-defective products and defective product images corresponding to defective products, and the quality of the work image is determined. A setting device for setting the appearance inspection device to be performed,
a display control unit for displaying an image for learning by the machine learning network on a display unit;
A first annotation method of adding a label indicating a non-defective product image or a defective product image to the image displayed on the display unit; an input unit that receives defect information input by one of the second annotation method that specifies the
Let the machine learning network learn both the non-defective product image or the defective product image labeled by the first annotation method and the defective product image having the defect information input by the second annotation method, and a processor for adjusting parameters of the learning network.
請求項1に記載の設定装置において、
前記入力部は、前記第2アノテーション方式として、不良品画像の不良箇所を囲むことで当該不良箇所を指定する領域指定方式と、不良品画像の不良箇所をなぞることで当該不良箇所を自由形状で指定する精密指定方式とが選択可能に構成されている、外観検査装置の設定装置。
The setting device according to claim 1,
The input unit includes, as the second annotation method, a region specification method in which the defective portion is designated by enclosing the defective portion in the defective product image, and a free-form defective portion by tracing the defective portion in the defective product image. A setting device for an appearance inspection device, configured to be able to select a precise specification method to specify.
請求項1に記載の設定装置において、
前記入力部は、前記第2アノテーション方式として、不良品画像の不良箇所と当該不良箇所の周囲とを囲むことによって指定された領域内で当該不良箇所を自動抽出する自動抽出方式を実行可能に構成されている、外観検査装置の設定装置。
The setting device according to claim 1,
The input unit is configured to be capable of executing, as the second annotation method, an automatic extraction method for automatically extracting the defective portion within a designated area by enclosing the defective portion of the defective product image and the periphery of the defective portion. A setting device for a visual inspection device.
請求項3に記載の設定装置において、
前記入力部は、前記第2アノテーション方式として、前記自動抽出方式の実行後、当該自動抽出方式で自動抽出された領域の形状の修正を受け付ける、外観検査装置の設定装置。
The setting device according to claim 3,
The setting device of the appearance inspection apparatus, wherein the input unit receives correction of the shape of the region automatically extracted by the automatic extraction method as the second annotation method after execution of the automatic extraction method.
請求項1から4のいずれか1つに記載の設定装置において、
前記プロセッサは、前記第1アノテーション方式でラベルが付与された良品画像または不良品画像と、前記第2アノテーション方式で不良箇所が指定された不良品画像とを単一の前記機械学習ネットワークに入力し、当該機械学習ネットワークのパラメータを調整する、外観検査装置の設定装置。
The setting device according to any one of claims 1 to 4,
The processor inputs a non-defective product image or a defective product image labeled by the first annotation method and a defective product image to which a defective part is specified by the second annotation method into the single machine learning network. , a setting device for a visual inspection device for adjusting the parameters of the machine learning network.
請求項1から5のいずれか1つに記載の設定装置において、
前記プロセッサは、
前記第1アノテーション方式で良品画像または不良品画像であることを示すラベルが付与された良品画像または不良品画像を学習することにより生成された前記機械学習ネットワークに、検証用画像データを入力して当該検証用画像データの良否判定を実行する検証処理と、
前記検証処理での前記良否判定の結果、不良品に対応する前記検証用画像データであるにも関わらず不良として判定されなかった場合、不良箇所が前記第2アノテーション方式により指定された前記検証用画像データを前記機械学習ネットワークに学習させて当該機械学習ネットワークのパラメータを更新する更新処理とを実行可能に構成されている、外観検査装置の設定装置。
The setting device according to any one of claims 1 to 5,
The processor
inputting verification image data to the machine learning network generated by learning a non-defective product image or a defective product image labeled as a non-defective product image or a defective product image by the first annotation method; a verification process for determining whether the verification image data is good or bad;
As a result of the pass/fail determination in the verification process, if the verification image data corresponding to the defective product is not determined to be defective, the verification image data in which the defective portion is specified by the second annotation method is selected. A setting device for a visual inspection apparatus configured to be capable of executing an update process of causing the machine learning network to learn image data and updating parameters of the machine learning network.
請求項1から6のいずれか1つに記載の設定装置において、
前記表示制御部は、前記第1アノテーション方式で不良品画像のラベルが付与された画像の中で、不良として判定されなかった画像の一覧を前記表示部に表示させ、
前記入力部は、前記表示部に一覧表示された画像の中から前記第2アノテーション方式で不良箇所の指定を行う画像の選択入力を受け付け、選択された画像に対して前記第2アノテーション方式で不良箇所の指定を受け付ける、外観検査装置の設定装置。
The setting device according to any one of claims 1 to 6,
The display control unit causes the display unit to display a list of images that are not determined to be defective among the images labeled as defective product images by the first annotation method,
The input unit accepts a selection input of an image for which a defective portion is to be designated by the second annotation method from among the images displayed as a list on the display unit, and determines whether the selected image is defective by the second annotation method. A setting device for a visual inspection device that accepts location designations.
請求項1から6のいずれか1つに記載の設定装置において、
前記プロセッサは、前記第1アノテーション方式で不良品画像であることを示すラベルが付与された不良品画像を学習することにより生成された前記機械学習ネットワークに、複数の互いに異なる検証用画像データを入力して当該各検証用画像データの良否判定を実行することによって判定結果を取得し、
前記表示制御部は、前記プロセッサが取得した前記判定結果を前記表示部に表示させる、外観検査装置の設定装置。
The setting device according to any one of claims 1 to 6,
The processor inputs a plurality of verification image data different from each other to the machine learning network generated by learning the defective product image labeled as the defective product image by the first annotation method. to acquire the judgment result by executing the pass/fail judgment of each verification image data,
The display control unit is a setting device for a visual inspection apparatus, which causes the display unit to display the determination result acquired by the processor.
請求項8に記載の設定装置において、
前記プロセッサは、前記判定結果として、良品画像であると判定された度数と不良品画像であると判定された度数とを取得し、良品画像であると判定された度数と不良品画像であると判定された度数とに基づく累積ヒストグラムを生成し、
前記表示制御部は、前記プロセッサが生成した前記累積ヒストグラムを前記表示部に表示させる、外観検査装置の設定装置。
The setting device according to claim 8,
The processor acquires the number of times the image is determined to be a non-defective image and the number of times the image is determined to be a defective image as the determination results, and the number of times the image is determined to be a non-defective image and the image is determined to be a defective image. generating a cumulative histogram based on the determined frequencies and
A setting device for a visual inspection apparatus, wherein the display control unit causes the display unit to display the cumulative histogram generated by the processor.
請求項1から9のいずれか1つに記載の設定装置において、
前記プロセッサは、
前記第1アノテーション方式で入力された良品情報を有する良品画像と不良品情報を有する不良品画像との両方を含み、かつ互いに異なる少なくとも3枚の画像を前記機械学習ネットワークに入力して異常度マップを生成し、
良品情報を有する画像の異常度マップと不良品情報を有する画像の異常度マップとの距離を所定以上離す処理を実行可能に構成されている、外観検査装置の設定装置。
A setting device according to any one of claims 1 to 9,
The processor
At least three images that include both a non-defective product image having non-defective product information and a defective product image having defective product information input by the first annotation method and are different from each other are input to the machine learning network to provide an anomaly map to generate
A setting device for a visual inspection apparatus configured to be capable of executing a process of separating an abnormality degree map of an image having non-defective product information and an abnormality degree map of an image having defective product information by a predetermined distance or more.
請求項10に記載の設定装置において、
前記プロセッサは、良品情報を有する画像同士の異常度マップ間の距離を近づける処理と、不良品情報を有する画像同士の異常度マップ間の距離を近づける処理との少なくとも一方を実行可能に構成されている、外観検査装置の設定装置。
The setting device according to claim 10, wherein
The processor is configured to be able to execute at least one of a process of reducing the distance between the images having non-defective product information and the process of reducing the distance between the abnormality maps of the images having defective product information. A setting device for visual inspection equipment.
請求項10または11に記載の設定装置において、
前記プロセッサは、前記第1アノテーション方式で入力された良品情報を有する良品画像を前記機械学習ネットワークに入力して生成された異常度マップ内の各画素値が0となるように当該機械学習ネットワークのパラメータを調整する、外観検査装置の設定装置。
The setting device according to claim 10 or 11,
The processor inputs the non-defective product image having the non-defective product information input by the first annotation method to the machine learning network so that each pixel value in the abnormality map generated is 0 of the machine learning network A setting device for visual inspection equipment that adjusts parameters.
請求項12に記載の設定装置において、
前記プロセッサは、前記第2アノテーション方式で入力された不良品情報を有する不良品画像を前記機械学習ネットワークに入力して生成された異常度マップ内において、前記第2アノテーション方式で指定された不良箇所以外に対応する部分の画素値が0となるように当該機械学習ネットワークのパラメータを調整する、外観検査装置の設定装置。
A setting device according to claim 12, wherein
The processor inputs the defective product image having the defective product information input by the second annotation method to the machine learning network, and the defect location specified by the second annotation method in the anomaly degree map generated by the machine learning network A setting device for a visual inspection device that adjusts the parameters of the machine learning network so that the pixel value of the portion corresponding to the area other than the above is 0.
良品に対応する良品画像と、不良品に対応する不良品画像とを学習することにより生成された機械学習ネットワークに、検査対象のワークを撮像したワーク画像を入力し、当該ワーク画像の良否判定を行う外観検査装置の設定方法であって、
前記機械学習ネットワークに学習させるための画像を表示部に表示させる表示ステップと、
前記表示ステップで前記表示部に表示された画像に対し、良品画像または不良品画像であることを示すラベルを付与する第1アノテーション方式と、前記表示部に表示された画像が不良品画像である場合に不良箇所を指定する第2アノテーション方式とのいずれかの方式で入力された不良情報を受け付ける入力ステップと、
前記第1アノテーション方式でラベルが付与された良品画像または不良品画像と、前記第2アノテーション方式で入力された不良情報を有する不良品画像との両方を前記機械学習ネットワークに学習させて、当該機械学習ネットワークのパラメータを調整する調整ステップとを備える、外観検査装置の設定方法。
A work image of a work to be inspected is input to a machine learning network generated by learning non-defective product images corresponding to non-defective products and defective product images corresponding to defective products, and the quality of the work image is determined. A setting method for a visual inspection apparatus to perform
a display step of displaying an image for learning by the machine learning network on a display unit;
a first annotation method of adding a label indicating a non-defective product image or a defective product image to the image displayed on the display unit in the display step; an input step of receiving defect information input by any one of a second annotation method for designating a defect location in a case;
Let the machine learning network learn both the non-defective product image or the defective product image labeled by the first annotation method and the defective product image having the defect information input by the second annotation method, and an adjusting step of adjusting parameters of the learning network.
請求項14に記載の設定方法において、
前記第1アノテーション方式で不良品画像であることを示すラベルが付与された不良品画像を前記機械学習ネットワークに学習させた後、検証用画像データを前記機械学習ネットワークに入力して当該検証用画像データの良否判定を実行する検証ステップと、
前記検証ステップでの前記良否判定の結果、不良品に対応する前記検証用画像データであるにも関わらず不良として判定されなかった場合、不良箇所を前記第2アノテーション方式により指定した後、当該第2アノテーション方式により不良箇所が指定された前記検証用画像データを前記機械学習ネットワークに学習させて当該機械学習ネットワークのパラメータを更新する更新ステップとをさらに備える、外観検査装置の設定方法。
In the setting method according to claim 14,
After having the machine learning network learn the defective product image to which the label indicating the defective product image is given by the first annotation method, the verification image data is input to the machine learning network to generate the verification image. a verification step for performing pass/fail judgment of data;
As a result of the pass/fail judgment in the verification step, if the verification image data corresponding to the defective product is not judged to be defective, after specifying the defective portion by the second annotation method, and an updating step of causing the machine learning network to learn the verification image data in which the defective portion is designated by the 2 annotation method, and updating parameters of the machine learning network.
JP2021190169A 2021-11-24 2021-11-24 Setting device and setting method Pending JP2023077051A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021190169A JP2023077051A (en) 2021-11-24 2021-11-24 Setting device and setting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021190169A JP2023077051A (en) 2021-11-24 2021-11-24 Setting device and setting method

Publications (1)

Publication Number Publication Date
JP2023077051A true JP2023077051A (en) 2023-06-05

Family

ID=86610394

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021190169A Pending JP2023077051A (en) 2021-11-24 2021-11-24 Setting device and setting method

Country Status (1)

Country Link
JP (1) JP2023077051A (en)

Similar Documents

Publication Publication Date Title
JP2009175954A (en) Generating device of processing robot program
US10306149B2 (en) Image processing apparatus, robot system, robot, and image processing method
JP2020125919A (en) Image inspection device
EP1710649A2 (en) Motion control apparatus for teaching robot position, robot-position teaching apparatus, motion control method for teaching robot postion, robot-position teaching method, and motion control program for teaching robot-position
CN1580748A (en) Methods and apparatus for inspection of lines embedded in highly textured material
JP2013148361A (en) Method for registering inspection standard for soldering inspection, and board inspection apparatus based on said method
JP7337495B2 (en) Image processing device, its control method, and program
JP2020125920A (en) Image inspection device
JP2020125918A (en) Image inspection device
US20230162344A1 (en) Appearance inspection apparatus and appearance inspection method
CN115803155A (en) Programming device
JP2017191492A (en) Information processing device, information processing method and video generation system
JP2020187071A (en) Image inspection device and method for setting image inspection device
JP2023090819A (en) Image inspection device and method for setting image inspection device
JP2570239B2 (en) Mounting component inspection data generation method and mounting component inspection apparatus used for implementing the method
JP5277505B2 (en) End material management method and management system
JP2023077051A (en) Setting device and setting method
JP7391571B2 (en) Electronic devices, their control methods, programs, and storage media
CN111609933A (en) Spectroscopic inspection method, image processing apparatus, and robot system
WO2021215333A1 (en) Program editing device
JP2019212166A (en) Image processing apparatus, image processing method, and image processing program
JP2013238947A (en) Substrate wiring operation support system
JP6220514B2 (en) Robot control system and robot control method
JP6835020B2 (en) Image processing system, image processing device, image processing program
JP6629250B2 (en) Work support device, work support method, and program