JP7289427B2 - Program, information processing method and information processing apparatus - Google Patents

Program, information processing method and information processing apparatus Download PDF

Info

Publication number
JP7289427B2
JP7289427B2 JP2020179620A JP2020179620A JP7289427B2 JP 7289427 B2 JP7289427 B2 JP 7289427B2 JP 2020179620 A JP2020179620 A JP 2020179620A JP 2020179620 A JP2020179620 A JP 2020179620A JP 7289427 B2 JP7289427 B2 JP 7289427B2
Authority
JP
Japan
Prior art keywords
image
abnormality
learning model
learning
computer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2020179620A
Other languages
Japanese (ja)
Other versions
JP2021140739A (en
Inventor
昌則 坂田
正一郎 安部
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.)
Pros Cons
Original Assignee
Pros Cons
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 Pros Cons filed Critical Pros Cons
Publication of JP2021140739A publication Critical patent/JP2021140739A/en
Application granted granted Critical
Publication of JP7289427B2 publication Critical patent/JP7289427B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Analysis (AREA)

Description

特許法第30条第2項適用 令和 1年 9月19日に、株式会社Pros Consのウェブサイトにて公開 (https://proscons.co.jp/2019/09/19/gemini-eye-lp/)(https://proscons.co.jp/ad/)(https://proscons.co.jp/2019/11/15/et-iot-technology-2019/) (https://proscons.co.jp/2019/11/26/et-iot-technology-2019-report/) Application of Article 30, Paragraph 2 of the Patent Act Released on the website of Pros Cons Co., Ltd. on September 19, 2019 (https://proscons.co.jp/2019/09/19/gemini-eye- lp/) (https://proscons.co.jp/ad/) (https://proscons.co.jp/2019/11/15/et-iot-technology-2019/) (https://proscons.co.jp/2019/11/15/et-iot-technology-2019/) co.jp/2019/11/26/et-iot-technology-2019-report/)

特許法第30条第2項適用 令和 1年11月20日に、Embedded Technology 2019/組込み総合技術展、IoT Technology 2019/IoT総合技術展にて公開Application of Patent Law Article 30, Paragraph 2 Released at Embedded Technology 2019 and IoT Technology 2019 on November 20, 2019

本発明は、プログラム、学習済みモデルの生成方法、情報処理方法及び情報処理装置に関する。 The present invention relates to a program, a method for generating a trained model, an information processing method, and an information processing apparatus.

近年、検査対象物の外観検査工程においては、カメラで検査対象物の画像を撮像し、当該画像を処理することで検査を行うことが広く行われている(特許文献1参照)。 2. Description of the Related Art In recent years, in a process of visual inspection of an object to be inspected, it has been widely practiced to take an image of the object to be inspected with a camera and process the image (see Patent Document 1).

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

しかしながら、特許文献1に係る技術では、学習、運用までに手間と期間を要するという問題がある。 However, the technique according to Patent Literature 1 has the problem that it takes time and effort to learn and operate.

一つの側面では、学習及び運用が容易となるプログラム等を提供することにある。 One aspect is to provide a program or the like that facilitates learning and operation.

一つの側面にプログラムは、学習モードまたは運用モードのいずれかの選択を受け付け、学習モードが選択された場合に、検査対象物を含む学習用の画像を取得し、教師なし学習により生成する第1学習モデルのハイパーパラメータの設定を受け付け、受け付けた前記ハイパーパラメータに基づき、取得した前記学習用の画像を入力した場合に前記学習用の画像に対応する再構成画像を出力する前記第1学習モデルを生成し、検査対象物を含む検査用の画像を取得し、取得した検査用の画像を相互にオーバーラップする複数の小片画像に分割し、分割した前記複数の小片画像を学習済みの前記第1学習モデルに入力し、前記第1学習モデルからそれぞれの小片画像の再構成画像を出力させ、分割した前記複数の小片画像と、前記第1学習モデルが出力したそれぞれの小片画像に対応する再構成画像との各ピクセルの異常度を小片画像ごとに算出し、小片画像ごとに算出した各ピクセルの異常度が足し込まれた回数を集計し、集計した回数に基づき、ピクセルごとに平均異常度を算出し、前記検査用の画像を検証するための異常度の閾値の設定を受け付け、算出した平均異常度と、受け付けた前記異常度の閾値とに基づき、検出した異常画像を表示する処理をコンピュータに実行させる。 In one aspect, the program receives selection of either the learning mode or the operation mode, and when the learning mode is selected, acquires an image for learning including the inspection target, and generates by unsupervised learning. The first learning model receives setting of hyperparameters of a learning model, and outputs a reconstructed image corresponding to the learning image when the acquired learning image is input based on the received hyperparameter. obtaining an inspection image including an inspection object; dividing the obtained inspection image into a plurality of mutually overlapping small piece images; input to the learning model, output reconstructed images of the respective small piece images from the first learning model, and reconstruct corresponding to the plurality of divided small piece images and the respective small piece images output by the first learning model Calculate the degree of anomaly of each pixel with the image for each small piece image, count the number of times that the degree of anomaly of each pixel calculated for each small piece image is added, and calculate the average degree of anomaly for each pixel based on the counted number of times. A computer performs processing for calculating and receiving a setting of a threshold value of the degree of abnormality for verifying the inspection image , and displaying the detected abnormal image based on the calculated average degree of abnormality and the received threshold value of the degree of abnormality. to execute.

一つの側面では、学習及び運用が容易となる。 In one aspect, it is easier to learn and operate.

外観検査システムの概要を示す説明図である。BRIEF DESCRIPTION OF THE DRAWINGS It is explanatory drawing which shows the outline|summary of a visual inspection system. コンピュータの構成例を示すブロック図である。It is a block diagram which shows the structural example of a computer. 学習モデル管理DBのレコードレイアウトの一例を示す説明図である。FIG. 4 is an explanatory diagram showing an example of a record layout of a learning model management DB; 外観検査システムの処理動作を示す機能ブロック図である。It is a functional block diagram showing the processing operation of the appearance inspection system. 良品学習モデルを生成する処理を説明する説明図である。It is an explanatory view explaining processing which generates a non-defective product learning model. 外観検査システムのメニューを示す説明図である。FIG. 4 is an explanatory diagram showing a menu of the visual inspection system; 学習モードでの素材作成画面の一例を示す説明図である。FIG. 10 is an explanatory diagram showing an example of a material creation screen in learning mode; 学習モードでの学習画面の一例を示す説明図である。FIG. 9 is an explanatory diagram showing an example of a learning screen in learning mode; 学習モードでの検証画面の一例を示す説明図である。FIG. 11 is an explanatory diagram showing an example of a verification screen in learning mode; 良品学習モデルを生成する際の処理手順を示すフローチャートである。FIG. 10 is a flow chart showing a processing procedure for generating a non-defective product learning model; FIG. 検査用の画像に基づいて検証処理を実行する際の処理手順を示すフローチャートである。4 is a flowchart showing a processing procedure when verification processing is executed based on an image for inspection; 運用モード画面の一例を示す説明図である。FIG. 5 is an explanatory diagram showing an example of an operation mode screen; 運用モードで異常を検出する際の処理手順を示すフローチャートである。4 is a flow chart showing a processing procedure when an abnormality is detected in an operation mode; 小片画像に基づいて異常を検出する際の処理手順を示すフローチャートである。4 is a flow chart showing a processing procedure for detecting an abnormality based on a small piece image; 小片画像サイズごとに良品学習モデルを生成する際の処理手順を示すフローチャートである。FIG. 10 is a flow chart showing a processing procedure for generating a non-defective product learning model for each small piece image size; FIG. 実施形態3のコンピュータの構成例を示すブロック図である。FIG. 11 is a block diagram showing a configuration example of a computer according to Embodiment 3; 異常検出モデルを用いて異常の有無を検出した検出結果を出力する説明図である。It is explanatory drawing which outputs the detection result which detected the presence or absence of abnormality using an abnormality detection model. 誤判定画像の収集画面の一例を示す説明図である。FIG. 11 is an explanatory diagram showing an example of a screen for collecting incorrectly determined images; 異常検出モデルの生成処理の処理手順の一例を示すフローチャートである。FIG. 11 is a flowchart showing an example of a processing procedure for generating an anomaly detection model; FIG. 実施形態4のコンピュータの構成例を示すブロック図である。FIG. 12 is a block diagram showing a configuration example of a computer according to Embodiment 4; 画像枚数DBのレコードレイアウトの一例を示す説明図である。FIG. 10 is an explanatory diagram showing an example of a record layout of an image number DB; 小片画像の最大枚数を取得する際の処理手順を示すフローチャートである。FIG. 10 is a flowchart showing a processing procedure for obtaining the maximum number of small piece images; FIG. 異常検出モデルを用いて検査対象物の異常を検出する処理の概要を説明する説明図である。FIG. 4 is an explanatory diagram for explaining an outline of processing for detecting an abnormality in an inspection object using an abnormality detection model; 検証モードで検査対象物の異常を検出する画面の一例を示す説明図である。FIG. 10 is an explanatory diagram showing an example of a screen for detecting an abnormality in an inspection object in verification mode; 運用モードで検査対象物の異常を検出する画面の一例を示す説明図である。FIG. 10 is an explanatory diagram showing an example of a screen for detecting an abnormality in an inspection object in an operation mode; 異常検出モデルを用いて検査対象物の異常を検出する際の処理手順を示すフローチャートである。4 is a flow chart showing a processing procedure for detecting an abnormality in an inspection object using an abnormality detection model; 良品学習モデルと異常検出モデルとを併用して検査対象物の異常を検出する検証モード画面の一例を示す説明図である。FIG. 10 is an explanatory diagram showing an example of a verification mode screen for detecting an abnormality in an inspection object using both a non-defective product learning model and an abnormality detection model; 良品学習モデルと異常検出モデルとを併用して検査対象物の異常を検出する運用モード画面の一例を示す説明図である。FIG. 10 is an explanatory diagram showing an example of an operation mode screen for detecting an abnormality in an inspection target using both a non-defective product learning model and an abnormality detection model; 良品学習モデルと異常検出モデルとを併用して検査対象物の異常を検出する際の処理手順を示すフローチャートである。FIG. 10 is a flow chart showing a processing procedure for detecting an abnormality in an inspection object using both a non-defective product learning model and an abnormality detection model; FIG. 良品学習モデルと異常検出モデルとを併用して検査対象物の異常を検出する際の処理手順を示すフローチャートである。FIG. 10 is a flow chart showing a processing procedure for detecting an abnormality in an inspection object using both a non-defective product learning model and an abnormality detection model; FIG. 検査対象物を含む画像を検証する際の処理手順を示すフローチャートである。4 is a flow chart showing a processing procedure when verifying an image including an inspection object; 見落とし画像を用いて異常検出モデルを学習させる際の処理手順を示すフローチャートである。FIG. 10 is a flowchart showing a processing procedure for learning an anomaly detection model using an overlooked image; FIG. 変形例1の検査対象物の異常を検出する検証モード画面の一例を示す説明図である。FIG. 11 is an explanatory diagram showing an example of a verification mode screen for detecting an abnormality of an inspection object according to Modification 1;

以下、本発明をその実施形態を示す図面に基づいて詳述する。 Hereinafter, the present invention will be described in detail based on the drawings showing its embodiments.

(実施形態1)
実施形態1は、検査対象物を含む画像に基づき、人工知能(AI:Artificial Intelligence)により外観検査を行って該検査対象物の異常を検出する形態に関する。検査対象物は、金属、食品、日用品、医療、電子デバイス等の業界の生産物、製品または部品である。検査対象物は、例えば、ベアリング、ネジ、商品容器、ガラス瓶、半導体パッケージ、プリント基板等である。外観検査は、検査対象物の傷、汚れ、異物等の外観上の欠陥を検出することである。例えば、ベアリングの欠けや異物、商品容器のラベル違い、電子デバイス部品の形状違いや微細な曲がり等の外観上の欠陥を外観検査により検出することができる。
(Embodiment 1)
Embodiment 1 relates to a mode in which an appearance inspection is performed by artificial intelligence (AI) based on an image including an inspection object to detect abnormalities in the inspection object. Objects to be inspected are products, products, or parts in industries such as metals, foods, daily necessities, medical care, and electronic devices. Objects to be inspected are, for example, bearings, screws, product containers, glass bottles, semiconductor packages, printed circuit boards, and the like. Appearance inspection is to detect defects in appearance such as scratches, stains, foreign matter, etc., on an object to be inspected. For example, appearance defects such as chipped bearings, foreign matter, wrong labels on product containers, wrong shapes and fine bends in electronic device parts can be detected by visual inspection.

図1は、外観検査システムの概要を示す説明図である。本実施形態のシステムは、情報処理装置1及び撮像装置2を含み、各装置はインターネット、イーサネット(登録商標)またはUSB(Universal Serial Bus)接続等のネットワークNを介して情報の送受信を行う。 FIG. 1 is an explanatory diagram showing an overview of an appearance inspection system. The system of this embodiment includes an information processing device 1 and an imaging device 2, and each device transmits and receives information via a network N such as the Internet, Ethernet (registered trademark), or USB (Universal Serial Bus) connection.

情報処理装置1は、種々の情報に対する処理、記憶及び送受信を行う情報処理装置である。情報処理装置1は、例えばサーバ装置、パーソナルコンピュータまたは汎用のタブレットPC(パソコン)等である。本実施形態において、情報処理装置1はパーソナルコンピュータであるものとし、以下では簡潔のためコンピュータ1と読み替える。 The information processing device 1 is an information processing device that processes, stores, and transmits/receives various information. The information processing device 1 is, for example, a server device, a personal computer, a general-purpose tablet PC (personal computer), or the like. In the present embodiment, the information processing apparatus 1 is assumed to be a personal computer, which will be replaced with the computer 1 for the sake of simplicity.

撮像装置2は、検査対象物を撮像して画像を生成する。本実施形態の撮像装置2は、無線通信部を含む。無線通信部は、通信に関する処理を行うための無線通信モジュールであり、ネットワークNを介して、コンピュータ1等と撮像画像の送受信を行う。なお、撮像装置2の代わりに、撮影可能なパーソナルコンピュータ、スマートフォン、または検査対象物を撮影可能な移動型の監視ロボット等であっても良い。 The imaging device 2 captures an image of an inspection object to generate an image. The imaging device 2 of this embodiment includes a wireless communication unit. The wireless communication unit is a wireless communication module for performing processing related to communication, and transmits/receives captured images to/from the computer 1 or the like via the network N. Note that, instead of the imaging device 2, a personal computer, a smart phone, or a mobile monitoring robot capable of imaging an object to be inspected may be used.

本実施形態に係るコンピュータ1は、学習モードの選択を受け付けた場合、検査対象物を含む学習用の画像を撮像装置2から取得する。コンピュータ1は、教師なし学習により生成する良品学習モデル(第1学習モデル)のハイパーパラメータの設定を受け付ける。コンピュータ1は、受け付けたハイパーパラメータに基づき、取得した学習用の画像を入力した場合に該画像に対応する再構成画像を出力する良品学習モデルを生成する。なお、良品学習モデルに関しては後述する。 The computer 1 according to the present embodiment acquires an image for learning including the inspection object from the imaging device 2 when the selection of the learning mode is received. The computer 1 receives settings of hyperparameters of a non-defective learning model (first learning model) generated by unsupervised learning. Based on the received hyperparameters, the computer 1 generates a non-defective product learning model that outputs a reconstructed image corresponding to the acquired image for learning when the image is input. Note that the non-defective product learning model will be described later.

コンピュータ1は、検査対象物を含む検査用の画像を撮像装置2から取得し、検査用の画像を検証するための異常度の閾値の設定を受け付ける。コンピュータ1は、取得した検査用の画像と、学習済みの良品学習モデルが出力した再構成画像との異常度を算出する。コンピュータ1は、算出した異常度と、受け付けた異常度の閾値とに基づき、検査対象物の異常を検出する。コンピュータ1は、検出した異常を示す異常画像を表示する。 The computer 1 acquires an inspection image including an inspection target from the imaging device 2, and receives setting of an abnormality threshold for verifying the inspection image. The computer 1 calculates the degree of abnormality between the acquired inspection image and the reconstructed image output by the learned non-defective product learning model. The computer 1 detects an abnormality in the object to be inspected based on the calculated abnormality degree and the threshold value of the received abnormality degree. The computer 1 displays an abnormality image indicating the detected abnormality.

コンピュータ1は、運用モードの選択を受け付けた場合、検査対象物を含む運用の画像を撮像装置2から取得する。コンピュータ1は、学習済みの良品学習モデルの選択を受け付ける。コンピュータ1は、取得した運用の画像と、良品学習モデルが出力した再構成画像との異常度を算出する。コンピュータ1は、算出した異常度に基づいて検査対象物の異常の有無を検出する。 When the computer 1 receives the selection of the operation mode, the computer 1 acquires an operation image including the inspection object from the imaging device 2 . The computer 1 accepts selection of a learned non-defective learning model. The computer 1 calculates the degree of abnormality between the acquired operation image and the reconstructed image output by the non-defective product learning model. The computer 1 detects whether or not there is an abnormality in the inspection object based on the calculated degree of abnormality.

図2は、コンピュータ1の構成例を示すブロック図である。コンピュータ1は、制御部11、記憶部12、通信部13、入力部14、表示部15、読取部16及び大容量記憶部17を含む。各構成はバスBで接続されている。 FIG. 2 is a block diagram showing a configuration example of the computer 1. As shown in FIG. The computer 1 includes a control section 11 , a storage section 12 , a communication section 13 , an input section 14 , a display section 15 , a reading section 16 and a mass storage section 17 . Each configuration is connected by a bus B.

制御部11はCPU(Central Processing Unit)、MPU(Micro-Processing Unit)、GPU(Graphics Processing Unit)等の演算処理装置を含み、記憶部12に記憶された制御プログラム1Pを読み出して実行することにより、コンピュータ1に係る種々の情報処理、制御処理等を行う。なお、図2では制御部11を単一のプロセッサであるものとして説明するが、マルチプロセッサであっても良い。 The control unit 11 includes arithmetic processing units such as a CPU (Central Processing Unit), an MPU (Micro-Processing Unit), and a GPU (Graphics Processing Unit). , various information processing, control processing, etc. related to the computer 1 are performed. Note that although FIG. 2 illustrates the controller 11 as a single processor, it may be a multiprocessor.

記憶部12はRAM(Random Access Memory)、ROM(Read Only Memory)等のメモリ素子を含み、制御部11が処理を実行するために必要な制御プログラム1P又はデータ等を記憶している。また、記憶部12は、制御部11が演算処理を実行するために必要なデータ等を一時的に記憶する。通信部13は通信に関する処理を行うための通信モジュールであり、ネットワークNを介して、撮像装置2等との間で情報の送受信を行う。 The storage unit 12 includes memory elements such as RAM (Random Access Memory) and ROM (Read Only Memory), and stores the control program 1P or data necessary for the control unit 11 to execute processing. The storage unit 12 also temporarily stores data and the like necessary for the control unit 11 to perform arithmetic processing. The communication unit 13 is a communication module for performing processing related to communication, and transmits/receives information to/from the imaging device 2 or the like via the network N.

入力部14は、マウス、キーボード、タッチパネル、ボタン等の入力デバイスであり、受け付けた操作情報を制御部11へ出力する。表示部15は、液晶ディスプレイ又は有機EL(electroluminescence)ディスプレイ等であり、制御部11の指示に従い各種情報を表示する。 The input unit 14 is an input device such as a mouse, keyboard, touch panel, buttons, etc., and outputs received operation information to the control unit 11 . The display unit 15 is a liquid crystal display, an organic EL (electroluminescence) display, or the like, and displays various information according to instructions from the control unit 11 .

読取部16は、CD(Compact Disc)-ROM又はDVD(Digital Versatile Disc)-ROMを含む可搬型記憶媒体1aを読み取る。制御部11が読取部16を介して、制御プログラム1Pを可搬型記憶媒体1aより読み取り、大容量記憶部17に記憶しても良い。また、ネットワークN等を介して他のコンピュータから制御部11が制御プログラム1Pをダウンロードし、大容量記憶部17に記憶しても良い。さらにまた、半導体メモリ1bから、制御部11が制御プログラム1Pを読み込んでも良い。 The reader 16 reads a portable storage medium 1a including CD (Compact Disc)-ROM or DVD (Digital Versatile Disc)-ROM. The control unit 11 may read the control program 1P from the portable storage medium 1a via the reading unit 16 and store it in the large-capacity storage unit 17 . Alternatively, the control unit 11 may download the control program 1P from another computer via the network N or the like and store it in the large-capacity storage unit 17 . Furthermore, the control unit 11 may read the control program 1P from the semiconductor memory 1b.

大容量記憶部17は、例えばHDD(Hard disk drive:ハードディスク)、SSD(Solid State Drive:ソリッドステートドライブ)等の記録媒体を備える。大容量記憶部17は、良品学習モデル171及び学習モデル管理DB(データベース:database)172を含む。良品学習モデル171は、深層生成モデルの一種であり、データの分布をモデリングしてそこから新しいデータを生成する学習済みモデルである。学習モデル管理DB172は、学習済みモデルのファイル等を記憶している。 The large-capacity storage unit 17 includes a recording medium such as an HDD (Hard disk drive) or an SSD (Solid State Drive). The large-capacity storage unit 17 includes a non-defective learning model 171 and a learning model management DB (database) 172 . The non-defective product learning model 171 is a kind of deep generative model, and is a trained model that models data distribution and generates new data therefrom. The learning model management DB 172 stores files of learned models and the like.

なお、本実施形態において記憶部12及び大容量記憶部17は一体の記憶装置として構成されていても良い。また、大容量記憶部17は複数の記憶装置により構成されていても良い。更にまた、大容量記憶部17はコンピュータ1に接続された外部記憶装置であっても良い。 In addition, in this embodiment, the storage unit 12 and the large-capacity storage unit 17 may be configured as an integrated storage device. Also, the large-capacity storage unit 17 may be composed of a plurality of storage devices. Furthermore, the large-capacity storage unit 17 may be an external storage device connected to the computer 1 .

なお、本実施形態では、コンピュータ1は一台の情報処理装置であるものとして説明するが、複数台により分散して処理させても良く、または仮想マシンにより構成されていても良い。 In this embodiment, the computer 1 is described as a single information processing device, but it may be distributed to a plurality of devices for processing, or may be composed of virtual machines.

図3は、学習モデル管理DB172のレコードレイアウトの一例を示す説明図である。学習モデル管理DB172は、モデルID列、学習モデルファイル列、生成日時列、テンプレート画像列及び備考列を含む。モデルID列は、各学習済みモデルのファイルを識別するために、一意に特定される学習済みモデルのファイルのIDを記憶している。 FIG. 3 is an explanatory diagram showing an example of the record layout of the learning model management DB 172. As shown in FIG. The learning model management DB 172 includes a model ID column, a learning model file column, a generation date/time column, a template image column, and a remarks column. The model ID column stores the ID of a uniquely identified learned model file in order to identify each learned model file.

学習モデルファイル列は、学習済みモデルのファイル、または学習済みモデルのファイルの保管場所を記憶している。生成日時列は、学習済みモデルのファイルを生成した日時情報を記憶している。テンプレート画像列は、検査対象物を含む画像を切り出す領域を示すための参照用の画像を記憶している。備考列は、学習済みモデルのファイルに対する説明情報を記憶している。 The learning model file column stores the file of the learned model or the storage location of the file of the learned model. The generation date/time column stores the date/time information when the file of the trained model was generated. The template image sequence stores reference images for indicating regions from which images containing inspection objects are cut out. The remarks column stores descriptive information for files of trained models.

なお、本実施形態では、学習モデルを学習モデル管理DB172で管理した例を説明したが、これに限るものではない。例えば、学習モデルごとに学習モデルファイルそのものをコンピュータ1の記憶部12または大容量記憶部17に管理しても良い。この場合、一意に特定されるファイル名に基づいて学習モデルが特定される。また、学習モデルに対応するテンプレート画像が学習モデルファイルと同じ保管場所で保管されても良い。 In this embodiment, an example in which learning models are managed by the learning model management DB 172 has been described, but the present invention is not limited to this. For example, the learning model file itself may be managed in the storage unit 12 or the large-capacity storage unit 17 of the computer 1 for each learning model. In this case, the learning model is identified based on the uniquely identified file name. Also, the template image corresponding to the learning model may be stored in the same storage location as the learning model file.

なお、上述した各DBの記憶形態は一例であり、データ間の関係が維持されていれば、他の記憶形態であっても良い。 Note that the storage form of each DB described above is an example, and other storage forms may be used as long as the relationship between data is maintained.

図4は、外観検査システムの処理動作を示す機能ブロック図である。外観検査システムは、学習モード及び運用モードを含む。学習モードは、検査対象物を含む異常なしの良品画像に基づき、教師なし学習により良品学習モデル171を生成するモードである。運用モードは、検査対象物を含む運用の画像と、学習済みの良品学習モデル171が出力した再構成画像との異常度に基づいて異常を検出するモードである。 FIG. 4 is a functional block diagram showing processing operations of the visual inspection system. The visual inspection system includes a learning mode and an operational mode. The learning mode is a mode in which a non-defective product learning model 171 is generated by unsupervised learning based on non-abnormal non-defective product images including inspection objects. The operation mode is a mode for detecting an abnormality based on the degree of abnormality between the operation image including the inspection object and the reconstructed image output by the learned non-defective product learning model 171 .

先に、学習モードで良品学習モデル171を生成する処理を説明する。コンピュータ1は学習モードの選択を受け付けた場合、コンピュータ1は、検査対象物を含む学習用の画像(正常画像)を撮像装置2から取得する。なお、学習用の画像が予め大容量記憶部17に記憶されても良く、または外部装置から転送されても良い。 First, the process of generating the non-defective product learning model 171 in the learning mode will be described. When the computer 1 accepts the selection of the learning mode, the computer 1 acquires a learning image (normal image) including the inspection object from the imaging device 2 . Note that images for learning may be stored in the large-capacity storage unit 17 in advance, or may be transferred from an external device.

コンピュータ1は、テンプレート画像に基づいて、学習モデルに学習させる画像を作成する。なお、テンプレート画像が未登録(未作成)である場合、コンピュータ1はテンプレート画像を登録(作成)する。具体的には、コンピュータ1は、検査対象物の領域の指定を受け付ける。例えばコンピュータ1は、マウスカーソルを使って長方形の選択範囲が表示されている画像の上に、ドラッグによる検査対象物の領域の選択を受け付ける。コンピュータ1は、選択された検査対象物の領域に基づいてテンプレート画像を登録する。 The computer 1 creates an image to be learned by the learning model based on the template image. If the template image has not been registered (created), the computer 1 registers (creates) the template image. Specifically, the computer 1 accepts designation of the area of the inspection object. For example, the computer 1 accepts the selection of the area of the inspection object by dragging the mouse cursor onto the image in which the rectangular selection range is displayed. The computer 1 registers a template image based on the selected area of the inspection object.

コンピュータ1は、登録済みのテンプレート画像の選択を受け付ける。コンピュータ1は、選択されたテンプレート画像に基づき、例えばテンプレートマッチング(Template Matching)手法を用いて、撮像装置2から取得された学習用の画像中の検査対象物を認識する。テンプレートマッチング手法は、入力画像中からテンプレート画像(部分画像)と最も類似する特定のパターンを探索する処理であり、例えばSSD(Sum of Squared Difference)、SAD(Sum of Absolute Difference)またはNCC(Normalized Cross Correlation)である。 The computer 1 accepts selection of a registered template image. Based on the selected template image, the computer 1 recognizes the inspection object in the learning image acquired from the imaging device 2 using, for example, a template matching method. The template matching method is a process of searching an input image for a specific pattern that is most similar to a template image (partial image). Correlation).

コンピュータ1は、学習用の画像から検査対象物を認識した画像を切り出して所定の学習用画像フォルダに記憶する。学習用画像フォルダは、例えば予め決められた画像フォルダであっても良く、またはユーザ(オペレーター)が指定した画像フォルダであっても良い。 The computer 1 cuts out an image obtained by recognizing the inspection object from the learning image and stores it in a predetermined learning image folder. The learning image folder may be, for example, a predetermined image folder or an image folder designated by the user (operator).

また、テンプレート画像に基づき、動画から学習モデルに学習させる画像を作成することができる。具体的には、コンピュータ1は、検査対象物を含む動画ファイルの選択を受け付ける。コンピュータ1は、テンプレート画像に基づき、例えばCNN(Convolution Neural Network)を用いた物体検出アルゴリズムを利用し、選択された動画中に含まれた検査対象物を認識する。コンピュータ1は、検査対象物を認識した複数の画像を動画から切り出して上述した所定の学習用画像フォルダに記憶する。 Also, based on the template image, it is possible to create an image for the learning model to learn from the moving image. Specifically, the computer 1 accepts selection of a moving image file containing the inspection object. Based on the template image, the computer 1 uses an object detection algorithm using, for example, a CNN (Convolution Neural Network) to recognize the inspection object included in the selected moving image. The computer 1 cuts out a plurality of images in which the inspection object is recognized from the moving image and stores them in the predetermined learning image folder described above.

なお、物体検出アルゴリズムに関しては、CNNの代わりに、RCNN(Regions with Convolutional Neural Network)、テンプレートマッチング(例えば、SSD、SAD)等の物体検出アルゴリズムを使用しても良い。 As for the object detection algorithm, RCNN (Regions with Convolutional Neural Network), template matching (for example, SSD, SAD), or other object detection algorithms may be used instead of CNN.

コンピュータ1は、教師なし学習により生成する良品学習モデル171のハイパーパラメータの設定を受け付ける。ハイパーパラメータは、機械学習アルゴリズムの挙動を制御するパラメータであり、RGB(Red Green Blue)/白黒、Depth、Channel及びEpochを含む。RGB/白黒は、画像に対する色モードを設定するパラメータである。色モードは、RGBカラー及びグレースケール(モノクロ)を含む。 The computer 1 accepts setting of hyperparameters of the non-defective product learning model 171 generated by unsupervised learning. Hyperparameters are parameters that control the behavior of machine learning algorithms and include RGB (Red Green Blue)/black and white, Depth, Channel and Epoch. RGB/BW is a parameter that sets the color mode for the image. Color modes include RGB color and grayscale (monochrome).

Depthは、学習モデルのエンコーダまたはデコーダの階層数を設定するパラメータである。Channelは、1階層あたりのニューロン数(フィルタ数)を設定するパラメータである。階層数またはChannel数を増やすと学習率が上がるが、学習に時間を要する。Epochは、一つの訓練データを何回繰り返して学習させるかの回数を設定するパラメータである。 Depth is a parameter that sets the number of layers of the encoder or decoder of the learning model. Channel is a parameter that sets the number of neurons (number of filters) per layer. Increasing the number of layers or the number of channels increases the learning rate, but it takes time to learn. Epoch is a parameter that sets the number of repetitions of one piece of training data for learning.

コンピュータ1は、設定された良品学習モデル171のハイパーパラメータに基づき、所定の学習用画像フォルダに記憶された画像を用いて良品学習モデル171を生成する。 The computer 1 generates the non-defective product learning model 171 based on the set hyperparameters of the non-defective product learning model 171 using the images stored in the predetermined learning image folder.

図5は、良品学習モデル171を生成する処理を説明する説明図である。良品学習モデル171は、ディープラーニングにより構築され、人工知能ソフトウェアの一部であるプログラムモジュールとして利用される。良品学習モデル171は、例えばオートエンコーダ(Auto Encoder)、VAE(変分オートエンコーダ:Variational Auto Encoder)、U-Net(Convolutional Networks for Biomedical Image Segmentation)、GAN(敵対的生成ネットワーク:Generative Adversarial Networks)等である。検査対象物の異常画像(不良品画像)が無い、または異常画像が少ない場合、教師なし学習により正常画像(良品画像)のみを学習することができる。 FIG. 5 is an explanatory diagram for explaining the process of generating the non-defective product learning model 171. As shown in FIG. The good product learning model 171 is constructed by deep learning and used as a program module that is part of artificial intelligence software. The good product learning model 171 is, for example, Auto Encoder, VAE (Variational Auto Encoder), U-Net (Convolutional Networks for Biomedical Image Segmentation), GAN (Generative Adversarial Networks), etc. is. When there are no abnormal images (defective product images) or few abnormal images of the inspection object, only normal images (good product images) can be learned by unsupervised learning.

以下では、良品学習モデル171の例としてVAEを用いて説明する。良品学習モデル171は、正常な学習データ(検査対象物を含む正常画像)を学習した確立密度推定器であり、正常な初期学習データの確率密度の特徴を学習したモデルである。確率密度推定による異常検出は、正常なトラフィックを基に正常な通信パターンの発生確率を学習し、発生確率の低い通信を異常として検知する。このため、VAEによれば、すべての悪性状態を知らずとも異常検出が可能である。 In the following, VAE is used as an example of the non-defective product learning model 171 for explanation. The non-defective product learning model 171 is a probability density estimator that has learned normal learning data (normal images including inspection objects), and is a model that has learned the probability density features of normal initial learning data. Anomaly detection by probability density estimation learns the occurrence probability of normal communication patterns based on normal traffic, and detects communications with a low occurrence probability as anomalies. Thus, VAE allows anomaly detection without knowledge of all malignant conditions.

VAEは、復元誤差(Reconstruction Error)をもとに、エンコーダ(符号化器:Encoder)とデコーダ(復号化器:Decoder)それぞれの重みを調整して、潜在変数z(凝縮された特徴)を求めている。具体的には、VAEは、潜在変数zを求めるのに確率分布を用いる。確率分布の推定と生成にそれぞれ用いるエンコーダとデコーダにニューラルネットワークを用い、確率的勾配降下法等の最適化手法によってパラメータを更新する。 Based on the reconstruction error, the VAE adjusts the weights of the encoder (encoder) and the decoder (decoder) to find the latent variable z (condensed feature). ing. Specifically, VAE uses probability distributions to determine the latent variable z. Neural networks are used for the encoder and decoder for estimating and generating probability distributions, respectively, and parameters are updated by optimization methods such as stochastic gradient descent.

VAEは、目的関数となる対数尤度関数の変分下限(ELBO:Evidence Lower Bound)を最大にするようなパラメータを求め、潜在空間上で多様体学習を行う。エンコーダの入力画像とデコーダの出力画像(再構成画像)が等しくなるように訓練することにより、良品学習モデル171が生成される。 The VAE finds parameters that maximize the Evidence Lower Bound (ELBO) of the logarithmic likelihood function, which is the objective function, and performs manifold learning on the latent space. A good product learning model 171 is generated by training such that the input image of the encoder and the output image (reconstructed image) of the decoder are the same.

VAEは、通常以下の式(1)で表される損失関数を用いて学習する。 A VAE learns using a loss function usually represented by the following equation (1).

Figure 0007289427000001
Figure 0007289427000001

ただし、DVAE(x)、AVAE(x)、MVAE(x)それぞれは、次の式(2)、(3)、(4)で表される。 However, D VAE (x), A VAE (x) and M VAE (x) are represented by the following equations (2), (3) and (4) respectively.

Figure 0007289427000002
Figure 0007289427000002

Figure 0007289427000003
Figure 0007289427000003

Figure 0007289427000004
Figure 0007289427000004

VAEは、パラメータθで表現される生成モデルpθ(x)に対してモデルエビデンスの下限(ELBO)を最大化することで学習を行うモデルである。VAEは、入力xを潜在変数zに変換するエンコーダ及び潜在変数zから入力の再構成を行うデコーダから構成される。変分事後分布qφ(z|x)及び条件付き確率pθ(x|z)は、共に分散共分散行列が対角行列となっている多変量正規分布としてモデル化される。エンコーダは入力xを受け取った後、変分事後分布qφ(z|x)における平均ベクトルμzと標準偏差ベクトルσzの二つの要素の出力を行う。変分事後分布qφ(z|x)のモンテカルロサンプリングを行う代わりに潜在変数zの最大事後確率推定μzが異常検知において使用される。 VAE is a model that performs learning by maximizing the lower bound of model evidence (ELBO) for a generative model p θ (x) represented by a parameter θ. A VAE consists of an encoder that transforms an input x into a latent variable z and a decoder that reconstructs the input from the latent variable z. Both the variational posterior distribution q φ (z|x) and the conditional probability p θ (x|z) are modeled as multivariate normal distributions with diagonal variance-covariance matrices. After receiving the input x, the encoder outputs two elements, the mean vector μ z and the standard deviation vector σ z in the variational posterior distribution q φ (z|x). Instead of performing Monte Carlo sampling of the variational posterior distribution q φ (z|x), the maximum posterior probability estimate μ z of the latent variable z is used in anomaly detection.

iとjは、それぞれデータxと潜在変数zの要素の番号を示す。VAEは、損失関数LVAE(x) = DVAE(x) + AVAE(x) + MVAE(x)と3つの項から構成されている。1つ目のDVAE(x)は、与えられたデータの中から頻度の高い特徴を学習し、頻度の少ない特徴を無視する性質を持つ項である。2つ目のAVAE(x)は、与えられたデータの中の特徴の複雑さに応じて調整する性質を持つ項である。3つ目のMVAE(x)は、直接的に再現誤差を表す項である。 i and j indicate the element numbers of data x and latent variable z, respectively. VAE is composed of loss function L VAE (x) = D VAE (x) + A VAE (x) + M VAE (x) and three terms. The first D VAE (x) is a term that has the property of learning high-frequency features from given data and ignoring low-frequency features. The second A VAE (x) is a term that has the property of adjusting according to the complexity of the features in the given data. The third M VAE (x) is a term that directly expresses the reproduction error.

本実施形態でのVAEは、非正規化異常度を用いた異常検知アルゴリズムに基づいて構築される。非正規化異常度は、深層生成モデルにおける異常度、即ち負の対数数度から正規化項を取り除いたものである。非正規化異常度は、データが潜在的に含有する複雑さに対して堅牢であり、画像内における各部分の出現頻度に依存することなく評価を行える。 The VAE in this embodiment is constructed based on an anomaly detection algorithm using non-normalized anomaly degrees. The non-normalized anomaly score is the anomaly score in the deep generative model, that is, the negative logarithmic degree minus the normalization term. The unnormalized anomaly score is robust to the complexity that the data potentially contains and can be evaluated without relying on the frequency of appearance of each part in the image.

正規化項DVAE(x)及び正規化定数の対数AVAE(x)は、対象部位自体の出現パターン(クラスタ)の頻度及び複雑さを表す持つ項であるため、異常度の算出に使用されない。このように、DVAE(x)及びAVAE(x)を取り除き、MVAE(x)のみを使用して異常度を算出する。非正規化の損失関数は以下の式(5)で表される。 The normalization term D VAE (x) and the logarithm A VAE (x) of the normalization constant are terms that represent the frequency and complexity of the appearance pattern (cluster) of the target site itself, so they are not used to calculate the degree of abnormality. . Thus, D VAE (x) and A VAE (x) are removed and only M VAE (x) is used to calculate the degree of anomaly. A non-normalized loss function is represented by the following equation (5).

Figure 0007289427000005
Figure 0007289427000005

よって、VAEによる異常検知におけるピクセルごとの異常度式は、以下の式(6)で表される。 Therefore, an abnormality degree formula for each pixel in abnormality detection by VAE is represented by the following formula (6).

Figure 0007289427000006
Figure 0007289427000006

xは、入力画像を表す項である。xiは、画素値を表す項である。μは、xに対応する再構成画像を表す項である。μxiは、条件付き確率pθ(x|z)における平均ベクトルを表す項である。μzは、変分事後分布qφ(z|x)における平均ベクトルを表す項である。σは、xが属するグループの不確かさ及び複雑さを表す項である。σxiは、条件付き確率pθ(x|z)における標準偏差ベクトルを表す項である。式(6)のように、xとμの差分(絶対距離)ではなく、σで除すことで、画像が持つ本質的な不確かさ及び複雑さに対して堅牢な異常度が計算される。 x is a term representing an input image. xi is a term representing a pixel value. μ is a term representing the reconstructed image corresponding to x. μ xi is a term representing the mean vector in the conditional probability p θ (x|z). μ z is a term representing the mean vector in the variational posterior distribution q φ (z|x). σ is a term representing the uncertainty and complexity of the group to which x belongs. σ xi is a term representing the standard deviation vector in the conditional probability p θ (x|z). By dividing by σ rather than by the difference (absolute distance) between x and μ, as in Equation (6), an anomaly score robust to the inherent uncertainty and complexity of the image is calculated.

コンピュータ1は、上記の非正規化異常度を用いた異常検知アルゴリズムに基づいて良品学習モデル171を生成する。コンピュータ1は、生成した良品学習モデル171を学習モデル管理DB172に記憶する。具体的には、コンピュータ1はモデルIDを割り振って、学習済みモデルのファイル、生成日時、テンプレート画像及び備考を一つのレコードとして学習モデル管理DB172に記憶する。 The computer 1 generates a non-defective product learning model 171 based on the anomaly detection algorithm using the non-normalized anomaly degree. The computer 1 stores the generated non-defective product learning model 171 in the learning model management DB 172 . Specifically, the computer 1 assigns a model ID, and stores the learned model file, generation date and time, template image, and remarks as one record in the learning model management DB 172 .

続いて、図4に戻り、学習モードで検査用の画像に基づいて検証処理を説明する。コンピュータ1は、検査対象物を含む検査用の画像を撮像装置2から取得する。なお、検査用の画像が予め大容量記憶部17に記憶されても良く、または外部装置から転送されても良い。コンピュータ1はテンプレート画像に基づき、検査用の画像を切り出して所定の検証画像フォルダに記憶する。 Next, referring back to FIG. 4, the verification process will be described based on the inspection image in the learning mode. The computer 1 acquires an inspection image including an inspection target from the imaging device 2 . The image for inspection may be stored in advance in the large-capacity storage unit 17, or may be transferred from an external device. Based on the template image, the computer 1 cuts out an inspection image and stores it in a predetermined verification image folder.

コンピュータ1は、検査用の画像を検証するための異常度の閾値の設定を受け付ける。異常度は、実際の画像(入力画像)と再構成画像(出力画像)とのずれの度合いである。異常度の閾値は、例えば「1~100」または「1~300」等の値に設定される。 The computer 1 accepts the setting of the threshold of the degree of abnormality for verifying the inspection image. The degree of anomaly is the degree of deviation between the actual image (input image) and the reconstructed image (output image). The threshold value of the degree of abnormality is set to a value such as "1 to 100" or "1 to 300", for example.

コンピュータ1は、切り出した画像を学習済みの良品学習モデル171に入力し、該画像に対応する再構成画像を出力させる。良品学習モデル171に画像を入力した場合、DVAE(x)とAVAE(x)をLVAE(x)から消去することにより、良品学習モデル171は、「頻繁さ」と「複雑さ」を該画像から消去した再構成画像を出力する。これにより、再構成画像に対し、同じ閾値でピクセルごとの異常を検出することができる。 The computer 1 inputs the clipped image to the learned non-defective product learning model 171 and outputs a reconstructed image corresponding to the image. When an image is input to the non-defective product learning model 171, the non-defective product learning model 171 can calculate “frequency” and “complexity” by eliminating D VAE (x) and A VAE (x) from L VAE (x). A reconstructed image erased from the image is output. As a result, anomalies can be detected for each pixel with the same threshold for the reconstructed image.

コンピュータ1は、切り出した画像と、該画像に対応する再構成画像との異常度に基づいて異常を検出する。先ず、コンピュータ1は切り出した画像と再構成画像との各ピクセルの異常度を式(6)で表される異常度式に従って算出する。具体的には、コンピュータ1は、再構成画像の画素値(μxi)と切り出した画像の画素値(xi)との差分を算出する。コンピュータ1は、算出した差分を標準偏差ベクトル(σxi)で除すことにより異常度を算出する。次に、コンピュータ1は、算出した各ピクセルの異常度が閾値(例えば、50)を超えたか否かを判定する。コンピュータ1は、各ピクセルの異常度のうち少なくとも1つが閾値を超えたと判定した場合、異常として検出する。 The computer 1 detects an abnormality based on the degree of abnormality between the clipped image and the reconstructed image corresponding to the image. First, the computer 1 calculates the degree of abnormality of each pixel in the clipped image and the reconstructed image according to the degree of abnormality formula represented by Equation (6). Specifically, the computer 1 calculates the difference between the pixel value (μ xi ) of the reconstructed image and the pixel value (x i ) of the clipped image. The computer 1 calculates the degree of abnormality by dividing the calculated difference by the standard deviation vector (σ xi ). Next, the computer 1 determines whether the calculated degree of abnormality of each pixel exceeds a threshold value (eg, 50). When the computer 1 determines that at least one of the degrees of abnormality of each pixel exceeds the threshold, it detects it as an abnormality.

なお、上述したピクセルごとの異常度による異常判定処理に限るものではない。例えば、上記の閾値を超えた画像の領域のうち、コンピュータ1は該領域の面積が所定の面積閾値(第2異常度閾値)を超えたと判定した場合、異常として検出しても良い。例えばコンピュータ1は、異常度が第1異常度閾値(例えば、50)を超えたピクセル数を集計し、集計したピクセル数が第2異常度閾値(例えば、30ピクセル)を超えたか否かを判定する。コンピュータ1は、異常度が第1異常度閾値を超えたピクセル数が第2異常度閾値を超えたと判定した場合、異常として検出する。 In addition, it does not restrict to the abnormality determination process by the abnormality degree for every pixel mentioned above. For example, if the computer 1 determines that the area of the image exceeds a predetermined area threshold (second abnormality degree threshold) among the areas of the image that exceed the above threshold, it may be detected as abnormal. For example, the computer 1 aggregates the number of pixels whose anomaly exceeds a first anomaly threshold (e.g., 50), and determines whether the aggregated number of pixels exceeds a second anomaly threshold (e.g., 30 pixels). do. When the computer 1 determines that the number of pixels whose degree of abnormality exceeds the first threshold of degree of abnormality exceeds the second threshold of degree of abnormality, the computer 1 detects it as an abnormality.

また、異常と判断された検査対象物のどの部位(部分)に異常点があるかの情報を異常度マップ(ヒートマップ)として提示することができる。異常度マップは、異常箇所を可視化するヒートマップである。例えば、異常度は1~100に正規化されており対数で色付けし、ヒートマップで色が濃い部分が異常と認識されている。コンピュータ1は、算出した各ピクセルの異常度に基づいて、画像の異常度マップを生成する。 In addition, it is possible to present information as an anomaly degree map (heat map) as to which site (portion) of the inspection object determined to be abnormal has an anomalous point. The degree of anomaly map is a heat map that visualizes the location of anomalies. For example, the degree of anomaly is normalized from 1 to 100 and colored logarithmically, and dark colored portions in the heat map are recognized as abnormal. The computer 1 generates an image anomaly degree map based on the calculated anomaly degree of each pixel.

コンピュータ1は、良品学習モデル171の名称、異常度の閾値、及び生成した画像の異常度マップを表示する。なお、画像の異常度マップの生成処理は必須ではない。例えば画像の異常度マップが生成されない場合、コンピュータ1は、良品学習モデル171の名称、異常度の閾値及び異常画像を表示しても良い。または、コンピュータ1は、異常を示すアラートアイコン等を用いて、異常箇所を異常画像上で明示しても良い。 The computer 1 displays the name of the non-defective product learning model 171, the threshold of the degree of abnormality, and the degree of abnormality map of the generated image. It should be noted that the process of generating the image anomaly degree map is not essential. For example, when an image anomaly map is not generated, the computer 1 may display the name of the non-defective product learning model 171, an anomaly degree threshold, and an anomaly image. Alternatively, the computer 1 may use an alert icon or the like indicating the abnormality to clearly indicate the abnormal location on the abnormal image.

なお、上述した異常検出処理に限るものではない。例えば、コンピュータ1はSSDを用いて、入力画像と該入力画像に対応する再構成画像との類似度を算出する。コンピュータ1は、算出した類似度が所定の類似度の閾値(例えば、80%)以下であると判定した場合、異常として検出しても良い。なお、画像の明度または輝度の差分により異常を検出しても良い。例えばコンピュータ1は、ピクセルごとに入力画像と該入力画像に対応する再構成画像との輝度の差分を算出する。コンピュータ1は、算出した輝度の差分が所定の差分閾値以上であると判定した場合、異常として検出する。 In addition, it is not limited to the abnormality detection process described above. For example, the computer 1 uses an SSD to calculate the degree of similarity between an input image and a reconstructed image corresponding to the input image. When the computer 1 determines that the calculated similarity is equal to or less than a predetermined similarity threshold (for example, 80%), the computer 1 may detect it as an anomaly. It should be noted that the abnormality may be detected based on the difference in brightness or brightness of the image. For example, the computer 1 calculates the luminance difference between the input image and the reconstructed image corresponding to the input image for each pixel. When the computer 1 determines that the calculated luminance difference is equal to or greater than a predetermined difference threshold value, the computer 1 detects an abnormality.

図6は、外観検査システムのメニューを示す説明図である。学習モードボタン10aは、学習モード画面に遷移するためのボタンである。運用モードボタン10bは、運用モード画面に遷移するためのボタンである。コンピュータ1は、学習モードボタン10aのタッチ(クリック)操作を受け付けた場合、コンピュータ1は学習モード画面(図7)に遷移する。コンピュータ1は、運用モードボタン10bのタッチ操作を受け付けた場合、コンピュータ1は運用モード画面(図12)に遷移する。 FIG. 6 is an explanatory diagram showing the menu of the visual inspection system. The learning mode button 10a is a button for transitioning to the learning mode screen. The operation mode button 10b is a button for transitioning to the operation mode screen. When the computer 1 accepts the touch (click) operation of the learning mode button 10a, the computer 1 transitions to the learning mode screen (FIG. 7). When the computer 1 receives a touch operation on the operation mode button 10b, the computer 1 transitions to the operation mode screen (FIG. 12).

図7は、学習モードでの素材作成画面の一例を示す説明図である。素材作成画面は、素材作成タブ11a、学習タブ11b、検証タブ11c、切り出し画像選択ボタン11d、画像フォルダ選択ボタン11e、動画ファイル選択ボタン11f、精度しきい値入力欄11g、学習用画像フォルダ選択ボタン11h、作成ボタン11i及び画像一覧欄11jを含む。 FIG. 7 is an explanatory diagram showing an example of the material creation screen in the learning mode. The material creation screen includes a material creation tab 11a, a learning tab 11b, a verification tab 11c, a clipped image selection button 11d, an image folder selection button 11e, a video file selection button 11f, an accuracy threshold input field 11g, and a learning image folder selection button. 11h, a create button 11i and an image list field 11j.

素材作成タブ11aは、学習モードでの素材作成画面(本画面)を表示するタブである。学習タブ11bは、学習モードでの学習画面(図8)を表示するタブである。検証タブ11cは、学習モードでの検証画面(図9)を表示タブである。切り出し画像選択ボタン11dは、テンプレート画像を選択するボタンである。画像フォルダ選択ボタン11eは、検査対象物を含む画像を保存した画像フォルダを選択するボタンである。動画ファイル選択ボタン11fは、検査対象物を含む動画を選択するボタンである。 The material creation tab 11a is a tab for displaying a material creation screen (main screen) in the learning mode. The learning tab 11b is a tab for displaying a learning screen (FIG. 8) in the learning mode. The verification tab 11c is a tab for displaying a verification screen (FIG. 9) in the learning mode. The clipped image selection button 11d is a button for selecting a template image. The image folder selection button 11e is a button for selecting an image folder in which images including inspection objects are stored. The moving image file selection button 11f is a button for selecting a moving image including an inspection object.

精度しきい値入力欄11gは、動画から検査対象物を認識する認識精度の閾値を入力するテキストフィールドである。学習用画像フォルダ選択ボタン11hは、テンプレート画像に基づいて切り出された学習用の画像を記憶するためのフォルダを選択するボタンである。作成ボタン11iは、良品学習モデル171を生成するボタンである。画像一覧欄11jは、学習用画像フォルダに出力された画像を表示する表示欄である。 The precision threshold input field 11g is a text field for inputting a recognition precision threshold for recognizing an inspection object from a moving image. The learning image folder selection button 11h is a button for selecting a folder for storing learning images cut out based on the template image. The create button 11i is a button for creating the non-defective product learning model 171 . The image list column 11j is a display column for displaying images output to the learning image folder.

コンピュータ1は、素材作成タブ11aのタッチ操作を受け付けた場合、素材作成画面を表示する。コンピュータ1は、学習タブ11bのタッチ操作を受け付けた場合、学習画面を表示する。コンピュータ1は、検証タブ11cのタッチ操作を受け付けた場合、検証画面を表示する。 The computer 1 displays a material creation screen when receiving a touch operation on the material creation tab 11a. The computer 1 displays a learning screen when receiving a touch operation on the learning tab 11b. The computer 1 displays the verification screen when the touch operation of the verification tab 11c is received.

コンピュータ1は、切り出し画像選択ボタン11dのタッチ操作を受け付けた場合、検査対象物を含むテンプレート画像の選択を受け付ける。コンピュータ1は、画像フォルダ選択ボタン11eのタッチ操作を受け付けた場合、検査対象物を含む画像を記憶したフォルダの選択を受け付ける。コンピュータ1は、動画ファイル選択ボタン11fのタッチ操作を受け付けた場合、対象物を含む動画ファイルの選択を受け付ける。コンピュータ1は、学習用画像フォルダ選択ボタン11hのタッチ操作を受け付けた場合、テンプレート画像に基づいて切り出された学習用の画像を記憶するためのフォルダの選択を受け付ける。 When the computer 1 accepts the touch operation of the clipped image selection button 11d, the computer 1 accepts selection of a template image including the inspection object. When the computer 1 accepts the touch operation of the image folder selection button 11e, the computer 1 accepts the selection of the folder storing the images including the inspection object. When the computer 1 accepts the touch operation of the moving image file selection button 11f, it accepts the selection of the moving image file including the object. When the computer 1 accepts a touch operation on the learning image folder selection button 11h, the computer 1 accepts selection of a folder for storing learning images cut out based on the template image.

コンピュータ1は、作成ボタン11iのタッチ操作を受け付けた場合、切り出し画像選択ボタン11dにより選択されたテンプレート画像に基づき、画像フォルダ選択ボタン11eにより選択された画像フォルダに記憶された学習用の画像を切り出す。コンピュータ1は切り出した画像を、学習用画像フォルダ選択ボタン11hにより選択された学習用画像フォルダに記憶する。コンピュータ1は、学習用画像フォルダに記憶された画像を画像一覧欄11jに表示する。 When the computer 1 receives the touch operation of the create button 11i, the computer 1 cuts out images for learning stored in the image folder selected by the image folder selection button 11e based on the template image selected by the cutout image selection button 11d. . The computer 1 stores the clipped image in the learning image folder selected by the learning image folder selection button 11h. The computer 1 displays the images stored in the learning image folder in the image list field 11j.

動画ファイル選択ボタン11fにより動画ファイルが選択された場合、コンピュータ1は、テンプレート画像と、精度しきい値入力欄11gにより入力された閾値とに基づき、選択された動画ファイルから検査対象物を認識した複数の画像を切り出す。コンピュータ1は切り出した画像を、学習用画像フォルダ選択ボタン11hにより選択された学習用画像フォルダに記憶する。コンピュータ1は、学習用画像フォルダに記憶された画像を画像一覧欄11jに表示する。 When a moving image file is selected by the moving image file selection button 11f, the computer 1 recognizes the inspection object from the selected moving image file based on the template image and the threshold entered in the accuracy threshold input field 11g. Crop multiple images. The computer 1 stores the clipped image in the learning image folder selected by the learning image folder selection button 11h. The computer 1 displays the images stored in the learning image folder in the image list column 11j.

図8は、学習モードでの学習画面の一例を示す説明図である。なお、素材作成タブ11a、学習タブ11b、検証タブ11cについては、図7と同様であるため、説明を省略する。学習画面は、学習画像フォルダ選択ボタン12a、色モード設定ラジオボタン12b、Depth入力欄12c、Channel選択ボタン12d、Epoch入力欄12e、AIモデル保存フォルダ選択ボタン12f、学習ボタン12g及び学習情報表示欄12hを含む。 FIG. 8 is an explanatory diagram showing an example of a learning screen in the learning mode. Note that the material creation tab 11a, the learning tab 11b, and the verification tab 11c are the same as those in FIG. 7, so description thereof will be omitted. The learning screen includes a learning image folder selection button 12a, a color mode setting radio button 12b, a depth input field 12c, a channel selection button 12d, an Epoch input field 12e, an AI model storage folder selection button 12f, a learning button 12g, and a learning information display field 12h. including.

学習画像フォルダ選択ボタン12aは、学習用の画像を記憶した画像フォルダを選択するボタンである。画像フォルダは、学習用の異常のない正常な検査対象物の画像が記憶されている。色モード設定ラジオボタン12bは、学習用の画像に対するRGBカラーモードかグレースケールモードかの設定を受け付けるボタンである。Depth入力欄12cは、学習モデルのエンコーダまたはデコーダの階層数を入力するテキストフィールドである。学習モデルの階層数は、例えば「1~4」の数値に設定される。 The learning image folder selection button 12a is a button for selecting an image folder in which learning images are stored. The image folder stores images of normal inspection objects with no abnormalities for learning. The color mode setting radio button 12b is a button for receiving the setting of RGB color mode or grayscale mode for the learning image. The depth input field 12c is a text field for inputting the layer number of the encoder or decoder of the learning model. The number of layers of the learning model is set, for example, to a numerical value of "1 to 4".

Channel選択ボタン12dは、チャンネル数(1階層あたりのニューロン数)を選択するボタンである。Epoch入力欄12eは、学習させる回数を入力するテキストフィールドである。学習させる回数は、例えば「1~100」の数値に設定される。なお、本実施形態では、ハイパーパラメータの例として、Depth、Channel及びEpochを挙げたが、これに限るものではない。例えば、学習係数、フィルタ数またはユニット数を設定できるようにしても良い。 The Channel selection button 12d is a button for selecting the number of channels (the number of neurons per layer). The Epoch input field 12e is a text field for inputting the number of learning times. The number of learning times is set, for example, to a numerical value of "1 to 100". In this embodiment, Depth, Channel, and Epoch are given as examples of hyperparameters, but the hyperparameters are not limited to these. For example, the learning coefficient, the number of filters, or the number of units may be set.

AIモデル保存フォルダ選択ボタン12fは、学習を実行させて生成される学習済みモデルのファイルを記憶するためのフォルダを選択するボタンである。学習ボタン12gは、設定されたパラメータに基づいて学習モデルを生成するボタンである。学習情報表示欄12hは、画面操作の説明情報、学習モデルの学習(生成)進捗状況等の学習情報を表示する表示欄である。 The AI model storage folder selection button 12f is a button for selecting a folder for storing files of learned models generated by executing learning. The learning button 12g is a button for generating a learning model based on the set parameters. The learning information display column 12h is a display column for displaying learning information such as explanation information of screen operation and progress of learning (generation) of the learning model.

コンピュータ1は、学習画像フォルダ選択ボタン12aのタッチ操作を受け付けた場合、学習用の画像を記憶した画像フォルダの選択を受け付ける。コンピュータ1は、AIモデル保存フォルダ選択ボタン12fのタッチ操作を受け付けた場合、AIモデル保存フォルダの選択を受け付ける。 When the computer 1 accepts a touch operation of the learning image folder selection button 12a, the computer 1 accepts selection of an image folder in which images for learning are stored. When the computer 1 accepts the touch operation of the AI model storage folder selection button 12f, the computer 1 accepts the selection of the AI model storage folder.

コンピュータ1は、学習ボタン12gのタッチ操作を受け付けた場合、色モード設定ラジオボタン12bにより色モードの選択、Depth入力欄12cにより階層数の入力、Channel選択ボタン12dによりチャンネル数の選択、及びEpoch入力欄12eにより学習させる回数の入力を受け付ける。コンピュータ1は、受け付けた色モード、階層数、チャネル数及び学習させる回数に基づき、学習画像フォルダ選択ボタン12aにより選択された画像を用いて良品学習モデル171を生成する。 When the computer 1 accepts the touch operation of the learning button 12g, the color mode is selected by the color mode setting radio button 12b, the number of layers is input by the depth input field 12c, the number of channels is selected by the channel selection button 12d, and Epoch is input. The field 12e accepts the input of the number of learning times. The computer 1 generates the non-defective product learning model 171 using the image selected by the learning image folder selection button 12a based on the received color mode, number of layers, number of channels, and number of times of learning.

コンピュータ1は、生成した良品学習モデル171のファイルを、AIモデル保存フォルダ選択ボタン12fにより選択されたフォルダに記憶する。コンピュータ1は、生成した良品学習モデル171のファイルを学習モデル管理DB172に記憶する。また、学習の進捗状況等が学習情報表示欄12hに表示される。 The computer 1 stores the file of the generated non-defective product learning model 171 in the folder selected by the AI model storage folder selection button 12f. The computer 1 stores the file of the generated non-defective product learning model 171 in the learning model management DB 172 . In addition, the learning progress and the like are displayed in the learning information display column 12h.

図9は、学習モードでの検証画面の一例を示す説明図である。なお、素材作成タブ11a、学習タブ11b、検証タブ11cについては、図7と同様であるため、説明を省略する。検証画面は、AIモデルファイル選択ボタン13a、検証画像フォルダ選択ボタン13b、異常度しきい値入力欄13c、検証結果保存フォルダ選択ボタン13d、検証ボタン13e及び検証情報表示欄13fを含む。 FIG. 9 is an explanatory diagram showing an example of a verification screen in the learning mode. Note that the material creation tab 11a, the learning tab 11b, and the verification tab 11c are the same as those in FIG. 7, so description thereof will be omitted. The verification screen includes an AI model file selection button 13a, a verification image folder selection button 13b, anomaly degree threshold input field 13c, a verification result storage folder selection button 13d, a verification button 13e, and a verification information display field 13f.

AIモデルファイル選択ボタン13aは、学習済みの良品学習モデル171ファイルの選択を受け付けるボタンである。検証画像フォルダ選択ボタン13bは、検査対象物を含む検査用の画像を記憶した画像フォルダを選択するボタンである。異常度しきい値入力欄13cは、異常度の閾値を入力するテキストフィールドである。 The AI model file selection button 13a is a button for accepting selection of a learned good product learning model 171 file. The verification image folder selection button 13b is a button for selecting an image folder in which inspection images including inspection objects are stored. The anomaly threshold entry field 13c is a text field for entering an anomaly threshold.

検証結果保存フォルダ選択ボタン13dは、検証結果を保存するフォルダを選択するボタンである。検証ボタン13eは、検査用の画像を検証するボタンである。検証情報表示欄13fは、画面操作の説明情報、検証結果等の検証情報を表示する表示欄である。 The verification result saving folder selection button 13d is a button for selecting a folder for saving the verification result. The verification button 13e is a button for verifying an inspection image. The verification information display field 13f is a display field for displaying verification information such as screen operation explanation information and verification results.

コンピュータ1は、AIモデルファイル選択ボタン13aのタッチ操作を受け付けた場合、学習済みの良品学習モデル171のファイルを大容量記憶部17の学習モデル管理DB172から取得する。例えばコンピュータ1は、取得した学習済みの良品学習モデル171(複数可)をリストボックス(図示せず)に表示する。コンピュータ1は、ユーザによる良品学習モデル171の選択を受け付ける。 The computer 1 acquires the file of the learned non-defective product learning model 171 from the learning model management DB 172 of the large-capacity storage unit 17 when receiving the touch operation of the AI model file selection button 13 a. For example, the computer 1 displays the learned non-defective product learning model 171 (a plurality of acquired models) in a list box (not shown). The computer 1 accepts selection of the non-defective product learning model 171 by the user.

コンピュータ1は、検証画像フォルダ選択ボタン13bのタッチ操作を受け付けた場合、検査用の画像を記憶した画像フォルダの選択を受け付ける。コンピュータ1は、検証結果保存フォルダ選択ボタン13dのタッチ操作を受け付けた場合、検証結果を記憶するフォルダの選択を受け付ける。 When the computer 1 accepts the touch operation of the verification image folder selection button 13b, the computer 1 accepts the selection of the image folder in which the images for inspection are stored. When the computer 1 accepts the touch operation of the verification result storage folder selection button 13d, the computer 1 accepts selection of a folder for storing the verification result.

コンピュータ1は、検証ボタン13eのタッチ操作を受け付けた場合、検証画像フォルダ選択ボタン13bにより選択された画像を、AIモデルファイル選択ボタン13aにより選択された良品学習モデル171に入力し、該画像に対応する再構成画像を出力させる。コンピュータ1は、選択された画像と、該画像に対応する再構成画像との異常度を算出する。コンピュータ1は、算出した異常度と、異常度しきい値入力欄13cにより入力された異常度の閾値とに基づいて異常を検出する。コンピュータ1は、検出した異常画像を、検証結果保存フォルダ選択ボタン13dにより選択されたフォルダに記憶し、検証情報表示欄13fに表示する。 When the computer 1 receives the touch operation of the verification button 13e, the computer 1 inputs the image selected by the verification image folder selection button 13b to the non-defective product learning model 171 selected by the AI model file selection button 13a, and corresponds to the image. output the reconstructed image. The computer 1 calculates the degree of abnormality between the selected image and the reconstructed image corresponding to the image. The computer 1 detects an anomaly based on the calculated anomaly degree and the anomaly degree threshold entered in the anomaly degree threshold entry field 13c. The computer 1 stores the detected abnormal image in the folder selected by the verification result storage folder selection button 13d, and displays it in the verification information display field 13f.

図10は、良品学習モデル171を生成する際の処理手順を示すフローチャートである。コンピュータ1の制御部11は、学習モードの選択を入力部14により受け付ける(ステップS111)。制御部11は、通信部13を介して、検査対象物を含む学習用の画像(正常画像)を撮像装置2から取得する(ステップS112)。制御部11は、入力部14を介して、検査対象物を含むテンプレート画像の選択を受け付ける(ステップS113)。 FIG. 10 is a flow chart showing a processing procedure for generating the non-defective product learning model 171. As shown in FIG. The control unit 11 of the computer 1 receives the selection of the learning mode through the input unit 14 (step S111). The control unit 11 acquires a learning image (normal image) including the inspection target from the imaging device 2 via the communication unit 13 (step S112). The control unit 11 receives selection of a template image including the inspection object via the input unit 14 (step S113).

制御部11は、取得したテンプレート画像に基づき、撮像装置2から取得された学習用の画像を切り出して所定の学習用画像フォルダに記憶する(ステップS114)。具体的には、制御部11は選択されたテンプレート画像に基づき、例えばSSDを用いて学習用の画像から検査対象物を認識する。制御部11は、検査対象物を認識した画像を学習用の画像から切り出して所定の学習用画像フォルダに記憶する。制御部11は入力部14を介して、RGB/白黒、Depth、Channel及びEpochを含む良品学習モデル171のハイパーパラメータの設定を受け付ける(ステップS115)。 Based on the acquired template image, the control unit 11 cuts out the learning image acquired from the imaging device 2 and stores it in a predetermined learning image folder (step S114). Specifically, based on the selected template image, the control unit 11 recognizes the inspection object from the learning image using, for example, an SSD. The control unit 11 cuts out an image in which the inspection object is recognized from the learning images and stores the cutouts in a predetermined learning image folder. The control unit 11 receives settings of hyperparameters of the non-defective product learning model 171 including RGB/monochrome, Depth, Channel and Epoch via the input unit 14 (step S115).

制御部11は、設定されたハイパーパラメータに基づき、画像を入力した場合に該画像に対応する再構成画像を出力する良品学習モデル171を生成する(ステップS116)。制御部11はモデルIDを割り振って、生成した良品学習モデル171のファイル、生成日時、テンプレート画像及び備考を一つのレコードとして学習モデル管理DB172に記憶し(ステップS117)、処理を終了する。 Based on the set hyperparameters, the control unit 11 generates a non-defective product learning model 171 that outputs a reconstructed image corresponding to an input image (step S116). The control unit 11 assigns a model ID, stores the file of the generated non-defective learning model 171, generation date and time, template image and remarks as one record in the learning model management DB 172 (step S117), and ends the process.

図11は、検査用の画像に基づいて検証処理を実行する際の処理手順を示すフローチャートである。コンピュータ1の制御部11は、通信部13を介して、検査対象物を含む検査用の画像を撮像装置2から取得する(ステップS121)。制御部11は、入力部14を介して、学習済みの良品学習モデル171の選択を受け付ける(ステップS122)。具体的には、制御部11は、AIモデルファイル選択ボタンのタッチ操作を受け付けた場合、学習済みの良品学習モデル171のファイルを大容量記憶部17の学習モデル管理DB172から取得する。制御部11は、取得した学習済みの良品学習モデル171を表示する。制御部11は、ユーザによる良品学習モデル171の選択を受け付ける。 FIG. 11 is a flowchart showing a processing procedure for executing verification processing based on an inspection image. The control unit 11 of the computer 1 acquires an inspection image including the inspection object from the imaging device 2 via the communication unit 13 (step S121). The control unit 11 receives selection of the learned non-defective product learning model 171 via the input unit 14 (step S122). Specifically, the control unit 11 acquires the file of the learned non-defective product learning model 171 from the learning model management DB 172 of the large-capacity storage unit 17 when the touch operation of the AI model file selection button is received. The control unit 11 displays the learned non-defective product learning model 171 that has been acquired. The control unit 11 accepts selection of the non-defective product learning model 171 by the user.

制御部11は、入力部14を介して、検査用の画像を検証するための異常度の閾値の設定を受け付ける(ステップS123)。制御部11は、選択された良品学習モデル171に対応するテンプレート画像に基づき、検査用の画像を切り出して所定の検証結果保存フォルダに記憶する(ステップS124)。制御部11は、切り出した画像を学習済みの良品学習モデル171のエンコーダに入力する(ステップS125)。制御部11は、良品学習モデル171のデコーダから該画像の再構成画像を出力させる(ステップS126)。 The control unit 11 receives, via the input unit 14, the setting of the threshold value of the degree of abnormality for verifying the inspection image (step S123). Based on the template image corresponding to the selected non-defective product learning model 171, the control unit 11 cuts out an inspection image and stores it in a predetermined verification result storage folder (step S124). The control unit 11 inputs the clipped image to the encoder of the learned non-defective product learning model 171 (step S125). The control unit 11 causes the decoder of the non-defective product learning model 171 to output the reconstructed image of the image (step S126).

制御部11は、切り出した画像と、該画像に対応する再構成画像との各ピクセルの異常度を式(6)で表される異常度式に従って算出する(ステップS127)。制御部11は、算出した各ピクセルの異常度のうち少なくとも1つが閾値(例えば、50)を超えたか否かを判定する(ステップS128)。制御部11は、各ピクセルの異常度のうち少なくとも1つが閾値を超えたと判定した場合(ステップS128でYES)、算出した各ピクセルの異常度に基づいて、検査用の画像の異常度マップ(ヒートマップ)を生成する(ステップS129)。例えば、制御部11はヒートマップライブラリを利用し、異常と判断された検査対象物のどの部位(部分)に異常点があるかの情報を色の濃さで示すヒートマップを生成する。例えば、色が濃くなればなるほど、異常度が高いことを示す。 The control unit 11 calculates the degree of abnormality of each pixel of the clipped image and the reconstructed image corresponding to the image according to the degree of abnormality formula represented by Equation (6) (step S127). The control unit 11 determines whether at least one of the calculated degrees of abnormality of each pixel exceeds a threshold value (eg, 50) (step S128). When determining that at least one of the degrees of abnormality of each pixel exceeds the threshold value (YES in step S128), the control unit 11 creates an abnormality degree map (heat map) is generated (step S129). For example, the control unit 11 uses a heat map library to generate a heat map that indicates, in terms of color density, information about which site (portion) of the inspection object determined to be abnormal has an abnormal point. For example, the darker the color, the higher the degree of abnormality.

制御部11は、良品学習モデル171の名称、異常度の閾値及び生成した画像の異常度マップを含む検証結果を表示部15により表示し(ステップS130)、処理を終了する。なお、制御部11は、異常度マップ(ヒートマップ)と、該異常度マップ上で異常点を示す色の濃さに対応する異常度の数値とを同時に表示しても良い。制御部11は、すべてのピクセルの異常度が閾値を超えないと判定した場合(ステップS128でNO)、制御部11は異常なしの検証結果を表示部15により表示し(ステップS131)、処理を終了する。 The control unit 11 causes the display unit 15 to display the verification result including the name of the non-defective product learning model 171, the threshold of the degree of abnormality, and the degree of abnormality map of the generated image (step S130), and ends the process. The control unit 11 may simultaneously display an anomaly degree map (heat map) and an anomaly degree numerical value corresponding to a color density indicating an anomaly point on the anomaly degree map. When the control unit 11 determines that the degree of abnormality of all pixels does not exceed the threshold value (NO in step S128), the control unit 11 displays the verification result of no abnormality on the display unit 15 (step S131), and executes the process. finish.

続いて、図4に戻り、運用モードで異常を検出する処理を説明する。コンピュータ1は運用モードの選択を受け付けた場合、コンピュータ1は、検査対象物を含む運用の画像を撮像装置2から取得する。コンピュータ1は、学習済みの良品学習モデル171の選択を受け付け、選択された良品学習モデル171に対応するテンプレート画像に基づき、撮像装置2から取得された運用の画像を切り出して所定の運用画像フォルダに記憶する。 Next, referring back to FIG. 4, the process of detecting an abnormality in the operational mode will be described. When the computer 1 accepts the selection of the operation mode, the computer 1 acquires an operation image including the inspection object from the imaging device 2 . The computer 1 accepts the selection of the learned non-defective product learning model 171, and based on the template image corresponding to the selected non-defective product learning model 171, cuts out the operation image acquired from the imaging device 2 and stores it in a predetermined operation image folder. Remember.

コンピュータ1は、切り出した画像を良品学習モデル171に入力し、該画像に対応する再構成画像を出力させる。コンピュータ1は、切り出した画像と該画像に対応する再構成画像との各ピクセルの異常度を算出する。なお、異常度の算出処理に関しては、上述した算出処理と同様であるため、説明を省略する。 The computer 1 inputs the clipped image to the non-defective product learning model 171 and outputs a reconstructed image corresponding to the image. The computer 1 calculates the degree of abnormality of each pixel in the clipped image and the reconstructed image corresponding to the image. In addition, since the calculation process of the degree of abnormality is the same as the calculation process described above, a description thereof will be omitted.

コンピュータ1は、算出した各ピクセルの異常度のうち少なくとも1つが閾値を超えたか否かを判定する。コンピュータ1は、算出した各ピクセルの異常度のうち少なくとも1つが閾値を超えた判定した場合、異常を検出した検出結果を出力する。なお、コンピュータ1は、算出した各ピクセルの異常度に基づいて異常度マップを生成し、生成した異常度マップと、該異常度マップ上で異常を表す色に対応付けられた異常度とを同時に出力しても良い。コンピュータ1は、すべてのピクセルの異常度が閾値を超えないと判定した場合、異常なしの検出結果を出力する。 The computer 1 determines whether at least one of the calculated degrees of abnormality of each pixel exceeds a threshold. When determining that at least one of the calculated degrees of abnormality of each pixel exceeds the threshold value, the computer 1 outputs a detection result indicating that an abnormality has been detected. In addition, the computer 1 generates an anomaly degree map based on the calculated anomaly degree of each pixel, and simultaneously displays the generated anomaly degree map and the anomaly degree associated with the color representing the anomaly on the anomaly degree map. You can output. When the computer 1 determines that the degree of abnormality of all pixels does not exceed the threshold, it outputs a detection result of no abnormality.

図12は、運用モード画面の一例を示す説明図である。運用モード画面は、AIモデルファイル選択ボタン14a、監視対象フォルダ選択ボタン14b、監視カメラ選択ボタン14c、ログファイル選択ボタン14d、運用ボタン14e及び運用情報表示欄14fを含む。 FIG. 12 is an explanatory diagram showing an example of the operation mode screen. The operation mode screen includes an AI model file selection button 14a, a monitored folder selection button 14b, a monitoring camera selection button 14c, a log file selection button 14d, an operation button 14e, and an operation information display field 14f.

AIモデルファイル選択ボタン14aは、学習済みの良品学習モデル171のファイルを選択するボタンである。監視対象フォルダ選択ボタン14bは、運用の画像を記憶したフォルダを選択するボタンである。監視カメラ選択ボタン14cは、監視用の撮像装置2を選択するボタンである。ログファイル選択ボタン14dは、検査対象物の異常を検出したログデータを記憶するためのログファイルを選択するボタンである。運用ボタン14eは、検査対象物の異常の有無を検出するボタンである。運用情報表示欄14fは、異常の有無、異常画像等の運用情報を表示する表示欄である。 The AI model file selection button 14a is a button for selecting a file of the good product learning model 171 that has been learned. The monitoring target folder selection button 14b is a button for selecting a folder in which images for operation are stored. The monitoring camera selection button 14c is a button for selecting the imaging device 2 for monitoring. The log file selection button 14d is a button for selecting a log file for storing log data in which an abnormality of an inspection object is detected. The operation button 14e is a button for detecting the presence or absence of abnormality in the inspection object. The operational information display field 14f is a display field for displaying operational information such as the presence or absence of an abnormality and an abnormal image.

コンピュータ1は、AIモデルファイル選択ボタン14aのタッチ操作を受け付けた場合、学習済みの良品学習モデル171のファイルを大容量記憶部17の学習モデル管理D
B172から取得する。例えばコンピュータ1は、取得した学習済みの良品学習モデル171(複数可)をリストボックス(図示せず)に表示する。コンピュータ1は、ユーザによる良品学習モデル171の選択を受け付ける。
When the computer 1 accepts the touch operation of the AI model file selection button 14a, the computer 1 stores the file of the non-defective product learning model 171 that has been learned in the learning model management D of the large-capacity storage unit 17.
Obtained from B172. For example, the computer 1 displays the learned non-defective product learning model 171 (a plurality of acquired models) in a list box (not shown). The computer 1 accepts selection of the non-defective product learning model 171 by the user.

コンピュータ1は、監視対象フォルダ選択ボタン14bのタッチ操作を受け付けた場合、運用の画像を記憶したフォルダの選択を受け付ける。コンピュータ1は、監視カメラ選択ボタン14cのタッチ操作を受け付けた場合、監視用の撮像装置2の選択を受け付ける。コンピュータ1は、ログファイル選択ボタン14dのタッチ操作を受け付けた場合、ログファイルの選択を受け付ける。 When the computer 1 accepts the touch operation of the monitoring target folder selection button 14b, the computer 1 accepts the selection of the folder in which the operation image is stored. When the computer 1 receives the touch operation of the monitoring camera selection button 14c, the computer 1 receives selection of the imaging device 2 for monitoring. When the computer 1 receives the touch operation of the log file selection button 14d, the computer 1 receives the selection of the log file.

コンピュータ1は、運用ボタン14eのタッチ操作を受け付けた場合、監視対象フォルダ選択ボタン14bにより選択された監視対象フォルダに記憶された運用の画像を、AIモデルファイル選択ボタン14aにより選択された良品学習モデル171に入力し、該運用の画像に対応する再構成画像を出力させる。コンピュータ1は、運用の画像と該運用画像に対応する再構成画像との異常度を算出する。 When the operation button 14e is touched, the computer 1 converts the operation image stored in the monitoring target folder selected by the monitoring target folder selection button 14b into the non-defective product learning model selected by the AI model file selection button 14a. 171 to output a reconstructed image corresponding to the operation image. The computer 1 calculates the degree of abnormality between the operational image and the reconstructed image corresponding to the operational image.

コンピュータ1は、算出した異常度に基づいて検査対象物の異常の有無を検出する。コンピュータ1は、検出した異常の有無を運用情報表示欄14fに表示する。コンピュータ1は、検査対象物の異常を検出したログデータを、ログファイル選択ボタン14dにより選択されたログファイルに出力する。 The computer 1 detects whether or not there is an abnormality in the inspection object based on the calculated degree of abnormality. The computer 1 displays the presence or absence of the detected abnormality in the operation information display column 14f. The computer 1 outputs the log data for detecting the abnormality of the inspection object to the log file selected by the log file selection button 14d.

なお、上述した異常検出処理は、予め監視対象フォルダに記憶された運用の画像に基づいて異常を検出したが、これに限るものではない。例えば、撮像装置2によりリアルタイムで撮像した動画に基づいて異常を検出しても良い。 Although the abnormality detection process described above detects an abnormality based on an operation image stored in advance in a monitoring target folder, the invention is not limited to this. For example, an abnormality may be detected based on a moving image captured in real time by the imaging device 2 .

具体的には、コンピュータ1は、監視カメラ選択ボタン14cにより選択された撮像装置2から、検査対象物を含む動画をリアルタイムで取得する。コンピュータ1は、AIモデルファイル選択ボタン14aにより選択された良品学習モデル171に対応するテンプレート画像に基づき、例えばCNNを用いた物体検出アルゴリズムを利用し、選択された動画中に含まれた検査対象物を認識する。 Specifically, the computer 1 obtains in real time a moving image including the inspection object from the imaging device 2 selected by the surveillance camera selection button 14c. The computer 1 uses, for example, an object detection algorithm using CNN based on the template image corresponding to the non-defective product learning model 171 selected by the AI model file selection button 14a, and the inspection object included in the selected moving image to recognize

コンピュータ1は、検査対象物を認識した複数の画像を動画から切り出して記憶部12または所定の画像フォルダに記憶する。コンピュータ1は、切り出した画像を良品学習モデル171に入力し、該画像に対応する再構成画像を出力させる。コンピュータ1は、切り出した画像と、該画像に対応する再構成画像との異常度に基づいて異常を検出する。その後、異常の表示及びログデータの出力処理に関しては、上述した処理と同様であるため、説明を省略する。 The computer 1 cuts out a plurality of images in which the inspection object is recognized from the moving image and stores them in the storage unit 12 or a predetermined image folder. The computer 1 inputs the clipped image to the non-defective product learning model 171 and outputs a reconstructed image corresponding to the image. The computer 1 detects an abnormality based on the degree of abnormality between the clipped image and the reconstructed image corresponding to the image. After that, the process of displaying the abnormality and outputting the log data is the same as the process described above, so the description thereof will be omitted.

図13は、運用モードで異常を検出する際の処理手順を示すフローチャートである。コンピュータ1の制御部11は、運用モードの選択を入力部14により受け付ける(ステップS141)。制御部11は、入力部14を介して、学習済みの良品学習モデル171の選択を受け付ける(ステップS142)。制御部11は、監視用の撮像装置2の選択を入力部14により受け付ける(ステップS143)。制御部11は、通信部13を介して、検査対象物を含む運用の画像を選択された撮像装置2から取得する(ステップS144)。 FIG. 13 is a flow chart showing a processing procedure when detecting an abnormality in the operation mode. The control unit 11 of the computer 1 receives the selection of the operation mode through the input unit 14 (step S141). The control unit 11 receives selection of the learned non-defective product learning model 171 via the input unit 14 (step S142). The control unit 11 receives the selection of the imaging device 2 for monitoring through the input unit 14 (step S143). The control unit 11 acquires the operation image including the inspection object from the selected imaging device 2 via the communication unit 13 (step S144).

制御部11は、選択された良品学習モデル171に対応するテンプレート画像に基づき、運用の画像を切り出して所定の運用画像保存フォルダに記憶する(ステップS145)。制御部11は、切り出した画像を学習済みの良品学習モデル171のエンコーダに入力する(ステップS146)。制御部11は、良品学習モデル171のデコーダから該画像に対応する再構成画像を出力させる(ステップS147)。 Based on the template image corresponding to the selected non-defective product learning model 171, the control unit 11 cuts out an operational image and stores it in a predetermined operational image storage folder (step S145). The control unit 11 inputs the clipped image to the encoder of the learned non-defective product learning model 171 (step S146). The control unit 11 causes the decoder of the non-defective product learning model 171 to output a reconstructed image corresponding to the image (step S147).

制御部11は、切り出した画像と該画像に対応する再構成画像との各ピクセルの異常度を式(6)で表される異常度式に従って算出する(ステップS148)。制御部11は、算出した各ピクセルの異常度のうち少なくとも1つが閾値(例えば、50)を超えたか否かを判定する(ステップS149)。 The control unit 11 calculates the degree of abnormality of each pixel in the clipped image and the reconstructed image corresponding to the image according to the degree of abnormality formula represented by Equation (6) (step S148). The control unit 11 determines whether at least one of the calculated degrees of abnormality of each pixel exceeds a threshold value (eg, 50) (step S149).

制御部11は、算出した各ピクセルの異常度のうち少なくとも1つが閾値を超えたと判定した場合(ステップS149でYES)、制御部11は、良品学習モデル171の名称、異常度の閾値及び異常画像を含む検出結果を表示部15により表示する(ステップS150)。制御部11は、検査対象物の異常を検出したログデータをログファイルに記憶(出力)し(ステップS151)、処理を終了する。制御部11は、すべてのピクセルの異常度が閾値を超えないと判定した場合(ステップS149でNO)、制御部11は異常なしの検出結果を表示部15により表示し(ステップS152)、処理を終了する。 When the control unit 11 determines that at least one of the calculated degrees of abnormality of each pixel exceeds the threshold (YES in step S149), the control unit 11 obtains the name of the non-defective product learning model 171, the threshold of the degree of abnormality, and the abnormal image. is displayed on the display unit 15 (step S150). The control unit 11 stores (outputs) the log data indicating the detection of the abnormality of the inspection object in the log file (step S151), and terminates the process. When the control unit 11 determines that the degree of abnormality of all pixels does not exceed the threshold value (NO in step S149), the control unit 11 displays the detection result of no abnormality on the display unit 15 (step S152), and executes the process. finish.

本実施形態によると、検査対象物を含む画像に基づいて教師なし学習により生成した良品学習モデル171から、該画像に対応する再構成画像を出力することが可能となる。 According to this embodiment, it is possible to output a reconstructed image corresponding to an image including an inspection object from the non-defective product learning model 171 generated by unsupervised learning based on the image.

本実施形態によると、検査対象物を含む画像と、良品学習モデル171が出力した該画像の再構成画像との異常度に基づいて異常の有無を検出することが可能となる。 According to this embodiment, it is possible to detect the presence or absence of an abnormality based on the degree of abnormality between an image including an inspection target and a reconstructed image of the image output by the non-defective product learning model 171 .

本実施形態によると、少量の良品画像のみで学習が可能であるため、不良品の定義が不明確な場合に異常の有無を検出することが可能となる。 According to this embodiment, since learning is possible using only a small number of non-defective product images, it is possible to detect the presence or absence of an abnormality when the definition of a defective product is unclear.

本実施形態によると、学習モードと運用モードとを提供することにより、学習及び運用が容易となる。 According to this embodiment, learning and operation are facilitated by providing a learning mode and an operation mode.

(実施形態2)
実施形態2は、検査対象物を含む画像を複数の小片画像に分割し、分割した複数の小片画像に基づいて検査対象物の異常を検出する形態に関する。なお、実施形態1と重複する内容については説明を省略する。
(Embodiment 2)
Embodiment 2 relates to an embodiment in which an image including an inspection object is divided into a plurality of small piece images, and an abnormality of the inspection object is detected based on the plurality of divided small piece images. In addition, description is abbreviate|omitted about the content which overlaps with Embodiment 1. FIG.

コンピュータ1は、検査対象物を含む画像を相互にオーバーラップする複数の小片画像(例えば、10×10ピクセル)に分割する。具体的には、コンピュータ1は、画像内で小片画像同士が一部重複するようにスライドさせながら小片画像を複数抽出する。例えば画像の中に所定座標(例えば、10,10)を小片画像の中心点とし、コンピュータ1は該小片画像を所定サイズ(例えば、10×10)で切り出す(トリミング)。コンピュータ1は、該中心点を横に所定のピクセル単位(例えば、20ピクセル)でスライドして第2中心点を取得する。コンピュータ1は、取得した第2中心点に基づき、上述した処理で切り出した小片画像と一部重複するよう小片画像を同様のサイズで切り出す。コンピュータ1は、横方向に沿って複数の小片画像を抽出した後に、最初の中心点に戻る。コンピュータ1は、該中心点を縦に同じのピクセル単位でスライドして次の中心点を取得する。コンピュータ1は取得した中心点に基づき、上述した処理と同様に横方向に沿って、小片画像同士が一部重複するよう小片画像を同様のサイズで切り出す。このようにして、画像を相互にオーバーラップする複数の小片画像に分割することができる。 The computer 1 divides the image containing the inspection object into a plurality of mutually overlapping strip images (eg 10×10 pixels). Specifically, the computer 1 extracts a plurality of small piece images while sliding the small piece images so that they partially overlap each other in the image. For example, a predetermined coordinate (eg, 10, 10) in the image is set as the center point of the small piece image, and the computer 1 cuts out (trimming) the small piece image to a predetermined size (eg, 10×10). The computer 1 horizontally slides the center point by a predetermined pixel unit (for example, 20 pixels) to obtain a second center point. Based on the obtained second center point, the computer 1 cuts out a small piece image of the same size as the small piece image cut out in the above-described process so that it partially overlaps with the small piece image. The computer 1 returns to the initial center point after extracting a plurality of strip images along the lateral direction. The computer 1 slides the center point vertically by the same pixel unit to obtain the next center point. Based on the acquired center point, the computer 1 cuts out the small piece images in the same size along the horizontal direction so that the small piece images partially overlap each other in the same manner as in the processing described above. In this way, the image can be divided into multiple strip images that overlap each other.

コンピュータ1は、実施形態1で生成した学習済みの良品学習モデル171に、分割した複数の小片画像を良品学習モデル171のエンコーダに入力し、良品学習モデル171のデコーダからそれぞれの小片画像に対応する再構成画像を出力させる。コンピュータ1は、分割した複数の小片画像と、それぞれの小片画像に対応する再構成画像との各ピクセルの異常度を、小片画像ごとに実施形態1での式(6)で表される異常度式に従って算出する。 The computer 1 inputs a plurality of divided small piece images to the non-defective product learning model 171 that has been trained in the first embodiment, to the encoder of the non-defective product learning model 171, and the decoder of the non-defective product learning model 171 corresponds to each small piece image Output the reconstructed image. The computer 1 calculates the degree of anomaly of each pixel of a plurality of divided small-piece images and the reconstructed image corresponding to each small-piece image as the degree of anomaly represented by the equation (6) in the first embodiment for each small-piece image. Calculate according to the formula.

コンピュータ1は、各ピクセルの異常度を足し込み、異常度が足し込まれた回数を集計する。コンピュータ1は、画像全体で集計した回数で除し、ピクセルごとに平均異常度を算出する。その後、コンピュータ1は、算出した平均異常度と所定の異常度の閾値とを比較し、実施形態1と同様処理で検査対象物の異常の有無を検出する。 The computer 1 adds the degree of abnormality of each pixel, and totals the number of times the degree of abnormality is added. The computer 1 calculates the average degree of abnormality for each pixel by dividing by the total number of times for the entire image. After that, the computer 1 compares the calculated average degree of abnormality with a predetermined threshold value of the degree of abnormality, and detects the presence or absence of an abnormality in the object to be inspected in the same manner as in the first embodiment.

図14は、小片画像に基づいて異常を検出する際の処理手順を示すフローチャートである。コンピュータ1の制御部11は、検査対象物を含む画像を通信部13により撮像装置2から取得する(ステップS161)。制御部11は、取得した画像を相互にオーバーラップする複数の小片画像(例えば、10×10ピクセル)に分割する(ステップS162)。 FIG. 14 is a flow chart showing a processing procedure for detecting an abnormality based on a small piece image. The control unit 11 of the computer 1 acquires an image including the inspection object from the imaging device 2 through the communication unit 13 (step S161). The control unit 11 divides the obtained image into a plurality of mutually overlapping small piece images (for example, 10×10 pixels) (step S162).

コンピュータ1は、実施形態1で生成した学習済みの良品学習モデル171に、分割した複数の小片画像を良品学習モデル171のエンコーダに入力し(ステップS163)、良品学習モデル171のデコーダからそれぞれの小片画像に対応する再構成画像を出力させる(ステップS164)。制御部11は、分割した複数の小片画像と、それぞれの小片画像に対応する再構成画像との各ピクセルの異常度を、小片画像ごとに実施形態1での式(6)で表される異常度式に従って算出する(ステップS165)。 The computer 1 inputs a plurality of divided small piece images to the encoder of the non-defective product learning model 171 (step S163), and outputs each small piece from the decoder of the non-defective product learning model 171. A reconstructed image corresponding to the image is output (step S164). The control unit 11 calculates the degree of abnormality of each pixel of the divided plural small piece images and the reconstructed image corresponding to each of the small piece images, for each small piece image, using the abnormality expressed by the equation (6) in the first embodiment. It is calculated according to the degree formula (step S165).

制御部11は、ピクセルごとに平均異常度を算出する(ステップS166)。具体的には、制御部11は各ピクセルの異常度を足し込み、異常度が足し込まれた回数を集計する。制御部11は画像全体で集計した回数で除し、ピクセルごとに平均異常度を算出する。制御部11は、算出した各ピクセルの平均異常度のうち少なくとも1つが異常度の閾値を超えたか否かを判定する(ステップS167)。 The control unit 11 calculates the average degree of abnormality for each pixel (step S166). Specifically, the control unit 11 adds the degree of abnormality of each pixel, and counts the number of times the degree of abnormality is added. The control unit 11 calculates the average degree of abnormality for each pixel by dividing by the total number of times for the entire image. The control unit 11 determines whether or not at least one of the calculated average degrees of abnormality of each pixel exceeds the threshold of the degree of abnormality (step S167).

制御部11は、各ピクセルの平均異常度のうち少なくとも1つが閾値を超えたと判定した場合(ステップS167でYES)、制御部11は、異常画像を含む検出結果を表示部15により表示し(ステップS168)、処理を終了する。制御部11は、すべてのピクセルの平均異常度が閾値を超えないと判定した場合(ステップS167でNO)、制御部11は異常なしの検出結果を表示部15により表示し(ステップS169)、処理を終了する。 When the control unit 11 determines that at least one of the average degrees of abnormality of each pixel exceeds the threshold value (YES in step S167), the control unit 11 causes the display unit 15 to display the detection result including the abnormal image (step S168), the process ends. When the control unit 11 determines that the average degree of abnormality of all pixels does not exceed the threshold value (NO in step S167), the control unit 11 displays the detection result of no abnormality on the display unit 15 (step S169), and performs processing. exit.

なお、上述した異常検出処理に限るものではない。コンピュータ1は、分割した複数の小片画像を良品学習モデル171のエンコーダに入力し、良品学習モデル171のデコーダからそれぞれの小片画像に対応する再構成画像を出力させる。コンピュータ1は、出力させた複数の再構成画像を結合して結合画像を生成する。なお、コンピュータ1は結合画像の生成処理を行った場合、小片画像の重なり部分の明度を、平均値を用いて算出しても良い。コンピュータ1は、生成した結合画像と分割元の画像との各ピクセルの異常度を実施形態1の式(6)で表される異常度式に従って算出する。その後、実施形態1と同様に、コンピュータ1は、算出した各ピクセルの異常度に基づいて検査対象物の異常を検出する。 In addition, it is not limited to the abnormality detection process described above. The computer 1 inputs the divided plural small piece images to the encoder of the non-defective product learning model 171, and causes the decoder of the non-defective product learning model 171 to output a reconstructed image corresponding to each small piece image. The computer 1 combines the output reconstructed images to generate a combined image. Note that, when the computer 1 performs the process of generating the combined image, the brightness of the overlapping portion of the small piece images may be calculated using an average value. The computer 1 calculates the degree of abnormality of each pixel of the generated combined image and the original image of division according to the degree of abnormality formula represented by the formula (6) of the first embodiment. After that, as in the first embodiment, the computer 1 detects an abnormality in the inspection object based on the calculated degree of abnormality of each pixel.

本実施形態によると、検査対象物を含む画像を小片画像に分割することで計算収束性が良くなるため、複数の小片画像の再構成化の並列計算処理時間を短縮することが可能となる。 According to this embodiment, by dividing an image including an inspection object into small piece images, calculation convergence is improved, so that it is possible to shorten the parallel calculation processing time for reconstructing a plurality of small piece images.

<実施形態2の変形例1>
実施形態2の変形例1は、異なる小片画像のサイズごとに、検査対象物を含む画像を複数の小片画像に分割し、分割した複数の小片画像に基づいて検査対象物の異常を検出する形態に関する。なお、既に説明した事項については重複する説明を省略する。
<Modification 1 of Embodiment 2>
Modification 1 of Embodiment 2 divides an image including an inspection object into a plurality of small piece images for each of different small piece image sizes, and detects an abnormality of the inspection object based on the plurality of divided small piece images. Regarding. It should be noted that duplicate descriptions of the items that have already been described will be omitted.

検査対象物の異常(欠陥)のサイズに応じて、小片画像のサイズを決める場合がある。異常のサイズに応じて画像を複数の小片画像に分割することにより、異常を検出することが容易になる。例えば検査対象物の画像に対し、予め10×10ピクセル、15×15ピクセル、20×20ピクセルである小片画像のサイズが決められても良い。 The size of the small piece image may be determined according to the size of the abnormality (defect) of the inspection object. Anomaly detection is facilitated by dividing the image into multiple slice images according to the size of the anomaly. For example, for the image of the object to be inspected, the sizes of the piece images, which are 10×10 pixels, 15×15 pixels, and 20×20 pixels, may be determined in advance.

図15は、小片画像サイズごとに良品学習モデル171を生成する際の処理手順を示すフローチャートである。なお、図10と重複する内容については同一の符号を付して説明を省略する。コンピュータ1の制御部11は、ステップS21~25(図10のステップS111~S115)処理を実行する。制御部11は、小片画像のサイズを複数特定する(ステップS26)。例えば、制御部11は入力部14を介して、ユーザによる小片画像のサイズの入力を受け付けることにより、小片画像のサイズを複数特定する。 FIG. 15 is a flow chart showing a processing procedure for generating the non-defective item learning model 171 for each small piece image size. In addition, the same code|symbol is attached|subjected about the content which overlaps with FIG. 10, and description is abbreviate|omitted. The control unit 11 of the computer 1 executes steps S21 to 25 (steps S111 to S115 in FIG. 10). The control unit 11 identifies a plurality of sizes of small piece images (step S26). For example, the control unit 11 identifies a plurality of sizes of small piece images by receiving input of sizes of small piece images by the user via the input unit 14 .

制御部11は、特定した小片画像の複数のサイズ中から、1つの小片画像のサイズを取得する(ステップS27)。制御部11は、取得した小片画像のサイズで、検査対象物を含む画像を相互にオーバーラップする複数の小片画像に分割する(ステップS28)。制御部11は、分割した小片画像に基づき、教師なし学習により良品学習モデル171を生成する(ステップS29)。なお、良品学習モデル171の生成処理に関しては、実施形態1と同様であるため、説明を省略する。制御部11は、生成した良品学習モデル171を大容量記憶部17の学習モデル管理DB172に記憶する(ステップS30)。 The control unit 11 acquires the size of one small piece image from among the plurality of sizes of the identified small piece images (step S27). The control unit 11 divides the image including the inspection object into a plurality of mutually overlapping small piece images according to the acquired small piece image size (step S28). The control unit 11 generates a non-defective product learning model 171 by unsupervised learning based on the divided small piece images (step S29). Note that the process of generating the non-defective product learning model 171 is the same as that of the first embodiment, so the description is omitted. The control unit 11 stores the generated non-defective product learning model 171 in the learning model management DB 172 of the large-capacity storage unit 17 (step S30).

制御部11は、特定した小片画像の複数のサイズ中に、該小片画像のサイズが最後のサイズであるか否かを判定する(ステップS31)。制御部11は、該小片画像のサイズが最後のサイズでないと判定した場合(ステップS31でNO)、制御部11はステップS27処理に戻る。制御部11は、該小片画像のサイズが最後のサイズであると判定した場合(ステップS31でYES)、制御部11は処理を終了する。 The control unit 11 determines whether or not the size of the small piece image is the last size among the plurality of sizes of the identified small piece images (step S31). When the control unit 11 determines that the size of the small piece image is not the last size (NO in step S31), the control unit 11 returns to step S27. When the control unit 11 determines that the size of the small piece image is the last size (YES in step S31), the control unit 11 ends the process.

続いて、運用モードで上記処理により生成した学習済みの良品学習モデル171を用いる例を説明する。コンピュータ1の制御部11は、検査対象物を含む運用の画像を撮像装置2から取得する。制御部11は、小片画像のサイズの入力を入力部14により受け付ける。制御部11は、受け付けた小片画像のサイズで、取得した運用の画像を相互にオーバーラップする複数の小片画像に分割する。制御部11は、分割した複数の小片画像を、該小片画像のサイズに対応する良品学習モデル171のエンコーダに入力し、該良品学習モデル171のデコーダからそれぞれの小片画像の再構成画像を出力させる。その後の異常検出処理に関しては、実施形態2と同様であるため、説明を省略する。 Next, an example using the learned non-defective product learning model 171 generated by the above processing in the operation mode will be described. The control unit 11 of the computer 1 acquires an operation image including the inspection object from the imaging device 2 . The control unit 11 receives an input of the size of the small piece image through the input unit 14 . The control unit 11 divides the acquired operational image into a plurality of mutually overlapping small piece images according to the size of the small piece image received. The control unit 11 inputs the plurality of divided small piece images to the encoder of the good product learning model 171 corresponding to the size of the small piece image, and causes the decoder of the good product learning model 171 to output the reconstructed image of each small piece image. . Since the subsequent abnormality detection processing is the same as that of the second embodiment, description thereof is omitted.

本変形例1によると、異なる小片画像のサイズごとに良品学習モデル171で学習させることにより、異常検出の精度を高めることが可能となる。 According to Modification 1, it is possible to improve the accuracy of abnormality detection by having the non-defective product learning model 171 learn for each different size of the small piece image.

(実施形態3)
実施形態3は、収集された異常画像に基づいて第2学習モデルを生成し、生成した第2学習モデルを用いて検査対象物の異常を検出する形態に関する。なお、実施形態1~2と重複する内容については説明を省略する。
(Embodiment 3)
The third embodiment relates to a form of generating a second learning model based on collected abnormal images and detecting an abnormality of an inspection object using the generated second learning model. Note that the description of the contents overlapping those of the first and second embodiments will be omitted.

図16は、実施形態3のコンピュータ1の構成例を示すブロック図である。なお、図2と重複する内容については同一の符号を付して説明を省略する。大容量記憶部17には、異常検出モデル173(第2学習モデル)が記憶されている。異常検出モデル173は、検査対象物を含む画像に基づいて異常の有無を検出する検出器であり、機械学習により生成された学習済みモデルである。 FIG. 16 is a block diagram showing a configuration example of the computer 1 of the third embodiment. In addition, the same code|symbol is attached|subjected about the content which overlaps with FIG. 2, and description is abbreviate|omitted. An abnormality detection model 173 (second learning model) is stored in the large-capacity storage unit 17 . The anomaly detection model 173 is a detector that detects the presence or absence of an anomaly based on an image including an inspection object, and is a trained model generated by machine learning.

教師なし異常検出での実運用で、正常または異常を誤判定した画像が存在している。例えば、画像を異常画像として判定したが、実際に該画像が正常画像である場合がある。また、例えば画像を正常画像として判定したが、実際に該画像が異常画像である場合がある。これらの誤判定画像の特徴量に対して学習することにより、異常検出モデル173を構築することができる。コンピュータ1は、異常検出モデル173を用いて、検査対象物を含む画像を入力した場合に該画像に対応する異常情報を出力する。 In the actual operation of unsupervised anomaly detection, some images are misjudged as normal or abnormal. For example, an image may be determined to be an abnormal image, but the image is actually a normal image. Also, for example, an image may be determined to be a normal image, but the image may actually be an abnormal image. The abnormality detection model 173 can be constructed by learning the feature amounts of these erroneously determined images. Using the anomaly detection model 173, the computer 1 outputs anomaly information corresponding to the image when an image including an inspection object is input.

図17は、異常検出モデル173を用いて異常の有無を検出した検出結果を出力する説明図である。異常検出モデル173は、ディープラーニングにより構築され、人工知能ソフトウェアの一部であるプログラムモジュールとして利用される。異常検出モデル173は、検査対象物を含む画像を入力とし、検査対象物に対する異常の有無を検出した検出結果を出力とするニューラルネットワークを構築(生成)済みの検出器である。 FIG. 17 is an explanatory diagram for outputting the detection result of detecting the presence or absence of an abnormality using the abnormality detection model 173. In FIG. The anomaly detection model 173 is constructed by deep learning and used as a program module that is part of artificial intelligence software. The abnormality detection model 173 is a detector that has already constructed (generated) a neural network that receives an image including an inspection object as an input and outputs a detection result of detecting the presence or absence of an abnormality in the inspection object.

コンピュータ1は、異常検出モデル173として、画像内における検査対象物の特徴量を学習するディープラーニングを行うことで異常検出モデル173を構築(生成)する。例えば、異常検出モデル173はCNN(Convolution Neural Network)であり、検査対象物を含む画像の入力を受け付ける入力層と、異常の有無を検出した検出結果を出力する出力層と、バックプロパゲーションにより学習済の中間層とを有する。 The computer 1 constructs (generates) the abnormality detection model 173 by performing deep learning for learning the feature amount of the inspection object in the image. For example, the anomaly detection model 173 is a CNN (Convolution Neural Network), and is learned by an input layer that receives an input of an image including an inspection object, an output layer that outputs the detection result of detecting the presence or absence of an anomaly, and back propagation. and a pre-filled intermediate layer.

入力層は、画像に含まれる各画素の画素値の入力を受け付ける複数のニューロンを有し、入力された画素値を中間層に受け渡す。中間層は、画像特徴量を抽出する複数のニューロンを有し、抽出した画像特徴量を出力層に受け渡す。中間層は、入力層から入力された各画素の画素値を畳み込むコンボリューション層と、コンボリューション層で畳み込んだ画素値をマッピングするプーリング層とが交互に連結された構成により、画像の画素情報を圧縮しながら最終的に画像の特徴量を抽出する。その後中間層は、バックプロパゲーションによりパラメータが学習された全結合層により、画像が検査対象物に対する異常の有無を予測する。予測結果は、複数のニューロンを有する出力層に出力される。 The input layer has a plurality of neurons that receive pixel values of pixels included in the image, and passes the input pixel values to the intermediate layer. The intermediate layer has a plurality of neurons for extracting image features, and passes the extracted image features to the output layer. In the intermediate layer, a convolution layer that convolves the pixel value of each pixel input from the input layer and a pooling layer that maps the pixel value convolved in the convolution layer are alternately connected to obtain pixel information of the image. is compressed, and finally the feature quantity of the image is extracted. Then, the hidden layer predicts whether or not the image has anomalies with respect to the inspected object by means of a fully connected layer whose parameters have been learned by back propagation. The prediction results are output to an output layer having multiple neurons.

なお、検査対象物を含む画像は、交互に連結されたコンボリューション層とプーリング層とを通過して特徴量が抽出された後に、入力層に入力されても良い。なお、CNNの代わりに、RCNN、Fast RCNN、Faster RCNN、SSDまたはYOLO(You Only Look Once)等の、任意の物体検出アルゴリズムを使用しても良い。 The image including the inspection object may be input to the input layer after passing through alternately connected convolution layers and pooling layers to extract feature amounts. Any object detection algorithm such as RCNN, Fast RCNN, Faster RCNN, SSD or YOLO (You Only Look Once) may be used instead of CNN.

コンピュータ1は、検査対象物を含む画像(例えば、正常画像、異常画像)と、各画像における異常の有無とが対応付けられた訓練データ(教師データ)の組み合わせを用いて学習を行う。訓練データは、検査対象物を含む画像に対し、異常の有無がラベル付けされたデータである。なお、訓練データの生成処理に関しては後述する。 The computer 1 performs learning using a combination of images including inspection objects (for example, normal images and abnormal images) and training data (teacher data) in which the presence or absence of abnormality in each image is associated. The training data is data in which the presence or absence of abnormality is labeled with respect to the image including the inspection object. Note that the process of generating training data will be described later.

コンピュータ1は、訓練データである画像を入力層に入力し、中間層での演算処理を経て、出力層から異常の有無を示す検出結果を取得する。なお、出力層から出力される検出結果は異常の有無を離散的に示す値(例えば「0」又は「1」の値)であっても良く、連続的な確率値(例えば「0」から「1」までの範囲の値)であっても良い。 The computer 1 inputs an image, which is training data, to the input layer, performs arithmetic processing in the intermediate layer, and acquires a detection result indicating the presence or absence of an abnormality from the output layer. The detection result output from the output layer may be a value discretely indicating the presence or absence of an abnormality (for example, a value of "0" or "1"), or a continuous probability value (for example, from "0" to " value in the range up to 1”).

制御部11は、出力層から出力された検出結果を、訓練データにおいて画像に対しラベル付けされた情報、すなわち正解値と比較し、出力層からの出力値が正解値に近づくように、中間層での演算処理に用いるパラメータを最適化する。当該パラメータは、例えばニューロン間の重み(結合係数)、各ニューロンで用いられる活性化関数の係数等である。パラメータの最適化の方法は特に限定されないが、例えばコンピュータ1は、誤差逆伝播法を用いて各種パラメータの最適化を行う。 The control unit 11 compares the detection result output from the output layer with the information labeled for the image in the training data, that is, the correct value, and controls the intermediate layer so that the output value from the output layer approaches the correct value. Optimize the parameters used in the calculation process. The parameters are, for example, weights (coupling coefficients) between neurons, coefficients of activation functions used in each neuron, and the like. Although the parameter optimization method is not particularly limited, for example, the computer 1 optimizes various parameters using the error backpropagation method.

コンピュータ1は、訓練データに含まれる各画像について上記の処理を行い、異常検出モデル173を生成する。これにより、例えばコンピュータ1は当該訓練データを用いて異常検出モデル173の学習を行うことで、検査対象物に対する異常の有無を検出可能なモデルを構築することができる。 The computer 1 performs the above processing on each image included in the training data to generate an anomaly detection model 173 . As a result, for example, the computer 1 learns the abnormality detection model 173 using the training data, thereby constructing a model capable of detecting the presence or absence of an abnormality in the inspection object.

コンピュータ1は検査対象物を含む画像を取得した場合、取得した画像を異常検出モデル173に入力する。コンピュータ1は、異常検出モデル173の中間層にて画像の特徴量を抽出する演算処理を行い、抽出した特徴量を異常検出モデル173の出力層に入力して、検査対象物に対する異常の有無を示す検出結果を出力として取得する。 When the computer 1 acquires an image including an inspection target, the computer 1 inputs the acquired image to the abnormality detection model 173 . The computer 1 performs arithmetic processing for extracting the feature amount of the image in the intermediate layer of the abnormality detection model 173, inputs the extracted feature amount to the output layer of the abnormality detection model 173, and determines the presence or absence of an abnormality in the inspection object. Get the detection result shown as an output.

コンピュータ1は、異常検出モデル173の出力層から出力した検出結果に基づき、検査対象物に対する異常の有無を判断する。例えば、異常の確率値(例えば、0.95)が所定閾値(例えば、0.85)以上である場合、コンピュータ1は異常を検出したと判断しても良い。 The computer 1 determines whether or not there is an abnormality in the inspection object based on the detection results output from the output layer of the abnormality detection model 173 . For example, the computer 1 may determine that an abnormality is detected when the probability value of abnormality (eg, 0.95) is equal to or greater than a predetermined threshold value (eg, 0.85).

図18は、誤判定画像の収集画面の一例を示す説明図である。図18Aは、誤判定の異常画像の収集画面の一例を示す説明図である。誤判定の異常画像の収集画面は、画像表示欄15a、OKボタン15b及びNGボタン15cを含む。画像表示欄15aは、実施形態1~2でのAIにより判定された異常画像を表示する表示欄である。OKボタン15bは、AIにより判定された異常画像に対し、正しく異常と判断された判断結果をユーザ(オペレーター)から受け付けるボタンである。NGボタン15cは、AIにより判定された異常画像に対し、誤って異常と判断された判断結果をユーザから受け付けるボタンである。 FIG. 18 is an explanatory diagram showing an example of a screen for collecting incorrectly determined images. FIG. 18A is an explanatory diagram showing an example of a screen for collecting abnormal images of erroneous determinations. The collection screen of erroneously determined abnormal images includes an image display field 15a, an OK button 15b, and an NG button 15c. The image display column 15a is a display column for displaying an abnormal image determined by AI in the first and second embodiments. The OK button 15b is a button for accepting from the user (operator) the determination result that the abnormal image determined by AI is correctly determined to be abnormal. The NG button 15c is a button for accepting from the user a determination result that an abnormal image determined by AI is erroneously determined to be abnormal.

図18Bは、誤判定の正常画像の収集画面の一例を示す説明図である。画像表示欄15aは、実施形態1~2でのAIにより判定された正常画像を表示する表示欄である。OKボタン15bは、AIにより判定された正常画像に対し、正しく正常と判断された判断結果をユーザから受け付けるボタンである。NGボタン15cは、AIにより判定された正常画像に対し、誤って正常と判断された判断結果をユーザから受け付けるボタンである。 FIG. 18B is an explanatory diagram illustrating an example of a collection screen of erroneously determined normal images. The image display column 15a is a display column for displaying normal images determined by AI in the first and second embodiments. The OK button 15b is a button for accepting from the user the determination result that the normal image determined by AI is correctly determined to be normal. The NG button 15c is a button for accepting from the user a determination result that an AI-determined normal image is erroneously determined to be normal.

なお、OKボタン15b及びNGボタン15cのタッチ操作に応じる処理に関しては、図19で説明する。 Note that processing in response to touch operations on the OK button 15b and the NG button 15c will be described with reference to FIG.

図19は、異常検出モデル173の生成処理の処理手順の一例を示すフローチャートである。図19に基づき、機械学習によって異常検出モデル173を生成する処理の処理内容について説明する。 FIG. 19 is a flow chart showing an example of the processing procedure for generating the anomaly detection model 173 . Based on FIG. 19, the processing contents of the processing for generating the abnormality detection model 173 by machine learning will be described.

コンピュータ1の制御部11は、複数の異常画像を通信部13により撮像装置2または外部装置から取得する(ステップS181)。なお、異常画像が予め大容量記憶部17に記憶されても良い。制御部11は、複数の異常画像から一つの異常画像を取得し、取得した該異常画像に対し、ユーザによるNGボタン15cのタッチ操作(図18)を受け付けたか否かを判定する(ステップS182)。 The control unit 11 of the computer 1 acquires a plurality of abnormal images from the imaging device 2 or an external device through the communication unit 13 (step S181). Incidentally, the abnormal image may be stored in the large-capacity storage unit 17 in advance. The control unit 11 acquires one abnormal image from a plurality of abnormal images, and determines whether or not the user's touch operation of the NG button 15c (FIG. 18) has been accepted for the acquired abnormal image (step S182). .

制御部11は、NGボタン15cのタッチ操作を受け付けたと判定した場合(ステップS182でYES)、誤って異常と判断され、該異常画像に対して正常であることを示すデータを付与した第1訓練データを生成する(ステップS184)。制御部11は、後述するステップS186処理に遷移する。制御部11は、NGボタン15cのタッチ操作を受け付けていないと判定した場合(ステップS182でNO)、OKボタン15bのタッチ操作(図18)を受け付けたか否かを判定する(ステップS183)。 When the control unit 11 determines that the touch operation of the NG button 15c has been accepted (YES in step S182), it is erroneously determined to be abnormal, and the first training is performed in which data indicating normality is added to the abnormal image. Data is generated (step S184). The control unit 11 transitions to step S186, which will be described later. When determining that the touch operation of the NG button 15c has not been accepted (NO in step S182), the control unit 11 determines whether or not the touch operation of the OK button 15b (FIG. 18) has been accepted (step S183).

制御部11は、OKボタン15bのタッチ操作を受け付けたと判定した場合(ステップS183でYES)、正しく異常と判断され、該異常画像に対して異常であることを示すデータを付与した第3訓練データを生成する(ステップS185)。制御部11は、OKボタン15bのタッチ操作を受け付けていないと判定した場合(ステップS183でNO)、制御部11はステップS182処理に戻る。 When the control unit 11 determines that the touch operation of the OK button 15b has been accepted (YES in step S183), the control unit 11 correctly determines that there is an abnormality, and the third training data obtained by adding data indicating an abnormality to the abnormal image. is generated (step S185). When the control unit 11 determines that the touch operation of the OK button 15b has not been received (NO in step S183), the control unit 11 returns to the process of step S182.

制御部11は、該異常画像が複数の異常画像中の最後の異常画像であるか否かを判定する(ステップS186)。制御部11は、該異常画像が最後の異常画像でないと判定した場合(ステップS186でNO)、制御部11はステップS182処理に戻る。制御部11は、該異常画像が最後の異常画像であると判定した場合(ステップS186でYES)、複数の正常画像を通信部13により撮像装置2または外部装置から取得する(ステップS187)。 The control unit 11 determines whether or not the abnormal image is the last abnormal image among the plurality of abnormal images (step S186). When the control unit 11 determines that the abnormal image is not the last abnormal image (NO in step S186), the control unit 11 returns to the process of step S182. When the control unit 11 determines that the abnormal image is the last abnormal image (YES in step S186), the communication unit 13 acquires a plurality of normal images from the imaging device 2 or an external device (step S187).

制御部11は、複数の正常画像から一つの正常画像を取得し、取得した該正常画像に対し、ユーザによるNGボタン15cのタッチ操作を受け付けたか否かを判定する(ステップS188)。制御部11は、NGボタン15cのタッチ操作を受け付けたと判定した場合(ステップS188でYES)、誤って正常と判断され、該正常画像に対して異常であることを示すデータを付与した第2訓練データを生成する(ステップS190)。制御部11は、後述するステップS192処理に遷移する。 The control unit 11 obtains one normal image from a plurality of normal images, and determines whether or not the user has touched the NG button 15c on the obtained normal image (step S188). When the control unit 11 determines that the touch operation of the NG button 15c has been accepted (YES in step S188), the control unit 11 erroneously determines that the image is normal. Data is generated (step S190). The control unit 11 transitions to step S192, which will be described later.

制御部11は、NGボタン15cのタッチ操作を受け付けていないと判定した場合(ステップS188でNO)、OKボタン15bのタッチ操作を受け付けたか否かを判定する(ステップS189)。制御部11は、OKボタン15bのタッチ操作を受け付けたと判定した場合(ステップS189でYES)、正しく正常と判断され、該正常画像に対して正常であることを示すデータを付与した第4訓練データを生成する(ステップS191)。制御部11は、OKボタン15bのタッチ操作を受け付けていないと判定した場合(ステップS189でNO)、制御部11はステップS188処理に戻る。 When determining that the touch operation of the NG button 15c has not been accepted (NO in step S188), the control unit 11 determines whether or not the touch operation of the OK button 15b has been accepted (step S189). When the control unit 11 determines that the touch operation of the OK button 15b has been accepted (YES in step S189), the control unit 11 correctly determines that the image is normal, and the normal image is added with data indicating that it is normal. is generated (step S191). When the control unit 11 determines that the touch operation of the OK button 15b has not been received (NO in step S189), the control unit 11 returns to the process of step S188.

制御部11は、該正常画像が複数の正常画像中の最後の正常画像であるか否かを判定する(ステップS192)。制御部11は、該正常画像が最後の正常画像でないと判定した場合(ステップS192でNO)、制御部11はステップS188処理に遷移する。制御部11は、該正常画像が最後の正常画像であると判定した場合(ステップS192でYES)、制御部11は生成した複数の第1訓練データ、第2訓練データ、第3訓練データ及び第4訓練データの組み合わせを用いて、画像を入力した場合に該画像に対する異常情報を検出(出力)する異常検出モデル173を生成する(ステップS193)。 The control unit 11 determines whether or not the normal image is the last normal image among the plurality of normal images (step S192). When the control unit 11 determines that the normal image is not the last normal image (NO in step S192), the control unit 11 transitions to the process of step S188. When the control unit 11 determines that the normal image is the last normal image (YES in step S192), the control unit 11 generates a plurality of first training data, second training data, third training data, and third training data. A combination of the four training data is used to generate an anomaly detection model 173 that, when an image is input, detects (outputs) anomaly information for the image (step S193).

具体的には、制御部11は、訓練データである画像をニューラルネットワークの入力層に入力し、該画像に対応する異常の有無を検出した検出結果を出力層から取得する。制御部11は、取得した検出結果を訓練データの正解値(画像に対してラベル付けられた情報)と比較し、出力層から出力される検出結果が正解値に近づくよう、中間層での演算処理に用いるパラメータ(重み等)を最適化する。制御部11は、生成した異常検出モデル173を大容量記憶部17の学習モデル管理DB172に記憶し(ステップS194)、一連の処理を終了する。 Specifically, the control unit 11 inputs an image, which is training data, to the input layer of the neural network, and acquires the detection result of detecting the presence or absence of an abnormality corresponding to the image from the output layer. The control unit 11 compares the obtained detection result with the correct value of the training data (information labeled with respect to the image), and performs calculations in the intermediate layer so that the detection result output from the output layer approaches the correct value. Optimize the parameters (weights, etc.) used for processing. The control unit 11 stores the generated abnormality detection model 173 in the learning model management DB 172 of the large-capacity storage unit 17 (step S194), and ends the series of processes.

コンピュータ1は、実施形態1で構築された学習済みの良品学習モデル171(第1学習モデル)、または本実施形態で構築された異常検出モデル173(第2学習モデル)の少なくとも一方の選択を受け付ける。良品学習モデル171が選択された場合、コンピュータ1は、実施形態1または2での異常検出処理に基づいて検査対象物の異常を検出する。異常検出モデル173が選択された場合、コンピュータ1は、本実施形態での異常検出処理に基づいて検査対象物の異常を検出する。 The computer 1 accepts selection of at least one of the learned non-defective product learning model 171 (first learning model) built in Embodiment 1 and the anomaly detection model 173 (second learning model) built in this embodiment. . When the non-defective product learning model 171 is selected, the computer 1 detects an abnormality in the inspection object based on the abnormality detection processing in the first or second embodiment. When the anomaly detection model 173 is selected, the computer 1 detects anomalies in the inspected object based on the anomaly detection processing of this embodiment.

本実施形態によると、収集された正常画像及び異常画像に基づいて異常検出モデル173を生成し、生成した異常検出モデル173を用いて検査対象物の異常を検出することが可能となる。 According to this embodiment, it is possible to generate the abnormality detection model 173 based on the collected normal images and abnormal images, and detect the abnormality of the inspection object using the generated abnormality detection model 173 .

本実施形態によると、収集された正常画像及び異常画像に基づき、教師あり学習により異常検出モデル173を構築することが可能となる。 According to this embodiment, it is possible to construct the abnormality detection model 173 by supervised learning based on the collected normal images and abnormal images.

本実施形態によると、教師なし学習により構築された学習済みモデルと、教師あり学習により構築された学習済みモデルとを併用することで、異常の検出精度を高めることが可能となる。 According to this embodiment, by using both a trained model constructed by unsupervised learning and a trained model constructed by supervised learning, it is possible to increase the accuracy of abnormality detection.

(実施形態4)
実施形態4は、コンピュータ1のハードウェア構成、良品学習モデル171のハイパーパラメータ、または小片画像のサイズの少なくとも1つに応じて、良品学習モデル171に同時入力する小片画像の最大枚数を決定する形態に関する。なお、実施形態1~3と重複する内容については説明を省略する。
(Embodiment 4)
Embodiment 4 determines the maximum number of small piece images to be simultaneously input to the good product learning model 171 according to at least one of the hardware configuration of the computer 1, the hyperparameters of the good product learning model 171, and the size of the small piece images. Regarding. Note that the description of the contents overlapping those of the first to third embodiments will be omitted.

コンピュータ1のハードウェア構成、良品学習モデル171のハイパーパラメータ、または小片画像のサイズによって、複数の小片画像に基づく異常検出処理の場合、良品学習モデル171に同時入力する枚数に応じて演算処理能力(例えば、処理速度等)の差が生じる。同時に処理する画像枚数が多いほど、メモリ使用率が高くなり、GPUの処理速度が低下する。コンピュータ1に処理能力を最大限に発揮させるために、良品学習モデル171に対する処理可能な小片画像の最大枚数を決定する必要がある。 In the case of abnormality detection processing based on a plurality of small piece images, the hardware configuration of the computer 1, the hyperparameter of the non-defective product learning model 171, or the size of the small piece image, the arithmetic processing capacity ( For example, a difference in processing speed, etc. occurs. As the number of images to be processed at the same time increases, the memory usage rate increases and the processing speed of the GPU decreases. In order to maximize the processing power of the computer 1, it is necessary to determine the maximum number of small piece images that can be processed for the non-defective product learning model 171. FIG.

ハードウェア構成は、GPU(プロセッサ)、メモリ、ハードディスク等のスペックである。なお、本実施形態では、GPUの例を説明したが、CPU、MPU等にも同様に適用される。良品学習モデル171のハイパーパラメータは、Depth(モデルの階層数)、Channel数(チャンネル数)、Epoch(学習させる回数)等を含む。 The hardware configuration is specs of GPU (processor), memory, hard disk, and the like. In addition, in this embodiment, an example of a GPU has been described, but the same applies to a CPU, an MPU, and the like. The hyperparameters of the non-defective product learning model 171 include Depth (the number of layers of the model), the number of Channels (the number of channels), Epoch (the number of times of learning), and the like.

図20は、実施形態4のコンピュータ1の構成例を示すブロック図である。なお、図16と重複する内容については同一の符号を付して説明を省略する。大容量記憶部17には、画像枚数DB174が記憶されている。画像枚数DB174は、コンピュータ1のハードウェア構成、良品学習モデル171のハイパーパラメータ及び小片画像のサイズに基づいて、良品学習モデル171に同時入力する画像の最大枚数を記憶している。 FIG. 20 is a block diagram showing a configuration example of the computer 1 of the fourth embodiment. 16 are assigned the same reference numerals, and description thereof will be omitted. A number-of-images DB 174 is stored in the large-capacity storage unit 17 . The number-of-images DB 174 stores the maximum number of images simultaneously input to the non-defective product learning model 171 based on the hardware configuration of the computer 1, the hyperparameters of the non-defective product learning model 171, and the size of the small piece image.

なお、画像枚数DB174に記憶された小片画像の最大枚数については、例えばGPUの負荷テストを通じて決定されても良い。 Note that the maximum number of small piece images stored in the image number DB 174 may be determined through a GPU load test, for example.

図21は、画像枚数DB174のレコードレイアウトの一例を示す説明図である。画像枚数DB174は、GPU列、ハイパーパラメータ列、画像サイズ及び画像枚数列を含む。GPU列は、CUDA(Compute Unified Device Architecture)コア数列、コアブロック列、メモリ量列及びメモリブロック列を含む。CUDAコア数列は、GPUのCUDAコア数を記憶している。コアブロック列は、GPUのコアブロックを記憶している。メモリ量列は、GPUのメモリ容量を記憶している。メモリブロック列は、GPUのメモリブロックを記憶している。 FIG. 21 is an explanatory diagram showing an example of the record layout of the number-of-images DB 174. As shown in FIG. The image count DB 174 includes a GPU column, a hyperparameter column, an image size column, and an image count column. The GPU column includes a CUDA (Compute Unified Device Architecture) core number column, a core block column, a memory amount column and a memory block column. The CUDA core number column stores the number of CUDA cores of the GPU. The core block column stores core blocks of the GPU. The memory capacity column stores the memory capacity of the GPU. The memory block column stores memory blocks of the GPU.

ハイパーパラメータ列は、Depth列、Channel数列及びEpoch列を含む。Depth列は、学習モデルの階層数を記憶している。Channel数列は、学習モデルのチャンネル数を記憶している。Epoch列は、学習させる回数を記憶している。画像サイズ列は、小片画像のサイズ(例えば、50×50ピクセル)を記憶している。画像枚数列は、良品学習モデル171に同時入力する小片画像の最大枚数を記憶している。 The hyperparameter sequences include the Depth sequence, the Channel sequence and the Epoch sequence. The depth column stores the number of layers of the learning model. The Channel sequence stores the number of channels of the learning model. The Epoch column stores the number of learning times. The image size column stores the size of the piece image (eg, 50×50 pixels). The number-of-images column stores the maximum number of small-piece images simultaneously input to the non-defective product learning model 171 .

図22は、小片画像の最大枚数を取得する際の処理手順を示すフローチャートである。コンピュータ1の制御部11は、システム情報取得API(Application Programming Interface)を利用してハードウェア構成を取得する(ステップS11)。例えばGPUのCUDAコア数、コアブロック、メモリ量、メモリブロック等が取得される。制御部11は、学習済みの良品学習モデル171のハイパーパラメータを取得する(ステップS12)。例えばDepth、Channel数、Epoch等が取得される。 FIG. 22 is a flowchart showing a processing procedure for obtaining the maximum number of small piece images. The control unit 11 of the computer 1 acquires the hardware configuration using a system information acquisition API (Application Programming Interface) (step S11). For example, the number of CUDA cores, core blocks, memory amount, memory blocks, etc. of the GPU are acquired. The control unit 11 acquires the hyperparameters of the learned non-defective product learning model 171 (step S12). For example, depth, number of channels, epoch, etc. are acquired.

制御部11は、小片画像のサイズの入力を入力部14により受け付ける(ステップS13)。制御部11は、取得したコンピュータ1のハードウェア構成、良品学習モデル171のハイパーパラメータ、及び受け付けた小片画像のサイズに基づき、大容量記憶部17の画像枚数DB174を照合して、小片画像の最大枚数を取得する(ステップS14)。制御部11は、検査対象物を含む画像を通信部13により撮像装置2から取得する(ステップS15)。制御部11は実施形態2での小片画像分割処理と同様に、取得した小片画像の最大枚数に基づき、取得した検査対象物の画像を相互にオーバーラップする複数の小片画像に分割する(ステップS16)。その後、実施形態2と同様に、制御部11は分割した複数の小片画像に基づいて検査対象物の異常を検出する。 The control unit 11 receives an input of the size of the small piece image through the input unit 14 (step S13). Based on the hardware configuration of the computer 1, the hyperparameters of the non-defective product learning model 171, and the size of the received small piece image, the control unit 11 collates the image number DB 174 of the large-capacity storage unit 17 to obtain the maximum number of small piece images. The number of sheets is obtained (step S14). The control unit 11 acquires an image including the inspection object from the imaging device 2 through the communication unit 13 (step S15). Similar to the small piece image division processing in the second embodiment, the control unit 11 divides the acquired image of the inspection object into a plurality of mutually overlapping small piece images based on the maximum number of acquired small piece images (step S16). ). After that, similarly to the second embodiment, the control unit 11 detects an abnormality of the inspection object based on the divided plural small piece images.

なお、図22では、コンピュータ1のハードウェア構成、良品学習モデル171のハイパーパラメータ、及び小片画像のサイズに応じて、良品学習モデル171に同時入力する小片画像の最大枚数を決定する処理の例を説明したが、これに限るものではない。ハードウェア構成、ハイパーパラメータまたは小片画像のサイズの少なくとも1つに応じて、小片画像の最大枚数を決定しても良い。 Note that FIG. 22 shows an example of processing for determining the maximum number of small piece images to be simultaneously input to the non-defective product learning model 171 according to the hardware configuration of the computer 1, the hyperparameters of the non-defective product learning model 171, and the size of the small piece images. Although explained, it is not limited to this. The maximum number of image strips may be determined according to at least one of the hardware configuration, hyperparameters, or size of the image strips.

なお、小片画像の最大枚数の決定処理に関しては、上述した処理に限るものではない。例えば、ハードウェア構成、ハイパーパラメータまたは小片画像のサイズに基づいて作成した数式(アルゴリズム)を用いて、小片画像の最大枚数を求めても良い。 Note that the processing for determining the maximum number of small piece images is not limited to the processing described above. For example, the maximum number of small piece images may be obtained using a formula (algorithm) created based on the hardware configuration, hyperparameters, or the size of the small piece images.

本実施形態によると、コンピュータ1のハードウェア構成、良品学習モデル171のハイパーパラメータ、または小片画像のサイズの少なくとも1つに応じて、良品学習モデル171に同時入力する小片画像の最大枚数を決定することが可能となる。 According to the present embodiment, the maximum number of small piece images simultaneously input to the good product learning model 171 is determined according to at least one of the hardware configuration of the computer 1, the hyperparameters of the good product learning model 171, and the size of the small piece images. becomes possible.

本実施形態によると、小片画像の最大枚数に基づいて学習または運用処理を行った場合、コンピュータ1が処理能力を最大限に発揮することが可能となる。 According to this embodiment, when learning or operation processing is performed based on the maximum number of small piece images, the computer 1 can maximize its processing ability.

(実施形態5)
実施形態5は、教師あり学習により生成する異常検出モデル173(第2学習モデル)を用いて検査対象物の異常の有無を検出する形態に関する。なお、実施形態1~4と重複する内容については説明を省略する。
(Embodiment 5)
Embodiment 5 relates to detecting the presence or absence of an abnormality in an inspection object using an abnormality detection model 173 (second learning model) generated by supervised learning. Note that descriptions of the contents overlapping those of the first to fourth embodiments will be omitted.

なお、本実施形態のコンピュータの構成に関しては、実施形態3のコンピュータの構成と同様であるため、説明を省略する。 Note that the configuration of the computer of this embodiment is the same as that of the computer of the third embodiment, so the description is omitted.

本実施形態での異常検出モデル173は、人工知能ソフトウェアの一部であるプログラムモジュールとして利用される。異常検出モデル173は、検査対象物を含む画像が入力された場合に、異常が写っていると推定する領域と、その領域に異常が写っている確信度(確率)とを示す情報を出力する学習モデルである。検査対象物の異常は、検査対象物の傷、汚れ、異物等の外観上の欠陥等であり、例えば「打痕」、「汚れ」または「傷」等である。 The anomaly detection model 173 in this embodiment is used as a program module that is part of artificial intelligence software. When an image including an object to be inspected is input, the abnormality detection model 173 outputs information indicating an area estimated to contain an abnormality and the degree of certainty (probability) that the abnormality appears in that area. Learning model. The abnormality of the object to be inspected is an external defect such as a scratch, stain, or foreign matter on the object to be inspected.

図23は、異常検出モデル173を用いて検査対象物の異常を検出する処理の概要を説明する説明図である。本実施の形態の異常検出モデル173は、RCNNを用いて推定を行う。異常検出モデル173は、領域候補抽出部73aと、分類部73bとを含む。異常検出モデル173に、検査対象物を含む画像が入力される。領域候補抽出部73aは、画像から様々なサイズの領域候補を抽出する。 FIG. 23 is an explanatory diagram for explaining an overview of processing for detecting anomalies in an inspection object using the anomaly detection model 173. As shown in FIG. The anomaly detection model 173 of this embodiment performs estimation using RCNN. The anomaly detection model 173 includes a region candidate extractor 73a and a classifier 73b. An image including an inspection target is input to the anomaly detection model 173 . The area candidate extraction unit 73a extracts area candidates of various sizes from the image.

分類部73bは、図示を省略するニューラルネットワークを含む。ニューラルネットワークは、コンボリューション層、プーリング層および全結合層を含む。分類部73bは、領域候補抽出部73aから抽出された各画素の画素値を畳み込むコンボリューション層と、コンボリューション層で畳み込んだ画素値をマッピングするプーリング層とが交互に連結された構成により、領域候補の画素情報を圧縮しながら最終的に領域候補の特徴量を抽出する。分類部73bは、バックプロパゲーションによりパラメータが学習された全結合層により、抽出した領域候補の特徴量に基づいて領域候補に映っている被写体が異常であるか否かを分類する。 The classification unit 73b includes a neural network (not shown). Neural networks include convolution layers, pooling layers and fully connected layers. The classification unit 73b has a configuration in which a convolution layer that convolves the pixel value of each pixel extracted from the region candidate extraction unit 73a and a pooling layer that maps the pixel value convoluted in the convolution layer are alternately connected. While compressing the pixel information of the area candidate, the feature amount of the area candidate is finally extracted. The classifying unit 73b classifies whether or not the subject appearing in the region candidate is abnormal based on the feature amount of the extracted region candidate using a fully connected layer whose parameters have been learned by back propagation.

異常検出モデル173は、領域候補の抽出と分類とを繰り返すことにより、検査対象物の異常の有無を示す情報を出力する。 The abnormality detection model 173 repeats the extraction and classification of region candidates to output information indicating the presence or absence of abnormality in the inspection object.

コンピュータ1は、検査対象物を含む画像と、該画像に対応する検査対象物の異常の有無を示す情報とが対応付けられた訓練データの組み合わせを用いて学習を行う。訓練データは、画像に対し、該画像に対応する異常箇所を示す情報がラベル付けされたデータである。ラベルは、例えば「打痕」、「汚れ」または「傷」等である。 The computer 1 performs learning using a combination of training data in which an image including an inspection object and information indicating the presence or absence of an abnormality in the inspection object corresponding to the image are associated with each other. The training data is data in which an image is labeled with information indicating an abnormal location corresponding to the image. The label is, for example, "dent", "dirt" or "scratch".

学習の際には、異常情報を格納するデータベースに存在する大量の過去の異常検出データを訓練データとして利用しても良く、または、実施形態1での異常検出結果により判断された見落とし画像を用いて作成された訓練データを利用しても良い。見落とし画像は、実施形態1の異常検出処理で良品学習モデル171に基づいて画像から検査対象物の異常が検出されていないが、検査員の検査(例えば、目視検査)により該検査対象物の異常を検出した画像である。コンピュータ1は、取得した見落とし画像と、検査員から入力された該見落とし画像に対応する検査対象物の異常有りを示す情報とを訓練データとして、異常検出モデル173の学習を行う。 During learning, a large amount of past anomaly detection data that exists in a database that stores anomaly information may be used as training data, or an overlooked image determined based on the anomaly detection result in the first embodiment may be used. It is also possible to use training data created by In the overlooked image, an abnormality of the inspection object is not detected from the image based on the non-defective product learning model 171 in the abnormality detection processing of the first embodiment, but an inspection (for example, visual inspection) by the inspector detects an abnormality of the inspection object. is detected. The computer 1 learns the abnormality detection model 173 using the obtained overlooked image and information indicating the existence of abnormality in the inspection object corresponding to the overlooked image input by the inspector as training data.

具体的には、コンピュータ1は、良品学習モデル171に基づいて検査対象物の異常を検出していない見落とし画像を取得する。コンピュータ1は、取得した見落とし画像に対し、該見落とし画像に対応する検査対象物の異常有りを示す情報(例えば、「打痕」、「汚れ」または「傷」等の異常ラベル)を設定する設定入力を受け付ける。コンピュータ1は、取得した見落とし画像と、受け付けた該見落とし画像に対応する検査対象物の異常有りを示す情報とが対応付けられた訓練データを作成する。見落とし画像を訓練データとすることにより、本システムを継続するほど異常検出モデル173がアップデートされ、より正確な異常検出を行うことができるようになる。 Specifically, the computer 1 acquires an overlooked image in which an abnormality of the inspection object is not detected based on the non-defective item learning model 171 . The computer 1 sets information (for example, an abnormality label such as “dent”, “dirt” or “flaw”) indicating the presence of an abnormality in the inspection object corresponding to the acquired overlooked image. Accept input. The computer 1 creates training data in which the acquired overlooked image and information indicating the presence of an abnormality in the inspection object corresponding to the received overlooked image are associated with each other. By using overlooked images as training data, the more the system is continued, the more the anomaly detection model 173 is updated, making it possible to perform more accurate anomaly detection.

コンピュータ1は、訓練データである画像を領域候補抽出部73aに入力し、分類部73bでの演算処理を経て、該画像に対応する検査対象物の異常の有無を示す情報を取得する。コンピュータ1は、分類部73bから出力された検査対象物の異常の有無を示す情報を、訓練データにおいて画像に対しラベル付けされた情報、すなわち正解値と比較し、分類部73bからの出力値が正解値に近づくように、分類部73b(コンボリューション層、プーリング層および全結合層)での演算処理に用いるパラメータを最適化する。当該パラメータは、例えばニューロン間の重み(結合係数)、各ニューロンで用いられる活性化関数の係数などである。パラメータの最適化の方法は特に限定されないが、例えばコンピュータ1は誤差逆伝播法を用いて各種パラメータの最適化を行う。 The computer 1 inputs an image, which is training data, to the region candidate extraction unit 73a, and acquires information indicating the presence or absence of an abnormality in the inspection object corresponding to the image through arithmetic processing in the classification unit 73b. The computer 1 compares the information indicating the presence or absence of abnormality in the inspection object output from the classification unit 73b with the information labeled for the image in the training data, that is, the correct value, and the output value from the classification unit 73b is Parameters used for arithmetic processing in the classification unit 73b (convolution layer, pooling layer and fully connected layer) are optimized so as to approach the correct value. The parameters are, for example, weights (coupling coefficients) between neurons, coefficients of activation functions used in each neuron, and the like. Although the parameter optimization method is not particularly limited, for example, the computer 1 uses error backpropagation to optimize various parameters.

コンピュータ1は、訓練データに含まれる各画像について上記の処理を行い、異常検出モデル173を生成する。コンピュータ1は、生成した異常検出モデル173を学習モデル管理DB172に記憶する。学習モデル管理DB172にこれにより、例えばコンピュータ1は当該訓練データを用いて異常検出モデル173の学習を行うことで、画像に対応する検査対象物の異常の有無を示す情報を出力可能なモデルを構築することができる。コンピュータ1は画像を取得した場合、異常検出モデル173を用いて該画像に対応する検査対象物の異常の有無を示す情報を出力する。 The computer 1 performs the above processing on each image included in the training data to generate an anomaly detection model 173 . The computer 1 stores the generated anomaly detection model 173 in the learning model management DB 172 . In the learning model management DB 172, for example, the computer 1 learns the abnormality detection model 173 using the training data, thereby constructing a model capable of outputting information indicating the presence or absence of an abnormality in the inspection object corresponding to the image. can do. When the computer 1 acquires an image, it uses the abnormality detection model 173 to output information indicating the presence or absence of an abnormality in the inspection object corresponding to the image.

異常検出モデル173は、所定の閾値よりも高い確信度で異常が写っていると分類された領域候補について、領域の範囲、および、異常が写っている確信度を出力する。図23に示す例では、所定の打痕異常の閾値(例えば、0.80)よりも高い0.87の確信度で打痕異常が写っている領域と、所定の汚れ異常の閾値(例えば、0.85)よりも高い0.92の確信度で汚れ異常が写っている領域とが検出されている。 The anomaly detection model 173 outputs the range of the area and the certainty that the anomaly is present for the area candidate classified as having an anomaly that is higher than a predetermined threshold. In the example shown in FIG. 23, an area in which a dent abnormality is shown with a certainty of 0.87, which is higher than a predetermined dent abnormality threshold (for example, 0.80), and a predetermined contamination abnormality threshold (for example, 0.85) with a certainty of 0.92, which is higher than 0.85).

なお、RCNNの代わりに、CNN、Fast RCNN、Faster RCNNまたはSSD、YOLO等の、任意の物体検出アルゴリズムを使用しても良い。その他、U-Net等のセグメンテーションネットワークを用いても良い。 Any object detection algorithm such as CNN, Fast RCNN, Faster RCNN, SSD, or YOLO may be used instead of RCNN. Alternatively, a segmentation network such as U-Net may be used.

図24は、検証モードで検査対象物の異常を検出する画面の一例を示す説明図である。該画面は、AIモデル選択ボタン16a、検証画像フォルダ選択ボタン16b、ラベル名選択コンボボックス16c、確信度閾値入力欄16d、更新ボタン16e、確信度表示欄16f、保存フォルダ選択ボタン16g、検証ボタン16h、異常種類タブ16i及び検出結果表示欄16jを含む。 FIG. 24 is an explanatory diagram showing an example of a screen for detecting an abnormality in an inspection object in verification mode. The screen includes an AI model selection button 16a, a verification image folder selection button 16b, a label name selection combo box 16c, a certainty threshold input field 16d, an update button 16e, a certainty display field 16f, a save folder selection button 16g, and a verification button 16h. , an abnormality type tab 16i and a detection result display field 16j.

AIモデル選択ボタン16aは、学習済みの異常検出モデル173ファイルの選択を受け付けるボタンである。検証画像フォルダ選択ボタン16bは、検査対象物を含む画像を記憶した画像フォルダを選択するボタンである。ラベル名選択コンボボックス16cは、画像に対しラベル付けされたラベルの名称の選択を受け付けるコンボボックスである。確信度閾値入力欄16dは、各種の異常の確信度の閾値の入力を受け付けるテキストフィールドである。更新ボタン16eは、各種の異常の確信度の閾値を更新するボタンである。 The AI model selection button 16a is a button for accepting selection of a learned anomaly detection model 173 file. The verification image folder selection button 16b is a button for selecting an image folder in which images including inspection objects are stored. The label name selection combo box 16c is a combo box that accepts selection of the name of the label attached to the image. The certainty threshold input field 16d is a text field for receiving input of thresholds for certainty of various types of abnormality. The update button 16e is a button for updating thresholds of certainty of various types of abnormality.

確信度表示欄16fは、設定された各種の異常の確信度の閾値を表示する表示欄である。保存フォルダ選択ボタン16gは、検証結果を保存するフォルダを選択するボタンである。検証ボタン16hは、検査対象物を含む画像を検証するボタンである。異常種類タブ16iは、異常の種類(例えば、打痕、汚れまたは傷)または異常検出なしを切り替えるためのタブである。図示のように、異常種類タブ16iは、「打痕」タブ、「汚れ」タブ、「傷」タブ及び「検出なし」タブを含む。検出結果表示欄16jは、検査対象物の異常の有無を検出する検出結果を表示する表示欄である。 The certainty display column 16f is a display column for displaying the set thresholds of the certainty of various types of abnormality. The storage folder selection button 16g is a button for selecting a folder for storing the verification result. The verification button 16h is a button for verifying an image including an inspection object. The abnormality type tab 16i is a tab for switching between the type of abnormality (for example, dent, stain, or scratch) or no abnormality detection. As illustrated, the abnormality type tab 16i includes a "dent" tab, a "dirt" tab, a "flaw" tab, and a "no detection" tab. The detection result display column 16j is a display column for displaying the detection result of detecting the presence or absence of an abnormality in the inspection object.

コンピュータ1は、AIモデル選択ボタン16aのタッチ操作を受け付けた場合、学習済みの異常検出モデル173のファイルを学習モデル管理DB172から取得する。例えばコンピュータ1は、取得した学習済みの異常検出モデル173(複数可)をリストボックス(図示せず)に表示する。コンピュータ1は、ユーザによる異常検出モデル173の選択を受け付ける。コンピュータ1は、検証画像フォルダ選択ボタン16bのタッチ操作を受け付けた場合、検証画像を記憶した画像フォルダの選択を受け付ける。 The computer 1 acquires the file of the learned abnormality detection model 173 from the learning model management DB 172 when receiving the touch operation of the AI model selection button 16 a. For example, the computer 1 displays the acquired learned anomaly detection model 173 (a plurality of models) in a list box (not shown). The computer 1 accepts selection of the anomaly detection model 173 by the user. When the computer 1 accepts the touch operation of the verification image folder selection button 16b, the computer 1 accepts the selection of the image folder in which the verification images are stored.

コンピュータ1は、ラベル名選択コンボボックス16cの選択操作を受け付けた場合、該当する異常のラベル名の選択を受け付ける。コンピュータ1は、確信度閾値入力欄16dの入力操作を受け付けた場合、ラベル名選択コンボボックス16cにより選択された異常のラベル名に対応する確信度の閾値の入力を受け付ける。コンピュータ1は、更新ボタン16eのタッチ操作を受け付けた場合、確信度閾値入力欄16dにより入力された異常の確信度の閾値を、ラベル名選択コンボボックス16cにより選択された異常のラベル名に対応付けて更新する。コンピュータ1は、更新した各種の異常の確信度の閾値を記憶部12または大容量記憶部17に記憶し、記憶した各種の異常の確信度の閾値を確信度表示欄16fに表示する。 When the computer 1 accepts the selection operation of the label name selection combo box 16c, the computer 1 accepts selection of the label name of the corresponding abnormality. When accepting an input operation in the certainty threshold input field 16d, the computer 1 accepts an input of the certainty threshold corresponding to the label name of the abnormality selected by the label name selection combo box 16c. When the touch operation of the update button 16e is received, the computer 1 associates the abnormality certainty threshold input in the certainty threshold input field 16d with the label name of the abnormality selected in the label name selection combo box 16c. to update. The computer 1 stores the updated thresholds of certainty of various types of abnormality in the storage unit 12 or the large-capacity storage unit 17, and displays the stored thresholds of certainty of various types of abnormality in the degree of certainty display column 16f.

コンピュータ1は、保存フォルダ選択ボタン16gのタッチ操作を受け付けた場合、検証結果を記憶するフォルダの選択を受け付ける。コンピュータ1は、検証ボタン16hのタッチ操作を受け付けた場合、各種の異常の確信度の閾値に基づいて検査対象物の異常の有無を検出する。具体的には、コンピュータ1は、検証画像フォルダ選択ボタン16bにより選択された画像を、AIモデル選択ボタン16aにより選択された異常検出モデル173に入力し、設定された各種の異常の確信度の閾値よりも高い確信度で異常が写っていると分類された領域候補について、領域の範囲、および、異常が写っている確信度を出力させる。 When the computer 1 accepts the touch operation of the storage folder selection button 16g, the computer 1 accepts selection of a folder for storing the verification result. When the computer 1 receives the touch operation of the verification button 16h, the computer 1 detects the presence or absence of an abnormality in the inspection object based on various thresholds of certainty of abnormality. Specifically, the computer 1 inputs the image selected by the verification image folder selection button 16b to the anomaly detection model 173 selected by the AI model selection button 16a, and the set thresholds for the certainty of various anomalies. For a region candidate classified as containing an abnormality with a higher certainty than , output the range of the region and the degree of certainty that the anomaly is shown.

コンピュータ1は、検出した異常画像を、保存フォルダ選択ボタン16gにより選択されたフォルダに記憶する。コンピュータ1は、異常種類タブ16iに示されている分類情報(例えば、打痕、汚れ、傷及び検出なし)に基づき、単一または複数の画像に対して分類する。コンピュータ1は、分類した各画像の検出結果を、該当する異常種類タブ16iに対応する検出結果表示欄16jに表示する。 The computer 1 stores the detected abnormal image in the folder selected by the save folder selection button 16g. The computer 1 classifies single or multiple images based on the classification information (eg, dent, dirt, scratch, and no detection) shown in the abnormality type tab 16i. The computer 1 displays the detection result of each classified image in the detection result display column 16j corresponding to the corresponding abnormality type tab 16i.

具体的には、コンピュータ1は、検査対象物の異常を検出した画像に対し、それぞれの画像と合わせて、異常が写っている領域の範囲(座標)、異常の種類及び確信度等を、異常種類に応じて該当する異常種類タブ16i(「打痕」タブ、「汚れ」タブまたは「傷」タブ)に対応する検出結果表示欄16jに表示する。コンピュータ1は、検査対象物の異常を検出していない画像に対し、「検出なし」タブである異常種類タブ16iに対応する検出結果表示欄16jに、それぞれの画像と合わせて、異常を検出していない検出結果を表示する。 Specifically, the computer 1 calculates the range (coordinates) of the region in which the abnormality appears, the type of abnormality, the degree of certainty, etc., together with each image, from the image in which the abnormality of the inspection object is detected. It is displayed in the detection result display field 16j corresponding to the corresponding abnormality type tab 16i ("dent" tab, "dirt" tab, or "flaw" tab) according to the type. The computer 1 detects an abnormality in the detection result display column 16j corresponding to the abnormality type tab 16i, which is the "no detection" tab, for the images in which no abnormality is detected in the inspection object, together with each image. to display detection results that are not

図25は、運用モードで検査対象物の異常を検出する画面の一例を示す説明図である。なお、図24と重複する内容については同一の符号を付して説明を省略する。該画面は、監視方法選択ラジオボタン17a、監視フォルダ選択ボタン17b、カメラ選択コンボボックス17c、解像度選択コンボボックス17d、ログファイル選択ボタン17e及び運用ボタン17fを含む。 FIG. 25 is an explanatory diagram showing an example of a screen for detecting anomalies in inspection objects in the operation mode. Note that the same reference numerals are given to the contents that overlap with those in FIG. 24, and the description thereof is omitted. The screen includes a monitoring method selection radio button 17a, a monitoring folder selection button 17b, a camera selection combo box 17c, a resolution selection combo box 17d, a log file selection button 17e and an operation button 17f.

監視方法選択ラジオボタン17aは、「フォルダ監視」または「カメラ監視」を選択するラジオボタンである。監視フォルダ選択ボタン17bは、運用の画像を記憶したフォルダを選択するボタンである。コンピュータ1は、監視フォルダ選択ボタン17bのタッチ操作を受け付けた場合、運用の画像を記憶したフォルダの選択を受け付ける。 The monitoring method selection radio button 17a is a radio button for selecting "folder monitoring" or "camera monitoring". The monitor folder selection button 17b is a button for selecting a folder in which images for operation are stored. When the computer 1 accepts the touch operation of the monitoring folder selection button 17b, the computer 1 accepts selection of the folder in which the operation image is stored.

カメラ選択コンボボックス17cは、接続された監視用の撮像装置2を選択するコンボボックスである。解像度選択コンボボックス17dは、選択された監視用の撮像装置2の解像度度の選択を受け付けるコンボボックスである。コンピュータ1は、カメラ選択コンボボックス17cの選択操作を受け付けた場合、監視用の撮像装置2の選択を受け付ける。コンピュータ1は、解像度選択コンボボックス17dの選択操作を受け付けた場合、カメラ選択コンボボックス17cにより選択された監視用の撮像装置2に対応する解像度の選択を受け付ける。 The camera selection combo box 17c is a combo box for selecting the connected imaging device 2 for monitoring. The resolution selection combo box 17d is a combo box for receiving the selection of the resolution of the selected imaging device 2 for monitoring. When the computer 1 accepts the selection operation of the camera selection combo box 17c, the computer 1 accepts the selection of the imaging device 2 for monitoring. When the computer 1 accepts the selection operation of the resolution selection combo box 17d, the computer 1 accepts the selection of the resolution corresponding to the monitoring imaging device 2 selected by the camera selection combo box 17c.

ログファイル選択ボタン17eは、検査対象物の異常を検出したログデータを記憶するためのログファイルを選択するボタンである。コンピュータ1は、ログファイル選択ボタン17eのタッチ操作を受け付けた場合、ログファイルの選択を受け付ける。 The log file selection button 17e is a button for selecting a log file for storing log data in which an abnormality of an inspection object is detected. When the computer 1 receives the touch operation of the log file selection button 17e, the computer 1 receives the selection of the log file.

運用ボタン17fは、検査対象物の異常の有無を検出するボタンである。コンピュータ1は、運用ボタン17fのタッチ操作を受け付けた場合、運用の画像を取得する。具体的には、コンピュータ1は、監視方法選択ラジオボタン17aにより選択された監視方法が「フォルダ監視」である場合、監視フォルダ選択ボタン17bにより選択された監視対象フォルダに記憶された運用の画像を取得する。コンピュータ1は、監視方法選択ラジオボタン17aにより選択された監視方法が「カメラ監視」である場合、カメラ選択コンボボックス17cにより選択された監視用の撮像装置2によりリアルタイムで撮像した動画を取得する。 The operation button 17f is a button for detecting the presence or absence of abnormality in the inspection object. The computer 1 acquires an operation image when receiving a touch operation of the operation button 17f. Specifically, when the monitoring method selected by the monitoring method selection radio button 17a is "folder monitoring", the computer 1 displays the operation image stored in the monitoring target folder selected by the monitoring folder selection button 17b. get. When the monitoring method selected by the monitoring method selection radio button 17a is "camera monitoring", the computer 1 obtains a moving image captured in real time by the monitoring imaging device 2 selected by the camera selection combo box 17c.

コンピュータ1は、取得した運用の画像を、AIモデル選択ボタン16aにより選択された学習済みの異常検出モデル173に入力し、該運用の画像に対応する検査対象物の異常の有無を示す情報を出力させる。コンピュータ1は、運用の画像と合わせて、異常検出モデル173から出力された検査対象物の異常の有無を示す情報を検出結果表示欄16jに表示する。 The computer 1 inputs the acquired operation image to the learned abnormality detection model 173 selected by the AI model selection button 16a, and outputs information indicating the presence or absence of an abnormality in the inspection object corresponding to the operation image. Let The computer 1 displays in the detection result display column 16j the information indicating the presence or absence of an abnormality in the inspection object output from the abnormality detection model 173 together with the operation image.

図26は、異常検出モデル173を用いて検査対象物の異常を検出する際の処理手順を示すフローチャートである。コンピュータ1の制御部11は、検査対象物を含む画像を通信部13または入力部14により取得する(ステップS21)。制御部11は、各種の異常の確信度の閾値の設定を入力部14により受け付ける(ステップS22)。なお、予め設定された異常の確信度の閾値が記憶部12または大容量記憶部17に記憶されている場合、制御部11は、各種の異常の確信度の閾値を記憶部12または大容量記憶部17から取得する。 FIG. 26 is a flow chart showing a processing procedure for detecting anomalies in inspection objects using the anomaly detection model 173. As shown in FIG. The control unit 11 of the computer 1 acquires an image including the inspection target through the communication unit 13 or the input unit 14 (step S21). The control unit 11 receives the setting of the threshold value of the certainty of various kinds of abnormality through the input unit 14 (step S22). Note that when preset thresholds for the certainty of abnormality are stored in the storage unit 12 or the large-capacity storage unit 17, the control unit 11 stores various thresholds for the certainty of anomalies in the storage unit 12 or the large-capacity storage. Acquired from the unit 17.

制御部11は、受け付けた各種の異常の確信度の閾値に基づき、取得した画像を異常検出モデル173に入力して該画像に対応する検査対象物の異常の有無を示す情報を検出結果として出力する(ステップS23)。制御部11は、該画像及び検出結果を表示部15により表示し(ステップS24)、処理を終了する。 The control unit 11 inputs the acquired image to the abnormality detection model 173 based on the received various thresholds of certainty of abnormality, and outputs information indicating the presence or absence of an abnormality in the inspection object corresponding to the image as a detection result. (step S23). The control unit 11 displays the image and the detection result on the display unit 15 (step S24), and terminates the process.

本実施形態によると、教師あり学習により生成する異常検出モデル173を用いて検査対象物の異常を検出することが可能となる。 According to this embodiment, it is possible to detect an abnormality in an inspection object using the abnormality detection model 173 generated by supervised learning.

本実施形態によると、各種の異常の確信度の閾値を設定することにより、検査対象物に対して各種の異常の検出精度を調整することが可能となる。 According to this embodiment, it is possible to adjust the accuracy of detection of various types of abnormality with respect to the inspection object by setting the thresholds of the degrees of certainty of various types of abnormality.

(実施形態6)
実施形態6は、良品学習モデル171(第1学習モデル)と異常検出モデル173(第2学習モデル)とを併用して検査対象物の異常を検出する形態に関する。なお、実施形態1~5と重複する内容については説明を省略する。
(Embodiment 6)
Embodiment 6 relates to a configuration in which a non-defective product learning model 171 (first learning model) and an abnormality detection model 173 (second learning model) are used together to detect an abnormality in an inspection object. Note that the description of the contents overlapping those of the first to fifth embodiments will be omitted.

コンピュータ1は、検査対象物を含む画像を取得する。先ず、コンピュータ1は、良品学習モデル171に基づいて該画像に対応する検査対象物の異常の有無を示す第1検出結果を検出する。具体的には、コンピュータ1は、画像を検証するための異常度の閾値及び面積閾値の設定を受け付ける。コンピュータ1は、検査対象物の領域に基づいて作成されたテンプレート画像と、取得した画像との一致度の閾値の設定を受け付ける。 A computer 1 acquires an image including an inspection object. First, the computer 1 detects a first detection result indicating the presence or absence of an abnormality in the inspection object corresponding to the image based on the non-defective item learning model 171 . Specifically, the computer 1 accepts settings of an abnormality threshold and an area threshold for verifying an image. The computer 1 accepts the setting of the threshold value of the degree of matching between the template image created based on the region of the inspection object and the acquired image.

コンピュータ1は、例えばSSD、SADまたはNCC等のテンプレートマッチング手法を用いて、テンプレート画像と取得した画像との一致度を算出する。コンピュータ1は、算出した一致度が、受け付けた一致度の閾値を超えたか否かを判定する。コンピュータ1は、算出した一致度が一致度の閾値を超えたと判定した場合、後述する異常検出処理を実行する。なお、一致度の判定処理は必須ではない。コンピュータ1は、上述した一致度の判定処理を実行せず、取得したすべての画像に対して異常検出処理を実行しても良い。 The computer 1 uses a template matching technique such as SSD, SAD, or NCC to calculate the degree of matching between the template image and the acquired image. The computer 1 determines whether or not the calculated matching degree exceeds the received matching degree threshold. When the computer 1 determines that the calculated degree of matching exceeds the threshold value of the degree of matching, the computer 1 executes abnormality detection processing, which will be described later. It should be noted that the matching degree determination process is not essential. The computer 1 may execute the abnormality detection process for all the acquired images without executing the matching degree determination process described above.

コンピュータ1は、取得した画像を学習済みの良品学習モデル171に入力して該画像に対応する再構成画像を出力する。コンピュータ1は、取得した画像と、良品学習モデル171が出力した再構成画像との各ピクセルの異常度を算出する。なお、異常度の算出処理に関しては、実施形態1と同様であるため、説明を省略する。コンピュータ1は、算出した各ピクセルの異常度が、受け付けた異常度の閾値(例えば、50)を超えたか否かを判定する。 The computer 1 inputs the obtained image to the trained non-defective product learning model 171 and outputs a reconstructed image corresponding to the image. The computer 1 calculates the degree of abnormality of each pixel between the acquired image and the reconstructed image output by the non-defective product learning model 171 . Note that the processing for calculating the degree of anomaly is the same as in the first embodiment, so the description is omitted. The computer 1 determines whether or not the calculated degree of abnormality of each pixel exceeds the threshold value (for example, 50) of the received degree of abnormality.

コンピュータ1は、算出した各ピクセルの異常度が閾値を超えた該画像の領域のうち、異常度が異常度の閾値を超えたピクセル数を集計する。コンピュータ1は、集計したピクセル数(領域の面積)が、受け付けた面積閾値(例えば、30ピクセル)を超えたか否かを判定する。コンピュータ1は、該領域の面積が面積閾値を超えたと判定した場合、異常として検出する。 The computer 1 tallies the number of pixels whose degree of abnormality exceeds the threshold of the degree of abnormality among the regions of the image in which the calculated degree of abnormality of each pixel exceeds the threshold. The computer 1 determines whether or not the counted number of pixels (the area of the region) exceeds the received area threshold (eg, 30 pixels). When the computer 1 determines that the area of the region exceeds the area threshold, it detects it as an abnormality.

コンピュータ1は、上述した処理を実行することにより、検査対象物の異常の有無を示す第1検出結果を検出する。第1検出結果には異常が写っている領域の範囲等が含まれる。 The computer 1 detects the first detection result indicating the presence or absence of abnormality in the inspection object by executing the above-described processing. The first detection result includes, for example, the range of the area where the abnormality is shown.

次に、コンピュータ1は、学習済みの異常検出モデル173を用いて検査対象物の異常の有無を示す第2検出結果を検出する。具体的には、コンピュータ1は、実施形態5で学習させた異常検出モデル173に、取得した画像を入力して該画像に対応する検査対象物の異常の有無を示す第2検出結果を検出する。第2検出結果には、異常が写っていると分類された領域候補の範囲、異常が写っている確信度及び種類等が含まれる。 Next, the computer 1 uses the learned abnormality detection model 173 to detect a second detection result indicating the presence or absence of an abnormality in the inspection object. Specifically, the computer 1 inputs the acquired image to the abnormality detection model 173 learned in the fifth embodiment, and detects a second detection result indicating the presence or absence of an abnormality in the inspection object corresponding to the image. . The second detection result includes the range of area candidates classified as containing an abnormality, the degree of certainty that the abnormality is contained, the type, and the like.

コンピュータ1は、第1検出結果から異常を検出したと判定した場合、画像の各ピクセルの異常度に基づいて、該画像の異常度マップを生成する。コンピュータ1は、検出した第1検出結果及び第2検出結果を、生成した該画像の異常度マップと共に表示する。コンピュータ1は、第1検出結果から異常を検出していないと判定した場合、検出した第1検出結果及び第2検出結果を該画像と共に表示する。 When determining that an abnormality is detected from the first detection result, the computer 1 generates an abnormality degree map of the image based on the degree of abnormality of each pixel of the image. The computer 1 displays the detected first detection result and second detection result together with the generated abnormality degree map of the image. When the computer 1 determines that no abnormality is detected from the first detection result, it displays the detected first detection result and second detection result together with the image.

図27は、良品学習モデル171と異常検出モデル173とを併用して検査対象物の異常を検出する検証モード画面の一例を示す説明図である。該検証モード画面は、良品学習モデル設定入力欄18a、異常検出モデル設定入力欄18b、良品フォルダ選択ボタン18c、不良品フォルダ選択ボタン18d、保存フォルダ選択ボタン18e、検証ボタン18f、分類タブ18g及び検証結果表示欄18hを含む。 FIG. 27 is an explanatory diagram showing an example of a verification mode screen for detecting an abnormality in an inspection object using both the non-defective product learning model 171 and the abnormality detection model 173. As shown in FIG. The verification mode screen includes a good product learning model setting input field 18a, an anomaly detection model setting input field 18b, a good product folder selection button 18c, a defective product folder selection button 18d, a storage folder selection button 18e, a verification button 18f, a classification tab 18g, and verification. A result display field 18h is included.

良品学習モデル設定入力欄18aは、学習済みの良品学習モデル171ファイルの選択、異常度の閾値及び面積閾値の入力を受け付ける設定入力欄である。異常検出モデル設定入力欄18bは、学習済みの異常検出モデル173ファイルの選択、及び各種の異常の確信度の閾値の入力を受け付ける設定入力欄である。良品フォルダ選択ボタン18cは、検査対象物を含む良品画像を記憶したフォルダを選択するボタンである。不良品フォルダ選択ボタン18dは、検査対象物を含む不良品画像を記憶したフォルダを選択するボタンである。保存フォルダ選択ボタン18eは、検証結果を保存するフォルダを選択するボタンである。検証ボタン18fは、画像を検証するボタンである。 The non-defective product learning model setting input field 18a is a setting input field for receiving selection of a learned non-defective product learning model 171 file and input of an abnormality threshold and an area threshold. The anomaly detection model setting input field 18b is a setting input field for receiving the selection of the learned anomaly detection model 173 file and the input of the threshold value of the certainty of various anomalies. The non-defective product folder selection button 18c is a button for selecting a folder in which non-defective product images including inspection objects are stored. The defective product folder selection button 18d is a button for selecting a folder in which defective product images including inspection objects are stored. The storage folder selection button 18e is a button for selecting a folder for storing the verification result. The verification button 18f is a button for verifying the image.

分類タブ18gは、第1検出結果と第2検出結果との対比関係からなる分類情報を切り替えるためのタブである。図示のように、分類情報は、「良品-良品判定」、「良品-不良品判定」、「不良品-良品判定」及び「不良品-不良品判定」を含む。「良品-良品判定」分類は、第1検出結果と第2検出結果の両方が良品(異常なし)である。「良品-不良品判定」分類は、第1検出結果が良品であり、且つ、第2検出結果が不良品(異常有り)である。「不良品-良品判定」分類は、第1検出結果が不良品であり、且つ、第2検出結果が良品である。「不良品-不良品判定」分類は、第1検出結果と第2検出結果の両方が不良品である。検証結果表示欄18hは、第1検出結果及び第2検出結果を表示する表示欄である。 The classification tab 18g is a tab for switching classification information consisting of a contrast relationship between the first detection result and the second detection result. As illustrated, the classification information includes "defective product-defective product determination", "defective product-defective product determination", "defective product-defective product determination", and "defective product-defective product determination". In the “non-defective product-non-defective product determination” classification, both the first detection result and the second detection result are non-defective products (no abnormality). In the "non-defective product-defective product determination" classification, the first detection result is a non-defective product, and the second detection result is a defective product (abnormal). In the "defective product-defective product determination" classification, the first detection result is a defective product, and the second detection result is a non-defective product. In the "defective product-defective product determination" classification, both the first detection result and the second detection result are defective products. The verification result display column 18h is a display column for displaying the first detection result and the second detection result.

コンピュータ1は、良品学習モデル設定入力欄18aの設定操作を受け付けた場合、学習済みの良品学習モデル171ファイルの選択、異常度の閾値及び面積閾値の入力を受け付ける。コンピュータ1は、異常検出モデル設定入力欄18bの設定操作を受け付けた場合、学習済みの異常検出モデル173ファイルの選択、及び各種の異常の確信度の閾値の入力を受け付ける。 When the computer 1 receives a setting operation in the non-defective product learning model setting input field 18a, the computer 1 receives selection of the learned non-defective product learning model 171 file and inputs of the threshold of the degree of abnormality and the threshold of area. When the computer 1 accepts a setting operation in the anomaly detection model setting input field 18b, it accepts selection of a learned anomaly detection model 173 file and input of various anomaly certainty thresholds.

コンピュータ1は、良品フォルダ選択ボタン18cのタッチ操作を受け付けた場合、良品と判断された良品画像を記憶したフォルダの選択を受け付ける。コンピュータ1は、不良品フォルダ選択ボタン18dのタッチ操作を受け付けた場合、不良品と判断された不良品画像を記憶したフォルダの選択を受け付ける。なお、良品画像及び不良品画像は、別々のフォルダに記憶されているが、これに限らず、同一のフォルダに記憶されても良い。コンピュータ1は、保存フォルダ選択ボタン18eのタッチ操作を受け付けた場合、検証結果を記憶するフォルダの選択を受け付ける。 When the computer 1 accepts the touch operation of the non-defective product folder selection button 18c, the computer 1 accepts selection of a folder storing non-defective product images determined to be non-defective products. When the computer 1 accepts the touch operation of the defective product folder selection button 18d, the computer 1 accepts selection of a folder storing defective product images determined as defective products. Although the non-defective product images and the defective product images are stored in separate folders, they may be stored in the same folder. When the computer 1 accepts the touch operation of the storage folder selection button 18e, the computer 1 accepts selection of a folder for storing the verification result.

コンピュータ1は、検証ボタン18fのタッチ操作を受け付けた場合、良品フォルダ選択ボタン18cにより選択されたフォルダに記憶された良品画像、及び不良品フォルダ選択ボタン18dにより選択されたフォルダに記憶された不良品画像を取得する。コンピュータ1は、良品学習モデル設定入力欄18aにより選択された学習済みの良品学習モデル171に、取得した良品画像及び不良品画像を含む検査用の画像を入力して各検査用の画像に対応する再構成画像を出力する。 When the computer 1 receives the touch operation of the verification button 18f, the image of the non-defective product stored in the folder selected by the non-defective product folder selection button 18c and the defective product image stored in the folder selected by the defective product folder selection button 18d are displayed. Get an image. The computer 1 inputs the inspection images including the acquired non-defective product images and defective product images to the learned non-defective product learning model 171 selected by the non-defective product learning model setting input field 18a, and corresponds to each inspection image. Output the reconstructed image.

コンピュータ1は、それぞれの検査用の画像と、良品学習モデル171が出力したそれぞれの検査用の画像に対応する再構成画像との異常度を算出する。コンピュータ1は、算出した異常度に基づき、それぞれの検査用の画像に対応する検査対象物の異常の有無を示す第1検出結果を検出する。 The computer 1 calculates the degree of abnormality between each inspection image and the reconstructed image corresponding to each inspection image output by the non-defective product learning model 171 . Based on the calculated degree of abnormality, the computer 1 detects a first detection result indicating the presence or absence of an abnormality in the inspection object corresponding to each inspection image.

コンピュータ1は、異常検出モデル設定入力欄18bにより選択された異常検出モデル173に、それぞれの検査用の画像を入力してそれぞれの検査用の画像に対応する検査対象物の異常の有無を示す第2検出結果を検出する。コンピュータ1は、保存フォルダ選択ボタン18eにより選択されたフォルダに、検出した第1検出結果及び第2検出結果を記憶する。コンピュータ1は、「良品-良品判定」、「良品-不良品判定」、「不良品-良品判定」及び「不良品-不良品判定」を含む分類情報に基づき、第1検出結果及び第2検出結果に応じて複数の検査用の画像を分類する。 The computer 1 inputs each inspection image to the abnormality detection model 173 selected by the abnormality detection model setting input field 18b, and indicates whether or not there is an abnormality in the inspection object corresponding to each inspection image. 2 Detect the detection result. The computer 1 stores the detected first detection result and second detection result in the folder selected by the storage folder selection button 18e. The computer 1 performs the first detection result and the second detection based on the classification information including "defective product-defective product determination", "defective product-defective product determination", "defective product-defective product determination", and "defective product-defective product determination". A plurality of inspection images are classified according to the results.

「良品-良品判定」に分類された検査用の画像に対し、コンピュータ1は、「良品-良品判定」である分類タブ18gに対応する検証結果表示欄18hに各検査用の画像を表示する。「不良品-良品判定」に分類された検査用の画像に対し、コンピュータ1は、それぞれの検査用の画像の各ピクセルの異常度に基づいて、それぞれの検査用の画像の異常度マップを生成する。コンピュータ1は、「不良品-良品判定」である分類タブ18gに対応する検証結果表示欄18hに、それぞれの検査用の画像の異常度マップと合わせて、それぞれの検査用の画像に対応する異常箇所を示す第1検出結果をアンカーボックスで表示する。 The computer 1 displays each inspection image in the verification result display field 18h corresponding to the classification tab 18g of "non-defective product-non-defective product determination" for the inspection image classified as "non-defective product-non-defective product determination". For the inspection images classified as "defective product - good product judgment", the computer 1 generates an abnormality degree map for each inspection image based on the abnormality degree of each pixel of each inspection image. do. The computer 1 displays the verification result display column 18h corresponding to the classification tab 18g of "defective product - non-defective product judgment" together with the abnormality degree map of each inspection image, and displays the abnormality corresponding to each inspection image. The first detection result indicating the location is displayed with an anchor box.

「良品-不良品判定」に分類された検査用の画像に対し、コンピュータ1は、「良品-不良品判定」である分類タブ18gに対応する検証結果表示欄18hに、それぞれの検査用の画像と合わせて、それぞれの検査用の画像に対応する異常箇所を示す第2検出結果を異常の種類に対応した色分けにより表示する。例えば、「打痕」異常が検出された場合、「打痕」の確信度等を含む第2検出結果を「打痕」の箇所に黄色のアンカーボックスで画像と重ねて表示しても良い。または、「汚れ」異常が検出された場合、「汚れ」の確信度等を含む第2検出結果を「汚れ」の箇所に青のアンカーボックスで画像と重ねて表示しても良い。 For the inspection images classified as "non-defective-defective product determination", the computer 1 displays each inspection image in the verification result display field 18h corresponding to the classification tab 18g "defective-defective product determination". In addition, the second detection result indicating the abnormal portion corresponding to each inspection image is displayed by color coding corresponding to the type of abnormality. For example, when a "hit" abnormality is detected, the second detection result including the certainty of the "hit" may be displayed in a yellow anchor box superimposed on the image at the "hit". Alternatively, when the "dirt" abnormality is detected, the second detection result including the degree of certainty of "dirt" may be superimposed on the image with a blue anchor box at the "dirt" location.

「不良品-不良品判定」に分類された検査用の画像に対し、コンピュータ1は、それぞれの検査用の画像の各ピクセルの異常度に基づいて、それぞれの検査用の画像の異常度マップを生成する。コンピュータ1は、「不良品-不良品判定」である分類タブ18gに対応する検証結果表示欄18hに、生成したそれぞれの検査用の画像の異常度マップと合わせて、それぞれの検査用の画像に対応する異常箇所を示す第1検出結果及び第2検出結果を異常の種類に対応した色分けにより表示する。例えばコンピュータ1は、検査用の画像に対応する異常箇所を示す第1検出結果(例えば、未知不良)を赤のアンカーボックスで異常度マップと重ねて表示しても良い。または、コンピュータ1は、検査用の画像に対応する異常箇所を示す第2検出結果(例えば、打痕異常の確信度)を黄色のアンカーボックスで異常度マップと重ねて表示しても良い。 For the inspection images classified as "defective product-defective product judgment", the computer 1 creates an abnormality degree map for each inspection image based on the abnormality degree of each pixel of each inspection image. Generate. The computer 1 displays the verification result display field 18h corresponding to the classification tab 18g "defective product-defective product judgment", together with the generated abnormality degree map of each inspection image, to each inspection image. The first detection result and the second detection result indicating the corresponding abnormal location are displayed in different colors corresponding to the type of abnormality. For example, the computer 1 may display a first detection result (for example, an unknown defect) indicating an abnormal location corresponding to the inspection image so as to be superimposed on the abnormality degree map with a red anchor box. Alternatively, the computer 1 may display the second detection result (for example, the degree of certainty of the dent abnormality) indicating the abnormal location corresponding to the inspection image, superimposed on the abnormality degree map in a yellow anchor box.

図28は、良品学習モデル171と異常検出モデル173とを併用して検査対象物の異常を検出する運用モード画面の一例を示す説明図である。なお、図25及び図27と重複する内容については同一の符号を付して説明を省略する。該運用モード画面は、良品学習モデル設定入力欄19a及び運用ボタン19bを含む。 FIG. 28 is an explanatory diagram showing an example of an operation mode screen for detecting an abnormality in an inspection target using both the non-defective product learning model 171 and the abnormality detection model 173. FIG. 25 and 27 are denoted by the same reference numerals, and description thereof will be omitted. The operation mode screen includes a non-defective product learning model setting input field 19a and an operation button 19b.

良品学習モデル設定入力欄19aは、学習済みの良品学習モデル171ファイルの選択、検査対象物の領域に基づいて作成されたテンプレート画像と運用の画像との一致度の閾値、異常度の閾値及び面積閾値の入力を受け付ける設定入力欄である。コンピュータ1は、良品学習モデル設定入力欄19aの設定操作を受け付けた場合、学習済みの良品学習モデル171ファイルの選択、一致度の閾値、異常度の閾値及び面積閾値の入力を受け付ける。 The non-defective product learning model setting input field 19a is used to select a learned non-defective product learning model 171 file, a threshold for the degree of matching between the template image created based on the area of the inspection object and the operation image, the threshold for the degree of abnormality, and the area. This is a setting input field for receiving input of a threshold value. When the computer 1 accepts a setting operation in the non-defective product learning model setting input field 19a, the computer 1 accepts selection of a learned non-defective product learning model 171 file, input of a matching threshold, an abnormality threshold, and an area threshold.

運用ボタン19bは、検査対象物の異常の有無を検出するボタンである。コンピュータ1は、運用ボタン19bのタッチ操作を受け付けた場合、検査対象物を含む運用の画像を取得する。具体的には、コンピュータ1は、監視方法選択ラジオボタン17aにより選択された監視方法が「フォルダ監視」である場合、監視フォルダ選択ボタン17bにより選択された監視対象フォルダに記憶された運用の画像を取得する。コンピュータ1は、監視方法選択ラジオボタン17aにより選択された監視方法が「カメラ監視」である場合、カメラ選択コンボボックス17cにより選択された監視用の撮像装置2によりリアルタイムで撮像した動画を取得する。 The operation button 19b is a button for detecting the presence or absence of abnormality in the inspection object. When the computer 1 receives a touch operation on the operation button 19b, the computer 1 acquires an operation image including the inspection object. Specifically, when the monitoring method selected by the monitoring method selection radio button 17a is "folder monitoring", the computer 1 displays the operation image stored in the monitoring target folder selected by the monitoring folder selection button 17b. get. When the monitoring method selected by the monitoring method selection radio button 17a is "camera monitoring", the computer 1 obtains a moving image captured in real time by the monitoring imaging device 2 selected by the camera selection combo box 17c.

コンピュータ1は、良品学習モデル設定入力欄19aにより選択された学習済みの良品学習モデル171に、取得した運用の画像を入力して該運用の画像に対応する再構成画像を出力する。コンピュータ1は、取得した運用の画像と、良品学習モデル171が出力した該運用の画像に対応する再構成画像との異常度を算出する。コンピュータ1は、算出した異常度に基づいて検査対象物の異常の有無を示す第1検出結果を検出する。コンピュータ1は、異常検出モデル設定入力欄18bにより選択された異常検出モデル173に、取得した運用の画像を入力して該運用の画像に対応する検査対象物の異常の有無を示す第2検出結果を検出する。 The computer 1 inputs the obtained operating image to the learned non-defective product learning model 171 selected by the non-defective product learning model setting input field 19a, and outputs a reconstructed image corresponding to the operational image. The computer 1 calculates the degree of abnormality between the obtained operation image and the reconstructed image corresponding to the operation image output by the non-defective product learning model 171 . The computer 1 detects a first detection result indicating whether or not there is an abnormality in the inspection object based on the calculated degree of abnormality. The computer 1 inputs the acquired operation image to the abnormality detection model 173 selected by the abnormality detection model setting input field 18b, and a second detection result indicating whether or not there is an abnormality in the inspection object corresponding to the operation image. to detect

コンピュータ1は、第1検出結果から検査対象物の異常を検出したと判定した場合、該運用の画像の各ピクセルの異常度に基づいて運用の画像の異常度マップを生成する。コンピュータ1は、生成した運用の画像の異常度マップと合わせて第1検出結果及び第2検出結果を検証結果表示欄18hに表示する。コンピュータ1は、第1検出結果から検査対象物の異常を検出していないと判定した場合、該運用の画像と合わせて第1検出結果及び第2検出結果を検証結果表示欄18hに表示する。 When the computer 1 determines that an abnormality in the inspection object is detected from the first detection result, the computer 1 generates an abnormality degree map of the operational image based on the degree of abnormality of each pixel of the operational image. The computer 1 displays the first detection result and the second detection result in the verification result display column 18h together with the generated abnormality degree map of the operation image. When the computer 1 determines from the first detection result that no abnormality has been detected in the inspection object, it displays the first detection result and the second detection result in the verification result display column 18h together with the operation image.

図29及び図30は、良品学習モデル171と異常検出モデル173とを併用して検査対象物の異常を検出する際の処理手順を示すフローチャートである。コンピュータ1の制御部11は、検査対象物を含む画像を取得する(ステップS31)。例えば、検査対象物を含む画像が記憶部12または大容量記憶部17に記憶されている場合、制御部11は記憶部12または大容量記憶部17から画像を取得する。 FIGS. 29 and 30 are flow charts showing a processing procedure for detecting an abnormality in an inspection object using both the non-defective product learning model 171 and the abnormality detection model 173. FIG. The control unit 11 of the computer 1 acquires an image including the inspection object (step S31). For example, when an image including an inspection object is stored in the storage unit 12 or the large-capacity storage unit 17 , the control unit 11 acquires the image from the storage unit 12 or the large-capacity storage unit 17 .

制御部11は、画像を検証するための異常度の閾値及び面積閾値の設定を入力部14により受け付ける(ステップS32)。制御部11は、各種の異常の確信度の閾値の設定を入力部14により受け付ける(ステップS33)。制御部11は、検査対象物の領域に基づいて作成されたテンプレート画像と、取得した画像との一致度の閾値の設定を入力部14により受け付ける(ステップS34)。 The control unit 11 receives through the input unit 14 settings of an abnormality threshold and an area threshold for verifying the image (step S32). The control unit 11 receives the setting of the threshold value of the certainty of various types of abnormality through the input unit 14 (step S33). The control unit 11 receives through the input unit 14 the setting of the threshold for the degree of matching between the template image created based on the region of the inspection object and the acquired image (step S34).

制御部11は、SSD等のテンプレートマッチング手法を用いて、テンプレート画像と取得した画像との一致度を算出する(ステップS35)。制御部11は、算出した一致度が、受け付けた一致度の閾値を超えたか否かを判定する(ステップS36)。制御部11は、算出した一致度が一致度の閾値を超えていないと判定した場合(ステップS36でNO)、ステップS31の処理に戻る。制御部11は、算出した一致度が一致度の閾値を超えたと判定した場合(ステップS36でYES)、取得した画像を学習済みの良品学習モデル171に入力して該画像に対応する再構成画像を出力する(ステップS37)。 The control unit 11 uses a template matching technique such as SSD to calculate the degree of matching between the template image and the acquired image (step S35). The control unit 11 determines whether or not the calculated matching degree exceeds the received matching degree threshold (step S36). When determining that the calculated degree of matching does not exceed the threshold value of the degree of matching (NO in step S36), the control unit 11 returns to the process of step S31. When the control unit 11 determines that the calculated degree of matching exceeds the threshold value of the degree of matching (YES in step S36), the control unit 11 inputs the acquired image to the learned non-defective product learning model 171 to generate a reconstructed image corresponding to the image. is output (step S37).

制御部11は、取得した画像と、良品学習モデル171が出力した再構成画像との各ピクセルの異常度を算出する(ステップS38)。制御部11は、算出した各ピクセルの異常度が異常度の閾値(例えば、50)を超えた該画像の領域のうち、異常度が閾値を超えたピクセル数を集計する(ステップS39)。制御部11は、集計したピクセル数(領域の面積)が、受け付けた面積閾値(例えば、30ピクセル)を超えたか否かを判定する(ステップS40)。 The control unit 11 calculates the degree of abnormality of each pixel in the acquired image and the reconstructed image output by the non-defective product learning model 171 (step S38). The control unit 11 tallies the number of pixels whose abnormality degree exceeds the threshold value (step S39), from among the regions of the image in which the calculated abnormality degree of each pixel exceeds the abnormality degree threshold value (for example, 50). The control unit 11 determines whether or not the counted number of pixels (the area of the region) exceeds the received area threshold value (for example, 30 pixels) (step S40).

制御部11は、該領域の面積が面積閾値を超えたと判定した場合(ステップS40でYES)、異常ありと判定し(ステップS41)、後述するステップS43の処理に遷移する。制御部11は、該領域の面積が面積の閾値を超えていないと判定した場合(ステップS40でNO)、異常なしと判定する(ステップS42)。制御部11は、異常の判定結果に基づいて第1検出結果を検出する(ステップS43)。第1検出結果には、異常が写っている領域の範囲等が含まれている。 When determining that the area of the region exceeds the area threshold (YES in step S40), the control unit 11 determines that there is an abnormality (step S41), and transitions to the processing of step S43 described later. If the control unit 11 determines that the area of the region does not exceed the area threshold (NO in step S40), it determines that there is no abnormality (step S42). The control unit 11 detects the first detection result based on the abnormality determination result (step S43). The first detection result includes, for example, the range of the area where the abnormality is shown.

制御部11は、ステップS31の処理で取得した画像を異常検出モデル173に入力する(ステップS44)。制御部11は、受け付けた各種の異常の確信度の閾値に基づき、学習済みの異常検出モデル173を用いて検査対象物の異常の有無を示す第2検出結果を検出する(ステップS45)。第2検出結果には、異常が写っていると分類された領域候補の範囲、および、異常が写っている確信度等が含まれている。 The control unit 11 inputs the image acquired in the process of step S31 to the abnormality detection model 173 (step S44). The control unit 11 uses the learned abnormality detection model 173 to detect a second detection result indicating the presence or absence of an abnormality in the inspection target based on the received thresholds of certainty of various types of abnormality (step S45). The second detection result includes the area candidate range classified as containing an abnormality, the degree of certainty that the abnormality is contained, and the like.

制御部11は、検出した第1検出結果から検査対象物の異常を検出したか否かを判定する(ステップS46)。制御部11は、第1検出結果から異常を検出したと判定した場合(ステップS46でYES)、画像の各ピクセルの異常度に基づいて該画像の異常度マップを生成する(ステップS47)。制御部11は、生成した画像の異常度マップと、検出した第1検出結果及び第2検出結果とを表示部15により表示し(ステップS48)、処理を終了する。制御部11は、第1検出結果から異常を検出していないと判定した場合(ステップS46でNO)、該画像と、検出した第1検出結果及び第2検出結果とを表示部15により表示し(ステップS49)、処理を終了する。なお、第1検出結果から異常が検出されていない場合、制御部11は、画像の異常度マップと、検出した第1検出結果及び第2検出結果とを表示しても良い。 The control unit 11 determines whether or not an abnormality of the inspection object is detected from the detected first detection result (step S46). When determining that an abnormality is detected from the first detection result (YES in step S46), the control unit 11 generates an abnormality degree map of the image based on the degree of abnormality of each pixel of the image (step S47). The control unit 11 displays the generated abnormality degree map of the image and the detected first detection result and second detection result on the display unit 15 (step S48), and ends the process. When the control unit 11 determines that no abnormality is detected from the first detection result (NO in step S46), the display unit 15 displays the image and the detected first detection result and second detection result. (Step S49), the process ends. Note that when no abnormality is detected from the first detection result, the control unit 11 may display an abnormality degree map of the image and the detected first detection result and second detection result.

図31は、検査対象物を含む画像を検証する際の処理手順を示すフローチャートである。コンピュータ1の制御部11は、検査対象物を含む複数の画像を記憶部12または大容量記憶部17から取得する(ステップS61)。制御部11は入力部14を介して、学習済みの良品学習モデル171の選択を受け付ける(ステップS62)。具体的には、制御部11は、AIモデルファイル選択ボタンのタッチ操作を受け付けた場合、学習済みの良品学習モデル171のファイルを大容量記憶部17の学習モデル管理DB172から取得する。制御部11は、取得した学習済みの良品学習モデル171を表示する。制御部11は、ユーザによる良品学習モデル171の選択を受け付ける。制御部11は入力部14を介して、異常検出モデル173の選択を受け付ける(ステップS63)。 FIG. 31 is a flow chart showing a processing procedure for verifying an image including an inspection object. The control unit 11 of the computer 1 acquires a plurality of images including the inspection object from the storage unit 12 or the large-capacity storage unit 17 (step S61). The control unit 11 receives selection of the learned non-defective product learning model 171 via the input unit 14 (step S62). Specifically, the control unit 11 acquires the file of the learned non-defective product learning model 171 from the learning model management DB 172 of the large-capacity storage unit 17 when the touch operation of the AI model file selection button is received. The control unit 11 displays the learned non-defective product learning model 171 that has been acquired. The control unit 11 accepts selection of the non-defective product learning model 171 by the user. The control unit 11 receives selection of the abnormality detection model 173 via the input unit 14 (step S63).

制御部11は、選択された良品学習モデル171に基づき、取得したそれぞれの画像に対応する検査対象物の異常の有無を示す第1検出結果を検出する(ステップS64)。制御部11は、選択された異常検出モデル173に基づき、取得したそれぞれの画像に対応する検査対象物の異常の有無を示す第2検出結果を検出する(ステップS65)。なお、第1検出結果及び第2検出結果の検出処理に関しては、上述した処理と同様であるため、説明を省略する。 Based on the selected non-defective product learning model 171, the control unit 11 detects a first detection result indicating the presence or absence of an abnormality in the inspection object corresponding to each acquired image (step S64). Based on the selected abnormality detection model 173, the control unit 11 detects a second detection result indicating the presence or absence of an abnormality in the inspection object corresponding to each acquired image (step S65). It should be noted that the detection processing of the first detection result and the second detection result is the same as the processing described above, so the description is omitted.

制御部11は、「良品-良品判定」、「良品-不良品判定」、「不良品-良品判定」及び「不良品-不良品判定」を含む分類情報に基づき、第1検出結果及び第2検出結果に応じて複数の画像を分類する(ステップS66)。制御部11は、分類情報に基づいて作成された分類タブ(例えば、「良品-良品判定」タブ、「良品-不良品判定」タブ、「不良品-良品判定」タブまたは「不良品-不良品判定」タブ)の選択を入力部14により受け付ける(ステップS67)。なお、ユーザによる分類タブの選択に限るものではない。例えば「良品-不良品判定」タブをディフォルトタブとして設定しても良い。 The control unit 11 determines the first detection result and the second A plurality of images are classified according to the detection result (step S66). The control unit 11 selects a classification tab created based on the classification information (for example, a "non-defective product-defective product judgment" tab, a "non-defective product-defective product judgment" tab, a "defective product-non-defective product judgment" tab, or a "defective product-defective product Judgment” tab) is accepted by the input unit 14 (step S67). It should be noted that the selection is not limited to the selection of the classification tab by the user. For example, the "non-defective product-defective product judgment" tab may be set as the default tab.

制御部11は、選択された分類タブに応じて、分類した画像から該当する単一または複数の画像を取得する(ステップS68)。制御部11は、選択された分類タブが「不良品-良品判定」または「不良品-不良品判定」であるか否かを判定する(ステップS69)。制御部11は、選択された分類タブが「不良品-良品判定」または「不良品-不良品判定」であると判定した場合(ステップS69でYES)、該分類に応じて取得したそれぞれの画像の各ピクセルの異常度に基づいて、それぞれの画像の異常度マップを生成する(ステップS70)。 The control unit 11 acquires a single or multiple images from the classified images according to the selected classification tab (step S68). The control unit 11 determines whether or not the selected classification tab is “defective product-defective product determination” or “defective product-defective product determination” (step S69). When the control unit 11 determines that the selected classification tab is “defective product-defective product determination” or “defective product-defective product determination” (YES in step S69), each image acquired according to the classification is displayed. An abnormality degree map for each image is generated based on the degree of abnormality for each pixel in the image (step S70).

制御部11は、選択された分類タブが「不良品-不良品判定」であるか否かを判定する(ステップS71)。制御部11は、分類タブが「不良品-不良品判定」であると判定した場合(ステップS71でYES)、「不良品-不良品判定」分類に対応するそれぞれの画像の異常度マップと、検出した第1検出結果及び第2検出結果とを表示部15により表示し(ステップS72)、処理を終了する。制御部11は、分類タブが「不良品-不良品判定」でないと判定した場合(ステップS71でNO)、「不良品-良品判定」分類に対応するそれぞれの画像の異常度マップと、検出した第1検出結果とを表示部15により表示し(ステップS73)、処理を終了する。 The control unit 11 determines whether or not the selected classification tab is "defective product-defective product determination" (step S71). When the control unit 11 determines that the classification tab is “defective product-defective product determination” (YES in step S71), the abnormality degree map of each image corresponding to the “defective product-defective product determination” classification, The detected first detection result and second detection result are displayed on the display unit 15 (step S72), and the process ends. When the control unit 11 determines that the classification tab is not “defective product-defective product determination” (NO in step S71), the abnormality degree map of each image corresponding to the “defective product-good product determination” classification and the detected The first detection result is displayed on the display unit 15 (step S73), and the process ends.

制御部11は、選択された分類タブが「不良品-良品判定」または「不良品-不良品判定」以外であると判定した場合(ステップS69でNO)、選択された分類タブが「良品-不良品判定」であるか否かを判定する(ステップS74)。制御部11は、選択された分類タブが「良品-不良品判定」であると判定した場合(ステップS74でYES)、「良品-不良品判定」分類に対応するそれぞれの画像と、検出した第2検出結果とを表示部15により表示し(ステップS75)、処理を終了する。制御部11は、選択された分類タブが「良品-不良品判定」でないと判定した場合(ステップS74でNO)、「良品-良品判定」分類に対応するそれぞれの画像を表示部15により表示し(ステップS76)、処理を終了する。 If the control unit 11 determines that the selected classification tab is other than "defective product-defective product determination" or "defective product-defective product determination" (NO in step S69), the selected classification tab is "defective product- It is determined whether or not it is "defective product determination" (step S74). When the control unit 11 determines that the selected classification tab is “non-defective product determination” (YES in step S74), each image corresponding to the “non-defective product-defective product determination” classification and the detected number 2 detection results are displayed on the display unit 15 (step S75), and the process ends. When the control unit 11 determines that the selected classification tab is not “non-defective-defective product determination” (NO in step S74), the display unit 15 displays images corresponding to the “defective-defective product determination” classification. (Step S76), the process ends.

図32は、見落とし画像を用いて異常検出モデル173を学習させる際の処理手順を示すフローチャートである。見落とし画像は、良品学習モデル171に基づいて画像から検査対象物の異常が検出されていないが、検査員の検査(例えば、目視検査)により該検査対象物の異常を検出した画像である。 FIG. 32 is a flowchart showing a processing procedure for learning the abnormality detection model 173 using an overlooked image. An oversight image is an image in which an abnormality of an inspection object is not detected from the image based on the non-defective product learning model 171, but an abnormality of the inspection object is detected by an inspector's inspection (for example, visual inspection).

コンピュータ1の制御部11は、検証対象となる複数の画像を記憶部12または大容量記憶部17から取得する(ステップS81)。制御部11は、良品学習モデル171に基づいて、取得したそれぞれの画像に対応する検査対象物の異常の有無を示す第1検出結果を検出する(ステップS82)。制御部11は、検証対象となる複数の画像から一つの画像を取得する(ステップS83)。 The control unit 11 of the computer 1 acquires a plurality of images to be verified from the storage unit 12 or the large-capacity storage unit 17 (step S81). Based on the non-defective product learning model 171, the control unit 11 detects a first detection result indicating the presence or absence of an abnormality in the inspection object corresponding to each acquired image (step S82). The control unit 11 acquires one image from a plurality of images to be verified (step S83).

制御部11は、取得した画像に対応する第1検出結果から異常を検出したか否かを判定する(ステップS84)。制御部11は、異常を検出したと判定した場合(ステップS84でYES)、ステップS83の処理に戻り、次の画像を取得する。制御部11は、異常を検出していないと判定した場合(ステップS84でNO)、検査員により該画像が見落とし画像であるか否かの判断結果の入力を入力部14により受け付ける(ステップS85)。なお、検査員が該画像に対して記憶部12または大容量記憶部17(フォルダ)に手動で振り分けても良い。 The control unit 11 determines whether or not an abnormality is detected from the first detection result corresponding to the acquired image (step S84). When determining that an abnormality is detected (YES in step S84), the control unit 11 returns to the process of step S83 and acquires the next image. When the control unit 11 determines that no abnormality is detected (NO in step S84), the input unit 14 receives the input of the result of determination by the inspector as to whether or not the image is an overlooked image (step S85). . Note that the inspector may manually distribute the images to the storage unit 12 or the large-capacity storage unit 17 (folder).

制御部11は、検査員から入力された判断結果に基づき、該画像が見落とし画像であるか否かを判定する(ステップS86)。制御部11は、該画像が見落とし画像でないと判定した場合(ステップS86でNO)、ステップS83の処理に戻る。制御部11は、該画像が見落とし画像であると判定した場合(ステップS86でYES)、検査員により該見落とし画像に対応する検査対象物の異常有りを示す情報の入力を入力部14により受け付ける(ステップS87)。異常有りを示す情報は、異常の種類(例えば、打痕、汚れまたは傷)、及び異常が写っている領域の範囲(座標)等を含む。 The control unit 11 determines whether or not the image is an overlooked image based on the determination result input by the inspector (step S86). When the control unit 11 determines that the image is not an overlooked image (NO in step S86), the process returns to step S83. When the control unit 11 determines that the image is an overlooked image (YES in step S86), the input unit 14 receives information input by the inspector indicating that there is an abnormality in the inspection object corresponding to the overlooked image ( step S87). The information indicating the presence of abnormality includes the type of abnormality (for example, dent, stain, or scratch), the range (coordinates) of the area in which the abnormality is shown, and the like.

制御部11は、検証対象となる複数の画像中で該画像が最後であるか否かを判定する(ステップS88)。制御部11は、該画像が最後でないと判定した場合(ステップS88でNO)、ステップS83の処理に戻る。制御部11は、該画像が最後であると判定した場合(ステップS88でYES)、該画像と、受け付けた該画像に対応する検査対象物の異常有りを示す情報とが対応付けられた訓練データを作成する(ステップS89)。 The control unit 11 determines whether or not the image is the last among the plurality of images to be verified (step S88). If the control unit 11 determines that the image is not the last image (NO in step S88), the process returns to step S83. When the control unit 11 determines that the image is the last one (YES in step S88), the training data in which the image and the information indicating the presence of an abnormality in the inspection object corresponding to the received image are associated with each other. (step S89).

制御部11は、作成した訓練データを用いて異常検出モデル173を学習(再学習)させる(ステップS90)。なお、異常検出モデル173の学習処理に関しては、実施形態5での異常検出モデル173の学習処理と同様であるため、説明を省略する。制御部11は、学習させた異常検出モデル173を用いて大容量記憶部17の学習モデル管理DB172を更新し(ステップS91)、処理を終了する。 The control unit 11 uses the created training data to learn (re-learn) the abnormality detection model 173 (step S90). Note that the learning process of the abnormality detection model 173 is the same as the learning process of the abnormality detection model 173 in the fifth embodiment, so the explanation is omitted. The control unit 11 updates the learning model management DB 172 of the large-capacity storage unit 17 using the learned abnormality detection model 173 (step S91), and terminates the process.

なお、見落とし画像を用いて異常検出モデル173を学習させる処理のほか、過検出画像を用いて異常検出モデル173を学習させることができる。過検出画像は、実施形態1の異常検出処理で良品学習モデル171に基づいて画像から検査対象物の異常が検出されたが、検査員の検査(例えば、目視検査)により該検査対象物の異常を検出していない画像である。コンピュータ1は、取得した過検出画像と、検査員から入力された過検出画像に対応する検査対象物の正常を示す情報とを訓練データとして、異常検出モデル173の学習を行う。 In addition to the process of learning the abnormality detection model 173 using the overlooked image, the abnormality detection model 173 can be learned using the overdetected image. An overdetected image is an image in which an abnormality of an inspection object is detected based on the non-defective product learning model 171 in the abnormality detection processing of the first embodiment, but an inspection by an inspector (for example, visual inspection) reveals an abnormality of the inspection object. is not detected. The computer 1 learns the abnormality detection model 173 using the acquired overdetected images and information indicating normality of the inspection object corresponding to the overdetected images input by the inspector as training data.

具体的には、コンピュータ1は、良品学習モデル171に基づいて検査対象物の異常を検出した過検出画像を取得する。コンピュータ1は、取得した過検出画像に対し、該過検出画像に対応する検査対象物の正常を示す情報(例えば、「正常」または「異常なし」等のラベル)を設定する設定入力を受け付ける。コンピュータ1は、取得した過検出画像と、受け付けた該過検出画像に対応する検査対象物の正常を示す情報とが対応付けられた訓練データを作成する。過検出画像を訓練データとすることにより、本システムを継続するほど異常検出モデル173がアップデートされ、より正確な異常検出を行うことができるようになる。 Specifically, the computer 1 acquires an overdetected image in which an abnormality of the inspection object is detected based on the non-defective product learning model 171 . The computer 1 receives a setting input for setting information (for example, a label such as "normal" or "no abnormality") indicating the normality of the inspection object corresponding to the acquired overdetected image. The computer 1 creates training data in which the acquired overdetected image and the information indicating the normality of the inspection object corresponding to the received overdetected image are associated with each other. By using overdetected images as training data, the more the system is continued, the more the anomaly detection model 173 is updated, and more accurate anomaly detection can be performed.

また、上述した処理のほか、異常検出モデル173に基づいて検査対象物の異常を検出した過検出画像を用いて、良品学習モデル171を学習させることができる。具体的には、コンピュータ1は、異常検出モデル173に基づいて異常を検出した過検出画像を取得する。コンピュータ1は、例えばオートエンコーダまたはVAE等を用いて、取得した過検出画像を正常画像として良品学習モデル171を学習させる。なお、良品学習モデル171の学習処理に関しては、実施形態1と同様であるため、説明を省略する。このような学習処理を実行することにより、過検出となった異常箇所を正常とみなすようにして検出精度を高めることが可能となる。 In addition to the processing described above, the non-defective product learning model 171 can be learned using an over-detected image obtained by detecting an abnormality in the inspection object based on the abnormality detection model 173 . Specifically, the computer 1 acquires an overdetected image in which an abnormality is detected based on the abnormality detection model 173 . The computer 1 uses an autoencoder, a VAE, or the like, for example, to learn the non-defective product learning model 171 using the acquired overdetected image as a normal image. Note that the learning process of the non-defective product learning model 171 is the same as that of the first embodiment, so the description is omitted. By executing such a learning process, it is possible to improve the detection accuracy by regarding an over-detected abnormal portion as being normal.

更にまた、コンピュータ1は、異常検出モデル173に基づいて検査対象物の異常の検出処理を実行した後に、良品学習モデル171に基づいて異常の検出処理を実行しても良い。このような処理順序に従い、異常検出モデル173が検出していない異常を、正常画像に基づいて学習させた良品学習モデル171に基づいて検出することが可能となる。 Furthermore, the computer 1 may execute the abnormality detection process based on the non-defective product learning model 171 after executing the abnormality detection process of the inspection object based on the abnormality detection model 173 . According to such a processing order, an abnormality that is not detected by the abnormality detection model 173 can be detected based on the non-defective product learning model 171 learned based on normal images.

本実施形態によると、良品学習モデル171と異常検出モデル173とを併用して検査対象物の異常の有無を検出することにより、画像検査重要所見の見落としを防ぐことが可能となる。 According to this embodiment, by detecting the presence/absence of an abnormality in an inspection target using both the non-defective product learning model 171 and the abnormality detection model 173, it is possible to prevent overlooking of important findings in image inspection.

<変形例1>
図33は、変形例1の検査対象物の異常を検出する検証モード画面の一例を示す説明図である。なお、図27と重複する内容については同一の符号を付して説明を省略する。該検証モード画面は、分類タブ18g、グラフ表示欄18i及び良品・不良品チェックボックス18jを含む。
<Modification 1>
FIG. 33 is an explanatory diagram showing an example of a verification mode screen for detecting anomalies in an inspection object according to Modification 1. FIG. 27 are assigned the same reference numerals, and descriptions thereof are omitted. The verification mode screen includes a classification tab 18g, a graph display field 18i, and good/defective check boxes 18j.

分類タブ18gは、第1検出結果と第2検出結果との対比関係からなる分類情報を切り替えるためのタブである。図示のように、分類情報は、良品-OK判定、不良品-NG判定、過検出及び未検出を含む。 The classification tab 18g is a tab for switching classification information consisting of a contrast relationship between the first detection result and the second detection result. As illustrated, the classification information includes non-defective-OK judgment, defective-NG judgment, overdetection and non-detection.

良品-OK判定は、画像に対応する検査対象物に対し、実際に良品でありOK(正)と判断された分類である。第1検出結果がOKであり、且つ、第2検出結果がOKであると判断された場合、該画像が「良品-OK判定」に分類される。不良品-NG判定は、画像に対応する検査対象物に対し、実際に不良品でありNG(誤)と判断された分類である。第1検出結果または第2検出結果のいずれか一方あるいは両方ともにNGであると判断された場合、該画像が「不良品-NG」に分類される。 The non-defective-OK determination is a classification in which an inspection object corresponding to an image is actually determined to be non-defective and OK (positive). When it is determined that the first detection result is OK and the second detection result is OK, the image is classified as "non-defective product-OK determination". Defective product-NG determination is a classification in which an inspection object corresponding to an image is actually determined to be defective and NG (erroneous). If either or both of the first detection result and the second detection result are determined to be NG, the image is classified as "defective product-NG".

過検出は、画像に対応する検査対象物に対し、実際に良品であるがNGと判断された分類である。第1検出結果または第2検出結果のいずれか一方あるいは両方ともにNGであると判断されたが、検査員によりOKと判断された場合、該画像が「過検出」に分類される。未検出は、画像に対応する検査対象物に対し、実際に不良品であるが不良品として検出されていない分類である。第1検出結果と第2検出結果の両方から不良品として検出されていないが、検査員により不良品として判断された場合、該画像が「未検出」に分類される。 Overdetection is a classification in which an object to be inspected corresponding to an image is judged to be NG even though it is actually a non-defective product. If either one or both of the first detection result and the second detection result are judged to be NG, but the inspector judges them to be OK, the image is classified as "overdetected." Undetected is a classification in which an object to be inspected corresponding to an image is actually defective but has not been detected as defective. If an image is not detected as a defective product from both the first detection result and the second detection result, but is judged as a defective product by the inspector, the image is classified as "undetected".

グラフ表示欄18iは、良品画像または不良品画像の分布を示すグラフを表示する表示欄である。良品・不良品チェックボックス18jは、集計対象となる良品画像または不良品画像の選択を受け付けるチェックボックスである。 The graph display column 18i is a display column for displaying a graph showing the distribution of non-defective product images or defective product images. The non-defective product/defective product check box 18j is a check box for accepting selection of a non-defective product image or a defective product image to be tabulated.

コンピュータ1は、検証ボタン18fのタッチ操作を受け付けた場合、良品フォルダ選択ボタン18cにより選択されたフォルダに記憶された良品画像、及び不良品フォルダ選択ボタン18dにより選択されたフォルダに記憶された不良品画像を取得する。コンピュータ1は、取得した良品画像及び不良品画像を含む検査用の画像に対応する検査対象物の異常の有無を示す第1検出結果及び第2検出結果を検出する。なお、第1検出結果及び第2検出結果の検出処理に関しては、上述した処理と同様であるため、説明を省略する。 When the computer 1 receives the touch operation of the verification button 18f, the image of the non-defective product stored in the folder selected by the non-defective product folder selection button 18c and the defective product image stored in the folder selected by the defective product folder selection button 18d are displayed. Get an image. The computer 1 detects a first detection result and a second detection result indicating whether or not there is an abnormality in the inspection object corresponding to the acquired inspection image including the non-defective product image and the defective product image. It should be noted that the detection processing of the first detection result and the second detection result is the same as the processing described above, so the description is omitted.

コンピュータ1は、良品-OK判定、不良品-NG判定、過検出及び未検出を含む分類情報に基づき、第1検出結果及び第2検出結果に応じて複数の検査用の画像を分類する。コンピュータ1は、それぞれの検査用の画像の各ピクセルの異常度に基づいて、それぞれの検査用の画像の異常度マップを生成する。コンピュータ1は、該当する分類タブ18gに対応する検証結果表示欄18hに、該分類に分類したそれぞれの検査用の画像の異常度マップと合わせて第1検出結果及び第2検出結果を表示する。なお、異常度マップに限定せず、検査用の画像と合わせて第1検出結果及び第2検出結果が表示されても良い。 The computer 1 classifies a plurality of inspection images according to the first detection result and the second detection result based on the classification information including non-defective product-OK judgment, defective product-NG judgment, over-detection and non-detection. The computer 1 generates an abnormality degree map of each inspection image based on the degree of abnormality of each pixel of each inspection image. The computer 1 displays the first detection result and the second detection result in the verification result display field 18h corresponding to the applicable classification tab 18g together with the abnormality degree map of each inspection image classified into the classification. In addition, the first detection result and the second detection result may be displayed together with the image for inspection without being limited to the degree of abnormality map.

具体的には、第1検出結果から異常が検出された場合、例えばコンピュータ1は、検査用の画像に対応する異常箇所を示す第1検出結果(例えば、未知不良)を赤のアンカーボックスで異常度マップと重ねて表示しても良い。または、コンピュータ1は、各ピクセルの異常度が閾値を超えた該画像の領域に対して任意の閉曲線(両端が一致している連続曲線)で表示しても良い。 Specifically, when an abnormality is detected from the first detection result, for example, the computer 1 displays the first detection result (for example, an unknown defect) indicating an abnormal location corresponding to the inspection image as an abnormality in a red anchor box. It may be superimposed on the degree map and displayed. Alternatively, the computer 1 may display an arbitrary closed curve (a continuous curve whose both ends are the same) for the region of the image in which the degree of abnormality of each pixel exceeds the threshold.

第2検出結果から異常が検出された場合、コンピュータ1は、それぞれの検査用の画像の異常度マップと合わせて、それぞれの検査用の画像に対応する異常箇所を示す第2検出結果を異常の種類に対応した色分けにより表示する。例えば、「打痕」異常が検出された場合、「打痕」の確信度等を含む第2検出結果を「打痕」の箇所に黄色のアンカーボックスで画像と重ねて表示しても良い。または、「汚れ」異常が検出された場合、「汚れ」の確信度等を含む第2検出結果を「汚れ」の箇所に青のアンカーボックスで画像と重ねて表示しても良い。 When an abnormality is detected from the second detection result, the computer 1 generates a second detection result indicating an abnormal location corresponding to each inspection image together with an abnormality degree map of each inspection image. It is displayed by color-coding corresponding to the type. For example, when a "hit" abnormality is detected, the second detection result including the certainty of the "hit" may be displayed in a yellow anchor box superimposed on the image at the "hit". Alternatively, when the "dirt" abnormality is detected, the second detection result including the degree of certainty of "dirt" may be superimposed on the image with a blue anchor box at the "dirt" location.

また、第1検出結果と第2検出結果との対比を示す情報をテキスト形式で表示することができる。例えば、検出結果の正誤を示す「OK」または「NG」ラベルを画像と共に画面に表示しても良い。図示のように、コンピュータ1は、第1検出結果と第2検出結果の両方が誤である場合、第1検出結果を示す「NG」と第2検出結果を示す「NG」とを対比して表示する。コンピュータ1は、第1検出結果が正であり、且つ、第2検出結果が誤である場合、第1検出結果を示す「NG」と第2検出結果を示す「OK」とを対比して表示する。 Also, information indicating a comparison between the first detection result and the second detection result can be displayed in text format. For example, an "OK" or "NG" label indicating whether the detection result is correct or not may be displayed on the screen together with the image. As illustrated, when both the first detection result and the second detection result are erroneous, the computer 1 compares "NG" indicating the first detection result with "NG" indicating the second detection result. indicate. When the first detection result is positive and the second detection result is incorrect, the computer 1 displays "NG" indicating the first detection result and "OK" indicating the second detection result in contrast. do.

コンピュータ1は、第1検出結果及び第2検出結果に基づいて良品画像または不良品画像の分布を示すフラフを生成する。グラフは、異常度の分布グラフ及び異常度を超えた面積の分布グラフを含む。異常度の分布グラフは、良品-OK判定、不良品-NG判定、過検出及び未検出を含む分類ごとに、異常度に基づいて良品画像または不良品画像の分布を示すグラフである。面積の分布グラフは、良品-OK判定、不良品-NG判定、過検出及び未検出を含む分類ごとに、異常度を超えた面積に基づいて良品画像または不良品画像の分布を示すグラフである。 The computer 1 generates a fluff showing the distribution of good product images or bad product images based on the first detection result and the second detection result. The graph includes an abnormality distribution graph and an area distribution graph exceeding the abnormality degree. The degree-of-abnormality distribution graph is a graph showing the distribution of non-defective product images or defective product images based on the degree of abnormality for each classification including non-defective product-OK determination, defective product-NG determination, overdetection, and non-detection. The area distribution graph is a graph showing the distribution of non-defective product images or defective product images based on the area exceeding the degree of abnormality for each classification including non-defective product-OK judgment, defective product-NG judgment, overdetection and non-detection. .

図33では、異常度の分布グラフを例示している。コンピュータ1は、異常度の分布の集計対象となる良品画像または不良品画像の選択を良品・不良品チェックボックス18jにより受け付ける。コンピュータ1は、検出した第1検出結果及び第2検出結果に基づき、受け付けた良品画像または不良品画像に対して異常度の分布を示すヒストグラムを生成する。 FIG. 33 illustrates a distribution graph of the degree of abnormality. The computer 1 accepts the selection of the non-defective product image or the defective product image for which the distribution of the degree of abnormality is to be tabulated by using the non-defective product/defective product check box 18j. Based on the detected first detection result and second detection result, the computer 1 generates a histogram showing the distribution of the degree of abnormality for the received non-defective product image or defective product image.

図示のように、ヒストグラムの横軸は異常度の値(Anomaly Value)を示し、縦軸は画像の枚数(Count)を示す。コンピュータ1は、設定された異常度の閾値(Threshold)に応じて、良品・不良品チェックボックス18jにより受け付けた不良品画像に基づいて、良品-OK判定、不良品-NG判定、過検出及び未検出を含む分類情報に応じて各分類に分類すべき不良品画像の枚数を集計する。コンピュータ1は、分類ごとに集計した不良品画像の枚数に基づいてヒストグラムを生成する。コンピュータ1は、生成したヒストグラムをグラフ表示欄18iに表示する。図示のように、例えば第1検出結果がOKと判定され(異常度の閾値以下)、且つ、第2検出結果がNGと判定された場合、ヒストグラムには右上りのハッチングで示されている。例えば第1検出結果がOKまたはNGと判定され、且つ、第2検出結果がOKと判定された場合、ヒストグラムには右下りのハッチングで示されている。例えば第1検出結果と第2検出結果の両方がOKと判定された場合、ヒストグラムにはハッチングなしで示されている。 As shown, the horizontal axis of the histogram indicates the value of the degree of anomaly (Anomaly Value), and the vertical axis indicates the number of images (Count). The computer 1, based on the defective product image received by the non-defective product/defective product check box 18j, determines the non-defective product-OK judgment, the defective product-NG judgment, the over-detection and the non-existence The number of defective product images to be classified into each classification is counted according to classification information including detection. The computer 1 generates a histogram based on the number of defective product images counted for each classification. The computer 1 displays the generated histogram in the graph display field 18i. As shown in the drawing, for example, when the first detection result is determined to be OK (below the threshold of the degree of abnormality) and the second detection result is determined to be NG, the histogram is indicated by hatching upward to the right. For example, when the first detection result is determined to be OK or NG and the second detection result is determined to be OK, the histogram is indicated by lower right hatching. For example, when both the first detection result and the second detection result are determined to be OK, the histogram is shown without hatching.

なお、図33では異常度の分布グラフを例示しているが、異常度を超えた面積に基づいて良品画像または不良品画像の分布グラフにも適用することができる。この場合、コンピュータ1は、異常度の閾値の代わりに、設定された面積閾値に基づいてヒストグラム生成しても良い。 Although FIG. 33 exemplifies the distribution graph of the degree of abnormality, it can also be applied to the distribution graph of the non-defective product image or the defective product image based on the area exceeding the degree of abnormality. In this case, the computer 1 may generate a histogram based on a set area threshold instead of the abnormality threshold.

なお、コンピュータ1は、第1検出結果及び第2検出結果に基づき、過検出率または未検出率を算出して画面に表示しても良い(図示なし)。具体的には、コンピュータ1は、良品画像枚数及び過検出画像枚数それぞれを集計し、集計した良品画像枚数と過検出画像枚数とに基づいて過検出率を算出する。コンピュータ1は、不良品画像枚数及び未検出画像枚数それぞれを集計し、集計した不良品画像枚数と未検出画像枚数とに基づいて未検出率を算出する。コンピュータ1は、算出した過検出率及び未検出率を画面に表示する。 Note that the computer 1 may calculate the overdetection rate or the non-detection rate based on the first detection result and the second detection result and display it on the screen (not shown). Specifically, the computer 1 counts the number of non-defective images and the number of overdetected images, and calculates the overdetection rate based on the counted number of nondefective images and the number of overdetected images. The computer 1 counts the number of defective product images and the number of undetected images, and calculates the non-detection rate based on the counted number of defective product images and the number of undetected images. The computer 1 displays the calculated over-detection rate and non-detection rate on the screen.

本変形例によると、異なる分類情報(良品-OK判定、不良品-NG判定、過検出及び未検出)に応じて、第1検出結果及び第2検出結果を表示することが可能となる。 According to this modification, it is possible to display the first detection result and the second detection result according to different classification information (non-defective product-OK judgment, defective product-NG judgment, overdetection and non-detection).

今回開示された実施形態はすべての点で例示であって、制限的なものではないと考えられるべきである。本発明の範囲は、上記した意味ではなく、特許請求の範囲によって示され、特許請求の範囲と均等の意味及び範囲内でのすべての変更が含まれることが意図される。 The embodiments disclosed this time are illustrative in all respects and should be considered not restrictive. The scope of the present invention is indicated by the scope of the claims rather than the meaning described above, and is intended to include all modifications within the scope and meaning equivalent to the scope of the claims.

1 情報処理装置(コンピュータ)
11 制御部
12 記憶部
13 通信部
14 入力部
15 表示部
16 読取部
17 大容量記憶部
171 良品学習モデル
172 学習モデル管理DB
173 異常検出モデル
174 画像枚数参照DB
1a 可搬型記憶媒体
1b 半導体メモリ
1P 制御プログラム
2 撮像装置
1 Information processing device (computer)
REFERENCE SIGNS LIST 11 control unit 12 storage unit 13 communication unit 14 input unit 15 display unit 16 reading unit 17 large-capacity storage unit 171 non-defective product learning model 172 learning model management DB
173 Abnormality detection model 174 Image number reference DB
1a portable storage medium 1b semiconductor memory 1P control program 2 imaging device

Claims (16)

学習モードまたは運用モードのいずれかの選択を受け付け、
学習モードが選択された場合に、検査対象物を含む学習用の画像を取得し、
教師なし学習により生成する第1学習モデルのハイパーパラメータの設定を受け付け、
受け付けた前記ハイパーパラメータに基づき、取得した前記学習用の画像を入力した場合に前記学習用の画像に対応する再構成画像を出力する前記第1学習モデルを生成し、
検査対象物を含む検査用の画像を取得し、
取得した検査用の画像を相互にオーバーラップする複数の小片画像に分割し、
分割した前記複数の小片画像を学習済みの前記第1学習モデルに入力し、前記第1学習モデルからそれぞれの小片画像の再構成画像を出力させ、
分割した前記複数の小片画像と、前記第1学習モデルが出力したそれぞれの小片画像に対応する再構成画像との各ピクセルの異常度を小片画像ごとに算出し、
小片画像ごとに算出した各ピクセルの異常度が足し込まれた回数を集計し、
集計した回数に基づき、ピクセルごとに平均異常度を算出し、
前記検査用の画像を検証するための異常度の閾値の設定を受け付け、
算出した平均異常度と、受け付けた前記異常度の閾値とに基づき、検出した異常画像を表示する
処理をコンピュータに実行させるプログラム。
accepts the choice of either learning mode or operational mode,
Acquire an image for learning including the inspection object when the learning mode is selected,
Accept settings of hyperparameters of the first learning model generated by unsupervised learning,
generating the first learning model that outputs a reconstructed image corresponding to the learning image when the acquired learning image is input based on the received hyperparameter;
Acquiring an image for inspection including the inspection object,
dividing the acquired inspection image into a plurality of overlapping small-piece images;
inputting the plurality of divided small piece images to the first learning model that has been trained, and outputting a reconstructed image of each small piece image from the first learning model;
calculating, for each small piece image, the degree of abnormality of each pixel in the plurality of divided small piece images and the reconstructed image corresponding to each of the small piece images output by the first learning model;
Aggregate the number of times the anomaly degree of each pixel calculated for each small piece image is added,
Based on the counted number of times, calculate the average anomaly degree for each pixel,
Receiving the setting of the threshold of the degree of abnormality for verifying the image for inspection,
A program for causing a computer to execute a process of displaying a detected abnormal image based on the calculated average degree of abnormality and the received threshold value of the degree of abnormality.
前記小片画像のサイズを複数特定し、
特定した前記小片画像のサイズごとに、画像を入力した場合に前記画像に対応する再構成画像を出力する第1学習モデルを生成する
処理を実行させる請求項に記載のプログラム。
identifying a plurality of sizes of the small piece image;
2. The program according to claim 1 , for generating a first learning model for outputting a reconstructed image corresponding to said image when an image is input for each size of said small piece image specified.
前記コンピュータのハードウェア構成、前記第1学習モデルのハイパーパラメータ、または前記小片画像のサイズの少なくとも1つに応じて、前記第1学習モデルに同時入力する小片画像の最大枚数を決定する
処理を実行させる請求項1又は2に記載のプログラム。
Determining the maximum number of small piece images to be simultaneously input to the first learning model according to at least one of the hardware configuration of the computer, the hyperparameter of the first learning model, and the size of the small piece images. 3. The program according to claim 1 or 2 , which causes
検査対象物を含む画像と前記画像に対応する再構成画像との各ピクセルの異常度を算出し、
算出した前記異常度に基づいて異常を検出する
処理を実行させる請求項1からまでのいずれかひとつに記載のプログラム。
Calculating the degree of abnormality of each pixel between an image containing the inspection object and a reconstructed image corresponding to the image,
The program according to any one of claims 1 to 3 , which executes a process of detecting an abnormality based on the calculated degree of abnormality.
各ピクセルの異常度のうち少なくとも1つが前記異常度の閾値を超えたと判定した場合、異常として検出する
処理を実行させる請求項1からまでのいずれかひとつに記載のプログラム。
5. The program according to any one of claims 1 to 4 , wherein when it is determined that at least one of the degrees of abnormality of each pixel exceeds the threshold value of the degree of abnormality, it is detected as an abnormality.
検査対象物の領域に基づいて作成されたテンプレート画像の選択を受け付け、
選択された前記テンプレート画像に基づき、検査対象物を認識した画像を前記画像から切り出して所定の画像フォルダに記憶し、
記憶した画像を前記第1学習モデルに入力する
処理を実行させる請求項1からまでのいずれかひとつに記載のプログラム。
accepting a selection of a template image created based on a region of the inspection object;
based on the selected template image, extracting an image of the inspection target from the image and storing it in a predetermined image folder;
6. The program according to any one of claims 1 to 5 , causing a process of inputting the stored image to the first learning model.
検査対象物の領域に基づいて作成されたテンプレート画像の選択を受け付け、
検査対象物を含む動画を取得し、
選択された前記テンプレート画像に基づき、前記検査対象物を認識した複数の画像を前記動画から切り出して所定の画像フォルダに記憶し、
記憶した画像を前記第1学習モデルに入力する
処理を実行させる請求項1からまでのいずれかひとつに記載のプログラム。
accepting a selection of a template image created based on a region of the inspection object;
Acquire a video containing the inspection object,
based on the selected template image, cutting out a plurality of images in which the inspection object is recognized from the moving image and storing them in a predetermined image folder;
7. The program according to any one of claims 1 to 6 , wherein the stored image is inputted to the first learning model.
前記第1学習モデルの名称、異常度の閾値、及び前記第1学習モデルに基づいて検出した異常画像を表示する
処理を実行させる請求項1からまでのいずれかひとつに記載のプログラム。
The program according to any one of claims 1 to 7 , which causes execution of a process of displaying an abnormal image detected based on the name of the first learning model, the threshold value of the degree of abnormality, and the first learning model.
運用モードの選択を受け付けた場合に、
学習済みの前記第1学習モデル、及び検査対象物を含む運用の画像が記憶されるフォルダの選択を受け付ける
処理を実行させる請求項1からまでのいずれかひとつに記載のプログラム。
When the selection of the operation mode is accepted,
9. The program according to any one of claims 1 to 8 , for executing a process of accepting selection of a folder in which operation images including the learned first learning model and an inspection object are stored.
前記フォルダに記憶された運用の画像と、前記第1学習モデルが出力した再構成画像との異常度に基づいて前記検査対象物の異常の有無を検出し、
検出した異常の有無を出力する
処理を実行させる請求項に記載のプログラム。
Detecting whether or not there is an abnormality in the inspection object based on the degree of abnormality between the operation image stored in the folder and the reconstructed image output by the first learning model,
10. The program according to claim 9 , which causes execution of a process of outputting presence/absence of the detected abnormality.
前記検査対象物の異常を検出したログデータを記憶する
処理を実行させる請求項又は10に記載のプログラム。
11. The program according to claim 9 or 10 , which causes execution of a process of storing log data in which an abnormality of the inspection object is detected.
異常画像が正しいか否かの入力を受け付け、
正しくないと入力された場合、前記異常画像に対して正常であることを示すデータを付与した第1訓練データを生成し、
正常画像が正しいか否かの入力を受け付け、
正しくないと入力された場合、前記正常画像に対して異常であることを示すデータを付与した第2訓練データを生成し、
生成した前記第1訓練データと前記第2訓練データとの組み合わせに基づき、画像を入力した場合に該画像に対応する異常情報を出力する第2学習モデルを生成する
処理を実行させる請求項1から11までのいずれかひとつに記載のプログラム。
Receiving input as to whether or not the abnormal image is correct,
If the input is incorrect, generating first training data with data indicating that the abnormal image is normal,
Receiving input as to whether or not the normal image is correct,
If the input is incorrect, generating second training data with data indicating that the normal image is abnormal;
generating a second learning model that outputs abnormality information corresponding to an image when an image is input based on the combination of the generated first training data and the second training data; 11. A program according to any one of 11 .
学習済みの前記第1学習モデル又は前記第2学習モデルの少なくとも一方の選択を受け付け、
受け付けた学習モデルを用いて検査対象物を含む画像の異常を検出する
処理を実行させる請求項12に記載のプログラム。
Accepting selection of at least one of the learned first learning model or the second learning model;
13. The program according to claim 12 , which executes a process of detecting an abnormality in an image including an inspection target using the received learning model.
前記検査用の画像の内、前記異常画像として検出されていない前記検査用の画像を取得し、
取得した前記検査用の画像に対し、異常有りを示す情報の入力を受け付け、
前記検査用の画像と、受け付けた前記異常有りを示す情報とが対応付けられた訓練データの組み合わせを複数取得し、
取得した前記訓練データの複数の組み合わせに基づき、検査用の画像を入力した場合に前記検査対象物の異常の有無を示す情報を出力する第2学習モデルを生成する
処理を実行させる請求項1から11までのいずれかひとつに記載のプログラム。
Acquiring the inspection image, which is not detected as the abnormal image, from the inspection images;
Receiving input of information indicating that there is an abnormality in the acquired image for inspection,
acquiring a plurality of combinations of training data in which the inspection image and the received information indicating the existence of an abnormality are associated;
generating a second learning model that outputs information indicating whether or not there is an abnormality in the object to be inspected when an inspection image is input based on a plurality of combinations of the acquired training data; 11. A program according to any one of 11 .
学習モードまたは運用モードのいずれかの選択を受け付け、
学習モードが選択された場合に、検査対象物を含む学習用の画像を取得し、
教師なし学習により生成する第1学習モデルのハイパーパラメータの設定を受け付け、 受け付けた前記ハイパーパラメータに基づき、取得した前記学習用の画像を入力した場合に前記学習用の画像に対応する再構成画像を出力する前記第1学習モデルを生成し、
検査対象物を含む検査用の画像を取得し、
取得した検査用の画像を相互にオーバーラップする複数の小片画像に分割し、
分割した前記複数の小片画像を学習済みの前記第1学習モデルに入力し、前記第1学習モデルからそれぞれの小片画像の再構成画像を出力させ、
分割した前記複数の小片画像と、前記第1学習モデルが出力したそれぞれの小片画像に対応する再構成画像との各ピクセルの異常度を小片画像ごとに算出し、
小片画像ごとに算出した各ピクセルの異常度が足し込まれた回数を集計し、
集計した回数に基づき、ピクセルごとに平均異常度を算出し、
前記検査用の画像を検証するための異常度の閾値の設定を受け付け、
算出した平均異常度と、受け付けた前記異常度の閾値とに基づき、検出した異常画像を表示する
処理を実行させる情報処理方法。
accepts the choice of either learning mode or operational mode,
Acquire an image for learning including the inspection object when the learning mode is selected,
Receiving settings of hyperparameters of a first learning model generated by unsupervised learning, and generating a reconstructed image corresponding to the learning image when the acquired learning image is input based on the received hyperparameter. generating the first learning model to be output;
Acquiring an image for inspection including the inspection object,
dividing the acquired inspection image into a plurality of overlapping small-piece images;
inputting the plurality of divided small piece images to the first learning model that has been trained, and outputting a reconstructed image of each small piece image from the first learning model;
calculating, for each small piece image, the degree of abnormality of each pixel in the plurality of divided small piece images and the reconstructed image corresponding to each of the small piece images output by the first learning model;
Aggregate the number of times the anomaly degree of each pixel calculated for each small piece image is added,
Based on the counted number of times, calculate the average anomaly degree for each pixel,
Receiving the setting of the threshold of the degree of abnormality for verifying the image for inspection,
An information processing method for executing a process of displaying a detected abnormal image based on the calculated average degree of abnormality and the received threshold value of the degree of abnormality.
学習モードまたは運用モードのいずれかの選択を受け付ける第1受付部と、
学習モードが選択された場合に、検査対象物を含む学習用の画像を取得する第1取得部と、
教師なし学習により生成する第1学習モデルのハイパーパラメータの設定を受け付ける第2受付部と、
受け付けた前記ハイパーパラメータに基づき、取得した前記学習用の画像を入力した場合に前記学習用の画像に対応する再構成画像を出力する前記第1学習モデルを生成する生成部と、
検査対象物を含む検査用の画像を取得する第2取得部と、
取得した検査用の画像を相互にオーバーラップする複数の小片画像に分割する分割部と、
分割した前記複数の小片画像を学習済みの前記第1学習モデルに入力し、前記第1学習モデルからそれぞれの小片画像の再構成画像を出力させる制御部と、
分割した前記複数の小片画像と、前記第1学習モデルが出力したそれぞれの小片画像に対応する再構成画像との各ピクセルの異常度を小片画像ごとに算出する第1算出部と、
小片画像ごとに算出した各ピクセルの異常度が足し込まれた回数を集計する集計部と、
集計した回数に基づき、ピクセルごとに平均異常度を算出する第2算出部と、
前記検査用の画像を検証するための異常度の閾値の設定を受け付ける第3受付部と、
算出した平均異常度と、受け付けた前記異常度の閾値とに基づき、検出した異常画像を表示する表示部と
を備える情報処理装置。
a first reception unit that receives a selection of either the learning mode or the operation mode;
a first acquiring unit that acquires a learning image including the inspection object when the learning mode is selected;
a second reception unit that receives settings of hyperparameters of the first learning model generated by unsupervised learning;
a generation unit that generates the first learning model that outputs a reconstructed image corresponding to the learning image when the acquired learning image is input based on the received hyperparameter;
a second acquisition unit that acquires an inspection image including the inspection target;
a division unit that divides the acquired inspection image into a plurality of mutually overlapping small piece images;
a control unit that inputs the plurality of divided small piece images to the first learning model that has been trained, and outputs a reconstructed image of each small piece image from the first learning model;
a first calculation unit for calculating, for each small piece image, the degree of abnormality of each pixel of the plurality of divided small piece images and the reconstructed image corresponding to each of the small piece images output by the first learning model;
a tallying unit that tallies the number of times that the degree of abnormality of each pixel calculated for each small piece image is added;
A second calculation unit that calculates the average degree of anomaly for each pixel based on the counted number of times;
a third reception unit that receives setting of an abnormality threshold for verifying the inspection image;
An information processing apparatus comprising: a display unit that displays an abnormal image detected based on the calculated average degree of abnormality and the received threshold value of the degree of abnormality.
JP2020179620A 2020-02-28 2020-10-27 Program, information processing method and information processing apparatus Active JP7289427B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2020033782 2020-02-28
JP2020033782 2020-02-28

Publications (2)

Publication Number Publication Date
JP2021140739A JP2021140739A (en) 2021-09-16
JP7289427B2 true JP7289427B2 (en) 2023-06-12

Family

ID=77668821

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020179620A Active JP7289427B2 (en) 2020-02-28 2020-10-27 Program, information processing method and information processing apparatus

Country Status (1)

Country Link
JP (1) JP7289427B2 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7233592B1 (en) 2021-10-22 2023-03-06 キヤノン株式会社 Image processing device, image processing method and program
WO2023106157A1 (en) * 2021-12-10 2023-06-15 東京エレクトロン株式会社 Substrate inspection method, substrate inspection program, and substrate inspection device
WO2023136032A1 (en) * 2022-01-14 2023-07-20 富士フイルム株式会社 Information processing device, method, and program
WO2023175831A1 (en) * 2022-03-17 2023-09-21 株式会社Fuji Image confirmation device and image confirmation method
JP7445154B2 (en) 2022-03-23 2024-03-07 ダイキン工業株式会社 Fin inspection system, fin inspection method, and program
JP2023168966A (en) * 2022-05-16 2023-11-29 ブラザー工業株式会社 Computer program and inspection device
CN114619591B (en) * 2022-05-16 2022-08-26 河南源宏高分子新材料有限公司 Sorting process in high polymer material regeneration process
WO2023248444A1 (en) * 2022-06-23 2023-12-28 日本電信電話株式会社 Learning device, learning method, and learning program
WO2024009868A1 (en) * 2022-07-05 2024-01-11 三菱電機株式会社 Appearance inspection system, appearance inspection method, training device, and inference device
JP7446697B2 (en) 2022-07-12 2024-03-11 本田技研工業株式会社 Teacher data creation method and creation device
JP2024018792A (en) * 2022-07-29 2024-02-08 株式会社日立産機システム Inspection device and method
JP7323841B1 (en) * 2022-11-30 2023-08-09 株式会社エクサウィザーズ Abnormality detection method, abnormality detection system and program

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011145791A (en) 2010-01-13 2011-07-28 Hitachi Ltd Classifier learning image production program, method and system
JP2011145179A (en) 2010-01-15 2011-07-28 Panasonic Corp Sensory test device and sensory test method
JP2017117139A (en) 2015-12-24 2017-06-29 キヤノンマーケティングジャパン株式会社 Information processing unit, control method, program
JP2018005773A (en) 2016-07-07 2018-01-11 株式会社リコー Abnormality determination device and abnormality determination method
JP2018120300A (en) 2017-01-23 2018-08-02 株式会社リコー Information processing apparatus, information processing method, and program
WO2019040214A1 (en) 2017-08-22 2019-02-28 Northrop Grumman Systems Corporation System and method for distributive training and weight distribution in a neural network
JP2019125351A (en) 2017-11-28 2019-07-25 南京地平綫机器人技術有限公司 Method for performing calculating in folding layer of folding neutral network and device
WO2019180848A1 (en) 2018-03-20 2019-09-26 株式会社島津製作所 Cell image analysis device, cell image analysis system, learning data generation method, learning model generation method, learning data generation program, and learning data production method
WO2020031984A1 (en) 2018-08-08 2020-02-13 Blue Tag株式会社 Component inspection method and inspection system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011145791A (en) 2010-01-13 2011-07-28 Hitachi Ltd Classifier learning image production program, method and system
JP2011145179A (en) 2010-01-15 2011-07-28 Panasonic Corp Sensory test device and sensory test method
JP2017117139A (en) 2015-12-24 2017-06-29 キヤノンマーケティングジャパン株式会社 Information processing unit, control method, program
JP2018005773A (en) 2016-07-07 2018-01-11 株式会社リコー Abnormality determination device and abnormality determination method
JP2018120300A (en) 2017-01-23 2018-08-02 株式会社リコー Information processing apparatus, information processing method, and program
WO2019040214A1 (en) 2017-08-22 2019-02-28 Northrop Grumman Systems Corporation System and method for distributive training and weight distribution in a neural network
JP2019125351A (en) 2017-11-28 2019-07-25 南京地平綫机器人技術有限公司 Method for performing calculating in folding layer of folding neutral network and device
WO2019180848A1 (en) 2018-03-20 2019-09-26 株式会社島津製作所 Cell image analysis device, cell image analysis system, learning data generation method, learning model generation method, learning data generation program, and learning data production method
WO2020031984A1 (en) 2018-08-08 2020-02-13 Blue Tag株式会社 Component inspection method and inspection system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Norbert Preining(アクセリア株式会社),"畳み込みニューラルネットワーク",[online],2017年06月14日,https://www.accelia.net/column/research/1222/

Also Published As

Publication number Publication date
JP2021140739A (en) 2021-09-16

Similar Documents

Publication Publication Date Title
JP7289427B2 (en) Program, information processing method and information processing apparatus
US10753881B2 (en) Methods and systems for crack detection
JP5546317B2 (en) Visual inspection device, visual inspection discriminator generation device, visual inspection discriminator generation method, and visual inspection discriminator generation computer program
CN111860565A (en) Workflow for training classifiers for quality inspection in measurement technology
US20020159642A1 (en) Feature selection and feature set construction
JP6749655B1 (en) Inspection device, abnormality detection method, computer program, learning model generation method, and learning model
Naresh et al. Early detection of lung cancer using neural network techniques
Al‐Tahhan et al. Accurate automatic detection of acute lymphatic leukemia using a refined simple classification
Roychowdhury et al. Random forests in the classification of diabetic retinopathy retinal images
CN113963190A (en) System and method for changing image
KR102455875B1 (en) Method and apparatus for bone age assessment
GB2457022A (en) Creating a fuzzy inference model for medical image analysis
CN110929877B (en) Model building method, device, equipment and storage medium based on transfer learning
JP7321452B2 (en) Program, information processing device, information processing method, and method for generating learned model
JP2024500470A (en) Lesion analysis methods in medical images
JP7322560B2 (en) Program, information processing method and information processing apparatus
JP7206892B2 (en) Image inspection device, learning method for image inspection, and image inspection program
Agnes et al. Classification of Lung nodules using Convolutional long short-term Neural Network
KR102622660B1 (en) Method for detecting serial section of medical image
Vidyabharathi et al. Enhancing crack detection with convolutional neural networks and oriented non-maximal suppression
Ghashghaei et al. Grayscale Image Statistical Attributes Effectively Distinguish the Severity of Lung Abnormalities in CT Scan Slices of COVID-19 Patients
Sahithi et al. Classification of Lung Diseases on Chest CT Images Using Convolutional Neural Networks
Shruthi et al. Accurate Brain Tumor Detection using Deep Learning: A Comprehensive Review and Implementation Study
Jurem et al. Early Identification of Skin Cancer Lesions with CNN Model
Kim et al. Automated end-of-line quality assurance with visual inspection and convolutional neural networks

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20201106

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220601

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20220601

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20221020

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20221025

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221212

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230307

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230407

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20230418

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230502

R150 Certificate of patent or registration of utility model

Ref document number: 7289427

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150