JP2021042955A - Food inspection device, food inspection method and learning method of food reconstruction neural network for food inspection device - Google Patents

Food inspection device, food inspection method and learning method of food reconstruction neural network for food inspection device Download PDF

Info

Publication number
JP2021042955A
JP2021042955A JP2017252576A JP2017252576A JP2021042955A JP 2021042955 A JP2021042955 A JP 2021042955A JP 2017252576 A JP2017252576 A JP 2017252576A JP 2017252576 A JP2017252576 A JP 2017252576A JP 2021042955 A JP2021042955 A JP 2021042955A
Authority
JP
Japan
Prior art keywords
food
image
neural network
learning
stage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2017252576A
Other languages
Japanese (ja)
Inventor
幸太郎 降旗
Kotaro Furuhata
幸太郎 降旗
武 荻野
Takeshi Ogino
武 荻野
祐介 水谷
Yusuke Mizutani
祐介 水谷
田村 崇
Takashi Tamura
崇 田村
満久 太田
Mitsuhisa Ota
満久 太田
義充 今津
Yoshimitsu Imazu
義充 今津
ティネオ アレハンドロ ハビエル ゴンザレス
Alejandro Javier Gonzales Tineo
ティネオ アレハンドロ ハビエル ゴンザレス
勇太 吉田
Yuta Yoshida
勇太 吉田
洋平 菅原
Yohei Sugawara
洋平 菅原
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.)
BRAINPAD Inc
QP Corp
Original Assignee
BRAINPAD Inc
QP Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BRAINPAD Inc, QP Corp filed Critical BRAINPAD Inc
Priority to JP2017252576A priority Critical patent/JP2021042955A/en
Priority to PCT/JP2018/048323 priority patent/WO2019131945A1/en
Publication of JP2021042955A publication Critical patent/JP2021042955A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/89Investigating the presence of flaws or contamination in moving material, e.g. running paper or textiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • Health & Medical Sciences (AREA)
  • Pathology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Textile Engineering (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

To provide a food inspection device capable of improving the robustness of food inspection for confirming that no foreign matter is mixed.SOLUTION: The food inspection device is provided with light irradiation means 3 that irradiates an inspection object A with light, imaging means 4 for capturing an image of the inspection object A, and an identification processing device 6. The identification processing device 6 includes a food reconstruction neural network that has learned only good food products in advance, reconstructs a food assumption image using the food reconstruction neural network from the image obtained by the imaging means 4, calculates a difference between the image obtained by the imaging means 4 and the food assumption image, and identifies the inspection object A whose difference exceeds the preset threshold value as a foreign substance.SELECTED DRAWING: Figure 1

Description

本発明は、食品検査装置、食品検査方法及び食品検査装置の食品再構成ニューラルネットワークの学習方法に関する。 The present invention relates to a food inspection device, a food inspection method, and a learning method of a food reconstruction neural network of the food inspection device.

従来、食品などの検査対象物に混在する異物を検出する食品検査装置に関し、金属検知やX線検査など各種の技術が提案されている。近年は、撮影画像を画像処理して、異物を検出するものも提案されている(特許文献1)。 Conventionally, various techniques such as metal detection and X-ray inspection have been proposed for food inspection devices that detect foreign substances mixed in inspection objects such as food. In recent years, there has been proposed an image processing of a photographed image to detect a foreign substance (Patent Document 1).

特許文献1(請求項1参照)には、食物等の腐敗する物質の腐敗部サンプルと健全部サンプルについてそれぞれの分光画像を取得し、各サンプルについての吸光スペクトルの違いを利用して主成分分析や回帰分析等の統計的手法により腐敗部か否かを判定する検量式を作成し、該検量式に同種物質の未知サンプルの分光画像を当てはめて該未知サンプルが腐敗部か否かを判断することが記載されている。 In Patent Document 1 (see claim 1), spectroscopic images of a rotten portion sample and a healthy portion sample of a perishable substance such as food are obtained, and principal component analysis is performed using the difference in absorption spectra of each sample. Create a calibration formula to determine whether or not it is a rotting part by a statistical method such as regression analysis or regression analysis, and apply a spectral image of an unknown sample of the same substance to the calibration formula to determine whether or not the unknown sample is a rotting part. It is stated that.

しかしながら、特許文献1の判定方法では、腐敗部サンプルとは異なる異物に対して異物の検出精度が落ちる可能性があった。そのため、一定の検出精度を維持するには、想定されるすべての異物に対して機械学習することが必要であるが、時間や労力、コンピュータの処理能力などの制約により実施が難しい場合があった。 However, in the determination method of Patent Document 1, there is a possibility that the detection accuracy of the foreign matter may be lowered for the foreign matter different from the putrefactive part sample. Therefore, in order to maintain a certain detection accuracy, it is necessary to perform machine learning for all possible foreign substances, but it may be difficult to implement due to restrictions such as time, labor, and computer processing power. ..

特開2005−201636号公報Japanese Unexamined Patent Publication No. 2005-201636

本発明は、このような事情を考慮してなされたものであり、その目的は、異物の混在がないことを確認する食品検査のロバスト性の向上を図ることができる食品検査装置、食品検査方法及び食品検査装置の食品再構成ニューラルネットワークの学習方法を提供することにある。 The present invention has been made in consideration of such circumstances, and an object of the present invention is a food inspection device and a food inspection method capable of improving the robustness of a food inspection for confirming that no foreign matter is mixed. And to provide a learning method of a food reconstruction neural network of a food inspection device.

このような目的を達成するため、本発明は、以下の構成によって把握される。
(1)本発明は、異物の混在がないことを確認する食品を検査対象物として前記検査対象物に光を照射する光照射手段と、前記検査対象物の映像を撮像する撮像手段と、識別処理装置と、を備え、前記識別処理装置は、予め食品の良品のみを学習した食品再構成ニューラルネットワークを備えており、前記撮像手段によって得られた画像から、前記食品再構成ニューラルネットワークを用いて、食品仮定画像を再構成し、前記撮像手段によって得られた前記画像と前記食品仮定画像との差分を算出し、前記差分が予め設定していた閾値を超える検査対象物を異物として識別するものである。
In order to achieve such an object, the present invention is grasped by the following configuration.
(1) The present invention distinguishes between a light irradiating means for irradiating the inspection object with light using a food for confirming that no foreign matter is mixed as an inspection object and an imaging means for capturing an image of the inspection object. The identification processing device includes a processing device, and the identification processing device includes a food reconstruction neural network in which only non-defective food products are learned in advance, and the food reconstruction neural network is used from an image obtained by the imaging means. , The food assumption image is reconstructed, the difference between the image obtained by the imaging means and the food assumption image is calculated, and the inspection object whose difference exceeds a preset threshold is identified as a foreign substance. Is.

(2)本発明は、上記(1)の構成において、前記食品再構成ニューラルネットワークとして自己符号化器を用いた再構成の畳み込みニューラルネットワークを用いることを特徴とするものである。 (2) The present invention is characterized in that, in the configuration of (1) above, a reconstructed convolutional neural network using a self-encoder is used as the food reconstructed neural network.

(3)本発明は、上記(1)の構成において、前記食品再構成ニューラルネットワークとして輝度のみを用いた色再構成を用いることを特徴とするものである。 (3) The present invention is characterized in that, in the configuration of (1) above, color reconstruction using only brightness is used as the food reconstruction neural network.

(4)本発明は、上記(1)から(3)までのいずれか1つの構成の食品検査装置によって、検査対象物の食品に異物の混在がないことを確認する食品検査方法である。 (4) The present invention is a food inspection method for confirming that the food to be inspected is free of foreign substances by using the food inspection apparatus having any one of the above (1) to (3).

(5)本発明は、上記(1)の構成の食品検査装置の食品再構成ニューラルネットワークの学習方法であって、前記食品検査装置の撮像手段によって、異物の混在がないことを確認する食品を撮像し、前記食品検査装置の撮像手段によって得られた元画像に基づく前記食品の良品が写っている且つ異物が写っていない良品画像から畳み込みニューラルネットワークが生成する食品仮定画像と、前記良品画像との差分が最小化されるように学習を行うものである。 (5) The present invention is a method for learning a food reconstruction neural network of the food inspection device having the above configuration (1), and uses the imaging means of the food inspection device to confirm that no foreign matter is mixed in the food. The food assumption image generated by the convolutional neural network from the good product image in which the good product of the food is shown and no foreign matter is shown based on the original image obtained by the imaging means of the food inspection device, and the good product image. Learning is performed so that the difference between the two is minimized.

(6)本発明は、上記(5)の構成の学習方法であって、前記食品検査装置の撮像手段によって前記食品の良品のみを撮像することにより、前記良品画像を得ることを特徴とするものである。 (6) The present invention is the learning method of the configuration of the above (5), characterized in that the good product image is obtained by imaging only the good product of the food with the imaging means of the food inspection device. Is.

(7)本発明は、上記(5)の構成の学習方法であって、前記元画像から異物の画像を取り除く処理を行うことにより、前記良品画像を得ることを特徴とするものである。 (7) The present invention is the learning method of the configuration of the above (5), and is characterized in that the good product image is obtained by performing a process of removing an image of a foreign substance from the original image.

本発明によれば、異物の混在がないことを確認する食品検査のロバスト性の向上を図ることができる食品検査装置、食品検査方法及び食品検査装置の食品再構成ニューラルネットワークの学習方法を提供することができる。 According to the present invention, there is provided a food inspection apparatus, a food inspection method, and a learning method of a food reconstruction neural network of a food inspection apparatus, which can improve the robustness of a food inspection for confirming that no foreign matter is mixed. be able to.

本発明の実施形態に係る食品検査装置を示す概略図である。It is the schematic which shows the food inspection apparatus which concerns on embodiment of this invention. 検査対象物の識別状態を示す概略図である。It is the schematic which shows the identification state of the inspection object. 本発明の実施形態に係る識別処理装置の実施例1の識別処理方法のモデル学習段階の処理の手順を示すフロー図である。It is a flow chart which shows the process of the model learning stage of the identification processing method of Example 1 of the identification processing apparatus which concerns on embodiment of this invention. 実施例1に係る学習データの準備段階(S110)の説明図である。It is explanatory drawing of the preparation stage (S110) of the learning data which concerns on Example 1. FIG. 実施例1に係る平均輝度の計算段階(S120)の説明図である。It is explanatory drawing of the calculation step (S120) of the average luminance which concerns on Example 1. FIG. 実施例1に係る前処理段階(S210)の説明図である。It is explanatory drawing of the pretreatment step (S210) which concerns on Example 1. FIG. 実施例1に係るモデルの学習段階(S220)の説明図である。It is explanatory drawing of the learning stage (S220) of the model which concerns on Example 1. FIG. 本発明の実施形態に係る識別処理装置の実施例1の識別処理方法の検知段階の処理の手順を示すフロー図である。It is a flow chart which shows the processing procedure of the detection step of the identification processing method of Example 1 of the identification processing apparatus which concerns on embodiment of this invention. 実施例1に係る検知段階(S300)の各段階(S310,S320,S330)の説明図である。It is explanatory drawing of each step (S310, S320, S330) of the detection step (S300) which concerns on Example 1. FIG. ab空間のカテゴリカル化(RGB色域)の例を示すグラフである。It is a graph which shows the example of the categorization (RGB color gamut) of ab space. ピクセルのab値のカテゴリカル化の表現例を示す説明図である。It is explanatory drawing which shows the expression example of the categorization of the ab value of a pixel. 実施例1に係るニューラルネットワーク「モデルNet(f(θ))」の構造の例を示す概念図である。It is a conceptual diagram which shows the example of the structure of the neural network "model Net (f (θ))" which concerns on Example 1. FIG. 実施例2に係る前処理段階(S210)の説明図である。It is explanatory drawing of the pretreatment step (S210) which concerns on Example 2. FIG. 実施例2に係るモデルの学習段階(S220)の説明図である。It is explanatory drawing of the learning stage (S220) of the model which concerns on Example 2. FIG. 実施例2に係る検知段階(S300)の各段階(S310,S320,S330)の説明図である。It is explanatory drawing of each stage (S310, S320, S330) of the detection stage (S300) which concerns on Example 2. FIG.

以下、添付図面を参照して、本発明を実施するための形態(以下、「実施形態」と称する)について詳細に説明する。実施形態の説明の全体を通して同じ要素には同じ符号を付している。 Hereinafter, embodiments for carrying out the present invention (hereinafter, referred to as “embodiments”) will be described in detail with reference to the accompanying drawings. The same elements are designated by the same reference numerals throughout the description of the embodiments.

まず、異物Fの混在がないことを確認したい食品B(検査対象物A)から、異物Fをインラインで識別する食品検査装置1について、図1に基づいて説明する。図1は本発明の実施形態に係る食品検査装置を示す概略図である。図1に示される食品検査装置1は、搬送手段2と、光照射手段3と、撮像手段4と、識別処理装置6とを備える。 First, a food inspection device 1 for in-line identification of foreign matter F from food B (inspection object A) for which it is desired to confirm that foreign matter F is not mixed will be described with reference to FIG. FIG. 1 is a schematic view showing a food inspection device according to an embodiment of the present invention. The food inspection device 1 shown in FIG. 1 includes a transport means 2, a light irradiation means 3, an image pickup means 4, and an identification processing device 6.

搬送手段2は、検査対象物Aを上流工程から検査場所Cでの検査工程を経て下流工程へ搬送するもので、ベルトコンベアなどから構成されている。搬送手段2は、2m/分から20m/分程度の搬送速度で検査対象物Aを搬送する。検査対象物Aは、食品Bの良品Sと異物Fを含む。 The transport means 2 transports the inspection object A from the upstream process to the downstream process through the inspection process at the inspection location C, and is composed of a belt conveyor or the like. The transport means 2 transports the inspection object A at a transport speed of about 2 m / min to 20 m / min. The inspection object A includes a non-defective product S of food B and a foreign substance F.

光照射手段3は、検査場所Cに在る検査対象物Aに光を照射する。なお、光照射手段3は、補光器32を含んでもよい。 The light irradiating means 3 irradiates the inspection object A at the inspection place C with light. The light irradiation means 3 may include a light enhancer 32.

撮像手段4は、検査場所Cに在る搬送中の検査対象物Aを撮像するもので、CCDカメラや、ハイパースペクトルカメラなどで構成される。 The imaging means 4 captures an image of the inspection object A being transported at the inspection location C, and is composed of a CCD camera, a hyperspectral camera, and the like.

識別処理装置6は、検査対象物A中の食品Bの異物Fを識別するものである。識別処理装置6は、撮像手段4により撮像された映像D1から検査対象物A中の食品Bの異物Fを識別する。 The identification processing device 6 identifies the foreign matter F of the food B in the inspection object A. The identification processing device 6 identifies the foreign matter F of the food B in the inspection object A from the image D1 captured by the imaging means 4.

識別処理装置6は、映像D1に基づいて、搬送手段2によって搬送中の検査対象物Aから異物Fをインラインで識別する。この識別処理装置6は、検査対象物Aから異物Fを識別する処理を、あらかじめディープラーニングにより学習している。 The identification processing device 6 identifies the foreign matter F in-line from the inspection object A being transported by the transport means 2 based on the image D1. The identification processing device 6 has learned in advance the process of identifying the foreign matter F from the inspection object A by deep learning.

図2は、検査対象物の識別状態を示す概略図である。図2においては、搬送手段2によって搬送中の検査対象物Aから異物F1,F2がインラインで識別されている。異物F2は、食品B中に良品Sの部分と混在するものである。 FIG. 2 is a schematic view showing an identification state of an inspection object. In FIG. 2, foreign substances F1 and F2 are identified in-line from the inspection object A being transported by the transport means 2. The foreign matter F2 is mixed with the portion of the non-defective product S in the food B.

次に本実施形態に係る識別処理装置6について、実施例1,2を挙げて説明する。 Next, the identification processing device 6 according to the present embodiment will be described with reference to Examples 1 and 2.

[実施例1]
本実施形態に係る識別処理装置6の実施例1について、図3から図12を参照して説明する。図3から図12は、本実施形態に係る識別処理装置6の実施例1の識別処理方法を示す図である。本識別処理方法は、モデル学習段階と、検知段階と、から構成される。モデル学習段階は、検知段階で使用されるニューラルネットワークの学習を行う段階である。実施例1では、輝度のみを用いた色再構成を行うように、ニューラルネットワークの学習を行う。検知段階は、モデル学習段階で学習したニューラルネットワークを使用して、搬送手段2によって搬送中の検査対象物A中の食品Bの異物Fを識別する段階である。
[Example 1]
The first embodiment of the identification processing device 6 according to the present embodiment will be described with reference to FIGS. 3 to 12. 3 to 12 are diagrams showing the identification processing method of the first embodiment of the identification processing device 6 according to the present embodiment. This identification processing method includes a model learning stage and a detection stage. The model learning stage is a stage in which the neural network used in the detection stage is trained. In the first embodiment, the neural network is trained so as to perform color reconstruction using only the brightness. The detection step is a step of identifying the foreign matter F of the food B in the inspection object A being transported by the transport means 2 using the neural network learned in the model learning step.

<モデル学習段階>
図3から図7を参照して、実施例1に係るモデル学習段階を説明する。図3は、本実施形態に係る識別処理装置の実施例1の識別処理方法のモデル学習段階の処理の手順を示すフロー図である。図3に示されるように、モデル学習段階では、まずデータ準備段階(S100)が行われ、次いで学習段階(S200)が行われる。
<Model learning stage>
The model learning stage according to the first embodiment will be described with reference to FIGS. 3 to 7. FIG. 3 is a flow chart showing a processing procedure in the model learning stage of the identification processing method of the first embodiment of the identification processing apparatus according to the present embodiment. As shown in FIG. 3, in the model learning stage, the data preparation stage (S100) is first performed, and then the learning stage (S200) is performed.

(データ準備段階)
データ準備段階(S100)を説明する。データ準備段階(S100)は、学習データの準備段階(S110)と、平均輝度の計算段階(S120)と、から構成される。以下、データ準備段階(S100)の各段階(S110,S120)を、図4,図5をそれぞれ参照して説明する。
(Data preparation stage)
The data preparation stage (S100) will be described. The data preparation stage (S100) is composed of a training data preparation stage (S110) and an average luminance calculation stage (S120). Hereinafter, each stage (S110, S120) of the data preparation stage (S100) will be described with reference to FIGS. 4 and 5, respectively.

(データ準備段階:学習データの準備段階(S110))
図4は、学習データの準備段階(S110)の説明図である。学習データの準備段階(S110)では、実施例1に係る学習段階(S200)で使用されるデータを準備する。この準備のために、まず、複数枚(Nall枚)の学習用画像(RGB画像)を用意する。学習用画像(RGB画像)は、食品Bの良品Sが写っている且つ異物Fが写っていない画像である。学習用画像(RGB画像)のサイズは、「P1×P2」ピクセル(px)である。学習用画像(RGB画像)は、撮像手段4によって食品Bの良品Sのみが撮像された画像であってもよい。この場合、撮像手段4により撮像された良品Sの映像D1が複数枚(Nall枚)の学習用画像(RGB画像)となる。又は、学習用画像(RGB画像)は、撮像手段4によって撮像された食品Bの良品S及び異物Fの映像D1から、異物Fの画像を取り除く処理が行われた後の映像D1であってもよい。この場合、撮像手段4により撮像された映像D1から異物Fの画像を取り除く処理が行われた後の映像D1が複数枚(Nall枚)の学習用画像(RGB画像)となる。異物Fの画像を取り除く処理は、異物Fが写っている画像自体を取り除く処理であってもよく、又は、異物Fが写っている画像から当該異物Fの画像領域を消す処理(例えば、白色で塗りつぶす処理等)であってもよい。
(Data preparation stage: Learning data preparation stage (S110))
FIG. 4 is an explanatory diagram of the learning data preparation stage (S110). In the learning data preparation stage (S110), the data used in the learning stage (S200) according to the first embodiment is prepared. For this preparation, first, a plurality of (Nall) learning images (RGB images) are prepared. The learning image (RGB image) is an image in which the good product S of the food B is shown and the foreign matter F is not shown. The size of the learning image (RGB image) is "P1 x P2" pixels (px). The learning image (RGB image) may be an image obtained by capturing only the non-defective product S of the food B by the imaging means 4. In this case, the image D1 of the non-defective product S captured by the imaging means 4 becomes a plurality of (Nall) learning images (RGB images). Alternatively, the learning image (RGB image) may be the image D1 after the process of removing the image of the foreign substance F from the image D1 of the non-defective product S and the foreign substance F of the food B captured by the imaging means 4. Good. In this case, the image D1 after the process of removing the image of the foreign matter F from the image D1 captured by the imaging means 4 becomes a plurality of (Nall) learning images (RGB images). The process of removing the image of the foreign matter F may be a process of removing the image itself in which the foreign matter F appears, or a process of erasing the image area of the foreign matter F from the image in which the foreign matter F appears (for example, in white). It may be a painting process, etc.).

次に、Nall枚の学習用画像(RGB画像)を使用して、データ準備段階(S100)を行う。まず、Nall枚の学習用画像(RGB画像)を、Nall枚のX%の枚数の学習用画像(RGB画像)と、Nall枚の(100−X)%の枚数の学習用画像(RGB画像)と、に分ける(S111)。Nall枚のX%の枚数の学習用画像(RGB画像)は、学習セット(Train set)の学習用画像(RGB画像)である。Nall枚の(100−X)%の枚数の学習用画像(RGB画像)は、検証セット(Validation set)の学習用画像(RGB画像)である。学習セット(Train set)は、ニューラルネットワークの学習に使用される。検証セット(Validation set)は、ニューラルネットワークの学習のクオリティを検証するために使用される。 Next, the data preparation step (S100) is performed using Nall learning images (RGB images). First, Nall's learning images (RGB images) are divided into Nall's X% number of learning images (RGB images) and Nall's (100-X)% number of learning images (RGB images). And (S111). The X% number of learning images (RGB images) of Nall are learning images (RGB images) of the training set (Train set). The number of (100-X)% of Nall learning images (RGB images) is the learning images (RGB images) of the validation set. Train sets are used to train neural networks. The validation set is used to validate the learning quality of neural networks.

次いで、学習セット(Train set)と、検証セット(Validation set)とに対して、それぞれの学習用画像(RGB画像)を、「P3×P3」ピクセル(px)のサブ画像(RGB画像)に分解する(S112、但し、「P1>P3,P2>P3」である)。また、1枚の学習用画像(RGB画像)から分解された複数枚のサブ画像(RGB画像)の間には、重なりがないようにする。
なお、ステップS112(サブ画像への分解処理)は実行しなくてもよい。ステップS112(サブ画像への分解処理)を実行しない場合、学習セット(Train set)の学習用画像(RGB画像)及び検証セット(Validation set)の学習用画像(RGB画像)がそのまま以降の処理で使用される。但し、サブ画像に分解することにより、後述するステップS200の学習段階における画素組み合わせを指数関数的に減らすことができるので、当該学習段階の学習時間の短縮が可能となる。
以降の処理の説明では、ステップS112(サブ画像への分解処理)が実行されたとして説明を行う。
Next, for the training set (Train set) and the verification set (Validation set), each training image (RGB image) is decomposed into sub-images (RGB images) of "P3 x P3" pixels (px). (S112, where "P1> P3, P2>P3"). In addition, there should be no overlap between a plurality of sub-images (RGB images) decomposed from one learning image (RGB image).
It is not necessary to execute step S112 (decomposition process into sub-images). When step S112 (decomposition processing into sub-images) is not executed, the training image (RGB image) of the training set (Train set) and the learning image (RGB image) of the verification set (Validation set) are used as they are in the subsequent processing. used. However, by decomposing into sub-images, the pixel combinations in the learning stage of step S200, which will be described later, can be exponentially reduced, so that the learning time in the learning stage can be shortened.
In the following description of the process, it is assumed that step S112 (decomposition process into sub-images) has been executed.

(データ準備段階:平均輝度の計算段階(S120))
図5は、実施例1に係る平均輝度の計算段階(S120)の説明図である。識別処理装置6は、学習セット(Train set)のNtrain枚のサブ画像(RGB画像)を計算対象にして、平均輝度の計算段階(S120)を行う。まず、識別処理装置6は、学習セット(Train set)のNtrain枚のサブ画像(RGB画像)のそれぞれから輝度チャネル(輝度ch)を抽出する(S121)。次いで、識別処理装置6は、該抽出されたNtrain枚のサブ画像の輝度チャネル(輝度ch)を使用して、平均輝度(Lavg)を計算する(S122)。この平均輝度(Lavg)の計算式は、次式(1)で表される。
(Data preparation stage: Average brightness calculation stage (S120))
FIG. 5 is an explanatory diagram of the calculation stage (S120) of the average luminance according to the first embodiment. The identification processing device 6 performs a calculation step (S120) of the average brightness on the sub-images (RGB images) of the N trains of the training set as the calculation target. First, the identification processing device 6 extracts a luminance channel (luminance ch) from each of the N train sub-images (RGB images) of the training set (S121). Next, the identification processing device 6 calculates the average brightness (Lavg) using the brightness channel (luminance ch) of the extracted Ntrain sub-images (S122). The calculation formula of the average brightness (Lavg) is expressed by the following formula (1).

Figure 2021042955
Figure 2021042955

識別処理装置6によって計算された平均輝度(Lavg)は、学習段階(S200)におけるニューラルネットワークの学習で使用される入力データを正規化するために使用される。 The average brightness (Lavg) calculated by the identification processing device 6 is used to normalize the input data used in the training of the neural network in the learning stage (S200).

(学習段階)
学習段階(S200)を説明する。学習段階(S200)は、前処理段階(S210)と、モデルの学習段階(S220)と、から構成される。以下、学習段階(S200)の各段階(S210,S220)を、図6,図7をそれぞれ参照して説明する。
(Learning stage)
The learning stage (S200) will be described. The learning stage (S200) is composed of a preprocessing stage (S210) and a model learning stage (S220). Hereinafter, each stage (S210, S220) of the learning stage (S200) will be described with reference to FIGS. 6 and 7, respectively.

(学習段階:前処理段階(S210))
図6は、実施例1に係る前処理段階(S210)の説明図である。前処理段階(S210)には、学習入力画像(RGB画像、「Pin1×Pin2」ピクセル)が入力される。学習データの準備段階(S110)においてステップS112(サブ画像への分解処理)が実行された場合、学習入力画像はサブ画像(Pin1=Pin2=P3)である。一方、学習データの準備段階(S110)においてステップS112(サブ画像への分解処理)が実行されなかった場合には、学習入力画像は学習用画像(Pin1=P1、Pin2=P2)である。前処理段階(S210)では、学習セット(Train set)と、検証セット(Validation set)とに対して、それぞれの学習入力画像(RGB画像)から「入力(x)と正解色(y)」のペアを生成する。
(Learning stage: Preprocessing stage (S210))
FIG. 6 is an explanatory diagram of the pretreatment stage (S210) according to the first embodiment. A learning input image (RGB image, "Pin1 x Pin2" pixel) is input to the preprocessing stage (S210). When step S112 (decomposition process into sub-images) is executed in the training data preparation stage (S110), the learning input image is a sub-image (Pin1 = Pin2 = P3). On the other hand, when step S112 (decomposition process into sub-images) is not executed in the learning data preparation stage (S110), the learning input image is a learning image (Pin1 = P1, Pin2 = P2). In the preprocessing stage (S210), for the training set (Train set) and the verification set (Validation set), "input (x) and correct color (y)" are selected from the respective learning input images (RGB images). Generate a pair.

識別処理装置6は、学習入力画像(RGB画像、「Pin1×Pin2」ピクセル)に対して、RGB空間からLab空間へ変換する色空間変換処理を行い、Lチャネル(Lch)のL値(輝度)と、abチャネル(abch)のa値及びb値(色)とを生成する(S211)。 The identification processing device 6 performs color space conversion processing for converting the learning input image (RGB image, “Pin1 × Pin2” pixels) from RGB space to Lab space, and L value (luminance) of L channel (Lch). And the a value and the b value (color) of the ab channel (abch) are generated (S211).

次いで、識別処理装置6は、LchのL値(輝度)を正規化する(S212)。この正規化の計算式は、次式(2)で表される。平均輝度(Lavg)は、上述した平均輝度の計算段階(S120)で計算された値である。なお、式(2)は正規化の方法の一例である。 Next, the identification processing device 6 normalizes the L value (luminance) of Lch (S212). The calculation formula for this normalization is expressed by the following formula (2). The average luminance (Lavg) is a value calculated in the above-mentioned average luminance calculation step (S120). Equation (2) is an example of the normalization method.

Figure 2021042955
Figure 2021042955

Lchの正規化の結果の値は入力(x={xi,j})である。「xi,j」は、「i,j」番目のピクセルのL値(輝度)の正規化の結果の値である。 The value of the result of Lch normalization is an input (x = {xi, j}). “Xi, j” is a value obtained as a result of normalization of the L value (luminance) of the “i, j” th pixel.

なお、上述したステップS212では、平均輝度(Lavg)を使用してL値(輝度)を正規化したが、正規化の代わりに、L値(輝度)を規格化してもよい。L値(輝度)の規格化は、上記の式(2)において平均輝度(Lavg)を0にすればよい(つまり、上記の式(2)の分子をL値「Li,j」にする)。但し、L値(輝度)を、規格化よりも正規化した方が、後述するステップS200の学習段階における学習効率をよくすることができる。 In step S212 described above, the L value (luminance) is normalized using the average brightness (Lavg), but the L value (luminance) may be standardized instead of the normalization. To standardize the L value (luminance), the average brightness (Lavg) may be set to 0 in the above formula (2) (that is, the numerator of the above formula (2) is set to the L value "Li, j"). .. However, if the L value (luminance) is normalized rather than standardized, the learning efficiency in the learning stage of step S200, which will be described later, can be improved.

また、識別処理装置6は、abchのa値及びb値(色)を、カテゴリカル化し、規格化する(S213)。abchのカテゴリカル化の結果の値は正解色(y)である。 Further, the identification processing device 6 categorizes and standardizes the a value and the b value (color) of the abch (S213). The value of the result of categorization of ach is the correct color (y).

ここで、図10,図11を参照して、abchのa値及びb値(色)のカテゴリカル化と規格化の方法を説明する。図10は、ab空間のカテゴリカル化(RGB色域)の例を示すグラフである。図11は、ピクセルのab値のカテゴリカル化と規格化の表現例を示す説明図である。 Here, a method of categorizing and standardizing the a value and the b value (color) of ach will be described with reference to FIGS. 10 and 11. FIG. 10 is a graph showing an example of categorization (RGB color gamut) of ab space. FIG. 11 is an explanatory diagram showing an example of representation of categorization and normalization of pixel ab values.

まず、図10に示されるように、予め、ab空間を、任意のカテゴリ数(Q)のカテゴリ基底(図10中の丸印)に均等的に離散化する。次いで、カテゴリカル化する対象の画像の各ピクセルについて、ピクセル値(p)に最も近い所定の複数個数(図10の例では5個)のカテゴリ基底(vk)を判定する。次いで、該判定結果の各カテゴリ基底(vk)とピクセル値(p)との間の距離を重みとしたベクタ(y’)を求める。最後にクラス間の重みを規格化し、ベクタ(y)を算出する。このベクタ(y={yk})の計算式は、次式(3)で表される(式(3)の例ではカテゴリ基底(vk)の個数は5個)。 First, as shown in FIG. 10, the ab space is discretized in advance evenly to the category bases (circles in FIG. 10) of an arbitrary number of categories (Q). Next, for each pixel of the image to be categorized, a predetermined number of categorical bases (vk) closest to the pixel value (p) (5 in the example of FIG. 10) is determined. Next, a vector (y') weighted by the distance between each category basis (vk) of the determination result and the pixel value (p) is obtained. Finally, the weights between the classes are standardized and the vector (y) is calculated. The calculation formula of this vector (y = {yk}) is represented by the following formula (3) (in the example of the formula (3), the number of category bases (vk) is five).

Figure 2021042955
Figure 2021042955

ベクタ(y)は、ピクセル値(p)のカテゴリカル化と規格化の表現である。図11に示されるカテゴリカル化と規格化の表現の一例では、カテゴリ数をQ個として(つまり、式(3)において、kは1からQまでの整数である)、ピクセル値(p:a値「−34」,b値「65」)のカテゴリカル化と規格化の表現「ベクタ(y={yk})」が示されている。 The vector (y) is an expression of categorization and normalization of the pixel value (p). In an example of the representation of categorization and normalization shown in FIG. 11, the number of categories is Q (that is, k is an integer from 1 to Q in the equation (3)), and the pixel value (p: a). The expression "vector (y = {yk})" of categorization and normalization of the value "-34" and the b value "65") is shown.

(学習段階:モデルの学習段階(S220))
図7は、実施例1に係るモデルの学習段階(S220)の説明図である。モデルの学習段階(S220)では、学習セット(Train set)の「入力(x)と正解色(y)」のペアと、検証セット(Validation set)の「入力(x)と正解色(y)」のペアとを使用して、ニューラルネットワーク「モデルNet(f(θ))」の学習を行う。
(Learning stage: Model learning stage (S220))
FIG. 7 is an explanatory diagram of the learning stage (S220) of the model according to the first embodiment. In the learning stage (S220) of the model, the pair of "input (x) and correct answer color (y)" of the training set (Train set) and the "input (x) and correct answer color (y)" of the validation set (Validation set) The neural network "model Net (f (θ))" is trained using the pair of "".

ここで、図12を参照して、ニューラルネットワーク「モデルNet(f(θ))」の構造を説明する。図12は、実施例1に係るニューラルネットワーク「モデルNet(f(θ))」の構造の例を示す概念図である。 Here, the structure of the neural network “model Net (f (θ))” will be described with reference to FIG. FIG. 12 is a conceptual diagram showing an example of the structure of the neural network “model Net (f (θ))” according to the first embodiment.

図12に示されるニューラルネットワーク「モデルNet(f(θ))」は、例えば8個の層(Layer)から構成される、畳み込みニューラルネットワークである。第1層は入力層である。第2層から第4層までは畳み込み層である。第5層から第7層までは逆畳み込み層であり、第8層は出力層である。入力画像は、サイズが「Pin1×Pin2」ピクセルであり、na個のチャネルから構成される。本実施例1では、入力画像はLch(輝度チャネル)のみである(つまり、na=1)。第2層の出力サイズは「P4×P4×16」である。第3層、第4層及び第5層の出力サイズは「P5×P5×16」である。第6層の出力サイズは「P4×P4×16」である。第7層の出力サイズは「Pin1×Pin2×16」である。第8層の出力サイズは、「Pin1×Pin2×nb」である。本実施例1では、nbはabchのカテゴリ数(Q)である(つまり、nb=Q)。Pin1,Pin2,P3,P4,P5の大小関係は「Pin1又はPin2≧Pin2又はPin1>P4>P5」である。 The neural network "model Net (f (θ))" shown in FIG. 12 is a convolutional neural network composed of, for example, eight layers (Layer). The first layer is an input layer. The second to fourth layers are convolutional layers. The fifth to seventh layers are deconvolution layers, and the eighth layer is an output layer. The input image is "Pin1 x Pin2" pixels in size and is composed of na channels. In the first embodiment, the input image is only Lch (luminance channel) (that is, na = 1). The output size of the second layer is "P4 x P4 x 16". The output size of the third layer, the fourth layer, and the fifth layer is "P5 x P5 x 16". The output size of the sixth layer is "P4 x P4 x 16". The output size of the seventh layer is "Pin1 x Pin2 x 16". The output size of the eighth layer is "Pin1 x Pin2 x nb". In the first embodiment, nb is the number of categories (Q) of abch (that is, nb = Q). The magnitude relationship of Pin1, Pin2, P3, P4, P5 is "Pin1 or Pin2 ≥ Pin2 or Pin1> P4> P5".

以下、図7を参照して、モデルの学習段階(S220)を説明する。
識別処理装置6は、学習セット(Train set)の「入力(x)と正解色(y)」のペアを使用して、「Categorical Cross-entropy」のロスを最小化するニューラルネットワーク「モデルNet(f(θ))」のパラメータ(θ)を学習する(S221,S222)。ステップS221では、入力(x)をニューラルネットワーク「モデルNet(f(θ))」に入力して、ニューラルネットワーク「モデルNet(f(θ))」の出力値を予測色(y^=fθ(x))とする。次いで、ステップS222では、予測色(y^=fθ(x))と正解色(y)とを使用して、「Categorical Cross-entropy」のロス(E(y,y^)を計算する。「Categorical Cross-entropy」のロス(E(y,y^)の計算式は、次式(4)で表される。Qは、上述したステップS213のabchのカテゴリカル化におけるカテゴリ数である。正解色(y)の「yi,j,k」は、「i,j」番目のピクセルの第kカテゴリの値(つまり、式(3)によるyk)である。予測色(y^)の「y^i,j,k」は、ニューラルネットワーク「モデルNet(f(θ))」の「i,j」番目の出力値の第kカテゴリの値である。
Hereinafter, the learning stage (S220) of the model will be described with reference to FIG. 7.
The identification processing device 6 uses a pair of “input (x) and correct color (y)” of the training set to minimize the loss of “Categorical Cross-entropy”, which is a neural network “Model Net”. The parameter (θ) of "f (θ))" is learned (S221, S222). In step S221, the input (x) is input to the neural network “model Net (f (θ))”, and the output value of the neural network “model Net (f (θ))” is predicted to be the predicted color (y ^ = fθ (y ^ = fθ)). x)). Next, in step S222, the loss (E (y, y ^) of "Categorical Cross-entropy" is calculated using the predicted color (y ^ = fθ (x)) and the correct color (y). The calculation formula for the loss (E (y, y ^)) of "Categorical Cross-entropy" is represented by the following formula (4). Q is the number of categories in the categorization of ach in step S213 described above. Correct answer. The “yi, j, k” of the color (y) is the value of the kth category of the “i, j” th pixel (that is, yk according to the equation (3)). The “y” of the predicted color (y ^). “^ I, j, k” is a value in the k-th category of the “i, j” th output value of the neural network “model Net (f (θ))”.

Figure 2021042955
Figure 2021042955

「Categorical Cross-entropy」のロス(E(y,y^)を最小化するニューラルネットワーク「モデルNet(f(θ))」のパラメータ(θ)を学習する方法として、誤差逆伝搬法と確率的勾配降下法(Stochastic Gradient Descent:SGD)とを使用する。 As a method of learning the parameter (θ) of the neural network "model Net (f (θ))" that minimizes the loss of "Categorical Cross-entropy" (E (y, y ^)), the error back propagation method and stochastic descent The gradient descent method (Stochastic Gradient Descent: SGD) is used.

識別処理装置6は、ニューラルネットワーク「モデルNet(f(θ))」のパラメータ(θ)の学習を、一定の反復数(epochs)だけ繰り返して行う。識別処理装置6は、該パラメータ(θ)の学習の繰り返し毎に、検証セット(Validation set)の「入力(x)と正解色(y)」のペアを使用して、該パラメータ(θ)を検証する。このパラメータ(θ)の検証では、検証セット(Validation set)の「入力(x)と正解色(y)」のペアを使用して、上述したステップS221,S222を行い、「Categorical Cross-entropy」のロス(E(y,y^)を計算する。このロス(E(y,y^)が下がったときの最新のパラメータ(θ)をベストパラメータとして保存する。この保存されたベストパラメータのパラメータ(θ)は、検知段階で使用されるニューラルネットワーク「モデルNet(f(θ))」に適用されるパラメータ(θ)である。 The identification processing device 6 repeatedly learns the parameter (θ) of the neural network “model Net (f (θ))” by a fixed number of iterations (epochs). The identification processing device 6 uses the pair of "input (x) and correct color (y)" of the validation set to set the parameter (θ) every time the learning of the parameter (θ) is repeated. Verify. In the verification of this parameter (θ), the above-mentioned steps S221 and S222 are performed using the pair of “input (x) and correct color (y)” of the validation set, and “Categorical Cross-entropy” is performed. The loss (E (y, y ^)) of is calculated. The latest parameter (θ) when this loss (E (y, y ^) decreases is saved as the best parameter. The parameter of this saved best parameter. (Θ) is a parameter (θ) applied to the neural network “model Net (f (θ))” used in the detection stage.

以上が実施例1に係るモデル学習段階の説明である。このモデル学習段階によって、食品Bの良品Sのみを学習したニューラルネットワーク「モデルNet(f(θ))」が生成される。 The above is the description of the model learning stage according to the first embodiment. By this model learning stage, a neural network "model Net (f (θ))" that learns only the non-defective product S of food B is generated.

<検知段階>
図8,図9を参照して、実施例1に係る検知段階を説明する。図8は、本実施形態に係る識別処理装置の実施例1の識別処理方法の検知段階の処理の手順を示すフロー図である。図8に示されるように、検知段階(S300)では、まず前処理段階(S310)が行われ、次いで予測段階(S320)が行われ、次いで後処理段階(S330)が行われる。図9は、実施例1に係る検知段階(S300)の各段階(S310,S320,S330)の説明図である。以下、検知段階(S300)の各段階(S310,S320,S330)を、図9を参照して説明する。
<Detection stage>
The detection stage according to the first embodiment will be described with reference to FIGS. 8 and 9. FIG. 8 is a flow chart showing a processing procedure in the detection stage of the identification processing method of the first embodiment of the identification processing apparatus according to the present embodiment. As shown in FIG. 8, in the detection stage (S300), the pretreatment stage (S310) is first performed, then the prediction stage (S320) is performed, and then the post-processing stage (S330) is performed. FIG. 9 is an explanatory diagram of each stage (S310, S320, S330) of the detection stage (S300) according to the first embodiment. Hereinafter, each stage (S310, S320, S330) of the detection stage (S300) will be described with reference to FIG.

(検知段階:前処理段階(S310))
入力画像は、撮像手段4によって、搬送中の検査対象物Aが撮像された映像D1のRGB画像である。入力画像(RGB画像)のサイズは、「P1×P2」ピクセルである。前処理段階(S310)では、入力画像(RGB画像)から「入力(x)と正解色(y)」のペアを生成する。
(Detection stage: Preprocessing stage (S310))
The input image is an RGB image of the image D1 in which the inspection object A being transported is captured by the imaging means 4. The size of the input image (RGB image) is "P1 x P2" pixels. In the preprocessing step (S310), a pair of "input (x) and correct color (y)" is generated from the input image (RGB image).

識別処理装置6は、入力画像(RGB画像)に対して、RGB空間からLab空間へ変換する色空間変換処理を行い、Lch)のL値(輝度)と、abchのa値及びb値(色)とを生成する(S311)。次いで、識別処理装置6は、LchのL値(輝度)を正規化する(S312)。この正規化の計算式は、上述の式(2)で表される。平均輝度(Lavg)は、上述した平均輝度の計算段階(S120)で計算された値である。Lchの正規化の結果の値は入力(x)である。また、識別処理装置6は、abchのa値及びb値(色)を、カテゴリカル化し、規格化する(S313)。このカテゴリカル化と規格化の方法は、上述したステップS213と同じである。abchのカテゴリカル化の結果の値は正解色(y)である。 The identification processing device 6 performs color space conversion processing for converting the input image (RGB image) from the RGB space to the Lab space, and the L value (luminance) of Lch) and the a value and b value (color) of abch. ) And (S311). Next, the identification processing device 6 normalizes the L value (luminance) of Lch (S312). The calculation formula for this normalization is represented by the above formula (2). The average luminance (Lavg) is a value calculated in the above-mentioned average luminance calculation step (S120). The value of the result of Lch normalization is the input (x). Further, the identification processing device 6 categorizes and standardizes the a value and the b value (color) of the abch (S313). The method of categorization and normalization is the same as that of step S213 described above. The value of the result of categorization of ach is the correct color (y).

(検知段階:予測段階(S320))
予測段階(S320)では、上述したモデル学習段階で食品Bの良品Sのみを学習したニューラルネットワーク「モデルNet(f(θ))」を使用して、入力画像(RGB画像)の「入力(x)と正解色(y)」のペアからヒートマップ(h)を生成する。
(Detection stage: Prediction stage (S320))
In the prediction stage (S320), the "input (x)" of the input image (RGB image) is used by using the neural network "model Net (f (θ))" in which only the non-defective product S of food B is learned in the model learning stage described above. ) And the correct color (y) ”to generate a heat map (h).

まず、識別処理装置6は、入力(x)をニューラルネットワーク「モデルNet(f(θ))」に入力して、ニューラルネットワーク「モデルNet(f(θ))」の出力値を予測色(y^=fθ(x))とする(S321)。次いで、識別処理装置6は、予測色(y^=fθ(x))と正解色(y)との間の再構成誤差(ヒートマップ(h))を、ピクセル毎に計算する(S322)。このヒートマップ(h)の計算式は、次式(5)で表される。Nkはカテゴリ数(Q)である。「hi,j」は、「i,j」番目のピクセルのヒートマップ値である。 First, the identification processing device 6 inputs the input (x) to the neural network "model Net (f (θ))" and predicts the output value of the neural network "model Net (f (θ))" (y). ^ = Fθ (x)) (S321). Next, the identification processing device 6 calculates the reconstruction error (heat map (h)) between the predicted color (y ^ = fθ (x)) and the correct color (y) for each pixel (S322). The calculation formula of this heat map (h) is expressed by the following formula (5). Nk is the number of categories (Q). “Hi, j” is a heat map value of the “i, j” th pixel.

Figure 2021042955
Figure 2021042955

(検知段階:後処理段階(S330))
後処理段階(S330)では、入力画像(RGB画像)のヒートマップ(h)を使用して、異物Fの検知位置(i,j)を求める。
(Detection stage: Post-processing stage (S330))
In the post-processing stage (S330), the heat map (h) of the input image (RGB image) is used to obtain the detection positions (i, j) of the foreign matter F.

まず、識別処理装置6は、ヒートマップ(h)において、ヒートマップ値「hi,j」が所定の閾値Th1を超えるピクセル(i,j)を不良「1」とし、その他のピクセルを良「0」として、ヒートマップ(h)をバイナリ化する(S331)。次いで、識別処理装置6は、不良「1」のピクセル同士の間の距離を計算し、該距離が所定の閾値Th2以下である不良「1」のピクセル同士を同じクラスターに分類する(S332)。次いで、識別処理装置6は、各クラスターの重心を計算し、該重心のピクセル(i,j)を異物Fの検知位置(i,j)として出力する(S333)。 First, in the heat map (h), the identification processing device 6 sets a pixel (i, j) in which the heat map value “hi, j” exceeds a predetermined threshold value Th1 as a defective “1”, and sets the other pixels as a good “0”. , The heat map (h) is binarized (S331). Next, the identification processing device 6 calculates the distance between the pixels with the defect “1”, and classifies the pixels with the defect “1” whose distance is equal to or less than the predetermined threshold Th2 into the same cluster (S332). Next, the identification processing device 6 calculates the center of gravity of each cluster and outputs the pixels (i, j) of the center of gravity as the detection positions (i, j) of the foreign matter F (S333).

以上が実施例1に係る検知段階の説明である。この検知段階によって、搬送手段2によって搬送中の検査対象物A中の食品Bの異物Fが識別された検知位置(i,j)が出力される。 The above is the description of the detection stage according to the first embodiment. In this detection step, the detection positions (i, j) at which the foreign matter F of the food B in the inspection object A being transported by the transport means 2 is identified are output.

上述した実施例1において、ニューラルネットワーク「モデルNet(f(θ))」は、L値(輝度)を用いた色再構成の畳み込みニューラルネットワークであり、食品再構成ニューラルネットワークの例である。また、予測色(y^=fθ(x))は食品仮定画像の例である。 In Example 1 described above, the neural network "model Net (f (θ))" is a color reconstruction convolutional neural network using an L value (luminance), and is an example of a food reconstruction neural network. The predicted color (y ^ = fθ (x)) is an example of a food assumption image.

なお、ニューラルネットワーク「モデルNet(f(θ))」の学習に使用される学習用画像(RGB画像)の撮像において、撮像手段4により撮像される撮像対象場所の画角四隅のうちの最低照度は、画角中央の照度の80%以上であることが好ましく、より好ましくは90%以上である。L値を用いた色再構成の畳み込みニューラルネットワークでは、ニューラルネットワークにインプットされるL値に大きく作用されるため、照度を安定させることで、再現性のある学習を行いやくなる。 In the imaging of the learning image (RGB image) used for learning the neural network "model Net (f (θ))", the lowest illuminance among the four corners of the angle of view of the imaging target location imaged by the imaging means 4. Is preferably 80% or more, more preferably 90% or more of the illuminance at the center of the angle of view. In the convolutional neural network of color reconstruction using the L value, since it is greatly affected by the L value input to the neural network, it becomes easy to perform reproducible learning by stabilizing the illuminance.

また、L値(輝度)を用いた色再構成の畳み込みニューラルネットワークの学習において、畳み込み層による畳み込み処理によってニューラルネットワークを経て複数のフィーチャーマップを得ることで特徴抽出される。次に逆畳み込み層による逆畳み込み処理によってニューラルネットワークを経て元の画像サイズのピクセル数を再現する。これらを複数回入れ子状(第2、3、…、第n層)に繰り返すことで、より概念的な特徴抽出が可能となる。
この輝度を用いた色再構成の学習には、サブ画像(RGB画像)を用いるのが好ましい。サブ画像(RGB画像)は、学習用画像に写りこむ食品Bの平均ピクセル長の約10倍未満の画像サイズで切り出して得られる。なお、食品Bの平均ピクセル長とは、対象となる食品Bを撮像したときの縦・横いずれかの最大ピクセル数を計測し、所定複数個(ここでの例として10個)を撮像したときの平均値である。
この輝度を用いた色再構成の学習では、まず学習用画像またはサブ画像のL値(入力(x))を入力し、第nの逆畳み込み層から得られた色再構成された再構成カテゴリカル表現が得られる。元画像である学習用画像またはサブ画像のカテゴリカル表現(正解色(y))と再構成カテゴリカル表現(予測色(y^=fθ(x)))との損失(ロス)関数(Categorical Cross-entropy)が極力低くなるように学習される。
Further, in the learning of a convolutional neural network for color reconstruction using the L value (brightness), features are extracted by obtaining a plurality of feature maps via the neural network by convolutional processing by the convolutional layer. Next, the number of pixels of the original image size is reproduced via the neural network by the deconvolution process by the deconvolution layer. By repeating these in a nested manner (second, third, ..., nth layer) a plurality of times, more conceptual feature extraction becomes possible.
It is preferable to use a sub-image (RGB image) for learning color reconstruction using this brightness. The sub image (RGB image) is obtained by cutting out an image size of less than about 10 times the average pixel length of the food B reflected in the learning image. The average pixel length of food B is when the maximum number of pixels in either the vertical or horizontal direction when the target food B is imaged is measured and a predetermined number of pixels (10 as an example here) are imaged. Is the average value of.
In the learning of color reconstruction using this brightness, the L value (input (x)) of the learning image or sub-image is first input, and the color-reconstructed reconstruction category obtained from the nth deconvolution layer is obtained. Cal expression is obtained. The loss function (Categorical Cross) between the categorical representation (correct color (y)) of the learning image or sub-image that is the original image and the reconstructed categorical representation (predicted color (y ^ = fθ (x))). -entropy) is learned to be as low as possible.

また、L値(輝度)を用いた色再構成の畳み込みニューラルネットワークを使用する検知段階では、入力画像のL値を第1の畳み込み層に入力して第n層から得られたカテゴリカル表現(食品仮定画像)と、入力画像から得られたカテゴリカル表現との差分を求め、その差分に対して予め定めた閾値を超えるピクセルを「良品でない物体(つまり、異物)」として検出する。 Further, in the detection stage using the convolutional neural network of color reconstruction using the L value (brightness), the L value of the input image is input to the first convolutional layer and the categorical representation obtained from the nth layer ( The difference between the food assumption image) and the categorical expression obtained from the input image is obtained, and pixels exceeding a predetermined threshold value for the difference are detected as "non-good objects (that is, foreign substances)".

以上が実施例1の説明である。 The above is the description of the first embodiment.

[実施例2]
本実施形態に係る識別処理装置6の実施例2について、図13から図15を参照して説明する。図13から図15は、本実施形態に係る識別処理装置6の実施例2の識別処理方法を示す図である。本識別処理方法は、上述した実施例1と同様に、モデル学習段階と、検知段階と、から構成される。モデル学習段階は、検知段階で使用されるニューラルネットワークの学習を行う段階である。実施例2では、自己符号化器を用いた再構成の畳み込みニューラルネットワークを用いる。検知段階は、モデル学習段階で学習したニューラルネットワークを使用して、搬送手段2によって搬送中の検査対象物A中の食品Bの異物Fを識別する段階である。
[Example 2]
The second embodiment of the identification processing device 6 according to the present embodiment will be described with reference to FIGS. 13 to 15. 13 to 15 are diagrams showing the identification processing method of the second embodiment of the identification processing device 6 according to the present embodiment. The present identification processing method is composed of a model learning stage and a detection stage, as in the first embodiment described above. The model learning stage is a stage in which the neural network used in the detection stage is trained. In the second embodiment, a reconstructed convolutional neural network using a self-encoder is used. The detection step is a step of identifying the foreign matter F of the food B in the inspection object A being transported by the transport means 2 using the neural network learned in the model learning step.

<モデル学習段階>
図13及び図14を参照して、実施例2に係るモデル学習段階を説明する。実施例2に係るモデル学習段階は、上述した実施例1の図3に示される手順と同様に、まずデータ準備段階(S100)が行われ、次いで学習段階(S200)が行われる。但し、実施例2では、データ準備段階(S100)において、平均輝度の計算段階(S120)は実行されない。
<Model learning stage>
The model learning stage according to the second embodiment will be described with reference to FIGS. 13 and 14. In the model learning stage according to the second embodiment, the data preparation stage (S100) is first performed, and then the learning stage (S200) is performed, similarly to the procedure shown in FIG. 3 of the first embodiment. However, in the second embodiment, the average brightness calculation step (S120) is not executed in the data preparation step (S100).

(データ準備段階)
実施例2に係るデータ準備段階(S100)は、学習データの準備段階(S110)から構成される。実施例2に係る学習データの準備段階(S110)は、上述した実施例1(図4)と同じであるので、その説明を省略する。なお、実施例1と同様に、ステップS112(サブ画像への分解処理)は実行してもしなくてもよい。
(Data preparation stage)
The data preparation stage (S100) according to the second embodiment is composed of a training data preparation stage (S110). Since the learning data preparation stage (S110) according to the second embodiment is the same as that of the first embodiment (FIG. 4) described above, the description thereof will be omitted. As in the first embodiment, step S112 (decomposition process into sub-images) may or may not be executed.

(学習段階)
実施例2に係る学習段階(S200)を説明する。実施例2に係る学習段階(S200)は、前処理段階(S210)と、モデルの学習段階(S220)と、から構成される。以下、実施例2に係る学習段階(S200)の各段階(S210,S220)を、図13,図14をそれぞれ参照して説明する。
(Learning stage)
The learning stage (S200) according to the second embodiment will be described. The learning stage (S200) according to the second embodiment is composed of a preprocessing stage (S210) and a model learning stage (S220). Hereinafter, each stage (S210, S220) of the learning stage (S200) according to the second embodiment will be described with reference to FIGS. 13 and 14, respectively.

(学習段階:前処理段階(S210))
図13は、実施例2に係る前処理段階(S210)の説明図である。前処理段階(S210)には、学習入力画像(RGB画像、「Pin1×Pin2」ピクセル)が入力される。実施例2に係る学習データの準備段階(S110)においてステップS112(サブ画像への分解処理)が実行された場合、学習入力画像はサブ画像(Pin1=Pin2=P3)である。一方、実施例2に係る学習データの準備段階(S110)においてステップS112(サブ画像への分解処理)が実行されなかった場合には、学習入力画像は学習用画像(Pin1=P1、Pin2=P2)である。実施例2に係る前処理段階(S210)では、学習セット(Train set)と、検証セット(Validation set)とに対して、それぞれの学習入力画像(RGB画像)から「入力(x)と正解画像(y)」のペアを生成する。
(Learning stage: Preprocessing stage (S210))
FIG. 13 is an explanatory diagram of the pretreatment stage (S210) according to the second embodiment. A learning input image (RGB image, "Pin1 x Pin2" pixel) is input to the preprocessing stage (S210). When step S112 (decomposition process into sub-images) is executed in the learning data preparation stage (S110) according to the second embodiment, the learning input image is a sub-image (Pin1 = Pin2 = P3). On the other hand, when step S112 (decomposition process into sub-images) is not executed in the learning data preparation stage (S110) according to the second embodiment, the learning input image is a learning image (Pin1 = P1, Pin2 = P2). ). In the preprocessing stage (S210) according to the second embodiment, the training set (Train set) and the verification set (Validation set) are subjected to "input (x) and correct answer image" from the respective learning input images (RGB images). (Y) ”pair is generated.

識別処理装置6は、学習入力画像(RGB画像、「Pin1×Pin2」ピクセル)に対して、RGB各チャネル(ch)の規格化を行う(S2110)。この規格化の計算式は、次式(6)で表される。なお、式(6)は規格化の方法の一例である。 The identification processing device 6 standardizes each RGB channel (ch) with respect to the learning input image (RGB image, “Pin1 × Pin2” pixel) (S2110). The calculation formula for this standardization is expressed by the following formula (6). Equation (6) is an example of a standardization method.

Figure 2021042955
Figure 2021042955

RGB各chの規格化の結果の値は入力(x={xi,j,k})である。「xi,j,k」は、「i,j」番目のピクセルのチャンネルkの規格化の結果の値である。また、入力(x={xi,j,k})とペアの正解画像(y)として、当該入力(x={xi,j,k})を使用する。つまり、一つのペアにおいて、入力(x)と正解画像(y)とは同じである。 The value as a result of standardization of each RGB channel is an input (x = {xi, j, k}). “Xi, j, k” is a value obtained as a result of normalization of the channel k of the “i, j” th pixel. Further, the input (x = {xi, j, k}) is used as the correct image (y) paired with the input (x = {xi, j, k}). That is, in one pair, the input (x) and the correct image (y) are the same.

なお、上述した実施例2に係る前処理段階(S210)では、RGB各chの規格化を行ったが、RGB各chの平均値を使用してRGB各chの正規化を行ってもよい。RGB各chの正規化の方法は、上述した実施例1に係るL値(輝度)の正規化の方法と同様である。 In the pretreatment step (S210) according to the second embodiment described above, the RGB channels are standardized, but the RGB channels may be normalized using the average value of the RGB channels. The method of normalizing each RGB channel is the same as the method of normalizing the L value (luminance) according to the first embodiment described above.

(学習段階:モデルの学習段階(S220))
図14は、実施例2に係るモデルの学習段階(S220)の説明図である。実施例2に係るモデルの学習段階(S220)では、学習セット(Train set)の「入力(x)と正解画像(y)」のペアと、検証セット(Validation set)の「入力(x)と正解画像(y)」のペアとを使用して、ニューラルネットワーク「CAE(f(θ))」の学習を行う。
(Learning stage: Model learning stage (S220))
FIG. 14 is an explanatory diagram of the learning stage (S220) of the model according to the second embodiment. In the learning stage (S220) of the model according to the second embodiment, the pair of “input (x) and correct image (y)” of the training set (Train set) and the “input (x)” of the validation set (Validation set) The neural network "CAE (f (θ))" is learned by using the pair of "correct image (y)".

実施例2に係るニューラルネットワーク「CAE(f(θ))」の構造は、上述した実施例1に係る図12のニューラルネットワーク「モデルNet(f(θ))」の構造と同様である。但し、図12において、実施例2に係るニューラルネットワーク「CAE(f(θ))」では、入力画像は、サイズが「Pin1×Pin2」ピクセルであり、RGBの3個のチャネルから構成される(つまり、na=3)。また、第8層の出力サイズは、「Pin1×Pin2×3」である(つまり、nb=3)。本実施例2では、na及びnbはRGBのチャネル数「3」である(na=nb=3)。 The structure of the neural network “CAE (f (θ))” according to the second embodiment is the same as the structure of the neural network “model Net (f (θ))” of FIG. 12 according to the first embodiment described above. However, in FIG. 12, in the neural network “CAE (f (θ))” according to the second embodiment, the input image has a size of “Pin1 × Pin2” pixels and is composed of three RGB channels ( That is, na = 3). The output size of the eighth layer is "Pin1 x Pin2 x 3" (that is, nb = 3). In the second embodiment, na and nb are the number of RGB channels "3" (na = nb = 3).

以下、図14を参照して、実施例2に係るモデルの学習段階(S220)を説明する。
識別処理装置6は、学習セット(Train set)の「入力(x)と正解画像(y)」のペアを使用して、「Binary Cross-entropy」のロスを最小化するニューラルネットワーク「CAE(f(θ))」のパラメータ(θ)を学習する(S2210,S2220)。ステップS2210では、入力(x)をニューラルネットワーク「CAE(f(θ))」に入力して、ニューラルネットワーク「CAE(f(θ))」の出力値を予測画像(y^=fθ(x))とする。次いで、ステップS2220では、予測画像(y^=fθ(x))と正解画像(y)とを使用して、「Binary Cross-entropy」のロス(E(y,y^)を計算する。「Binary Cross-entropy」のロス(E(y,y^)の計算式は、次式(7)で表される。正解画像(y)の「yi,j,k」は、「i,j」番目のピクセルのチャンネルk(RGB各ch)の値である。予測画像(y^)の「y^i,j,k」は、ニューラルネットワーク「CAE(f(θ))」の「i,j」番目の出力値のチャンネルk(RGB各ch)の値である。
Hereinafter, the learning stage (S220) of the model according to the second embodiment will be described with reference to FIG.
The identification processing device 6 uses a pair of "input (x) and correct image (y)" of the training set to minimize the loss of "Binary Cross-entropy", which is a neural network "CAE (f)". (Θ)) ”parameter (θ) is learned (S2210, S2220). In step S2210, the input (x) is input to the neural network “CAE (f (θ))”, and the output value of the neural network “CAE (f (θ))” is predicted image (y ^ = fθ (x)). ). Next, in step S2220, the loss (E (y, y ^) of "Binary Cross-entropy" is calculated using the predicted image (y ^ = fθ (x)) and the correct image (y). The calculation formula for the loss (E (y, y ^)) of "Binary Cross-entropy" is expressed by the following formula (7). The "yi, j, k" in the correct image (y) is "i, j". It is the value of the channel k (each of RGB channels) of the third pixel. The “y ^ i, j, k” of the predicted image (y ^) is the “i, j” of the neural network “CAE (f (θ))”. This is the value of the channel k (each RGB channel) of the third output value.

Figure 2021042955
Figure 2021042955

「Binary Cross-entropy」のロス(E(y,y^)を最小化するニューラルネットワーク「CAE(f(θ))」のパラメータ(θ)を学習する方法として、誤差逆伝搬法と確率的勾配降下法(Stochastic Gradient Descent:SGD)とを使用する。 The error back propagation method and stochastic gradient descent are methods for learning the parameter (θ) of the neural network “CAE (f (θ))” that minimizes the loss (E (y, y ^)) of the “Binary Cross-entropy”. The descent method (Stochastic Gradient Descent: SGD) is used.

識別処理装置6は、ニューラルネットワーク「CAE(f(θ))」のパラメータ(θ)の学習を、一定の反復数(epochs)だけ繰り返して行う。識別処理装置6は、該パラメータ(θ)の学習の繰り返し毎に、検証セット(Validation set)の「入力(x)と正解画像(y)」のペアを使用して、該パラメータ(θ)を検証する。このパラメータ(θ)の検証では、検証セット(Validation set)の「入力(x)と正解画像(y)」のペアを使用して、上述したステップS2210,S2220を行い、「Binary Cross-entropy」のロス(E(y,y^)を計算する。このロス(E(y,y^)が下がったときの最新のパラメータ(θ)をベストパラメータとして保存する。この保存されたベストパラメータのパラメータ(θ)は、検知段階で使用されるニューラルネットワーク「CAE(f(θ))」に適用されるパラメータ(θ)である。 The identification processing device 6 repeatedly learns the parameter (θ) of the neural network “CAE (f (θ))” by a fixed number of iterations (epochs). The identification processing device 6 uses the pair of "input (x) and correct image (y)" of the validation set to set the parameter (θ) every time the learning of the parameter (θ) is repeated. Verify. In the verification of this parameter (θ), the above-mentioned steps S2210 and S2220 are performed using the pair of “input (x) and correct image (y)” of the validation set, and “Binary Cross-entropy” is performed. The loss (E (y, y ^)) of is calculated. The latest parameter (θ) when this loss (E (y, y ^) decreases is saved as the best parameter. The parameter of this saved best parameter. (Θ) is a parameter (θ) applied to the neural network “CAE (f (θ))” used in the detection stage.

以上が実施例2に係るモデル学習段階の説明である。このモデル学習段階によって、食品Bの良品Sのみを学習したニューラルネットワーク「CAE(f(θ))」が生成される。 The above is the description of the model learning stage according to the second embodiment. By this model learning stage, a neural network "CAE (f (θ))" that learns only the non-defective product S of food B is generated.

<検知段階>
図15を参照して、実施例2に係る検知段階を説明する。実施例2に係る検知段階は、上述した実施例1の図8に示される検知段階(S300)の手順と同様に、まず前処理段階(S310)が行われ、次いで予測段階(S320)が行われ、次いで後処理段階(S330)が行われる。図15は、実施例2に係る検知段階(S300)の各段階(S310,S320,S330)の説明図である。以下、実施例2に係る検知段階(S300)の各段階(S310,S320,S330)を、図15を参照して説明する。
<Detection stage>
The detection step according to the second embodiment will be described with reference to FIG. As for the detection step according to the second embodiment, the pretreatment step (S310) is first performed, and then the prediction step (S320) is performed in the same manner as the procedure of the detection step (S300) shown in FIG. 8 of the first embodiment. Then, the post-treatment step (S330) is performed. FIG. 15 is an explanatory diagram of each stage (S310, S320, S330) of the detection stage (S300) according to the second embodiment. Hereinafter, each stage (S310, S320, S330) of the detection stage (S300) according to the second embodiment will be described with reference to FIG.

(検知段階:前処理段階(S310))
入力画像は、撮像手段4によって、搬送中の検査対象物Aが撮像された映像D1のRGB画像である。入力画像(RGB画像)のサイズは、「P1×P2」ピクセルである。前処理段階(S310)では、入力画像(RGB画像)から「入力(x)と正解画像(y)」のペアを生成する。
(Detection stage: Preprocessing stage (S310))
The input image is an RGB image of the image D1 in which the inspection object A being transported is captured by the imaging means 4. The size of the input image (RGB image) is "P1 x P2" pixels. In the preprocessing step (S310), a pair of "input (x) and correct answer image (y)" is generated from the input image (RGB image).

識別処理装置6は、入力画像(RGB画像)に対して、RGB各チャネル(ch)の規格化を行う(S3110)。この規格化の計算式は、上述の式(6)で表される。RGB各chの規格化の結果の値は入力(x={xi,j,k})である。「xi,j,k」は、「i,j」番目のピクセルのチャンネルkの規格化の結果の値である。また、入力(x={xi,j,k})とペアの正解画像(y)として、当該入力(x={xi,j,k})を使用する。つまり、一つのペアにおいて、入力(x)と正解画像(y)とは同じである。 The identification processing device 6 standardizes each RGB channel (ch) with respect to the input image (RGB image) (S3110). The calculation formula for this standardization is represented by the above formula (6). The value as a result of standardization of each RGB channel is an input (x = {xi, j, k}). “Xi, j, k” is a value obtained as a result of normalization of the channel k of the “i, j” th pixel. Further, the input (x = {xi, j, k}) is used as the correct image (y) paired with the input (x = {xi, j, k}). That is, in one pair, the input (x) and the correct image (y) are the same.

(検知段階:予測段階(S320))
予測段階(S320)では、上述した実施例2に係るモデル学習段階で食品Bの良品Sのみを学習したニューラルネットワーク「CAE(f(θ))」を使用して、入力画像(RGB画像)の「入力(x)と正解画像(y)」のペアからヒートマップ(h)を生成する。
(Detection stage: Prediction stage (S320))
In the prediction stage (S320), the input image (RGB image) is obtained by using the neural network “CAE (f (θ))” in which only the non-defective product S of the food B is learned in the model learning stage according to the second embodiment described above. A heat map (h) is generated from a pair of "input (x) and correct image (y)".

まず、識別処理装置6は、入力(x)をニューラルネットワーク「CAE(f(θ))」に入力して、ニューラルネットワーク「CAE(f(θ))」の出力値を予測画像(y^=fθ(x))とする(S3210)。次いで、識別処理装置6は、予測画像(y^=fθ(x))と正解画像(y)との間の再構成誤差(ヒートマップ(h))を、ピクセル毎に計算する(S3220)。このヒートマップ(h)の計算式は、次式(8)で表される。「hi,j」は、「i,j」番目のピクセルのヒートマップ値である。 First, the identification processing device 6 inputs the input (x) to the neural network “CAE (f (θ))” and predicts the output value of the neural network “CAE (f (θ))” (y ^ = Let fθ (x)) (S3210). Next, the identification processing device 6 calculates the reconstruction error (heat map (h)) between the predicted image (y ^ = fθ (x)) and the correct image (y) for each pixel (S3220). The calculation formula of this heat map (h) is expressed by the following formula (8). “Hi, j” is a heat map value of the “i, j” th pixel.

Figure 2021042955
Figure 2021042955

なお、ヒートマップ(h)の他の計算方法として、正解画像(y)と予測画像(y^=fθ(x))との差分をグレースケール変換し、このグレースケール変換後の値をヒートマップ値に使用してもよい。 As another calculation method of the heat map (h), the difference between the correct image (y) and the predicted image (y ^ = fθ (x)) is grayscale-converted, and the value after the grayscale conversion is heat-mapped. May be used for the value.

(検知段階:後処理段階(S330))
後処理段階(S330)では、入力画像(RGB画像)のヒートマップ(h)を使用して、異物Fの検知位置(i,j)を求める。実施例2に係る後処理段階(S330)は、上述した実施例1(図9の後処理段階(S330)と同じであるので、その説明を省略する。
(Detection stage: Post-processing stage (S330))
In the post-processing stage (S330), the heat map (h) of the input image (RGB image) is used to obtain the detection positions (i, j) of the foreign matter F. Since the post-treatment step (S330) according to the second embodiment is the same as the post-treatment step (S330) of the above-described first embodiment (S330), the description thereof will be omitted.

以上が実施例2に係る検知段階の説明である。この検知段階によって、搬送手段2によって搬送中の検査対象物A中の食品Bの異物Fが識別された検知位置(i,j)が出力される。 The above is the description of the detection stage according to the second embodiment. In this detection step, the detection positions (i, j) at which the foreign matter F of the food B in the inspection object A being transported by the transport means 2 is identified are output.

上述した実施例2において、ニューラルネットワーク「CAE(f(θ))」は、自己符号化器を用いた再構成の畳み込みニューラルネットワークであり、食品再構成ニューラルネットワークの例である。また、予測画像(y^=fθ(x))は食品仮定画像の例である。 In Example 2 described above, the neural network "CAE (f (θ))" is a reconstructed convolutional neural network using a self-encoder, and is an example of a food reconstructed neural network. The predicted image (y ^ = fθ (x)) is an example of a food assumption image.

なお、自己符号化器を用いた再構成の畳み込みニューラルネットワークの学習において、学習用画像またはサブ画像(入力(x))は、畳み込み層による畳み込み処理によってニューラルネットワークを経て複数のフィーチャーマップを得ることで特徴抽出され、次に逆畳み込み層による逆畳み込み処理によってニューラルネットワークを経て再構成される。さらに、畳み込み処理と逆畳み込み処理を複数回入れ子状に繰り返すことで、より概念的な特徴抽出が可能となる。
この自己符号化器を用いた再構成の畳み込みニューラルネットワークの学習は、最終逆畳み込み層からの出力が元の入力された学習用画像またはサブ画像(正解画像(y))と極力一致するように、つまり差分を表す損失関数が極力低くなるように学習される。この時の損失関数は、BCE(Binary Cross−entropy)といった損失関数が利用できる。
In the learning of the reconstructed convolutional neural network using the self-encoder, the learning image or sub-image (input (x)) obtains a plurality of feature maps via the neural network by the convolution processing by the convolutional layer. The features are extracted with, and then reconstructed via the neural network by the reverse convolution processing by the reverse convolution layer. Further, by repeating the convolution process and the deconvolution process a plurality of times in a nested manner, more conceptual feature extraction becomes possible.
In the learning of the reconstructed convolutional neural network using this self-encoder, the output from the final deconvolutional layer should match the original input learning image or sub-image (correct image (y)) as much as possible. That is, the loss function representing the difference is learned to be as low as possible. As the loss function at this time, a loss function such as BCE (Binary Cross-entropy) can be used.

以上が実施例2の説明である。 The above is the description of the second embodiment.

なお、上述した図1に示される食品検査装置1は搬送手段2を備えたが、搬送手段2は無くてもよい。例えば、検査対象物Aを落下させながら撮像して検査するように構成してもよい。さらには、検査対象物Aを回転落下させながら撮像して検査するように構成してもよい。検査対象物Aを回転落下させながら撮像して検査することによって、検査対象物Aの複数の方向さらには全方向を撮像して検査することができる。 Although the food inspection device 1 shown in FIG. 1 described above includes the transport means 2, the transport means 2 may not be provided. For example, the inspection object A may be configured to be inspected by taking an image while dropping it. Further, the inspection object A may be configured to be inspected by taking an image while rotating and dropping it. By imaging and inspecting the inspection object A while rotating and dropping it, it is possible to image and inspect a plurality of directions and all directions of the inspection object A.

以上、説明した実施形態の効果について述べる。
実施形態の食品検査装置1は、異物Fの混在がないことを確認する食品Bを検査対象物Aとして該検査対象物Aに光を照射する光照射手段3と、検査対象物Aの映像を撮像する撮像手段4と、識別処理装置6と、を備え、識別処理装置6は、予め食品Bの良品Sのみを学習した食品再構成ニューラルネットワークを備えており、撮像手段4によって得られた画像から、該食品再構成ニューラルネットワークを用いて、食品仮定画像を再構成し、撮像手段4によって得られた該画像と該食品仮定画像との差分を算出し、該差分が予め設定していた閾値を超える検査対象物Aを異物として識別するものである。この食品検査装置1によれば、食品仮定画像は「もし仮に撮像された食品Bが全て良品Sであった場合を予測した画像」であり、食品仮定画像と撮像手段4によって得られた画像との差分が予め設定していた閾値を超える検査対象物Aを異物として識別することが可能となる。これにより、異物を学習する必要がないので、任意の異物に対応することができ、異物の混在がないことを確認する食品検査のロバスト性、つまり異常判別においての汎用性の向上を図ることができる。特に、食品再構成ニューラルネットワークとしてL値(輝度)のみを用いた色再構成の畳み込みニューラルネットワークを用いれば、自己符号化器を用いた再構成の畳み込みニューラルネットワークと比べて、ニューラルネットワークの詳細設計モデルの検査対象物依存性が少なく、L値のみを用いた色再構成の畳み込みニューラルネットワークの詳細設計モデルを変更することなく、多様な検査対象物に対して汎用的に現場で学習し、異物の混在がないことを確認することができる。
The effects of the described embodiments will be described above.
In the food inspection device 1 of the embodiment, the food B for confirming that the foreign matter F is not mixed is set as the inspection target A, and the light irradiation means 3 for irradiating the inspection target A with light and the image of the inspection target A are displayed. An image pickup means 4 for taking an image and an identification processing device 6 are provided, and the identification processing device 6 is provided with a food reconstruction neural network in which only the non-defective product S of the food B is learned in advance, and the image obtained by the image pickup means 4 is provided. From, the food assumption image is reconstructed using the food reconstruction neural network, the difference between the image obtained by the imaging means 4 and the food assumption image is calculated, and the difference is a preset threshold value. The inspection object A exceeding the above is identified as a foreign substance. According to this food inspection apparatus 1, the food assumption image is "an image predicted when all the captured foods B are non-defective products S", and the food assumption image and the image obtained by the imaging means 4 It becomes possible to identify the inspection object A whose difference exceeds the preset threshold value as a foreign substance. As a result, since it is not necessary to learn foreign substances, it is possible to deal with arbitrary foreign substances, and it is possible to improve the robustness of food inspection to confirm that there is no foreign matter mixed, that is, the versatility in abnormality discrimination. it can. In particular, if a color reconstruction convolutional neural network that uses only the L value (brightness) is used as the food reconstruction neural network, the detailed design of the neural network will be compared with the reconstruction convolutional neural network that uses a self-encoder. Detailed design of a convolutional neural network for color reconstruction using only the L value, which is less dependent on the inspection object of the model. It can be confirmed that there is no mixture of.

また、食品再構成ニューラルネットワークとして輝度のみを用いた色再構成を用いることにより、食品再構成ニューラルネットワークの学習において輝度のみから色を再構成させるという難題を学習させるので、結果的に自明なルールの学習が避けられて学習効率が向上する効果が期待される。 In addition, by using color reconstruction using only brightness as the food reconstruction neural network, the difficult problem of reconstructing colors from only brightness is learned in the learning of the food reconstruction neural network, and as a result, a self-explanatory rule. It is expected that the learning of the neural network will be avoided and the learning efficiency will be improved.

また、実施形態の識別処理装置6は、専用のハードウェアにより実現されるものであってもよく、あるいはパーソナルコンピュータ等のコンピュータシステムにより構成され、実施形態の識別処理装置6の機能を実現するためのプログラムを実行することによりその機能を実現させるものであってもよい。 Further, the identification processing device 6 of the embodiment may be realized by dedicated hardware, or may be configured by a computer system such as a personal computer to realize the function of the identification processing device 6 of the embodiment. The function may be realized by executing the program of.

また、その識別処理装置6には、周辺機器として入力装置、表示装置等が接続されてもよい。ここで、入力装置とはキーボード、マウス等の入力デバイスのことをいう。表示装置とはCRT(Cathode Ray Tube)や液晶表示装置等のことをいう。
また、上記周辺機器については、識別処理装置6に直接接続するものであってもよく、あるいは通信回線を介して接続するようにしてもよい。
Further, an input device, a display device, or the like may be connected to the identification processing device 6 as peripheral devices. Here, the input device refers to an input device such as a keyboard and a mouse. The display device refers to a CRT (Cathode Ray Tube), a liquid crystal display device, or the like.
Further, the peripheral device may be directly connected to the identification processing device 6, or may be connected via a communication line.

以上、実施形態を用いて本発明を説明したが、本発明の技術的範囲は上記実施形態に記載の範囲には限定されないことは言うまでもない。上記実施形態に、多様な変更又は改良を加えることが可能であることが当業者に明らかである。また、その様な変更又は改良を加えた形態も本発明の技術的範囲に含まれ得ることが、特許請求の範囲の記載から明らかである。 Although the present invention has been described above using the embodiments, it goes without saying that the technical scope of the present invention is not limited to the scope described in the above embodiments. It will be apparent to those skilled in the art that various changes or improvements can be made to the above embodiments. Further, it is clear from the description of the scope of claims that such a modified or improved form may be included in the technical scope of the present invention.

1 食品検査装置
2 搬送手段
3 光照射手段
32 補光器
4 撮像手段
6 識別処理装置
A 検査対象物
B 食品
S 良品
F 異物
1 Food inspection device 2 Transport means 3 Light irradiation means 32 Auxiliary device 4 Imaging means 6 Identification processing device A Inspection object B Food S Good product F Foreign matter

Claims (7)

異物の混在がないことを確認する食品を検査対象物として前記検査対象物に光を照射する光照射手段と、
前記検査対象物の映像を撮像する撮像手段と、
識別処理装置と、を備え、
前記識別処理装置は、
予め食品の良品のみを学習した食品再構成ニューラルネットワークを備えており、
前記撮像手段によって得られた画像から、前記食品再構成ニューラルネットワークを用いて、食品仮定画像を再構成し、
前記撮像手段によって得られた前記画像と前記食品仮定画像との差分を算出し、
前記差分が予め設定していた閾値を超える検査対象物を異物として識別する、
食品検査装置。
A light irradiation means for irradiating the inspection object with light using a food for which it is confirmed that there is no foreign matter as an inspection object, and a light irradiation means.
An imaging means for capturing an image of the inspection object and
Equipped with an identification processing device
The identification processing device is
It is equipped with a food reconstruction neural network that learns only good food products in advance.
From the image obtained by the imaging means, the food assumption image is reconstructed using the food reconstruction neural network.
The difference between the image obtained by the imaging means and the food assumption image is calculated.
An inspection object whose difference exceeds a preset threshold value is identified as a foreign substance.
Food inspection equipment.
請求項1に記載の食品検査装置であって、
前記食品再構成ニューラルネットワークとして輝度のみを用いた色再構成を用いることを特徴とする食品検査装置。
The food inspection device according to claim 1.
A food inspection apparatus characterized in that color reconstruction using only luminance is used as the food reconstruction neural network.
請求項1に記載の食品検査装置であって、
前記食品再構成ニューラルネットワークとして自己符号化器を用いた再構成の畳み込みニューラルネットワークを用いることを特徴とする食品検査装置。
The food inspection device according to claim 1.
A food inspection apparatus characterized in that a reconstructed convolutional neural network using a self-encoder is used as the food reconstructed neural network.
請求項1から3までのいずれか1項に記載の食品検査装置によって、
検査対象物の食品に異物の混在がないことを確認する食品検査方法。
By the food inspection apparatus according to any one of claims 1 to 3.
A food inspection method that confirms that the food to be inspected is free of foreign substances.
請求項1に記載の食品検査装置の食品再構成ニューラルネットワークの学習方法であって、
前記食品検査装置の撮像手段によって、異物の混在がないことを確認する食品を撮像し、
前記食品検査装置の撮像手段によって得られた元画像に基づく前記食品の良品が写っている且つ異物が写っていない良品画像から畳み込みニューラルネットワークが生成する食品仮定画像と、前記良品画像との差分が最小化されるように学習を行う、
食品検査装置の食品再構成ニューラルネットワークの学習方法。
The method for learning the food reconstruction neural network of the food inspection apparatus according to claim 1.
By the imaging means of the food inspection device, the food to be confirmed to be free of foreign substances is imaged,
The difference between the food assumption image generated by the convolutional neural network from the good product image in which the good product of the food is shown and no foreign matter is shown based on the original image obtained by the imaging means of the food inspection device is different from the good product image. Learn to be minimized,
Learning method of food reconstruction neural network of food inspection equipment.
請求項5に記載の学習方法であって、
前記食品検査装置の撮像手段によって前記食品の良品のみを撮像することにより、前記良品画像を得ることを特徴とする、
食品検査装置の食品再構成ニューラルネットワークの学習方法。
The learning method according to claim 5.
The image of the non-defective product is obtained by imaging only the non-defective product of the food product by the imaging means of the food inspection device.
Learning method of food reconstruction neural network of food inspection equipment.
請求項5に記載の学習方法であって、
前記元画像から異物の画像を取り除く処理を行うことにより、前記良品画像を得ることを特徴とする、
食品検査装置の食品再構成ニューラルネットワークの学習方法。
The learning method according to claim 5.
It is characterized in that a non-defective image is obtained by performing a process of removing an image of a foreign substance from the original image.
Learning method of food reconstruction neural network of food inspection equipment.
JP2017252576A 2017-12-27 2017-12-27 Food inspection device, food inspection method and learning method of food reconstruction neural network for food inspection device Pending JP2021042955A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2017252576A JP2021042955A (en) 2017-12-27 2017-12-27 Food inspection device, food inspection method and learning method of food reconstruction neural network for food inspection device
PCT/JP2018/048323 WO2019131945A1 (en) 2017-12-27 2018-12-27 Food inspection device, food inspection method, and learning method for food reconstruction neural network of food inspection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017252576A JP2021042955A (en) 2017-12-27 2017-12-27 Food inspection device, food inspection method and learning method of food reconstruction neural network for food inspection device

Publications (1)

Publication Number Publication Date
JP2021042955A true JP2021042955A (en) 2021-03-18

Family

ID=67067529

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017252576A Pending JP2021042955A (en) 2017-12-27 2017-12-27 Food inspection device, food inspection method and learning method of food reconstruction neural network for food inspection device

Country Status (2)

Country Link
JP (1) JP2021042955A (en)
WO (1) WO2019131945A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7072953B1 (en) 2021-11-11 2022-05-23 吉泉産業株式会社 Weighing foreign matter detection packaging device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7046150B1 (en) * 2020-12-03 2022-04-01 Ckd株式会社 Substrate foreign matter inspection device and substrate foreign matter inspection method

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08136466A (en) * 1994-11-10 1996-05-31 Dainippon Screen Mfg Co Ltd Image pattern inspection device
JP2004334814A (en) * 2003-05-07 2004-11-25 Susumu Shiroyama Technique, device, and program of colorization of monochromatic image
JP2009115613A (en) * 2007-11-06 2009-05-28 Hitachi High-Tech Control Systems Corp Foreign matter inspecting apparatus
US9384560B2 (en) * 2014-10-27 2016-07-05 King Fahd University Of Petroleum And Minerals Contamination level estimation method for high voltage insulators
JP6715001B2 (en) * 2015-12-18 2020-07-01 株式会社流通システム設計 Food inspection system and food inspection method
JP6702064B2 (en) * 2016-06-07 2020-05-27 株式会社デンソー Appearance abnormality inspection apparatus, method, and program
CN110036279B (en) * 2016-12-06 2022-03-15 三菱电机株式会社 Inspection apparatus and inspection method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7072953B1 (en) 2021-11-11 2022-05-23 吉泉産業株式会社 Weighing foreign matter detection packaging device
JP2023071311A (en) * 2021-11-11 2023-05-23 吉泉産業株式会社 Weighing foreign matter detection packaging device

Also Published As

Publication number Publication date
WO2019131945A1 (en) 2019-07-04

Similar Documents

Publication Publication Date Title
JP6924413B2 (en) Data generator, data generation method and data generation program
KR102166458B1 (en) Defect inspection method and apparatus using image segmentation based on artificial neural network
JP7004145B2 (en) Defect inspection equipment, defect inspection methods, and their programs
US9180552B2 (en) System and method for identifying defects in welds by processing X-ray images
CN104169945B (en) To the two-stage classification of the object in image
WO2020024127A1 (en) Bone age assessment and height prediction model, system thereof and prediction method therefor
Rodríguez et al. Study and classification of plum varieties using image analysis and deep learning techniques
US20140119638A1 (en) System, method and computer program product to evaluate a semiconductor wafer fabrication process
US20220244194A1 (en) Automated inspection method for a manufactured article and system for performing same
CN113095438A (en) Wafer defect classification method and device, system, electronic equipment and storage medium thereof
KR102622720B1 (en) Image noise reduction using stacked denoising autoencoders
KR20220095216A (en) BBP-assisted defect detection flow for SEM images
US20230222645A1 (en) Inspection apparatus, unit selection apparatus, inspection method, and computer-readable storage medium storing an inspection program
CN104680185B (en) Hyperspectral image classification method based on boundary point reclassification
CN112534243A (en) Inspection apparatus and method
Huang et al. Smart agriculture: real‐time classification of green coffee beans by using a convolutional neural network
WO2019131945A1 (en) Food inspection device, food inspection method, and learning method for food reconstruction neural network of food inspection device
El-Tokhy et al. Classification of welding flaws in gamma radiography images based on multi-scale wavelet packet feature extraction using support vector machine
CN114066835A (en) Image detection method, automatic optical detection method, device, storage medium and equipment
CN112184717A (en) Automatic segmentation method for quality inspection
Ibarra et al. Determination of Leaf Degradation Percentage for Banana leaves with Panama Disease Using Image Segmentation of Color Spaces and OpenCV
CN116485766A (en) Grain imperfect grain detection and counting method based on improved YOLOX
CN116152153A (en) Method and apparatus for automated defect detection
JP7250330B2 (en) Inspection device and learning device
Menon et al. Digital grading and sorting of fruits

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180201