JP7702892B2 - Inspection device and inspection method - Google Patents
Inspection device and inspection method Download PDFInfo
- Publication number
- JP7702892B2 JP7702892B2 JP2022009890A JP2022009890A JP7702892B2 JP 7702892 B2 JP7702892 B2 JP 7702892B2 JP 2022009890 A JP2022009890 A JP 2022009890A JP 2022009890 A JP2022009890 A JP 2022009890A JP 7702892 B2 JP7702892 B2 JP 7702892B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- unit
- learning
- ingredients
- model
- 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
Links
Landscapes
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
- Image Analysis (AREA)
Description
本発明は、検査装置および検査方法に関し、特に画像認識を利用した食品の盛り付け検査技術に関する。 The present invention relates to an inspection device and an inspection method, and in particular to a food presentation inspection technology that uses image recognition.
製造ラインなどで製造された食品の品質管理として、食品の盛り付け検査や、具材抜けの検査等の外観検査が知られている。従来から、これらの検査は目視により行われている。近年、画像認識技術の発展に伴い食品製造の分野においても、製造された食品の品質管理に画像認識を利用する技術が開発されている。 Appearance inspections, such as inspecting food presentation and checking for missing ingredients, are known as quality control methods for food produced on production lines. Traditionally, these inspections have been carried out visually. In recent years, with the development of image recognition technology, technology has been developed in the food production field that uses image recognition for quality control of produced foods.
例えば、特許文献1は、検査対象の食品について、異なる2つの波長の画像を撮影し、各画素のスペクトル解析を行って検査画像を生成し、検査対象の食品の状態を検査する技術を開示している。 For example, Patent Document 1 discloses a technology for capturing images of a food to be inspected at two different wavelengths, performing spectral analysis of each pixel to generate an inspection image, and inspecting the condition of the food to be inspected.
しかしながら、実際の食品製造の現場では、依然として食品の盛り付け検査などの品質検査は目視により行われることが多い。その理由として、食品に盛り付けられる食材は不定形状を有することが多く、同じ食材であっても形状がそれぞれ異なり、また食材はその色味も一定ではない場合があることが挙げられる。そのため、製造された食品に、決められた食材が盛り付けられていることの確認、各食材の個数、量、および盛り付け位置などを含む食品の盛り付け検査は、常に同じ基準で行うことが困難な場合が多い。このことから、画像認識を利用した食品の盛り付け検査は、検出ロジックの作成自体が困難とされることがある。 However, in actual food manufacturing sites, quality inspections such as food presentation inspections are still often performed visually. The reason for this is that the ingredients arranged on food products often have irregular shapes, and even the same ingredients can have different shapes and ingredients whose colors are also not always consistent. As a result, it is often difficult to always use the same standards to inspect food presentation, including checking that the specified ingredients are arranged on manufactured foods and the number, amount, and presentation position of each ingredient. For this reason, creating the detection logic for food presentation inspections using image recognition can be difficult.
さらに、近年においては、消費者のニーズの多様化に応じて多品種少量生産や商品ライフサイクルの短縮化が進み、一旦検出ロジックが作成されたとしても、利用範囲が限られてしまうことがあり、画像認識技術を利用した食品の盛り付け検査を現実的な手法として用いることが困難な場合がある。 Furthermore, in recent years, diversifying consumer needs have led to the trend toward high-mix, low-volume production and shorter product lifecycles. Even if detection logic is created, the scope of its use may be limited, making it difficult to use image recognition technology to inspect food presentation as a practical method.
従来の技術によれば、画像認識を利用した食品の盛り付け検査を簡易に行うことは困難であった。 With conventional technology, it has been difficult to easily inspect food presentation using image recognition.
本発明は、上述した課題を解決するためになされたものであり、画像認識を利用した食品の盛り付け検査をより簡易に行うことを目的とする。 The present invention has been made to solve the above-mentioned problems, and aims to make it easier to inspect food presentation using image recognition.
上述した課題を解決するために、本発明に係る検査装置は、配置された食材が含まれる画像を取得する取得部と、学習済み第1モデルを用いて、前記画像における前記食材の領域および種類を推定し、推定された前記食材の領域および種類を前記画像に関連付けた出力画像を含む第1推定結果を出力する第1推定部と、前記第1推定結果に基づいて、前記食材の種類ごとに、対応する前記領域が、前記食材の有無および過不足に関して予め設定された第1基準を満たすか否かを判断する第1判断部と、前記第1判断部による判断結果に基づいて、前記食材の配置に関する検査を行う検査部とを備える。 To solve the above-mentioned problems, the inspection device of the present invention includes an acquisition unit that acquires an image containing arranged ingredients, a first estimation unit that estimates the area and type of the ingredients in the image using a trained first model and outputs a first estimation result including an output image in which the estimated area and type of the ingredients are associated with the image, a first judgment unit that judges, based on the first estimation result, whether the corresponding area for each type of ingredient satisfies a first predetermined criterion regarding the presence or absence and excess or deficiency of the ingredient, and an inspection unit that inspects the arrangement of the ingredients based on the judgment result by the first judgment unit.
また、本発明に係る検査装置において、前記第1判断部は、前記食材の種類ごとに、前記領域の個数および大きさの少なくとも一方を特定して、前記領域の個数および大きさの少なくとも一方が前記第1基準を満たすか否かを判断してもよい。 In addition, in the inspection device according to the present invention, the first judgment unit may identify at least one of the number and size of the regions for each type of food material and judge whether or not at least one of the number and size of the regions satisfies the first criterion.
また、本発明に係る検査装置において、前記第1推定結果に含まれる前記出力画像を入力とする学習済み第2モデルを用いて、前記出力画像における複数の前記食材の間の相対的な配置関係を推定し、推定された配置関係を前記出力画像に関連付けた第2推定結果を出力する第2推定部と、前記第2推定結果に基づいて、前記配置関係が、前記配置関係の妥当性に関して予め設定された第2基準を満たすか否かを判断する第2判断部とをさらに備え、前記検査部は、前記第2判断部による判断結果に基づいて、前記食材の配置に関する検査を行ってもよい。 The inspection device according to the present invention may further include a second estimation unit that estimates the relative positional relationship between the ingredients in the output image using a trained second model that uses the output image included in the first estimation result as an input, and outputs a second estimation result that associates the estimated positional relationship with the output image, and a second judgment unit that judges whether the positional relationship satisfies a second criterion set in advance regarding the validity of the positional relationship based on the second estimation result, and the inspection unit may inspect the positional relationship of the ingredients based on the judgment result by the second judgment unit.
また、本発明に係る検査装置において、さらに、少なくとも前記検査部による検査結果を提示する提示部を備え、前記提示部は、前記画像、前記第1推定結果、前記第1判断部による判断結果、前記第2推定結果、前記第2判断部による判断結果、および前記検査部による検査結果を含む情報報のうちの少なくともいずれかを提示してもよい。 The inspection device according to the present invention may further include a presentation unit that presents at least the inspection results by the inspection unit, and the presentation unit may present at least one of the image, the first estimation result, the judgment result by the first judgment unit, the second estimation result, the judgment result by the second judgment unit, and information including the inspection results by the inspection unit.
また、本発明に係る検査装置において、さらに、予め設定されたモデルを構築するための学習処理を行う学習装置を備え、前記学習装置は、配置された前記食材を含む画像を第1学習用画像として用い、ニューラルネットワークの第1モデルを学習させて、前記食材の領域および種類を識別する第1特徴量を抽出し、抽出された前記第1特徴量により前記学習済み第1モデルを獲得する第1学習部と、前記第1学習部で獲得された前記学習済み第1モデルを記憶する第1記憶部とを備え、前記第1推定部は、前記第1記憶部から前記学習済み第1モデルを読み込んで前記学習済み第1モデルによる前記画像における前記食材の領域および種類の推定を行ってもよい。 The inspection device according to the present invention may further include a learning device that performs a learning process to construct a preset model, and the learning device may include a first learning unit that uses an image containing the arranged ingredients as a first learning image, learns a first model of a neural network, extracts a first feature amount that identifies the area and type of the ingredients, and acquires the trained first model using the extracted first feature amount, and a first storage unit that stores the trained first model acquired by the first learning unit, and the first estimation unit may read the trained first model from the first storage unit and estimate the area and type of the ingredients in the image using the trained first model.
また、本発明に係る検査装置において、前記第1モデルが、インスタンス・セグメンテーションによる画像認識モデルであってもよい。 In addition, in the inspection device according to the present invention, the first model may be an image recognition model based on instance segmentation.
また、本発明に係る検査装置において、前記学習装置は、前記第1推定部が出力する前記第1推定結果に含まれる前記出力画像を第2学習用画像として用いて、ニューラルネットワークの第2モデルを学習させて、前記第2学習用画像における複数の前記食材の間の相対的な配置関係を識別する第2特徴量を抽出し、抽出された前記第2特徴量により前記学習済みの第2モデルを獲得する第2学習部と、前記第2学習部で獲得された前記学習済みの第2モデルを記憶する第2記憶部とをさらに備えてもよい。 In the inspection device according to the present invention, the learning device may further include a second learning unit that uses the output image included in the first estimation result output by the first estimation unit as a second learning image to train a second model of a neural network, extracts second features that identify the relative positional relationship between the multiple ingredients in the second learning image, and acquires the trained second model using the extracted second features, and a second storage unit that stores the trained second model acquired by the second learning unit.
また、本発明に係る検査装置において、さらに、前記第1推定結果に含まれる前記出力画像を変換してより単純化した変換画像を生成する変換部を備え、前記第2学習部は、前記変換画像を前記第2学習用画像として用いて前記第2モデルを学習させ、前記学習済みの第2モデルを獲得してもよい。 In addition, the inspection device according to the present invention may further include a conversion unit that converts the output image included in the first estimation result to generate a simplified converted image, and the second learning unit may use the converted image as the second learning image to train the second model and acquire the trained second model.
また、本発明に係る検査装置において、前記第1推定結果に含まれる前記出力画像は、前記食材の種類ごとに、対応する前記領域が任意の色で塗られたカラーパターン画像であり、前記変換画像は、前記カラーパターン画像の領域各々を同一形状のオブジェクトに置き換えたカラーパターン画像であってもよい。 In addition, in the inspection device according to the present invention, the output image included in the first estimation result may be a color pattern image in which the corresponding areas for each type of food ingredient are painted with an arbitrary color, and the converted image may be a color pattern image in which each area of the color pattern image is replaced with an object of the same shape.
また、本発明に係る検査装置において、前記第1推定結果に含まれる前記出力画像は、前記食材の種類ごとに、対応する前記領域が任意の色で塗られたカラーパターン画像であり、前記変換画像は、前記カラーパターン画像の領域各々を、カラーパターンの色ごとに形状の異なるオブジェクトに置き換え、かつ、置き換えた前記オブジェクトの色を形状ごとに異なる色とした画像であってもよい。 In addition, in the inspection device according to the present invention, the output image included in the first estimation result may be a color pattern image in which the corresponding area is painted with an arbitrary color for each type of food ingredient, and the converted image may be an image in which each area of the color pattern image is replaced with an object having a different shape for each color of the color pattern, and the replaced object has a different color for each shape.
また、本発明に係る検査装置において、前記第1推定結果に含まれる前記出力画像は、前記食材の種類ごとに、対応する前記領域が任意の色で塗られたカラーパターン画像であり、前記変換画像は、前記カラーパターン画像の領域各々を、カラーパターンの色ごとに形状の異なるオブジェクトに置き換え、かつ、置き換えた前記オブジェクトの前記カラーパターンの色をすべて同一の色とした画像であってもよい。 In addition, in the inspection device according to the present invention, the output image included in the first estimation result may be a color pattern image in which the corresponding area is painted with an arbitrary color for each type of food ingredient, and the converted image may be an image in which each area of the color pattern image is replaced with an object having a different shape for each color of the color pattern, and the colors of the color patterns of the replaced objects are all the same color.
また、本発明に係る検査装置において、さらに、前記第1推定結果に含まれる前記出力画像の前記領域の推定外形線の最長のものの内部が、当該領域であるとして、前記出力画像を加工した加工画像を生成する加工部を備え、前記第2学習部は、前記加工画像を前記第2学習用画像として用いて前記第2モデルを学習させ、前記学習済みの第2モデルを獲得してもよい。 In addition, the inspection device according to the present invention may further include a processing unit that generates a processed image by processing the output image by assuming that the inside of the longest estimated outline of the area of the output image included in the first estimation result is the area in question, and the second learning unit may use the processed image as the second learning image to train the second model and acquire the trained second model.
また、本発明に係る検査装置において、前記学習装置は、さらに、前記食材の領域および種類が前記画像に関連付けられた対象画像のデータ拡張を行って前記第2学習用画像を生成するデータ拡張部を備え、前記データ拡張部は、前記対象画像に付与されている、前記対象画像における複数の前記食材の間の相対的な配置関係の妥当性に関するラベル情報に基づいて前記第2学習用画像を生成してもよい。 In addition, in the inspection device according to the present invention, the learning device further includes a data expansion unit that performs data expansion of a target image in which the region and type of the ingredient are associated with the image to generate the second learning image, and the data expansion unit may generate the second learning image based on label information that is assigned to the target image and that is related to the validity of the relative positional relationship between the multiple ingredients in the target image.
また、本発明に係る検査装置において、前記データ拡張部は、前記対象画像における複数の前記食材の間の相対的な配置関係が妥当であることを示す第1ラベルが付与された対象画像のデータ拡張を行って、前記第1ラベルが付与された前記第2学習用画像を生成してもよい。 In addition, in the inspection device according to the present invention, the data expansion unit may perform data expansion of a target image to which a first label indicating that the relative positional relationship between the multiple ingredients in the target image is valid is assigned, and generate the second learning image to which the first label is assigned.
また、本発明に係る検査装置において、前記データ拡張部は、前記対象画像における複数の前記食材の間の相対的な配置関係が妥当であることを示す第1ラベルが付与された対象画像のデータ拡張を行って、複数の前記食材の間の相対的な配置関係が妥当でないことを示す第2ラベルが付与された前記第2学習用画像を生成してもよい。 In addition, in the inspection device according to the present invention, the data expansion unit may perform data expansion of a target image to which a first label indicating that the relative positional relationship between the multiple ingredients in the target image is valid is assigned, and generate the second training image to which a second label indicating that the relative positional relationship between the multiple ingredients is invalid is assigned.
また、本発明に係る検査装置において、前記データ拡張部は、複数の前記食材の間の相対的な配置関係が妥当でないことを示す第2ラベルが付与された対象画像のデータ拡張を行って、前記第2ラベルが付与された前記第2学習用画像を生成してもよい。 In addition, in the inspection device according to the present invention, the data expansion unit may perform data expansion of a target image to which a second label indicating that the relative positional relationship between the multiple ingredients is not valid is assigned, and generate the second learning image to which the second label is assigned.
また、本発明に係る検査装置において、さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する抽出部を備え、前記データ拡張部は、前記対象画像における複数の前記食材の間の相対的な配置関係を維持しつつ、前記抽出部が抽出した前記領域を加工後再配置して前記第2学習用画像を生成してもよい。 The inspection device according to the present invention may further include an extraction unit that extracts the regions for each type of food ingredient from the target image, and the data expansion unit may process and rearrange the regions extracted by the extraction unit while maintaining the relative positional relationship between the multiple food ingredients in the target image to generate the second learning image.
また、本発明に係る検査装置において、さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する抽出部を備え、前記データ拡張部は、前記抽出部が抽出した前記領域のうち、2つ以上の互いに異なる種類の前記食材に対応する領域の位置を互いに置き換えて前記第2学習用画像を生成してもよい。 The inspection device according to the present invention may further include an extraction unit that extracts the regions for each type of food ingredient from the target image, and the data expansion unit may generate the second learning image by mutually replacing positions of regions corresponding to two or more different types of food ingredients among the regions extracted by the extraction unit.
また、本発明に係る検査装置において、さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する抽出部を備え、前記データ拡張部は、前記抽出部が抽出した前記領域のうちの1つ以上を前記対象画像から削除して前記第2学習用画像を生成してもよい。 The inspection device according to the present invention may further include an extraction unit that extracts the regions for each type of food material from the target image, and the data expansion unit may generate the second learning image by deleting one or more of the regions extracted by the extraction unit from the target image.
また、本発明に係る検査装置において、さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する抽出部を備え、前記データ拡張部は、前記抽出部が抽出した前記領域の各々の反転、回転、膨張、および収縮のうちの少なくともいずれかを行って前記対象画像のデータ拡張を行ってもよい。 The inspection device according to the present invention may further include an extraction unit that extracts the regions for each type of food material from the target image, and the data expansion unit may perform data expansion of the target image by performing at least one of inversion, rotation, expansion, and contraction of each of the regions extracted by the extraction unit.
また、上述した課題を解決するために、本発明に係る検査装置は、配置された食材が含まれる画像を取得する取得部と、学習済み第1モデルを用いて、前記画像における前記食材の領域をバウンディングボックスで検出して、複数の前記食材の間の相対的な配置関係と、前記食材の種類とを推定し、推定された前記配置関係を前記画像に関連付けた出力画像を含む第1推定結果を出力する第1推定部と、前記第1推定結果に基づいて、前記配置関係が予め設定された基準を満たすか否かを判断する第1判断部と、前記第1判断部による判断結果に基づいて、前記食材の配置に関する検査を行う検査部とを備える。 In order to solve the above-mentioned problems, the inspection device according to the present invention includes an acquisition unit that acquires an image containing arranged ingredients, a first estimation unit that uses a trained first model to detect the area of the ingredients in the image using a bounding box, estimates the relative arrangement between the ingredients and the type of the ingredients, and outputs a first estimation result including an output image in which the estimated arrangement is associated with the image, a first judgment unit that judges whether the arrangement satisfies a preset criterion based on the first estimation result, and an inspection unit that inspects the arrangement of the ingredients based on the judgment result by the first judgment unit.
また、上述した課題を解決するために、本発明に係る上記検査装置を用いて検査される食品は、食品製造ラインで製造され、前記食材が配置されて盛り付けられる加工麺、冷凍食品、弁当、および惣菜を含む。 Furthermore, in order to solve the above-mentioned problems, foods that can be inspected using the inspection device according to the present invention include processed noodles, frozen foods, boxed lunches, and side dishes that are manufactured on a food manufacturing line and in which the ingredients are arranged and served.
また、上述した課題を解決するために、本発明に係る検査方法は、配置された食材が含まれる画像を取得する第1ステップと、学習済み第1モデルを用いて、前記画像における前記食材の領域および種類を推定し、推定された前記食材の領域および種類を前記画像に関連付けた出力画像を含む第1推定結果を出力する第2ステップと、前記第1推定結果に基づいて、前記食材の種類ごとに、対応する前記領域が、前記食材の有無および過不足に関して予め設定された第1基準を満たすか否かを判断する第3ステップと、前記第3ステップでの判断結果に基づいて、前記食材の配置に関する検査を行う第4ステップとを備える。 To solve the above-mentioned problems, the inspection method of the present invention includes a first step of acquiring an image containing arranged ingredients, a second step of estimating the area and type of the ingredients in the image using a trained first model and outputting a first estimation result including an output image in which the estimated area and type of the ingredients are associated with the image, a third step of determining, based on the first estimation result, whether the corresponding area for each type of ingredient satisfies a first predetermined criterion regarding the presence or absence and excess or deficiency of the ingredient, and a fourth step of inspecting the arrangement of the ingredients based on the determination result in the third step.
また、本発明に係る検査方法において、前記第3ステップは、前記食材の種類ごとに、前記領域の個数および大きさの少なくとも一方を特定して、前記領域の個数および大きさの少なくとも一方が前記第1基準を満たすか否かを判断し、前記第4ステップは、前記判断結果に基づいて、前記食材の配置に関する検査を行ってもよい。 In addition, in the inspection method according to the present invention, the third step may involve identifying at least one of the number and size of the regions for each type of food ingredient and determining whether or not at least one of the number and size of the regions meets the first criterion, and the fourth step may involve inspecting the arrangement of the food ingredients based on the determination result.
また、本発明に係る検査方法において、前記第1推定結果に含まれる前記出力画像を入力とする学習済み第2モデルを用いて、前記出力画像における複数の前記食材の間の相対的な配置関係を推定し、推定された配置関係を前記出力画像に関連付けた第2推定結果を出力する第5ステップと、前記第2推定結果に基づいて、前記配置関係が、前記配置関係の妥当性に関して予め設定された第2基準を満たすか否かを判断する第6ステップとをさらに備え、前記第4ステップは、前記第6ステップでの判断結果に基づいて、前記食材の配置に関する検査を行ってもよい。 The inspection method according to the present invention further includes a fifth step of estimating the relative positional relationship between the ingredients in the output image using a trained second model that uses the output image included in the first estimation result as an input, and outputting a second estimation result in which the estimated positional relationship is associated with the output image, and a sixth step of determining whether the positional relationship satisfies a second predetermined criterion regarding the validity of the positional relationship based on the second estimation result, and the fourth step may inspect the positional relationship of the ingredients based on the determination result in the sixth step.
また、本発明に係る検査方法において、さらに、予め設定されたモデルを構築するための学習処理を行う学習ステップを備え、前記学習ステップは、配置された前記食材が含まれる画像を第1学習用画像として用い、ニューラルネットワークの第1モデルを学習させて、前記食材の領域および種類を識別する第1特徴量を抽出し、抽出された前記第1特徴量により前記学習済み第1モデルを獲得する第7ステップと、前記第7ステップで獲得された前記学習済み第1モデルを第1記憶部に記憶する第8ステップとを備え、前記第3ステップは、前記第1記憶部から前記学習済み第1モデルを読み込んで前記学習済み第1モデルによる前記画像における前記食材の領域および種類の推定を行ってもよい。 The inspection method according to the present invention further includes a learning step of performing a learning process to construct a preset model, the learning step including a seventh step of using an image including the arranged ingredients as a first learning image to train a first model of a neural network, extracting a first feature that identifies the area and type of the ingredients, and acquiring the trained first model using the extracted first feature, and an eighth step of storing the trained first model acquired in the seventh step in a first storage unit, and the third step may include reading the trained first model from the first storage unit and estimating the area and type of the ingredients in the image using the trained first model.
また、本発明に係る検査方法において、前記学習ステップは、前記第3ステップで出力する前記第1推定結果に含まれる前記出力画像を第2学習用画像として用いて、ニューラルネットワークの第2モデルを学習させて、前記第2学習用画像における複数の前記食材の間の相対的な配置関係を識別する第2特徴量を抽出し、抽出された前記第2特徴量により前記学習済みの第2モデルを獲得する第9ステップと、前記第9ステップで獲得された前記学習済みの第2モデルを第2記憶部に記憶する第10ステップとをさらに備えていてもよい。 In the inspection method according to the present invention, the learning step may further include a ninth step of using the output image included in the first estimation result output in the third step as a second learning image to train a second model of a neural network, extracting a second feature that identifies the relative positional relationship between the multiple ingredients in the second learning image, and acquiring the trained second model using the extracted second feature, and a tenth step of storing the trained second model acquired in the ninth step in a second storage unit.
また、本発明に係る検査方法において、さらに、前記第1推定結果に含まれる前記出力画像の前記領域の推定外形線の最長のものの内部が、当該領域であるとして、前記出力画像を加工した加工画像を生成する第11ステップを備え、前記第9ステップは、前記加工画像を前記第2学習用画像として用いて前記第2モデルを学習させ、前記学習済みの第2モデルを獲得してもよい。 In addition, the inspection method according to the present invention may further include an eleventh step of generating a processed image by processing the output image, assuming that the inside of the longest estimated outline of the region of the output image included in the first estimation result is the region in question, and the ninth step may use the processed image as the second learning image to train the second model, thereby acquiring the trained second model.
また、本発明に係る検査方法において、前記学習ステップは、さらに、前記食材の領域および種類が前記画像に関連付けられた対象画像のデータ拡張を行って前記第2学習用画像を生成する第12ステップを備え、前記第12ステップは、前記対象画像に付与されている、前記対象画像における複数の前記食材の間の相対的な配置関係の妥当性に関するラベル情報に基づいて前記第2学習用画像を生成してもよい。 In addition, in the inspection method according to the present invention, the learning step further includes a twelfth step of performing data expansion of a target image in which the area and type of the food ingredient are associated with the image to generate the second learning image, and the twelfth step may generate the second learning image based on label information attached to the target image regarding the validity of the relative positional relationship between the multiple food ingredients in the target image.
また、本発明に係る検査方法において、前記第12ステップは、前記対象画像における複数の前記食材の間の相対的な配置関係が妥当であることを示す第1ラベルが付与された対象画像のデータ拡張を行って、前記第1ラベルが付与された前記第2学習用画像を生成してもよい。 In addition, in the inspection method according to the present invention, the 12th step may involve performing data expansion on a target image to which a first label indicating that the relative positional relationship between the multiple ingredients in the target image is valid is assigned, to generate the second learning image to which the first label is assigned.
また、本発明に係る検査方法において、前記第12ステップは、前記対象画像における複数の前記食材の間の相対的な配置関係が妥当であることを示す第1ラベルが付与された対象画像のデータ拡張を行って、複数の前記食材の間の相対的な配置関係が妥当でないことを示す第2ラベルが付与された前記第2学習用画像を生成してもよい。 In addition, in the inspection method according to the present invention, the 12th step may involve performing data expansion of a target image to which a first label has been assigned indicating that the relative positional relationship between the multiple ingredients in the target image is appropriate, and generating the second learning image to which a second label has been assigned indicating that the relative positional relationship between the multiple ingredients is not appropriate.
また、本発明に係る検査方法において、前記第12ステップは、複数の前記食材の間の相対的な配置関係が妥当でないことを示す第2ラベルが付与された対象画像のデータ拡張を行って、前記第2ラベルが付与された前記第2学習用画像を生成してもよい。 In addition, in the inspection method according to the present invention, the 12th step may involve performing data expansion of a target image to which a second label indicating that the relative positional relationship between the multiple ingredients is not valid is assigned, and generating the second learning image to which the second label is assigned.
また、本発明に係る検査方法において、さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する第13ステップを備え、前記第12ステップは、前記対象画像における複数の前記食材の間の相対的な配置関係を維持しつつ、前記第13ステップで抽出された前記領域を加工後再配置して前記第2学習用画像を生成してもよい。 The inspection method according to the present invention may further include a thirteenth step of extracting the areas for each type of food ingredient from the target image, and the twelfth step may process and rearrange the areas extracted in the thirteenth step while maintaining the relative positional relationship between the multiple food ingredients in the target image to generate the second learning image.
また、本発明に係る検査方法において、さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する第13ステップを備え、前記第12ステップは、前記第13ステップで抽出された前記領域のうち、2つ以上の互いに異なる種類の前記食材に対応する領域の位置を互いに置き換えて前記第2学習用画像を生成してもよい。 The inspection method according to the present invention may further include a thirteenth step of extracting the regions for each type of food ingredient from the target image, and the twelfth step may generate the second learning image by mutually replacing the positions of the regions corresponding to two or more different types of food ingredients among the regions extracted in the thirteenth step.
また、本発明に係る検査方法において、さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する第13ステップを備え、前記第12ステップは、前記第13ステップで抽出された前記領域のうちの1つ以上を前記対象画像から削除して前記第2学習用画像を生成してもよい。 The inspection method according to the present invention may further include a thirteenth step of extracting the regions for each type of food material from the target image, and the twelfth step may generate the second learning image by deleting one or more of the regions extracted in the thirteenth step from the target image.
また、本発明に係る検査方法において、さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する第13ステップを備え、前記第12ステップは、前記第13ステップで抽出された前記領域の各々の反転、回転、膨張、および収縮のうちの少なくともいずれかを行って前記対象画像のデータ拡張を行ってもよい。 The inspection method according to the present invention may further include a thirteenth step of extracting the regions for each type of food material from the target image, and the twelfth step may perform at least one of inversion, rotation, expansion, and contraction of each of the regions extracted in the thirteenth step to expand the data of the target image.
また、本発明に係る検査方法において、さらに、少なくとも前記第4ステップでの検査結果を提示する第14ステップを備え、前記第14ステップは、前記画像、前記第1推定結果、前記第3ステップでの判断結果、および前記第4ステップでの検査結果を含む情報のうちの少なくともいずれかを提示してもよい。 The inspection method according to the present invention may further include a fourteenth step of presenting at least the inspection results from the fourth step, and the fourteenth step may present at least any of information including the image, the first estimation result, the judgment result from the third step, and the inspection results from the fourth step.
本発明によれば、学習済み第1モデルを用いて、配置された食材が含まれる画像における食材の領域および種類を推定し、推定された第1推定結果に基づいて、食材の種類ごとに、対応する領域が、食材の有無および過不足に関して予め設定された第1基準を満たすか否かを判断する。そのため、画像認識を利用した食品の盛り付け検査をより簡易に行うことができる。 According to the present invention, the area and type of ingredients in an image containing arranged ingredients are estimated using a trained first model, and for each type of ingredient, it is determined whether the corresponding area meets a pre-set first criterion regarding the presence or absence of ingredients and whether there is an excess or deficiency based on the first estimation result. This makes it easier to inspect food presentation using image recognition.
以下、本発明の好適な実施の形態について、図1から図25を参照して詳細に説明する。また、以下の説明において、本発明に係る検査装置の検査対象は、「配置された食材」であり、食材は、例えば、食品の製造ラインで製造された「食品」を構成し、食材の数は1つおよび複数の場合が含まれる。また、「食材の配置に関する検査」とは、食品の製造ラインで製造等されて、例えば容器に配置された複数の食材各々の種類、その有無、数、量のいずれか1つ以上の検査項目を含んでいてもよく、場所および食材の並び方である配置位置に関する検査を含み、これらを総称して「食品の盛り付け検査」ということがある。また、食材の並び方には当該食材のばらけ方を含むものとする。 A preferred embodiment of the present invention will be described in detail below with reference to Figures 1 to 25. In the following description, the inspection device according to the present invention inspects "arranged ingredients", which constitute "food" produced, for example, on a food production line, and includes both one and multiple ingredients. "Inspection of the arrangement of ingredients" may include one or more inspection items of the type, presence, number, and amount of each of multiple ingredients produced, for example, on a food production line and arranged in a container, and includes inspection of the location and arrangement of ingredients, which is the arrangement of the ingredients, and these are sometimes collectively referred to as "food presentation inspection". The arrangement of ingredients includes the way the ingredients are spread out.
[第1の実施の形態]
図1は、本発明の第1の実施の形態に係る検査装置1の構成を示すブロック図である。本実施の形態に係る検査装置1は、事前に外部のサーバなどで学習処理されて用意された学習済み第1モデルNN1を用いて、食品の容器等に配置された複数の食材が含まれる画像における複数の食材の領域および種類を推定する。さらに、検査装置1は、推定された結果(第1推定結果)に基づいて、複数の食材の種類ごとに、対応する領域が、複数の食材各々の有無および過不足に関して予め設定された第1基準を満たすか否かを判断する。さらに、検査装置1は、判断結果に基づいて、容器等に配置された食材の配置に関する検査を行う。本実施の形態では、学習済み第1モデルNN1として、食材を互いに区別して食材が存在する画像内の領域をピクセル単位で識別するインスタンス・セグメンテーションを用いる場合を例に挙げて説明する。
[First embodiment]
FIG. 1 is a block diagram showing the configuration of an inspection device 1 according to a first embodiment of the present invention. The inspection device 1 according to this embodiment estimates the areas and types of multiple ingredients in an image containing multiple ingredients placed in a food container or the like, using a trained first model NN1 that has been trained and prepared in advance on an external server or the like. Furthermore, the inspection device 1 judges whether or not the corresponding area for each type of multiple ingredients meets a first criterion set in advance regarding the presence or absence and excess or deficiency of each of the multiple ingredients based on the estimated result (first estimation result). Furthermore, the inspection device 1 inspects the arrangement of ingredients placed in a container or the like based on the judgment result. In this embodiment, an example will be described in which instance segmentation is used as the trained first model NN1, which distinguishes ingredients from each other and identifies areas in an image in which ingredients are present on a pixel-by-pixel basis.
[検査装置の機能ブロック]
本実施の形態に係る検査装置1は、取得部10、第1推定部11、第1判断部12、検査部13、提示部14、およびメモリ15を備える。
[Functional block of the inspection device]
The inspection device 1 according to this embodiment includes an acquisition unit 10 , a first estimation unit 11 , a first judgment unit 12 , an inspection unit 13 , a presentation unit 14 , and a memory 15 .
取得部10は、配置された食材が含まれる画像を取得する。例えば、取得部10は、食品の容器等に配置された複数の食材が含まれる画像を取得することができる。取得部10は、例えば、外部に設置されたカメラ105によって撮影された食品の静止画像または動画像を有線あるいは無線で取得する。本実施の形態において、カメラ105は、食品製造ラインに事前に構築された撮影環境に設けられ、容器等に配置された食材が含まれる画像(以下、「食品の画像」ということがある。)を撮影するものとする。特に、カメラ105は、製造ライン内の撮影環境において固定して設置され、固定された画角で画像を撮影するものとする。取得部10は、カメラ105から取得した食品の画像の輝度の調整やノイズの除去などの公知の前処理を行うことができる。 The acquisition unit 10 acquires an image including the arranged ingredients. For example, the acquisition unit 10 can acquire an image including multiple ingredients arranged in a food container or the like. The acquisition unit 10 acquires, for example, still or moving images of food captured by an externally installed camera 105 via wired or wireless connection. In this embodiment, the camera 105 is provided in a shooting environment that is constructed in advance in the food production line, and captures images including ingredients arranged in a container or the like (hereinafter, sometimes referred to as "food images"). In particular, the camera 105 is fixedly installed in the shooting environment in the production line, and captures images with a fixed angle of view. The acquisition unit 10 can perform known pre-processing such as adjusting the brightness of the food image acquired from the camera 105 and removing noise.
第1推定部11は、学習済み第1モデルNN1を用いて、取得部10が取得した画像における複数の食材の領域および種類を推定し、推定された複数の食材の領域および種類を取得部10によって取得された画像に関連付けて出力画像を含む第1推定結果を出力する。 The first estimation unit 11 uses the trained first model NN1 to estimate the areas and types of multiple ingredients in the image acquired by the acquisition unit 10, and outputs a first estimation result including an output image by associating the estimated areas and types of multiple ingredients with the image acquired by the acquisition unit 10.
より具体的には、第1推定部11は、取得部10が取得した画像を学習済み第1モデルNN1に与え、学習済み第1モデルNN1の演算を行って、入力された画像内のピクセルごとに食材のクラスである食材の種類と、画像に実際に存在する各食材の実体あるいは個体である食材インスタンスの領域を抽出する。 More specifically, the first estimation unit 11 provides the image acquired by the acquisition unit 10 to the trained first model NN1, and performs calculations of the trained first model NN1 to extract the type of ingredient, which is the ingredient class, for each pixel in the input image, and the area of the ingredient instance, which is the actual entity or individual of each ingredient that actually exists in the image.
第1推定部11は、後述のメモリ15が備える第1メモリ15Aに記憶されている学習済み第1モデルNN1を読み込んで推定処理を実行する。 The first estimation unit 11 reads the learned first model NN1 stored in the first memory 15A of the memory 15 described below and executes the estimation process.
ここで、第1推定部11による推定処理について、図4および図5を参照してより詳細に説明する。例えば、図4および図5に示す画像iは、取得部10によって取得された、食品の容器に配置された複数の食材の画像を示しており、例えば、食品「冷やし中華」のトッピングとして、「a」,「b」,「c」,「d」の4種類の食材が配置されている。より具体的には、食品「冷やし中華」には、例えば、食材「a」として「ハム」、食材「b」として「たまご」、食材「c」として「きゅうり」、食材「d」として「トマト」などの予め決められたトッピング食材が容器の中の冷やし中華の麺の上に配置され盛り付けられている。また、これらの食材は各々の数や量が決められており、製造ラインで製造された製品個々の食材の数や量が一定であることが好ましい。 Here, the estimation process by the first estimation unit 11 will be described in more detail with reference to Figs. 4 and 5. For example, image i shown in Figs. 4 and 5 shows an image of multiple ingredients arranged in a food container acquired by the acquisition unit 10, and four types of ingredients "a", "b", "c", and "d" are arranged as toppings for the food "hiyashi chuka". More specifically, the food "hiyashi chuka" has predetermined topping ingredients such as "ham" as ingredient "a", "egg" as ingredient "b", "cucumber" as ingredient "c", and "tomato" as ingredient "d" arranged and served on top of the noodles of the hiyashi chuka in the container. In addition, the number and amount of each of these ingredients are determined, and it is preferable that the number and amount of ingredients for each product manufactured on the production line are constant.
図4および図5に示す出力画像pは、画像iに含まれる各食材インスタンスの領域が抽出されて、各領域「a1」,「b1」,「c1」,「d1」および食材のクラスである種類「a」,「b」,「c」,「d」が推定されて、画像iに関連付けられた画像である。 The output image p shown in Figures 4 and 5 is an image associated with image i, in which the regions of each ingredient instance contained in image i are extracted, and the regions "a1", "b1", "c1", and "d1" and the ingredient classes "a", "b", "c", and "d" are estimated.
また、図4に示すように、第1推定部11は、画像iを入力として推定処理を行い、食材インスタンスごとの領域「a1」,「b1」,「c1」,「d1」がカラーパターンで示された画像pを出力する。例えば、任意の色のカラーパターンによって食材の種類(クラス)が区別される。同一種類の食材インスタンスの領域が複数存在する場合、これら複数の領域は、例えば、同一色のカラーパターンで示される。第1推定部11は、同一色あるいは同一模様のカラーパターンで示される食材の領域の数に基づき、食材の種類ごとの個数を検出することができる。特定の種類の食材における領域の数がゼロ個であった場合、その特定の食材は存在しないことを示す。 As shown in FIG. 4, the first estimation unit 11 performs estimation processing using image i as input, and outputs image p in which the regions "a1", "b1", "c1", and "d1" for each ingredient instance are shown in a color pattern. For example, ingredient types (classes) are distinguished by color patterns of any color. When there are multiple regions of the same type of ingredient instance, these multiple regions are shown, for example, in a color pattern of the same color. The first estimation unit 11 can detect the number of each type of ingredient based on the number of ingredient regions shown in a color pattern of the same color or design. If the number of regions for a particular type of ingredient is zero, this indicates that the particular ingredient does not exist.
図1に戻り、第1判断部12は、第1推定部11による第1推定結果に基づいて、複数の食材の種類ごとに、対応する領域が、食材の有無および過不足に関して予め設定された第1基準を満たすか否かを判断する。 Returning to FIG. 1, the first judgment unit 12 judges, based on the first estimation result by the first estimation unit 11, whether or not the corresponding area for each of the multiple types of ingredients satisfies a first criterion set in advance regarding the presence or absence of ingredients and the surplus or deficiency of ingredients.
例えば、第1判断部12は、複数の食材の種類ごとに、領域の個数および大きさの少なくとも一方を特定して、領域の個数および大きさの少なくとも一方が第1基準を満たすか否かを判断することができる。 For example, the first judgment unit 12 can identify at least one of the number and size of regions for each of multiple types of ingredients and judge whether or not at least one of the number and size of regions satisfies a first criterion.
第1基準は、決められた食材が存在しているか否か、食材が決められた個数だけ配置されているか、および、食材が決められた量だけ存在しているかを判断する基準として設定される。 The first criterion is set as a criterion for determining whether a specific ingredient is present, whether the ingredient is arranged in a specific number, and whether the ingredient is present in a specific amount.
第1基準は、より適切に食材の有無および過不足に関する判断が可能となるよう食材の種類ごとの形状や大きさなどの特質に基づいて設定される。したがって、食材の個数のみで過不足を判断することが好ましい場合には個数についての基準値を用いることができる。あるいは、食材の領域の大きさで過不足を判断することがより適切である場合には領域の大きさに係る基準値を用いることができる。同様に、これらの組み合わせで判断されることもできる。このように、第1基準は、複数の基準を含む場合がある。 The first criterion is set based on the characteristics of each type of ingredient, such as the shape and size, so as to make it possible to more appropriately determine whether an ingredient is present or absent, and whether there is an excess or deficiency. Thus, if it is preferable to determine whether there is an excess or deficiency based only on the number of ingredients, a reference value for the number can be used. Alternatively, if it is more appropriate to determine whether there is an excess or deficiency based on the size of the area of the ingredient, a reference value related to the size of the area can be used. Similarly, a determination can also be made based on a combination of these. In this way, the first criterion may include multiple criteria.
例えば、第1判断部12は、食材の種類ごとの領域の大きさとして、画像において抽出された食材の領域の絶対的な面積が食材の量に相当するものとして面積値を第1基準として用いることができる。なお、面積値は画像における領域のピクセル数で表現することができる。あるいは、後述するように、推定された食材の種類ごとの領域の面積の総和を、その食材の量として第1基準を設定することもできる。 For example, the first judgment unit 12 can use the area value as the first criterion for the size of the area for each type of ingredient, assuming that the absolute area of the area of the ingredient extracted in the image corresponds to the amount of the ingredient. The area value can be expressed as the number of pixels of the area in the image. Alternatively, as described below, the first criterion can be set to the sum of the areas of the estimated areas for each type of ingredient, representing the amount of the ingredient.
また、一つの種類の食材が複数の食材によって構成される場合に、第1判断部12は、各々の領域が含まれる一つの種類の食材全体の面積が一定の面積を超えるか否かを第1基準として用いて、同一種類の食材の過不足についての判断を行うことができる。例えば、ピザのトッピングとして一定の範囲に一定の量だけ配置されるシュレッドチーズ等が挙げられる。例えば、シュレッド状のチーズ各々の領域を囲った面積が、一定面積を超える、かつ、シュレッド状のチーズの数が一定数を超える場合に、第1判断部12は、食材チーズが第1基準を満たし、食材チーズの過不足がないと判断することができる。 In addition, when one type of ingredient is composed of multiple ingredients, the first judgment unit 12 can use as a first criterion whether the total area of one type of ingredient, including each region, exceeds a certain area to judge whether there is an excess or deficiency of the same type of ingredient. An example is shredded cheese, which is placed in a certain amount in a certain area as a pizza topping. For example, when the area surrounding each region of shredded cheese exceeds a certain area and the number of shredded cheese pieces exceeds a certain number, the first judgment unit 12 can judge that the cheese ingredient meets the first criterion and there is no excess or deficiency of the cheese ingredient.
例えば、図5の領域Bに示すように、予め設定された第1基準として、食材の種類ごとに予め設定されている食材の個数に対するしきい値、および画像に占める食材の領域における面積に対するしきい値を用いることができる。例えば、図5の食材aの例では、第1推定部11が推定した「推定個数」は「2」個、食材aにおける領域a1の絶対的な面積である「推定面積」は「100」ピクセルである。また、個数について設定された第1基準「個数しきい値」は「3」個、面積について設定された第1基準である「面積しきい値」は「110-200」ピクセルの範囲である。 For example, as shown in area B in FIG. 5, the first criterion may be a threshold value for the number of ingredients that is preset for each type of ingredient, and a threshold value for the area of the ingredient's area in the image. For example, in the example of ingredient a in FIG. 5, the "estimated number" estimated by the first estimation unit 11 is "2", and the "estimated area", which is the absolute area of area a1 in ingredient a, is "100" pixels. In addition, the first criterion set for the number, the "number threshold", is "3", and the first criterion set for the area, the "area threshold", is in the range of "110-200" pixels.
第1判断部12は、推定された食材各々の個数が第1基準を満たすか否か、および、推定された食材各々の領域の面積が第1基準を満たすか否かを判断する。図5の例では、第1判断部12は、推定された食材aの個数については、項目「個数判定」に示すように「個数しきい値」の「3」個を満たしていない(「NG」)と判断する。さらに、第1判断部12は、推定された食材aにおける領域a1の面積について、項目「面積判定」に示される「面積しきい値」の「110-200」ピクセルの範囲を満たしていない(「NG」)と判断する。 The first judgment unit 12 judges whether the number of each estimated ingredient meets a first criterion, and whether the area of each estimated ingredient's region meets a first criterion. In the example of FIG. 5, the first judgment unit 12 judges that the number of estimated ingredient a does not meet the "number threshold" of "3" ("NG") as shown in the item "number judgment". Furthermore, the first judgment unit 12 judges that the area of region a1 in estimated ingredient a does not meet the "area threshold" of "110-200" pixels ("NG") as shown in the item "area judgment".
また、第1判断部12は、例えば、図5の領域Bに示される「検査項目」に示すように、食材aの個数が第1基準を満たし、かつ、領域a1の面積が第1基準を満たしているか否かを判断する。なお、例えば、食材b、cについては、領域b1、c1の面積のみが考慮され、食材dについては個数のみが食材の有無および過不足の判断において考慮されている。 The first judgment unit 12 judges whether the number of ingredients a meets the first criterion and the area of area a1 meets the first criterion, for example, as shown in the "inspection items" shown in area B of FIG. 5. Note that, for example, for ingredients b and c, only the areas of areas b1 and c1 are taken into consideration, and for ingredient d, only the number is taken into consideration in judging the presence or absence of the ingredient and whether there is an excess or shortage.
検査部13は、第1判断部12による判断結果に基づいて、容器等に配置された複数の食材の配置に関する検査を行う。例えば、検査部13は、食品の容器等に配置された全ての種類の食材「a」,「b」,「c」,「d」について、その有無および過不足に関する第1判断部12による判断が肯定的であった場合には、食材の配置に関する検査は合格であるとの検査結果を出力することができる。一方、複数の種類の食材の一つでも否定的な判断結果が得られた場合には、検査部13は、食材の配置に関する検査は不合格とする検査結果を出力することができる。 The inspection unit 13 inspects the arrangement of multiple ingredients placed in a container or the like based on the judgment result by the first judgment unit 12. For example, if the judgment by the first judgment unit 12 regarding the presence or absence and excess or deficiency of all types of ingredients "a", "b", "c", and "d" placed in a food container or the like is positive, the inspection unit 13 can output an inspection result indicating that the inspection of the ingredient arrangement has passed. On the other hand, if a negative judgment result is obtained for even one of the multiple types of ingredients, the inspection unit 13 can output an inspection result indicating that the inspection of the ingredient arrangement has failed.
例えば、図5の領域Bにおける項目「検査結果」は、食材aからdのうち、食材a、cに係る食材の有無および過不足に関する判断結果が第1基準を満たしていないため、最終的な食材の配置に関する検査結果、即ち、食品の盛り付け検査結果は不合格「NG」となっている。 For example, in the item "Inspection Result" in area B of FIG. 5, the judgment results regarding the presence or absence and excess or deficiency of ingredients a and c among ingredients a to d do not meet the first criterion, so the final inspection result regarding the placement of ingredients, i.e., the food presentation inspection result, is a failure "NG."
提示部14は、少なくとも検査部13による検査結果を提示する。例えば、提示部14は、検査結果を表示させる表示装置108を備えることができる。図5に示すように、例えば、提示部14は、表示装置108の表示画面の領域Aにおいて、カメラ105によって撮影された複数の食材の画像iと、第1推定部11による第1推定結果を示す出力画像pと、画像i、および推定結果がカラーパターンで区別された出力画像pを合成した画像sとを表示させることができる。 The presentation unit 14 presents at least the inspection results obtained by the inspection unit 13. For example, the presentation unit 14 can include a display device 108 that displays the inspection results. As shown in FIG. 5, for example, the presentation unit 14 can display, in area A of the display screen of the display device 108, an image i of a plurality of ingredients photographed by the camera 105, an output image p showing the first estimation result obtained by the first estimation unit 11, and an image s obtained by combining the image i and the output image p in which the estimation result is distinguished by a color pattern.
また、提示部14は、表示装置108の表示画面に設けられた領域Bに、食品の「品種:冷やし中華」、「食材」の種類、「推定個数」、「推定面積」、「個数しきい値」、「面積しきい値」、「個数判定」、「面積判定」、「検査項目」、「判定結果」、「検査結果」のそれぞれの項目に対応する値を表示させることができる。 In addition, the presentation unit 14 can display in area B on the display screen of the display device 108 values corresponding to each of the following items: "Type: chilled Chinese noodles," "Ingredient" type of food, "Estimated number," "Estimated area," "Number threshold," "Area threshold," "Number judgment," "Area judgment," "Test item," "Judgment result," and "Test result."
なお、提示部14は、検査部13による検査結果を検査装置1のユーザに提示することができれば、画面表示だけでなく、音声、その他の形態による情報の提示を行うこともできる。 In addition, if the presentation unit 14 can present the test results obtained by the test unit 13 to the user of the test device 1, it can present the information not only by displaying the screen, but also by voice or other forms of information.
メモリ15は、取得部10がカメラ105から取得した、食品の容器等に配置された食材が含まれる画像を記憶する。また、メモリ15は、第1推定部11による第1推定結果、第1判断部12が用いる予め設定された第1基準などを記憶している。 The memory 15 stores images acquired by the acquisition unit 10 from the camera 105, the images including ingredients placed in food containers, etc. The memory 15 also stores the first estimation result by the first estimation unit 11, the first criterion set in advance to be used by the first judgment unit 12, etc.
メモリ15は、第1メモリ15Aを備える。第1メモリ15Aは、外部のサーバ等で事前に学習処理され構築されたインスタンス・セグメンテーションによる画像認識モデルである学習済み第1モデルNN1およびその結果を用いた判断に用いる閾値情報等の第1基準を記憶する。例えば、第1メモリ15Aは、食品の品種ごとの学習済み第1モデルNN1を事前に記憶することができる。このように、予め複数の食品の各々に対応する学習済み第1モデルNN1および第1基準を記憶しておくことで、同一の製造ラインにおいて異なる食品が製造される場合においても、検査装置1で利用する学習済み第1モデルNN1を切り替えることで、異なる食品の盛り付け検査に対応することが可能である。 The memory 15 includes a first memory 15A. The first memory 15A stores a trained first model NN1, which is an image recognition model based on instance segmentation that has been previously trained and constructed on an external server or the like, and a first criterion such as threshold information used for making judgments using the results. For example, the first memory 15A can store a trained first model NN1 for each food variety in advance. In this way, by storing trained first models NN1 and first criteria corresponding to each of a plurality of foods in advance, even when different foods are manufactured on the same production line, it is possible to handle the plating inspection of different foods by switching the trained first model NN1 used by the inspection device 1.
[検査装置のハードウェア構成]
次に、本実施の形態に係る検査装置1を実現するハードウェア構成の一例について図2のブロック図を用いて説明する。
[Hardware configuration of inspection device]
Next, an example of a hardware configuration for realizing the inspection device 1 according to the present embodiment will be described with reference to the block diagram of FIG.
図2に示すように、検査装置1は、例えば、バス101を介して接続されるプロセッサ102、主記憶装置103、通信インターフェース(I/F)104、補助記憶装置106、入出力I/O107を備えるコンピュータと、これらのハードウェア資源を制御するプログラムによって実現することができる。また、検査装置1は、バス101を介して外部のカメラ105と接続する。また、検査装置1は、バス101を介して接続された表示装置108を備えることができる。 As shown in FIG. 2, the inspection device 1 can be realized by, for example, a computer including a processor 102, a main memory device 103, a communication interface (I/F) 104, an auxiliary memory device 106, and an input/output I/O 107 connected via a bus 101, and a program that controls these hardware resources. The inspection device 1 also connects to an external camera 105 via the bus 101. The inspection device 1 can also include a display device 108 connected via the bus 101.
主記憶装置103には、プロセッサ102が各種制御や演算を行うためのプログラムが予め格納されている。プロセッサ102と主記憶装置103とによって、図1に示した取得部10、第1推定部11、第1判断部12、検査部13など、検査装置1の各機能が実現される。 The main memory device 103 stores in advance programs that allow the processor 102 to perform various controls and calculations. The processor 102 and the main memory device 103 realize the various functions of the inspection device 1, such as the acquisition unit 10, the first estimation unit 11, the first judgment unit 12, and the inspection unit 13 shown in FIG. 1.
通信I/F104は、検査装置1と各種外部電子機器との間をネットワーク接続するためのインターフェース回路である。通信I/F104によって図1で示した取得部10や提示部14が実現される。なお、通信I/F104より、図1で説明した第1推定部11が用いる学習済み第1モデルNN1およびその結果を用いた判断に用いる閾値情報等がネットワークNWを介して外部端末より受信される構成やメモリーカード等の記憶媒体を利用して取得される構成としてもよい。また、通信I/F104より、図1で説明した第1判断部12および検査部13がそれぞれ用いる予め設定された基準が、ネットワークNWを介して外部端末より受信される構成やメモリーカード等の記憶媒体を利用して取得される構成としてもよい。 The communication I/F 104 is an interface circuit for network connection between the inspection device 1 and various external electronic devices. The acquisition unit 10 and the presentation unit 14 shown in FIG. 1 are realized by the communication I/F 104. The communication I/F 104 may receive the learned first model NN1 used by the first estimation unit 11 described in FIG. 1 and threshold information used for judgment using the result from the learned first model NN1 from an external terminal via the network NW or may be acquired using a storage medium such as a memory card. The communication I/F 104 may also receive the preset criteria used by the first judgment unit 12 and the inspection unit 13 described in FIG. 1 from an external terminal via the network NW or may be acquired using a storage medium such as a memory card.
カメラ105は、光信号を画像信号に変換して、動画や静止画像を生成することができる。カメラ105で撮影された、食品の容器等に配置された食材が含まれる動画像や静止画像が学習済み第1モデルNN1の入力画像として用いられて、プロセッサ102によりインスタンス・セグメンテーションによる画像内の各ピクセルレベルでの食材の種類がインスタンスごとに検出される。 The camera 105 can convert the optical signal into an image signal to generate video and still images. Video and still images captured by the camera 105, which include ingredients placed in a food container or the like, are used as input images for the trained first model NN1, and the processor 102 detects the type of ingredient for each instance at the pixel level in the image by instance segmentation.
補助記憶装置106は、読み書き可能な記憶媒体と、その記憶媒体に対してプログラムやデータなどの各種情報を読み書きするための駆動装置とで構成されている。補助記憶装置106には、記憶媒体としてハードディスクやフラッシュメモリなどの半導体メモリを使用することができる。 The auxiliary storage device 106 is composed of a readable/writable storage medium and a drive for reading and writing various information such as programs and data from the storage medium. The auxiliary storage device 106 can use semiconductor memory such as a hard disk or flash memory as the storage medium.
補助記憶装置106は、検査装置1が実行する検査プログラムを格納するプログラム格納領域を有する。また、補助記憶装置106は、インスタンス・セグメンテーションによる食材の検出などの推定処理、推定結果に基づく判断処理、食品の盛り付けに関する検査処理を行うためのプログラムを格納する領域を有する。補助記憶装置106によって、図1で説明したメモリ15および第1メモリ15Aが実現される。また、補助記憶装置106には、学習済み第1モデルNN1およびその結果を用いた判断に用いる閾値情報等の第1基準が記憶されている。さらには、例えば、上述したデータやプログラムやなどをバックアップするためのバックアップ領域などを有していてもよい。 The auxiliary storage device 106 has a program storage area for storing the inspection program executed by the inspection device 1. The auxiliary storage device 106 also has an area for storing programs for performing estimation processes such as detecting ingredients by instance segmentation, judgment processes based on the estimation results, and inspection processes related to food presentation. The auxiliary storage device 106 realizes the memory 15 and first memory 15A described in FIG. 1. The auxiliary storage device 106 also stores the first criterion, such as the learned first model NN1 and threshold information used for judgments using the results of the learned model. Furthermore, the auxiliary storage device 106 may have, for example, a backup area for backing up the above-mentioned data, programs, etc.
入出力I/O107は、外部機器からの信号を入力したり、外部機器へ信号を出力したりするI/O端子により構成される。 The input/output I/O 107 is composed of I/O terminals that input signals from external devices and output signals to external devices.
表示装置108は、液晶ディスプレイなどによって構成される。表示装置108によっても図1で説明した提示部14を実現することができる。 The display device 108 is configured with a liquid crystal display or the like. The display device 108 can also realize the presentation unit 14 described in FIG. 1.
ここで、補助記憶装置106のプログラム格納領域に格納されているプログラムは、本明細書で説明する検査方法の順序に沿って時系列に処理が行われるプログラムであってもよく、並列に、あるいは呼び出しが行われたときなどの必要なタイミングで処理が行われるプログラムであってもよい。また、プログラムは、1つのコンピュータにより処理されるものでもよく、複数のコンピュータによって分散処理されるものであってもよい。 The program stored in the program storage area of the auxiliary storage device 106 may be a program that is processed chronologically in accordance with the sequence of the inspection method described in this specification, or may be a program that is processed in parallel or at the required timing, such as when called. In addition, the program may be processed by one computer, or may be processed in a distributed manner by multiple computers.
[検査装置の動作]
次に、上述した構成を有する検査装置1の動作について、図3のフローチャートおよび図4の説明図を用いて詳細に説明する。第1メモリ15Aには、事前に図示されない外部のサーバなどで行われた学習処理により得られた学習済み第1モデルNN1およびその結果を用いた判断に用いる閾値情報等の第1基準が格納され、以下の処理が実行される。
[Operation of the inspection device]
Next, the operation of the inspection device 1 having the above-mentioned configuration will be described in detail with reference to the flowchart in Fig. 3 and the explanatory diagram in Fig. 4. The first memory 15A stores a trained first model NN1 obtained by a learning process performed in advance on an external server (not shown) and a first criterion such as threshold information used for judgment using the result of the learning process, and the following process is executed.
まず、検査が開始されると、第1推定部11は、第1メモリ15Aから学習済み第1モデルNN1をロードする(ステップS1)。例えば、ステップS1でロードされる学習済み第1モデルNN1は、Mask R-CNN,DeepMask,FCISなどに代表されるインスタンス・セグメンテーションのアーキテクチャを有する。例えば、図4に示すように、学習済み第1モデルNN1は、食品の容器等に配置された食材a,b,c,dをピクセルごとに識別し、入力された画像iに含まれる食材インスタンスを推定し、食材インスタンスの領域a1,b1,c1,d1を抽出して、領域ごとの食材a,b,c,dを推定する特徴量(第1特徴量)が学習されたモデルである。 First, when the inspection is started, the first estimation unit 11 loads the trained first model NN1 from the first memory 15A (step S1). For example, the trained first model NN1 loaded in step S1 has an instance segmentation architecture represented by Mask R-CNN, DeepMask, FCIS, and the like. For example, as shown in FIG. 4, the trained first model NN1 is a model that has been trained to identify ingredients a, b, c, and d arranged in a food container, etc., for each pixel, estimate the ingredient instance contained in the input image i, extract the areas a1, b1, c1, and d1 of the ingredient instance, and estimate the ingredients a, b, c, and d for each area (first feature amount).
次に、取得部10は、カメラ105で撮影された複数の食材が含まれる画像を取得する(ステップS2)。図4に示すように、ステップS2で取得される画像iは、例えば、製造ラインで製造された食品の容器等に配置あるいは盛り付けられた食材a,b,c,dの状態がより把握しやすい上面から撮影された画像である。 Next, the acquisition unit 10 acquires an image including multiple ingredients captured by the camera 105 (step S2). As shown in FIG. 4, the image i acquired in step S2 is, for example, an image captured from above, which makes it easier to grasp the state of ingredients a, b, c, and d arranged or plated in food containers or the like produced on a production line.
次に、第1推定部11は、第2ステップで取得された画像を入力として、ステップS1でロードした学習済み第1モデルNN1の演算を行う(ステップS3)。次に、第1推定部11は、学習済み第1モデルNN1の演算結果である第1推定結果を出力する(ステップS4)。 Next, the first estimation unit 11 performs calculations on the trained first model NN1 loaded in step S1 using the image acquired in the second step as input (step S3). Next, the first estimation unit 11 outputs the first estimation result, which is the calculation result of the trained first model NN1 (step S4).
具体的には、第1推定部11は、学習済み第1モデルNN1を用いて、ステップS2で取得された画像における複数の食材の領域a1,b1,c1,d1および食材の種類a,b,c,dを推定し、推定された複数の食材の領域および種類を入力画像iに関連付けた出力画像pを含む第1推定結果を出力する。出力画像pは、複数の食材の種類ごとに、対応する領域が任意の色で塗られたカラーパターン画像である。 Specifically, the first estimation unit 11 uses the trained first model NN1 to estimate the regions a1, b1, c1, d1 of multiple ingredients and the types a, b, c, d of ingredients in the image acquired in step S2, and outputs a first estimation result including an output image p in which the estimated regions and types of multiple ingredients are associated with the input image i. The output image p is a color pattern image in which the corresponding regions for each type of multiple ingredients are painted in an arbitrary color.
つまり、第1推定結果に含まれる出力画像には、ピクセル情報、および画像内での位置情報が含まれる。本実施の形態では、第1モデルNN1として、このようなインスタンス・セグメンテーションを採用するため、画像内に同一種類の食材が複数個含まれている場合であっても、食材をインスタンスごとに区別して検出することが可能である。 In other words, the output image included in the first estimation result includes pixel information and position information within the image. In this embodiment, because this type of instance segmentation is adopted as the first model NN1, it is possible to distinguish and detect ingredients by instance even if the image contains multiple ingredients of the same type.
次に、第1判断部12は、ステップS4で出力された第1推定結果に基づいて、複数の食材の種類ごとに、対応する領域が、食材の有無および過不足に関して予め設定された第1基準を満たすか否かを判断する(ステップS5)。例えば、第1判断部12は、各食材の推定個数、つまり、同一種類の食材の領域あるいはカラーパターンの数に対するしきい値処理を行うことができる。また、第1判断部12は、食材の種類ごとに推定された、食材の領域の画像内に占める面積に対するしきい値処理を行うことができる。 Next, the first judgment unit 12 judges, for each of the multiple types of ingredients, whether the corresponding area satisfies a first preset criterion regarding the presence or absence of ingredients and the excess or deficiency of ingredients, based on the first estimation result output in step S4 (step S5). For example, the first judgment unit 12 can perform threshold processing on the estimated number of each ingredient, that is, the number of areas or color patterns of the same type of ingredient. The first judgment unit 12 can also perform threshold processing on the area of the ingredient area within the image, estimated for each type of ingredient.
次に、検査部13は、ステップS5で得られた各食材の有無および過不足に関する判断結果に基づいて、食品の容器等に配置された複数の食材の配置に関する検査を行う(ステップS6)。例えば、検査部13は、ステップS5において、すべての種類の食材が、個数および面積に係る第1基準を満たす場合には、食品の容器等に配置された複数の食材の配置に関する検査は合格であるとの検査結果を出力することができる。前述したように、本実施の形態において、容器等に配置された食材の配置に関する検査とは、食材各々の種類、その有無、数、量などに関する食品の盛り付け検査が含まれる。 Next, the inspection unit 13 inspects the arrangement of multiple ingredients placed in a food container or the like based on the judgment results regarding the presence or absence and surplus/deficiency of each ingredient obtained in step S5 (step S6). For example, if in step S5 the inspection unit 13 finds that all types of ingredients meet the first criteria regarding the number and area, it can output an inspection result indicating that the inspection of the arrangement of multiple ingredients placed in a food container or the like has passed. As described above, in this embodiment, the inspection of the arrangement of ingredients placed in a container or the like includes an inspection of the food presentation regarding the type of each ingredient, its presence or absence, number, amount, etc.
次に、提示部14は、ステップS6で得られた検査結果を提示する(ステップS7)。例えば、提示部14は、図5に示すように、表示装置108の表示画面の領域Bに、ステップS4で算出された食材a,b,c,dごとの推定個数および推定面積をテーブル形式で表示することができる。また、提示部14は、領域Bに設けられたテーブルに個数および面積についてのステップS5での判断結果を示す値を表示させることができる。また、前述したように、提示部14は、元の画像i、食材インスタンスの領域がカラーパターンで区別された出力画像p、および元の画像iと出力画像pとを合成した画像sをそれぞれ並べて領域Aに表示する。このように、検査結果とともに入力画像および出力画像、さらにはこれらを合成した画像を並べて表示することで、ユーザはより直感的に食品の盛り付け検査の結果を把握することができる。 Next, the presentation unit 14 presents the inspection results obtained in step S6 (step S7). For example, as shown in FIG. 5, the presentation unit 14 can display the estimated number and estimated area of each of ingredients a, b, c, and d calculated in step S4 in a table format in area B of the display screen of the display device 108. The presentation unit 14 can also display values indicating the judgment results in step S5 regarding the number and area in a table provided in area B. As described above, the presentation unit 14 displays the original image i, the output image p in which the areas of the ingredient instances are distinguished by a color pattern, and the image s obtained by combining the original image i and the output image p side by side in area A. In this way, by displaying the input image, the output image, and the image obtained by combining these side by side together with the inspection results, the user can more intuitively grasp the results of the food presentation inspection.
以上説明したように、第1の実施の形態によれば、食品の容器等に配置された食材が含まれる画像に基づいて、画像内のピクセルごとに食材の種類を推定し、食材のインスタンスごとに領域を抽出するので、画像認識を利用した食品の盛り付け検査をより簡易に行うことができる。 As described above, according to the first embodiment, based on an image containing ingredients arranged in a food container or the like, the type of ingredient is estimated for each pixel in the image, and an area is extracted for each ingredient instance, making it easier to inspect food presentation using image recognition.
また、第1の実施の形態によれば、画像認識技術の中でも、インスタンス・セグメンテーションに係る物体検出手法を採用するので、個々の食材における色の違い、濃淡、明暗等の存在や形状が一定でない場合であっても、食材の種類、数、および量を画像内のインスタンスごとに容易に推定することができる。 In addition, according to the first embodiment, an object detection method related to instance segmentation is adopted among image recognition techniques, so that the type, number, and amount of ingredients can be easily estimated for each instance in the image even if the presence or shape of each ingredient is not consistent, such as differences in color, shade, brightness, etc.
また、第1の実施の形態によれば、食品の容器等に配置された食材の画像を撮影する際に、食品の品種に応じて個別の撮影環境を構築する必要が少なく、検査装置1およびカメラ105はより簡易な構成を有するので、食品の製造ラインに容易に組み込むことが可能である。さらに、同一の製造ラインで異なる食品を製造する場合であっても、食品ごとに用意された学習済み第1モデルNN1を切り替えて用いれば検査が可能である。さらには、従来目視で行われていた食品の盛り付け検査を検査装置1が行うことで省人化に寄与することができる。 In addition, according to the first embodiment, when taking images of ingredients placed in food containers or the like, there is less need to create separate shooting environments for each type of food, and the inspection device 1 and camera 105 have a simpler configuration, making them easy to incorporate into food production lines. Furthermore, even when different foods are produced on the same production line, inspection is possible by switching between the trained first model NN1 prepared for each food. Furthermore, the inspection device 1 can contribute to labor savings by performing food presentation inspection, which was previously performed visually.
なお、説明した実施の形態ではカメラ105が外部に設置されている場合について説明したが、取得部10がカメラを備える構成としてもよい。 In the embodiment described above, the camera 105 is installed externally, but the acquisition unit 10 may also be configured to include a camera.
また、説明した実施の形態では、一つの検査装置1にすべての機能部が設けられている場合について説明した。しかし、検査装置1が備える各機能部は、一つのコンピュータとして実現される場合以外にも、ネットワーク上に分散した構成とすることもできる。 In the embodiment described above, all the functional units are provided in one inspection device 1. However, the functional units of the inspection device 1 can be realized as a single computer or can be distributed over a network.
[第2の実施の形態]
次に、本発明の第2の実施の形態について説明する。なお、以下の説明では、上述した第1の実施の形態と同じ構成については同一の符号を付し、その説明を省略する。
[Second embodiment]
Next, a second embodiment of the present invention will be described. In the following description, the same components as those in the first embodiment are given the same reference numerals, and the description thereof will be omitted.
第1の実施の形態では、学習済みの第1モデルNN1を用いて、食品の容器等に配置された複数の食材の種類ごとの有無および過不足に関して予め設定された第1基準を満たすか否かを判断する場合について説明した。これに加えて、第2の実施の形態では、さらに、学習済み第2モデルNN2を用いて、複数の種類の食材間の相対的な配置関係を推定する。 In the first embodiment, a trained first model NN1 is used to determine whether a predetermined first criterion is met regarding the presence or absence and surplus/deficiency of each type of multiple ingredients placed in a food container or the like. In addition, in the second embodiment, a trained second model NN2 is further used to estimate the relative positional relationship between multiple types of ingredients.
[検査装置の機能ブロック]
図6は、本実施の形態に係る検査装置1Aの構成を示す機能ブロック図である。本実施の形態に係る検査装置1Aは、取得部10、第1推定部11、第1判断部12、検査部13、提示部14、メモリ15、第2推定部16、および第2判断部17を備える。第2メモリ15B、第2推定部16、および第2判断部17をさらに備える点で第1の実施の形態に係る検査装置1と異なる。以下、第1の実施の形態と異なる構成を中心に説明する。
[Functional block of the inspection device]
6 is a functional block diagram showing the configuration of an inspection device 1A according to the present embodiment. The inspection device 1A according to the present embodiment includes an acquisition unit 10, a first estimation unit 11, a first judgment unit 12, an inspection unit 13, a presentation unit 14, a memory 15, a second estimation unit 16, and a second judgment unit 17. The inspection device 1A according to the present embodiment differs from the inspection device 1 according to the first embodiment in that the inspection device 1A further includes a second memory 15B, a second estimation unit 16, and a second judgment unit 17. The following description will focus on the configuration different from the first embodiment.
第2メモリ15Bは、外部のサーバなどで事前の学習処理により構築された学習済み第2モデルNN2を記憶する。より具体的には、第2メモリ15Bは、学習済み第2モデルNN2、および学習済み第2モデルNN2の演算の結果に対する判断基準である後述の第2基準を記憶する。 The second memory 15B stores the trained second model NN2 that has been constructed by a prior learning process on an external server or the like. More specifically, the second memory 15B stores the trained second model NN2 and a second criterion (described below) that is a judgment criterion for the results of the calculations of the trained second model NN2.
ここで、学習済み第2モデルNN2は、検査対象の複数の種類の食材の間の相対的な配置関係を識別する特徴量(第2特徴量)が学習されたモデルであるが機械学習、特にディープラーニングなどのニューラルネットワークモデルであってもよい。このような学習済み第2モデルNN2を用いることで、未知の食品の画像における食材の盛り付け位置を分類することができる。本実施の形態では、第1メモリ15Aに記憶されている学習済み第1モデルNN1と、第2メモリ15Bに記憶されている学習済み第2モデルNN2との2つの学習モデルが一対となって同一品目の食品の盛り付け検査に用いられる。 The trained second model NN2 is a model in which features (second features) that identify the relative positional relationships between the multiple types of ingredients being inspected have been trained, but it may also be a neural network model such as machine learning, particularly deep learning. By using such a trained second model NN2, it is possible to classify the presentation positions of ingredients in an image of an unknown food. In this embodiment, two learning models, the trained first model NN1 stored in the first memory 15A and the trained second model NN2 stored in the second memory 15B, are used as a pair to inspect the presentation of the same food item.
図7は、本実施の形態に係る第2推定部16および第2判断部17によって行われる学習済み第2モデルNN2を用いた食材の配置位置に関する推定処理の概要を説明するための図である。図7の(a)および図7の(b)の左側に図示された画像iはそれぞれ取得部10によって取得された食品の画像の例を示している。例えば図7の(a)の食材間の位置(aの隣にb、bの隣にcが盛り付けられている。)が仮に正しい配置関係であるとする。これに対して、図7の(b)では、食材aとbの位置が逆になっている。本実施の形態では、図7の(b)のような食材間の配置関係の誤りを検出するものである。 Figure 7 is a diagram for explaining an overview of the estimation process for the placement of ingredients using the trained second model NN2, which is performed by the second estimation unit 16 and the second judgment unit 17 according to this embodiment. The images i shown on the left side of Figure 7(a) and Figure 7(b) each show an example of a food image acquired by the acquisition unit 10. For example, assume that the positions of the ingredients in Figure 7(a) (b is placed next to a, and c is placed next to b) are the correct placement relationship. In contrast, in Figure 7(b), the positions of ingredients a and b are reversed. This embodiment detects errors in the placement relationship between ingredients such as that shown in Figure 7(b).
第1推定部11によって得られた第1推定結果に含まれる出力画像は、図7の(a)および図7の(b)の中央に図示された画像pからわかるように、食材の種類(クラス)がピクセル単位でラベル付けされ、食材のインスタンスごとに領域がカラーパターンで区別されたカラーパターン画像である。事前に構築された学習済み第2モデルNN2は、第1推定部11によって得られた食材インスタンスごとのカラーパターン画像の特徴、すなわち、食材間の相対的な配置関係を学習し、未知のカラーパターン画像が入力された場合にその画像の特徴を抽出し、食材間の相対的な配置関係の正誤を分類する分類器である。 As can be seen from image p shown in the center of Figures 7(a) and 7(b), the output image included in the first estimation result obtained by the first estimation unit 11 is a color pattern image in which the type (class) of ingredient is labeled on a pixel-by-pixel basis and the area for each ingredient instance is distinguished by a color pattern. The pre-constructed trained second model NN2 is a classifier that learns the features of the color pattern image for each ingredient instance obtained by the first estimation unit 11, i.e., the relative positional relationship between ingredients, and when an unknown color pattern image is input, extracts the features of the image and classifies the accuracy of the relative positional relationship between ingredients.
第2モデルNN2としては、良品と不良品を学習し分類する2クラス分類や、オートエンコーダのように良品のみを学習し分類する1クラス分類などが挙げられる。 Examples of the second model NN2 include two-class classification, which learns and classifies good and bad products, and one-class classification, which learns and classifies only good products like an autoencoder.
図6に戻り、第2推定部16は、第1推定部11による第1推定結果に含まれる出力画像を入力とする学習済み第2モデルNN2を用いて、出力画像における複数の種類の食材の間の相対的な配置関係を推定し、推定された配置関係を第1推定部11からの出力画像に関連付けた第2推定結果を出力する。 Returning to FIG. 6, the second estimation unit 16 uses a trained second model NN2 that receives as input the output image included in the first estimation result by the first estimation unit 11 to estimate the relative positional relationship between multiple types of ingredients in the output image, and outputs a second estimation result that associates the estimated positional relationship with the output image from the first estimation unit 11.
第2推定部16は、第1推定結果に含まれる、食材インスタンスの領域ごとにカラーパターンが表示された出力画像をそのまま入力として用いる。また、第2推定部16は、入力されたカラーパターンの出力画像において、複数の種類の食材間の相対的な位置である配置関係を示す特徴を抽出し、その特徴から複数の種類の食材間における配置関係の正誤を確率的に分類する。なお、第2推定部16が推定する食材相互の相対的な配置関係は、種類の異なる複数の食材間の配置関係だけでなく、設定に応じて、一つの種類の食材が複数の食材で構成されている場合の個々の食材間における相対的な配置関係であってもよい。 The second estimation unit 16 uses as input the output image in which a color pattern is displayed for each region of the ingredient instance included in the first estimation result. The second estimation unit 16 also extracts features that indicate the arrangement relationship, i.e., the relative positions between multiple types of ingredients, from the output image of the input color pattern, and probabilistically classifies the accuracy of the arrangement relationship between the multiple types of ingredients from the features. Note that the relative arrangement relationship between ingredients estimated by the second estimation unit 16 may not only be the arrangement relationship between multiple ingredients of different types, but may also be the relative arrangement relationship between individual ingredients when one type of ingredient is composed of multiple ingredients, depending on the settings.
第2判断部17は、第2推定部16による第2推定結果に基づいて、食品の容器等に配置された複数の種類の食材相互の相対的な配置関係の妥当性に関して予め設定された第2基準を満たすか否かを判断する。例えば、第2判断部17は、確率で示された分類結果に対して予め設定されたしきい値を設けて、推定された配置関係の正誤を判断することができる。 The second judgment unit 17 judges whether or not a preset second criterion is satisfied regarding the validity of the relative arrangement of multiple types of ingredients placed in a food container or the like, based on the second estimation result by the second estimation unit 16. For example, the second judgment unit 17 can set a preset threshold value for the classification result shown as a probability and judge the accuracy of the estimated arrangement.
また、一つの種類の食材が複数の食材で構成される場合の配置関係の妥当性を判断するための第2基準は、同一種類の食材を構成する複数の食材が一定の並び方であるか否かを判断する基準として設定することができる。このような第2基準を用いることで、第2判断部17は、同一種類の食材を構成する複数の食材相互の相対的な配置関係の妥当性の有無を判断することができる。 In addition, the second criterion for determining the appropriateness of the relative arrangement when one type of ingredient is composed of multiple ingredients can be set as a criterion for determining whether the multiple ingredients that make up the same type of ingredient are arranged in a certain way. By using such a second criterion, the second judgment unit 17 can determine whether the relative arrangement of the multiple ingredients that make up the same type of ingredient is appropriate.
例えば、ピザのトッピングとして配置されるシュレッドチーズを例に挙げて説明する。例えば、シュレッド状の複数のチーズは、互いに一定の距離をもって偏りなくピザの生地の上にばらけて配置されることが好ましいとする。この場合の第2基準として、複数のシュレッド状のチーズの相対的な配置関係の妥当性の有無、換言すると、シュレッドチーズの並び方が基準を満たすか否か、あるいは、トッピングとして配置されたシュレッドチーズのばらけ方の程度が一定であるか否かを判断するための基準が設定される。例えば、第2判断部17は、このような第2基準に基づいて、シュレッドチーズ各々が所定の位置に配置されているか否か、さらには、特定の位置に偏ってトッピングされていないか等の検出を行うことが可能である。 For example, the following describes shredded cheese placed as a pizza topping. For example, it is preferable that multiple pieces of shredded cheese are evenly spaced apart from one another on the pizza dough. In this case, the second criterion is set to determine whether the relative arrangement of the multiple pieces of shredded cheese is appropriate, in other words, whether the arrangement of the shredded cheese satisfies a criterion, or whether the degree of scattering of the shredded cheese placed as a topping is uniform. For example, based on such a second criterion, the second judgment unit 17 can detect whether each piece of shredded cheese is placed in a predetermined position, and further whether the shredded cheese is unevenly placed in a particular position.
検査部13は、第1判断部12による判断結果、および第2判断部17による判断結果に基づいて、食品の容器等に配置された複数の食材の配置に関する検査を行う。本実施の形態では、検査部13は、第1判断部12による食材の有無および過不足に関する判断結果に加え、第2判断部17による食材の配置位置に関する判断結果から、最終的な食品の盛り付け検査を行う。 The inspection unit 13 performs an inspection of the arrangement of multiple ingredients placed in a food container or the like based on the judgment results from the first judgment unit 12 and the judgment results from the second judgment unit 17. In this embodiment, the inspection unit 13 performs a final food presentation inspection based on the judgment results from the first judgment unit 12 regarding the presence or absence of ingredients and the excess or deficiency of ingredients, as well as the judgment results from the second judgment unit 17 regarding the arrangement of ingredients.
提示部14は、検査部13による検査結果を提示する。より具体的には、提示部14は、図10に示すように、表示装置108の表示画面に表示された領域Bに、食材ごとの第1推定部11による「推定個数」、「推定面積」、第1判断部12が用いる「個数しきい値」、「面積しきい値」を表示させる。さらに、提示部14は、しきい値ごとの判断結果の値「個数判定」、「面積判定」、および「検査項目」に基づく検査結果の項目「判定結果」の値を領域Bに表示させる。 The presentation unit 14 presents the inspection results from the inspection unit 13. More specifically, as shown in FIG. 10, the presentation unit 14 displays the "estimated number" and "estimated area" for each ingredient by the first estimation unit 11, and the "number threshold" and "area threshold" used by the first judgment unit 12 in area B displayed on the display screen of the display device 108. Furthermore, the presentation unit 14 displays in area B the values of the judgment results for each threshold, "number judgment" and "area judgment", and the value of the inspection result item "judgment result" based on the "inspection item".
また、提示部14は、領域Bに設けられたテーブルの項目「場所検査結果」において、第2推定部16による第2推定結果「確率(0.999)」および第2判断部17による食材間の相対的な配置関係の妥当性に関する判断結果「NG」の値を表示させる。 In addition, the presentation unit 14 displays the second estimation result "Probability (0.999)" by the second estimation unit 16 and the judgment result "NG" regarding the validity of the relative positional relationship between the ingredients by the second judgment unit 17 in the item "Location inspection result" of the table provided in area B.
さらに、提示部14は、第1判断部12による食材の有無および過不足に関する判断結果(項目「判定結果」)と、第2判断部17による食材間の配置関係の妥当性に関する判断結果(「場所検査結果」)とに基づいた、複数の食材の配置に関する最終的な検査結果(「検査結果」)を領域Bに表示させる。 Furthermore, the presentation unit 14 displays in area B the final inspection result ("Inspection result") regarding the arrangement of multiple ingredients based on the judgment result by the first judgment unit 12 regarding the presence or absence of ingredients and the surplus or deficiency (item "Judgment result") and the judgment result by the second judgment unit 17 regarding the appropriateness of the arrangement relationship between the ingredients ("Location inspection result").
また、提示部14は、取得部10が取得した検査対象の画像iと、第1推定部11による第1推定結果を含む食材の種類ごとのカラーパターンの出力画像pと、検査対象の画像iおよび出力画像pを合成した画像sとを領域Aに並べて表示させることができる。 The presentation unit 14 can also display, side by side in the area A, the image i of the inspection object acquired by the acquisition unit 10, the output image p of the color pattern for each type of food ingredient including the first estimation result by the first estimation unit 11, and an image s obtained by combining the image i of the inspection object and the output image p.
[検査装置の動作]
次に、上述した構成を有する検査装置1Aの動作について、図8のフローチャートおよび図9の説明図を参照して説明する。事前に外部のサーバなどで第1学習モデルNN1および第2学習モデルNN2の学習処理が行われるものとする。また、第1メモリ15Aには、事前に構築された学習済みの第1学習モデルNN1およびその演算結果に対する判断処理に用いるしきい値情報等を含む第1基準が記憶されている。同様に、第2メモリ15Bには、学習済みの第2学習モデルNN2およびその演算結果に対する判断処理に用いるしきい値情報等を含む第2基準が記憶されているものとする。
[Operation of the inspection device]
Next, the operation of the inspection device 1A having the above-mentioned configuration will be described with reference to the flowchart in Fig. 8 and the explanatory diagram in Fig. 9. It is assumed that the learning process of the first learning model NN1 and the second learning model NN2 is performed in advance by an external server or the like. In addition, the first memory 15A stores a first standard including the learned first learning model NN1 constructed in advance and threshold value information used in the judgment process for the calculation result thereof. Similarly, it is assumed that the second memory 15B stores a second standard including the learned second learning model NN2 and threshold value information used in the judgment process for the calculation result thereof.
まず、第1推定部11は、第1メモリ15Aから学習済み第1モデルNN1をロードする(ステップS10)。次に、第2推定部16は、第2メモリ15Bから学習済み第2モデルNN2をロードする(ステップS11)。 First, the first estimation unit 11 loads the trained first model NN1 from the first memory 15A (step S10). Next, the second estimation unit 16 loads the trained second model NN2 from the second memory 15B (step S11).
次に、取得部10は、カメラ105で撮影された、食品の容器等に配置された複数の食材が含まれる画像を取得する(ステップS12)。次に、第1推定部11は、ステップS10でロードした学習済み第1モデルNN1の演算を行う(ステップS13)。 Next, the acquisition unit 10 acquires an image captured by the camera 105 that includes multiple ingredients arranged in a food container or the like (step S12). Next, the first estimation unit 11 performs calculations using the trained first model NN1 that was loaded in step S10 (step S13).
具体的には、図9に示すように、第1推定部11は、学習済み第1モデルNN1を用いて、ステップS10で取得された画像iにおける複数の食材の領域a1,b1,c1,d1および食材の種類a,b,c,dを推定し、推定された複数の食材の領域および種類を入力画像iに関連付けた出力画像pを含む第1推定結果を出力する。出力画像pは、複数の食材の種類ごとに、対応する領域が任意の色で塗られたカラーパターン画像である。 Specifically, as shown in FIG. 9, the first estimation unit 11 uses the trained first model NN1 to estimate the regions a1, b1, c1, d1 of multiple ingredients and the types a, b, c, d of ingredients in the image i acquired in step S10, and outputs a first estimation result including an output image p in which the estimated regions and types of multiple ingredients are associated with the input image i. The output image p is a color pattern image in which the corresponding regions for each type of multiple ingredients are painted in an arbitrary color.
つまり、第1推定結果に含まれる出力画像には、ピクセル情報、および画像内での位置情報が含まれる。本実施の形態では、第1モデルNN1として、このようなインスタンス・セグメンテーションを採用するため、画像内に同一種類の食材が複数個含まれている場合であっても、食材をインスタンスごとに区別して検出することが可能である。 In other words, the output image included in the first estimation result includes pixel information and position information within the image. In this embodiment, because this type of instance segmentation is adopted as the first model NN1, it is possible to distinguish and detect ingredients by instance even if the image contains multiple ingredients of the same type.
次に、第1推定部11は、学習済み第1モデルNN1の演算結果である第1推定結果を第2推定部16に入力する(ステップS14)。より具体的には、第1推定部11は、図9のステップS13に示すように、食材インスタンスの領域ごとにカラーパターンが割り当てられた出力画像pを第2推定部16に入力する。なお、第1推定部11による第1推定結果は、第1判断部12にも渡される。 Next, the first estimation unit 11 inputs the first estimation result, which is the calculation result of the trained first model NN1, to the second estimation unit 16 (step S14). More specifically, as shown in step S13 of FIG. 9, the first estimation unit 11 inputs the output image p, in which a color pattern is assigned to each region of the food ingredient instance, to the second estimation unit 16. The first estimation result by the first estimation unit 11 is also passed to the first judgment unit 12.
次に、第2推定部16は、ステップS11でロードされた学習済み第2モデルNN2の演算を行い、演算結果を第2判断部17へ渡す(ステップS15)。より詳細には、第2推定部16は、第1推定結果に含まれる出力画像を入力とする学習済み第2モデルNN2を用いて、出力画像における複数の種類の食材間の配置関係を推定し、推定された配置関係を出力画像に関連付けた第2推定結果を出力する。 Next, the second estimation unit 16 performs calculations using the trained second model NN2 loaded in step S11, and passes the calculation results to the second judgment unit 17 (step S15). More specifically, the second estimation unit 16 uses the trained second model NN2, which uses as input the output image included in the first estimation result, to estimate the positional relationship between multiple types of ingredients in the output image, and outputs a second estimation result that associates the estimated positional relationship with the output image.
次に、第1判断部12は、ステップS13での学習済み第1モデルNN1の演算による第1推定結果に基づいて、食材の種類ごとの有無および過不足に関して予め設定された第1基準を満たすか否かを判断する(ステップS16)。より詳細には、第1判断部12は、学習済み第1モデルNN1と対応付けて第1メモリ15Aに記憶されている食材の種類ごとの判断項目やしきい値等の第1基準を第1メモリ15Aから読み出してステップS16の処理を行う。 Next, the first judgment unit 12 judges whether the first criteria set in advance for the presence or absence and surplus/deficiency of each type of ingredient are met based on the first estimation result obtained by the calculation of the trained first model NN1 in step S13 (step S16). More specifically, the first judgment unit 12 reads from the first memory 15A the first criteria, such as judgment items and thresholds for each type of ingredient that are stored in the first memory 15A in association with the trained first model NN1, and performs the process of step S16.
例えば、第1判断部12は、各食材の推定個数、つまり、同一種類の食材の領域あるいはカラーパターンの数に対するしきい値処理を行うことができる。また、第1判断部12は、食材の種類ごとに推定された、食材の領域の画像内に占める面積に対するしきい値処理を行うことができる。 For example, the first judgment unit 12 can perform threshold processing on the estimated number of each ingredient, that is, the number of areas or color patterns of the same type of ingredient. The first judgment unit 12 can also perform threshold processing on the area that the ingredient area occupies within the image, estimated for each type of ingredient.
次に、第2判断部17は、ステップS15で得られた第2推定結果に基づいて、複数種類の食材相互における配置関係が、配置関係の妥当性に関して予め設定された第2基準を満たすか否かを判断する(ステップS17)。より詳細には、第2判断部17は、学習済み第2モデルNN2と対応付けて第2メモリ15Bに記憶されているしきい値等を含む第2基準を第2メモリ15Bから読み出してステップS17の処理を行う。 Next, the second judgment unit 17 judges whether the mutual arrangement of the multiple types of ingredients satisfies a second criterion set in advance regarding the validity of the arrangement based on the second estimation result obtained in step S15 (step S17). More specifically, the second judgment unit 17 reads from the second memory 15B the second criterion including a threshold value etc. stored in the second memory 15B in association with the trained second model NN2, and performs the process of step S17.
例えば、図10の領域Bにおいて、項目「場所検査結果」の値が示すように、第2推定部16によって推定された食材間の相対的な配置関係が正しいか否かを示す確率に基づいて、食材の配置された位置は誤り「NG」であると判断している。 For example, in area B of FIG. 10, as indicated by the value of the item "Location inspection result," the position of the ingredients is determined to be incorrect ("NG") based on the probability indicating whether the relative placement relationship between ingredients estimated by the second estimation unit 16 is correct.
次に、検査部13は、ステップS16で得られた各食材の有無および過不足に関する判断結果、およびステップS17で得られた複数種類の食材間の配置関係の妥当性に関する判断結果に基づいて、食品の容器等に配置された複数の食材の配置に関する検査を行う(ステップS18)。 Next, the inspection unit 13 inspects the arrangement of multiple ingredients placed in a food container, etc., based on the judgment results obtained in step S16 regarding the presence or absence and surplus/deficiency of each ingredient, and the judgment results obtained in step S17 regarding the appropriateness of the arrangement relationship between multiple types of ingredients (step S18).
例えば、検査部13は、ステップS16において、すべての種類の食材が、個数および面積に係る第1基準を満たし、かつ、ステップS17において、複数種類の食材間の配置関係が第2基準を満たす場合には、食品の容器等に配置された複数の食材の配置に関する検査は合格であるとの検査結果を出力することができる。本実施の形態において、容器等に配置された食材の配置に関する検査とは、食材各々の種類、その有無、数、量、および配置位置に関する食品の盛り付け検査が含まれる。 For example, if in step S16 all types of ingredients meet the first criteria related to the number and area, and in step S17 the arrangement of the multiple types of ingredients meets the second criterion, the inspection unit 13 can output an inspection result indicating that the inspection of the arrangement of multiple ingredients arranged in a food container or the like has passed. In this embodiment, the inspection of the arrangement of ingredients arranged in a container or the like includes an inspection of the food presentation regarding the type, presence, number, amount, and arrangement position of each ingredient.
次に、提示部14は、ステップS18で得られた食材の配置に関する検査結果を提示する(ステップS19)。例えば、提示部14は、図10に示すように、表示装置108の表示画面の領域Bに、食材a,b,c,dごとの推定個数および推定面積をテーブル形式で表示することができる。また、提示部14は、領域Bに設けられたテーブルに個数および面積についてのしきい値との比較による判定結果を表示させることができる。 Next, the presentation unit 14 presents the inspection results regarding the arrangement of ingredients obtained in step S18 (step S19). For example, as shown in FIG. 10, the presentation unit 14 can display the estimated numbers and estimated areas of each of ingredients a, b, c, and d in a table format in area B of the display screen of the display device 108. The presentation unit 14 can also display the judgment results based on the comparison of the numbers and areas with threshold values in the table provided in area B.
さらに、提示部14は、第2推定部16による第2推定結果および第2判断部17による複数種類の食材間の配置関係における妥当性に関する判断結果を領域Bのテーブルに表示させることができる。また、提示部14は、検査部13によって行われた総合的な食品の盛り付け検査の結果についても領域Bのテーブルに表示させることができる。 Furthermore, the presentation unit 14 can display, in the table in area B, the second estimation result by the second estimation unit 16 and the judgment result by the second judgment unit 17 regarding the validity of the arrangement relationship between multiple types of ingredients. The presentation unit 14 can also display, in the table in area B, the results of the comprehensive food presentation inspection performed by the inspection unit 13.
また、前述したように、提示部14は、カメラ105で撮影された画像iと、カラーパターンの出力画像pと、画像iおよびカラーパターンの出力画像pを合成した画像sとをそれぞれ並べて領域Aに表示する。また、提示部14は、正しい位置に食材が配置されている食品の画像を参照画像として、領域Aにさらに並べて表示することで、ユーザはより直感的に食材の配置に関する検査結果を把握することができる。 As described above, the presentation unit 14 displays the image i captured by the camera 105, the output image p of the color pattern, and the image s obtained by combining the image i and the output image p of the color pattern side by side in the area A. The presentation unit 14 also displays an image of the food in which ingredients are placed in the correct positions as a reference image side by side in the area A, allowing the user to more intuitively understand the inspection results regarding the placement of ingredients.
ここで、本実施の形態に係る検査装置1Aを用いて食品の盛り付け検査を行った際の処理時間について、図11を参照して説明する。図11の横軸はデータ区間[msec]、縦軸は検査対象の食品の数である度数を示している。処理時間は、カメラ105で製造された食品の画像を撮影してから、第1推定部11によるインスタンス・セグメンテーションによる推定処理、第2推定部16による分類、さらに、画像の保存、および各数値の保存までの時間を処理時間として記録したものである。なお、インスタンス・セグメンテーションおよび分類器の精度については、予め実用に十分な精度を有する設計とされている。 Now, referring to FIG. 11, we will explain the processing time when inspecting food presentation using the inspection device 1A according to this embodiment. The horizontal axis of FIG. 11 indicates the data interval [msec], and the vertical axis indicates the frequency, which is the number of foods to be inspected. The processing time is recorded as the time from when an image of the manufactured food is taken by the camera 105, to the estimation process using instance segmentation by the first estimation unit 11, classification by the second estimation unit 16, and further, to the saving of the image and each numerical value. The accuracy of the instance segmentation and the classifier has been designed in advance to be sufficient for practical use.
図11の横軸の最も右端に示される1食目の検査時間が約700msecである。また、2食目以降は、400msecの処理時間となっていることがわかる。これは、食品の製造ラインにおけるタクトタイムを、例えば1.0secとした場合に、処理時間としては余裕があることが示されている。このように、本実施の形態に係る検査装置1Aは、十分な検査精度を保ちながら、より簡易な構成を有しつつ、十分な処理時間が得られることがわかる。 The inspection time for the first meal, shown at the far right of the horizontal axis in Figure 11, is approximately 700 msec. It can also be seen that the processing time for the second meal onwards is 400 msec. This shows that there is ample processing time available when the takt time in a food production line is, for example, 1.0 sec. In this way, it can be seen that the inspection device 1A of this embodiment has a simpler configuration and can provide sufficient processing time while maintaining sufficient inspection accuracy.
以上、第2の実施の形態によれば、第1推定部11による第1推定結果を第2推定部16の分類器の入力として用いることで、より簡易な構成で画像認識を利用した食材の配置に関する検査を行うことができる。 As described above, according to the second embodiment, the first estimation result by the first estimation unit 11 is used as an input to the classifier of the second estimation unit 16, making it possible to perform inspection of the arrangement of ingredients using image recognition with a simpler configuration.
また、第2の実施の形態によれば、一つの検査装置1Aにおいて、食品の容器等に配置された食材の有無、数、量だけでなく、配置された複数の種類の食材間における相対的な位置についても検査を行うことでき、より効率的かつ効果的な食材の配置に関する検査が実現される。 In addition, according to the second embodiment, a single inspection device 1A can inspect not only the presence, number, and amount of ingredients placed in a food container, etc., but also the relative positions of multiple types of ingredients placed in the container, allowing for more efficient and effective inspection of the placement of ingredients.
また、第2の実施の形態によれば、食材が配置される容器等の形状や素材にかかわらず、食材の配置の正誤に関する検査を行うことができる。 Furthermore, according to the second embodiment, it is possible to inspect whether the food ingredients are placed correctly, regardless of the shape or material of the container in which the food ingredients are placed.
[第3の実施の形態]
次に、本発明の第3の実施の形態について説明する。なお、以下の説明では、上述した第1および第2の実施の形態と同じ構成については同一の符号を付し、その説明を省略する。
[Third embodiment]
Next, a third embodiment of the present invention will be described. In the following description, the same components as those in the first and second embodiments are given the same reference numerals, and the description thereof will be omitted.
第2の実施の形態では、事前に外部のサーバ等で学習処理が行われて構築された学習済み第1モデルNN1および学習済み第2モデルNN2を用いて、推定処理が行われる場合について説明した。これに対して、第3の実施の形態では、第1モデルNN1の学習を行う第1学習部18、および第2モデルNN2の学習を行う第2学習部19を有する学習装置をさらに備え、それぞれの学習処理を自装置において行う。 In the second embodiment, a case was described in which estimation processing is performed using a trained first model NN1 and a trained second model NN2 that have been constructed in advance through learning processing on an external server or the like. In contrast, in the third embodiment, a learning device is further provided that has a first learning unit 18 that learns the first model NN1 and a second learning unit 19 that learns the second model NN2, and each learning processing is performed within the device itself.
[検査装置の機能ブロック]
図12は、本実施の形態に係る検査装置1Bの構成を示すブロック図である。検査装置1Bは、取得部10、第1推定部11、第1判断部12、検査部13、提示部14、メモリ15、第2推定部16、第2判断部17、第1学習部18、および第2学習部19を備える。検査装置1Bは、第1学習部18および第2学習部19をさらに備える点で、第2の実施の形態の構成と異なる。以下、第1および第2の実施の形態と異なる構成を中心に説明する。
[Functional block of the inspection device]
12 is a block diagram showing the configuration of an inspection device 1B according to the present embodiment. The inspection device 1B includes an acquisition unit 10, a first estimation unit 11, a first judgment unit 12, an inspection unit 13, a presentation unit 14, a memory 15, a second estimation unit 16, a second judgment unit 17, a first learning unit 18, and a second learning unit 19. The inspection device 1B differs from the configuration of the second embodiment in that it further includes the first learning unit 18 and the second learning unit 19. The following description will focus on the configuration that differs from the first and second embodiments.
第1学習部18は、食品の容器等に配置された食材が含まれる画像を学習用画像(第1学習用画像)として用いて、ニューラルネットワークの第1モデルを学習させて、食材の領域および種類を識別する第1特徴量を抽出し、抽出された第1特徴量により学習済み第1モデルNN1を獲得する。第1学習部18によって得られた学習済み第1モデルNN1は、第1メモリ15Aに記憶される。 The first learning unit 18 uses an image containing ingredients placed in a food container or the like as a learning image (first learning image) to train a first model of the neural network, extracts a first feature that identifies the area and type of the ingredient, and obtains a trained first model NN1 from the extracted first feature. The trained first model NN1 obtained by the first learning unit 18 is stored in the first memory 15A.
より詳細には、第1学習部18は、Mask R-CNNなどのインスタンス・セグメンテーションのアーキテクチャを有するニューラルネットワークモデルを第1モデルNN1として用いる。第1学習部18は、学習用画像に含まれる複数の食材a,b,c,dをピクセルごとに識別し、学習用画像に含まれる食材インスタンスの領域における食材の種類a,b,c,dが推定されるような特徴量を学習する。 More specifically, the first learning unit 18 uses a neural network model having an instance segmentation architecture such as Mask R-CNN as the first model NN1. The first learning unit 18 identifies multiple ingredients a, b, c, and d included in the learning image for each pixel, and learns features that allow the types of ingredients a, b, c, and d to be estimated in the areas of the ingredient instances included in the learning image.
例えば、図9に示すように、食材a,b,c,dごとの学習用画像が、第1モデルNN1に入力として与えられる。第1学習部18は、第1モデルNN1の学習演算を行い、食材a,b,c,dの特徴を学習する。学習処理において用いられる学習用画像の数は、後段の検査処理において十分な精度が担保されるだけの枚数が用いられるが、例えば、カメラ105で撮影された食材a,b,c,dそれぞれ10枚の画像を切り出して、学習用画像とすればよい。なお、学習用画像として、取得部10で事前に取得された画像を用いてもよい。 For example, as shown in FIG. 9, learning images for each of ingredients a, b, c, and d are given as input to the first model NN1. The first learning unit 18 performs learning calculations for the first model NN1 and learns the characteristics of ingredients a, b, c, and d. The number of learning images used in the learning process is a number that ensures sufficient accuracy in the subsequent inspection process, and for example, 10 images each of ingredients a, b, c, and d photographed by the camera 105 may be cut out and used as learning images. Note that images acquired in advance by the acquisition unit 10 may also be used as learning images.
第2学習部19は、第1推定部11による推定結果に含まれる出力画像を学習用画像(第2学習用画像)として用いて、ニューラルネットワークによる第2モデルを学習させて、学習用画像における食材間の相対的な配置関係を識別する第2特徴量を抽出し、抽出された第2特徴量により学習済みの第2モデルNN2を獲得する。第2学習部19によって得られた学習済み第2モデルNN2は、第2メモリ15Bに記憶される。 The second learning unit 19 uses the output image included in the estimation result by the first estimation unit 11 as a learning image (second learning image) to learn a second model using a neural network, extracts second features that identify the relative positional relationship between ingredients in the learning image, and obtains a learned second model NN2 from the extracted second features. The learned second model NN2 obtained by the second learning unit 19 is stored in the second memory 15B.
より具体的には、第2学習部19は、インスタンス・セグメンテーションによるカラーパターンの出力画像を学習して、食材間の配置関係の正誤を分類結果として出力する学習済み第2モデルNN2を構築する。第2モデルNN2としては、良品と不良品を学習し分類する2クラス分類や、オートエンコーダのように良品のみを学習し分類する1クラス分類などが挙げられる。 More specifically, the second learning unit 19 learns the output image of the color pattern by instance segmentation and constructs a trained second model NN2 that outputs the correctness of the positional relationship between ingredients as a classification result. Examples of the second model NN2 include two-class classification that learns and classifies good and bad products, and one-class classification that learns and classifies only good products like an autoencoder.
後述の第6の実施の形態で詳述するが、例えば、第2学習部19は、第1推定部11が学習済み第1モデルNN1の演算を行って出力した一定数の出力画像を複製あるいは加工することで、必要枚数の学習用画像を確保することができる。また、学習用画像としては、図9に示すように、食品の容器等に配置されている、複数種類の食材a,b,c,dを表すカラーパターンの互いの位置が正しい画像と、誤っている画像とが用いられる。なお、食材の配置位置が誤っている画像については、第1推定結果に含まれる出力画像の加工により作成すればよい。 As will be described in detail in the sixth embodiment below, for example, the second learning unit 19 can secure the required number of learning images by duplicating or processing a certain number of output images output by the first estimation unit 11 performing calculations of the learned first model NN1. As the learning images, images in which color patterns representing multiple types of ingredients a, b, c, and d are correctly positioned relative to each other and images in which they are incorrectly positioned, as shown in FIG. 9, are used. Images in which ingredients are incorrectly positioned can be created by processing the output images included in the first estimation results.
なお、第1学習部18および第2学習部19は、複数の異なる食品の品種ごとに、学習済み第1モデルNN1および学習済み第2モデルNN2を構築し、メモリ15(第1メモリ15A、第2メモリ15B)に記憶することができる。また、第1メモリ15Aは、学習済み第1モデルNN1と対応付けられた、学習済み第1モデルNN1の演算結果に対して用いるしきい値などの第1基準を記憶する。同様に、第2メモリ15Bは、学習済み第2モデルNN2と対応付けられた、学習済み第2モデルNN2の演算結果に対して用いるしきい値等の第2基準を記憶する。 The first learning unit 18 and the second learning unit 19 can construct a learned first model NN1 and a learned second model NN2 for each of a number of different food varieties and store them in the memory 15 (first memory 15A, second memory 15B). The first memory 15A also stores a first criterion, such as a threshold value, associated with the learned first model NN1 and used for the calculation results of the learned first model NN1. Similarly, the second memory 15B stores a second criterion, such as a threshold value, associated with the learned second model NN2 and used for the calculation results of the learned second model NN2.
本実施の形態では、第1学習部18、第2学習部19、第1メモリ15A、および第2メモリ15Bは、予め設定されたモデルを構築するための学習処理を行う学習装置を構成する。 In this embodiment, the first learning unit 18, the second learning unit 19, the first memory 15A, and the second memory 15B constitute a learning device that performs a learning process to construct a preset model.
[検査装置の動作]
次に、上述した構成を有する検査装置1Bの動作について、図13のフローチャートを用いて説明する。
[Operation of the inspection device]
Next, the operation of the inspection device 1B having the above-mentioned configuration will be described with reference to the flowchart of FIG.
まず、取得部10は、カメラ105で撮影された、食品の容器等に配置されている複数の食材が含まれる画像を学習用画像として取得する(ステップS101)。次に、第1学習部18は、ステップS101で取得された学習用画像を用いて、予め設定されているインスタンス・セグメンテーションを実現するニューラルネットワークの第1モデルを学習して、学習用画像内のピクセルごとに食材の領域および種類を識別する第1特徴量を抽出し、抽出された第1特徴量により学習済み第1モデルNN1を獲得する(ステップS102)。次に、ステップS102で得られた学習済み第1モデルNN1は第1メモリ15Aに記憶される(ステップS103)。より詳細には、ステップS103では、さらに、学習済み第1モデルNN1の演算結果に対する判断処理(後述のステップS111)で用いられる第1基準が第1メモリ15Aに記憶される。 First, the acquisition unit 10 acquires an image captured by the camera 105, which includes multiple ingredients arranged in a food container or the like, as a learning image (step S101). Next, the first learning unit 18 uses the learning image acquired in step S101 to learn a first model of a neural network that realizes a preset instance segmentation, extracts a first feature that identifies the area and type of ingredients for each pixel in the learning image, and acquires a learned first model NN1 from the extracted first feature (step S102). Next, the learned first model NN1 obtained in step S102 is stored in the first memory 15A (step S103). More specifically, in step S103, a first criterion used in a judgment process (step S111 described later) for the calculation result of the learned first model NN1 is also stored in the first memory 15A.
次に、第2学習部19は、学習済み第1モデルNN1からの出力画像を学習用画像として取得する(ステップS104)。例えば、第2学習部19は、事前に構築された学習済み第1モデルNN1を用いた推定処理により出力された出力画像を取得することができる。 Next, the second learning unit 19 acquires an output image from the trained first model NN1 as a learning image (step S104). For example, the second learning unit 19 can acquire an output image output by an estimation process using the trained first model NN1 constructed in advance.
第2学習部19は、取得した学習用画像を用いて、ニューラルネットワークによる第2モデルNN2を学習させて、複数種類の食材間における相対的な配置関係を識別する第2特徴量を学習用画像から抽出し、抽出された第2特徴量により学習済み第2モデルNN2を獲得する(ステップS105)。 The second learning unit 19 uses the acquired learning images to train a second model NN2 based on a neural network, extracts second features from the learning images that identify the relative positional relationships between multiple types of ingredients, and acquires a trained second model NN2 based on the extracted second features (step S105).
その後、ステップS105で得られた学習済み第2モデルNN2は第2メモリ15Bに記憶される(ステップS106)。より詳細には、ステップS106では、さらに、学習済み第2モデルNN2の演算結果に対する判断処理(後述のステップS112)で用いられる第2基準が第2メモリ15Bに記憶される。 Then, the trained second model NN2 obtained in step S105 is stored in the second memory 15B (step S106). More specifically, in step S106, a second criterion to be used in the judgment process for the calculation result of the trained second model NN2 (step S112 described below) is also stored in the second memory 15B.
取得部10は、カメラ105で撮影された検査用の画像を取得する(ステップS107)。次に、第1推定部11は、ステップS103で第1メモリ15Aに記憶された学習済み第1モデルNN1を読み込み、ステップS107で取得された画像を入力として、学習済み第1モデルNN1の演算を行う(ステップS108)。 The acquisition unit 10 acquires an image for inspection captured by the camera 105 (step S107). Next, the first estimation unit 11 reads the trained first model NN1 stored in the first memory 15A in step S103, and performs calculations of the trained first model NN1 using the image acquired in step S107 as input (step S108).
また、ステップS108において、第1推定部11は、学習済み第1モデルNN1を用いて、ステップS107で取得された画像における複数の食材の領域および食材の種類を推定し、推定された複数の食材の領域および種類を入力画像に関連付けた出力画像を含む第1推定結果を出力する。出力画像は、複数の食材の種類ごとに、対応する領域が任意の色で塗られたカラーパターン画像である。 In addition, in step S108, the first estimation unit 11 uses the trained first model NN1 to estimate the areas and types of ingredients in the image acquired in step S107, and outputs a first estimation result including an output image in which the estimated areas and types of ingredients are associated with the input image. The output image is a color pattern image in which the areas corresponding to each type of ingredient are painted in an arbitrary color.
第1推定結果に含まれる出力画像には、ピクセル情報、および位置情報が含まれる。本実施の形態では、第1モデルNN1としてインスタンス・セグメンテーションを採用するため、画像に同一種類の食材が複数個盛り付けられている場合であっても、食材のインスタンスごとに区別して検出することが可能である。 The output image contained in the first estimation result includes pixel information and position information. In this embodiment, instance segmentation is adopted as the first model NN1, so even if multiple ingredients of the same type are served in the image, it is possible to distinguish and detect each instance of the ingredient.
次に、第1推定部11は、第1推定結果を第2推定部16に入力する(ステップS109)。第1推定部11は、食材の領域ごとにカラーパターンが割り当てられた出力画像を含む第1推定結果を出力する。この第1推定結果は、第2推定部16の入力画像として用いられる。なお、第1推定結果は、第1判断部12にも渡される。 Next, the first estimation unit 11 inputs the first estimation result to the second estimation unit 16 (step S109). The first estimation unit 11 outputs the first estimation result including an output image in which a color pattern is assigned to each region of the ingredient. This first estimation result is used as an input image for the second estimation unit 16. The first estimation result is also passed to the first judgment unit 12.
次に、第2推定部16は、ステップS106で第2メモリ15Bに記憶された学習済み第2モデルNN2を読み込み、第1推定結果に含まれる出力画像を学習済み第2モデルNN2に与え、学習済み第2モデルNN2の演算を行い、演算結果を第2判断部17へ渡す(ステップS110)。 Next, the second estimation unit 16 reads the trained second model NN2 stored in the second memory 15B in step S106, provides the output image included in the first estimation result to the trained second model NN2, performs calculations on the trained second model NN2, and passes the calculation results to the second judgment unit 17 (step S110).
より詳細には、第2推定部16は、第1推定結果に含まれる出力画像を入力とする学習済み第2モデルNN2を用いて、出力画像における複数種類の食材間の配置関係を推定し、推定された配置関係を出力画像に関連付けた第2推定結果を出力する。 More specifically, the second estimation unit 16 uses a trained second model NN2 that uses the output image included in the first estimation result as input to estimate the relative positions of multiple types of ingredients in the output image, and outputs a second estimation result that associates the estimated relative positions with the output image.
次に、第1判断部12は、ステップS13での学習済み第1モデルNN1の演算による第1推定結果に基づいて、食材の種類ごとの有無および過不足に関して予め設定された第1基準を満たすか否かを判断する(ステップS111)。より詳細には、第1判断部12は、学習済み第1モデルNN1と対応付けて第1メモリ15Aに記憶されているしきい値等を含む第1基準を第1メモリ15Aから読み出してステップS111の判断処理を行う。 Next, the first judgment unit 12 judges whether the first criteria set in advance for the presence or absence and surplus/deficiency of each type of ingredient are satisfied based on the first estimation result obtained by the calculation of the trained first model NN1 in step S13 (step S111). More specifically, the first judgment unit 12 reads from the first memory 15A the first criteria including thresholds and the like stored in the first memory 15A in association with the trained first model NN1, and performs the judgment process of step S111.
例えば、第1判断部12は、各食材の推定個数、つまり、同一種類の食材の領域あるいはカラーパターンの数に対するしきい値処理を行うことができる。また、第1判断部12は、食材の種類ごとに推定された、食材の領域の画像内に占める面積に対するしきい値処理を行うことができる。 For example, the first judgment unit 12 can perform threshold processing on the estimated number of each ingredient, that is, the number of areas or color patterns of the same type of ingredient. The first judgment unit 12 can also perform threshold processing on the area that the ingredient area occupies within the image, estimated for each type of ingredient.
次に、第2判断部17は、ステップS110で得られた第2推定結果に基づいて、複数種類の食材間の配置関係が、配置関係の妥当性に関して予め設定された第2基準を満たすか否かを判断する(ステップS112)。より詳細には、第2判断部17は、学習済み第2モデルNN2と対応付けて第2メモリ15Bに記憶されているしきい値等を含む第2基準を第2メモリ15Bから読み出してステップS112の判断処理を行う。 Next, the second judgment unit 17 judges whether the arrangement relationship between the multiple types of ingredients satisfies a second criterion set in advance regarding the validity of the arrangement relationship based on the second estimation result obtained in step S110 (step S112). More specifically, the second judgment unit 17 reads from the second memory 15B the second criterion including a threshold value etc. stored in the second memory 15B in association with the trained second model NN2, and performs the judgment process of step S112.
次に、検査部13は、ステップS111で得られた各食材の有無および過不足に関する判断結果、およびステップS112で得られた食材間の配置関係の妥当性に関する判断結果に基づいて、食品の容器等に配置された複数の食材の配置に関する検査を行う(ステップS113)。 Next, the inspection unit 13 inspects the arrangement of multiple ingredients placed in a food container or the like based on the judgment results obtained in step S111 regarding the presence or absence and surplus/deficiency of each ingredient, and the judgment results obtained in step S112 regarding the appropriateness of the arrangement relationship between the ingredients (step S113).
例えば、検査部13は、ステップS111において、すべての種類の食材が、個数および面積に係る第1基準を満たし、かつ、ステップS112において、食材間の配置関係が第2基準を満たす場合には、食品の容器等に配置された複数の食材の配置に関する検査は合格であるとの検査結果を出力することができる。本実施の形態において、容器等に配置された食材の配置に関する検査とは、食材各々の種類、その有無、数、量、および配置位置に関する食品の盛り付け検査が含まれる。 For example, in step S111, if all types of ingredients satisfy the first criteria related to the number and area, and in step S112, the positional relationship between the ingredients satisfies the second criterion, the inspection unit 13 can output an inspection result indicating that the inspection of the arrangement of multiple ingredients arranged in a food container or the like has passed. In this embodiment, the inspection of the arrangement of ingredients arranged in a container or the like includes an inspection of the food presentation regarding the type, presence, number, amount, and arrangement position of each ingredient.
次に、提示部14は、ステップS113で得られた食材の配置に関する検査結果を提示する(ステップS114)。 Next, the presentation unit 14 presents the inspection results regarding the placement of ingredients obtained in step S113 (step S114).
以上説明したように、第3の実施の形態によれば、検査装置1Bは学習装置を備え、第1学習部18がインスタンス・セグメンテーションを実現する第1モデルNN1を学習させ、かつ、第2学習部19は、学習済み第1モデルNN1からの出力画像を学習用画像として用いて食材間の配置関係の正誤を分類する第2モデルNN2を学習する。そのため、より簡易な構成により学習処理から推定処理さらには検査までの処理を一つの検査装置1Bで行うことができる。 As described above, according to the third embodiment, the inspection device 1B is equipped with a learning device, and the first learning unit 18 learns a first model NN1 that realizes instance segmentation, and the second learning unit 19 learns a second model NN2 that uses output images from the trained first model NN1 as training images to classify whether the positional relationship between ingredients is correct or incorrect. Therefore, with a simpler configuration, the processes from learning to estimation and even inspection can be performed by a single inspection device 1B.
また、第3の実施の形態によれば、第2モデルNN2は、学習済み第1モデルNN1の出力画像を入力画像として用いる。そのため、第2モデルNN2の学習用画像を容易に準備することができ、第2モデルNN2の学習処理をより簡素化することができる。 Furthermore, according to the third embodiment, the second model NN2 uses the output image of the trained first model NN1 as an input image. Therefore, it is possible to easily prepare training images for the second model NN2, and further simplify the training process of the second model NN2.
また、第3の実施の形態によれば、学習用画像が容易に取得されるので、第1モデルNN1および第2モデルNN2を食品ごとに構築すれば、製造された食品が少量多品種である場合や製品の改廃が頻繁に行われる場合においても、少量多品種の製品に係る食品の盛り付け検査に容易に対応可能である。 In addition, according to the third embodiment, learning images can be easily acquired, so if the first model NN1 and the second model NN2 are constructed for each food, food presentation inspection for small quantities of many different products can be easily performed even when the food produced is small quantities of many different types or when products are frequently revised or discontinued.
また、第3の実施の形態においても、学習用画像を取得するにあたり、簡易に構築された画像の撮影環境を用い、かつ、取得された画像自体の処理は簡易な処理でよいため、画像処理を利用した食品の盛り付け検査が容易となる。 Also, in the third embodiment, a simply constructed image capture environment is used to acquire learning images, and the acquired images themselves can be processed simply, making it easy to inspect food presentation using image processing.
[第4の実施の形態]
次に、本発明の第4の実施の形態について説明する。なお、以下の説明では、上述した第1から第3の実施の形態と同じ構成については同一の符号を付し、その説明を省略する。
[Fourth embodiment]
Next, a fourth embodiment of the present invention will be described. In the following description, the same components as those in the first to third embodiments are given the same reference numerals, and the description thereof will be omitted.
第2および第3の実施の形態では、第2学習部19および第2推定部16は、学習済み第1モデルNN1の演算により得られた出力画像をそのまま学習用画像および推定処理のための入力画像として用いる場合について説明した。これに対して、第4の実施の形態では、第2学習部19および第2推定部16において用いられる学習用画像および入力画像を変換し、より単純化した画像を第2学習部19の学習用画像として用いる。 In the second and third embodiments, the second learning unit 19 and the second estimation unit 16 use the output image obtained by the calculation of the trained first model NN1 as the learning image and the input image for the estimation process as is. In contrast, in the fourth embodiment, the learning image and the input image used in the second learning unit 19 and the second estimation unit 16 are converted, and the simplified image is used as the learning image for the second learning unit 19.
[検査装置の機能ブロック]
図14は、本実施の形態に係る検査装置1Cの構成を示すブロック図である。検査装置1Cは、取得部10、第1推定部11、第1判断部12、検査部13、提示部14、メモリ15、第2推定部16、第2判断部17、第1学習部18、第2学習部19、および変換部20を備える。検査装置1Cは、変換部20をさらに備える点で、第3の実施の形態の構成と異なる。以下、第1から第3の実施の形態と異なる構成を中心に説明する。
[Functional block of the inspection device]
14 is a block diagram showing the configuration of an inspection device 1C according to the present embodiment. The inspection device 1C includes an acquisition unit 10, a first estimation unit 11, a first judgment unit 12, an inspection unit 13, a presentation unit 14, a memory 15, a second estimation unit 16, a second judgment unit 17, a first learning unit 18, a second learning unit 19, and a conversion unit 20. The inspection device 1C differs from the configuration of the third embodiment in that it further includes the conversion unit 20. The following description will focus on the configurations that differ from the first to third embodiments.
変換部20は、第1推定部11による第1推定結果に含まれる出力画像を変換してより単純化した変換画像を生成する。例えば、図15の例に示すように、第1推定部11からの出力画像は、食材の種類ごとに、対応する領域が食材の実際の形状を有する。また、各領域が任意の色で塗られたカラーパターン画像である。変換部20は、カラーパターン画像の領域各々を同一形状のオブジェクトに置き換えたカラーパターン画像に変換する。例えば、変換部20は、領域a1,b1,c1,d1の形状を、円形等のオブジェクトに置き換えることができる。この場合、変換部20によって変換された画像は、各領域のカラーパターンの色は互いに異なるが、形状が同一の画像となる。 The conversion unit 20 converts the output image included in the first estimation result by the first estimation unit 11 to generate a more simplified converted image. For example, as shown in the example of FIG. 15, the output image from the first estimation unit 11 has a corresponding area for each type of ingredient that has the actual shape of the ingredient. Also, it is a color pattern image in which each area is painted with an arbitrary color. The conversion unit 20 converts the areas of the color pattern image into a color pattern image in which each area is replaced with an object of the same shape. For example, the conversion unit 20 can replace the shapes of areas a1, b1, c1, and d1 with objects such as circles. In this case, the image converted by the conversion unit 20 has color patterns of different colors for each area, but the same shape.
図15および図16に示すように、カラーパターン画像は、各領域が実際の食材インスタンスの外形を有する複雑な形状を有する。そのため、変換部20は、境界抽出に影響のない微細な変化は除去したより単純化したオブジェクトで各領域を置き換えて、第2モデルNN2を用いた学習処理および推定処理での演算負荷を軽減する。 As shown in Figures 15 and 16, the color pattern image has a complex shape in which each region has the outline of an actual food ingredient instance. Therefore, the conversion unit 20 replaces each region with a simplified object that removes minute changes that do not affect boundary extraction, thereby reducing the computational load in the learning process and estimation process using the second model NN2.
別の例を挙げると、図16に示すように、変換部20は、第1推定部11からの出力画像のカラーパターン画像の領域各々を、カラーパターンの色ごとに形状の異なるオブジェクトに置き換え、かつ、置き換えたオブジェクトのカラーパターンをすべて同一の色とした画像に変換することができる。つまり、変換部20は、複雑な形状を有する領域を、食材の種類ごとに形状が異なる単純な形状のオブジェクトに置換する。例えば、領域の形状をより単純化した幾何学形状、例えば、三角、四角、丸、星形など、任意の形状の置換した変換画像を生成することができる。一例では、変換画像をモノクロの二値画像とすることができ、これにより、変換画像のデータサイズを小さくすることができる。 As another example, as shown in FIG. 16, the conversion unit 20 can convert each region of the color pattern image of the output image from the first estimation unit 11 into an image in which the regions are replaced with objects of different shapes for each color of the color pattern, and the color patterns of the replaced objects are all the same color. In other words, the conversion unit 20 replaces regions with complex shapes with objects of simple shapes that differ for each type of ingredient. For example, a converted image can be generated in which the shape of the region is replaced with a simplified geometric shape, such as a triangle, square, circle, star, or any other shape. In one example, the converted image can be a monochrome binary image, which can reduce the data size of the converted image.
当然、変換部20は、カラーパターン画像の領域各々を、カラーパターンの色ごとに形状の異なる形状のオブジェクトに置き換え、かつ、置き換えたオブジェクトを、オブジェクトの形状ごとに異なる色とすることができるのは言うまでもない。 It goes without saying that the conversion unit 20 can replace each area of the color pattern image with an object of a different shape for each color of the color pattern, and can also give the replaced object a different color for each object shape.
第2学習部19は、変換部20によって変換された画像を学習用画像として用いて、第2モデルNN2の学習を行い、学習済み第2モデルNN2を獲得する。 The second learning unit 19 uses the images converted by the conversion unit 20 as learning images to learn the second model NN2 and acquire a trained second model NN2.
第2推定部16は、変換部20によって生成された変換画像を入力とする学習済み第2モデルNN2を用いて、変換画像における複数の食材の間の相対的な配置関係の推定を行う。 The second estimation unit 16 uses a trained second model NN2, which receives as input the converted image generated by the conversion unit 20, to estimate the relative positional relationship between multiple ingredients in the converted image.
以上説明したように、第4の実施の形態によれば、変換部20において、第1推定部11からの出力画像をより単純化した変換画像を生成し、変換画像を学習用画像として第2モデルNN2の学習を行う。そのため、第2学習部19における第2モデルNN2の学習処理における演算負荷の軽減やメモリ量の削減が可能となる。また、第2推定部16における学習済み第2モデルNN2の演算を行う際の演算負荷が軽減され得る。 As described above, according to the fourth embodiment, the conversion unit 20 generates a converted image that is a simplified version of the output image from the first estimation unit 11, and the converted image is used as a learning image to learn the second model NN2. This makes it possible to reduce the computational load and memory size in the learning process of the second model NN2 in the second learning unit 19. In addition, the computational load when calculating the learned second model NN2 in the second estimation unit 16 can be reduced.
[第5の実施の形態]
次に、本発明の第5の実施の形態について説明する。なお、以下の説明では、上述した第1から第4の実施の形態と同じ構成については同一の符号を付し、その説明を省略する。
[Fifth embodiment]
Next, a fifth embodiment of the present invention will be described. In the following description, the same components as those in the first to fourth embodiments are given the same reference numerals, and the description thereof will be omitted.
第4の実施の形態では、第1推定部11からの出力画像に含まれる、食材の領域ごとのカラーパターンを変換してより単純化した形状のオブジェクトに置き換えた変換画像を生成する場合について説明した。これに対し、第5の実施の形態では、第1推定部11からの出力画像に含まれる、カラーパターンに含まれる不連続な部分を連続なものに補完した画像を生成し、第2モデルNN2の学習に用いる。 In the fourth embodiment, a converted image is generated in which the color pattern of each region of the food ingredient included in the output image from the first estimation unit 11 is converted and replaced with an object of a simpler shape. In contrast, in the fifth embodiment, an image is generated in which discontinuous parts in the color pattern included in the output image from the first estimation unit 11 are complemented to be continuous, and the image is used for training the second model NN2.
[検査装置の機能ブロック]
図17は、本実施の形態に係る検査装置1Dの構成を示すブロック図である。検査装置1Cは、取得部10、第1推定部11、第1判断部12、検査部13、提示部14、メモリ15、第2推定部16、第2判断部17、第1学習部18、第2学習部19、および加工部21を備える。検査装置1Dは、加工部21を備える点で、変換部20を備えた第4の実施の形態の構成と異なる。以下、第1から第4の実施の形態と異なる構成を中心に説明する。
[Functional block of the inspection device]
17 is a block diagram showing the configuration of an inspection device 1D according to the present embodiment. The inspection device 1C includes an acquisition unit 10, a first estimation unit 11, a first judgment unit 12, an inspection unit 13, a presentation unit 14, a memory 15, a second estimation unit 16, a second judgment unit 17, a first learning unit 18, a second learning unit 19, and a processing unit 21. The inspection device 1D differs from the configuration of the fourth embodiment including the conversion unit 20 in that it includes the processing unit 21. The following description will focus on the configurations different from the first to fourth embodiments.
加工部21は、第1推定部11による推定結果の出力画像に含まれる食材の領域の推定外形線の最長のものの内部が、その食材の領域であるとして、カラーパターンの不連続性を補完して連続にした加工画像を生成する。 The processing unit 21 determines that the area of the ingredient contained in the output image of the estimation result by the first estimation unit 11 is the area of the ingredient, and generates a processed image that complements the discontinuity in the color pattern to make it continuous.
具体的には、図18に示すように、第1推定部11からの出力画像において、食材の領域b1に不連続な部分が含まれているとする。例えば、食材自体の形状に空洞があるような場合、あるいは、食材の加工状態によっては隙間が形成されるような場合が考えられる。このような場合には、第2学習部19におけるニューラルネットワークの学習負荷軽減の観点から、事前に領域内の全ての領域は、推定された食材を示していることを明確にしておくことが有効である。 Specifically, as shown in FIG. 18, assume that the output image from the first estimation unit 11 includes discontinuous parts in the region b1 of the ingredient. For example, there may be a cavity in the shape of the ingredient itself, or gaps may form depending on how the ingredient is processed. In such cases, from the perspective of reducing the learning load on the neural network in the second learning unit 19, it is effective to clarify in advance that all areas within the region represent the estimated ingredient.
そのため、加工部21は、領域b1の内部に含まれる穴は、食材bを示す領域であるとみなして、領域b1に割り当てられているカラーパターンで領域b1内の不連続な部分を補完して連続な部分とした加工画像を生成する。 Therefore, the processing unit 21 regards the hole contained within the region b1 as a region representing the ingredient b, and generates a processed image in which the discontinuous parts within the region b1 are complemented to make them continuous by using the color pattern assigned to the region b1.
第2学習部19は、加工部21によって加工されたカラーパターンの不連続な部分を補完して連続にした加工画像を学習用画像として用いて、第2モデルNN2の学習を行って学習済み第2モデルNN2を獲得する。 The second learning unit 19 uses the processed image, which is obtained by complementing discontinuous parts of the color pattern processed by the processing unit 21 to make it continuous, as a learning image to learn the second model NN2 and acquire the learned second model NN2.
第2推定部16は、加工部21によって生成されたカラーパターンの不連続性を補完して連続にした出力画像の加工画像を入力として学習済み第2モデルNN2の演算を行い、食材間の相対的な配置関係を推定し、推定された配置関係を出力画像に関連付けた第2推定結果を出力する。 The second estimation unit 16 performs calculations of the learned second model NN2 using as input a processed image of the output image in which the discontinuity of the color pattern generated by the processing unit 21 is complemented to make it continuous, estimates the relative positional relationship between the ingredients, and outputs a second estimation result that associates the estimated positional relationship with the output image.
以上説明したように、第5の実施の形態によれば、加工部21において、第1推定部11からの出力画像に含まれる食材の領域におけるカラーパターンの不連続な部分を補完して連続な部分とした加工画像を生成し、第2モデルNN2の学習を行う。そのため、第2学習部19における第2モデルNN2の学習における演算負荷を軽減してより効率的に学習を行うことが可能となる。 As described above, according to the fifth embodiment, the processing unit 21 generates a processed image in which discontinuous parts of the color pattern in the area of the food material included in the output image from the first estimation unit 11 are complemented to make them continuous, and the second model NN2 is trained. This reduces the computational load in training the second model NN2 in the second learning unit 19, making it possible to perform training more efficiently.
[第6の実施の形態]
次に、本発明の第6の実施の形態について説明する。なお、以下の説明では、上述した実施の形態と同じ構成については同一の符号を付し、その説明を省略する。
Sixth embodiment
Next, a sixth embodiment of the present invention will be described. In the following description, the same components as those in the above-mentioned embodiment are given the same reference numerals, and the description thereof will be omitted.
上述した第3の実施の形態では、第1モデルNN1の学習を行う第1学習部18、および第2モデルNN2の学習を行う第2学習部19を有する学習装置をさらに備える構成について説明した。また、第3の実施の形態では、第2学習部19が第2モデルNN2の学習を行う場合に、学習済み第1モデルNN1の演算で得られた出力画像のみを学習用画像として用いる場合について説明した。これに対し、第6の実施の形態では、学習装置がデータ拡張を行って、第2モデルNN2の学習で用いる学習用画像を水増しする。 In the above-mentioned third embodiment, a configuration was described that further includes a learning device having a first learning unit 18 that learns the first model NN1, and a second learning unit 19 that learns the second model NN2. Also, in the third embodiment, a case was described in which when the second learning unit 19 learns the second model NN2, only the output image obtained by the calculation of the trained first model NN1 is used as the learning image. In contrast, in the sixth embodiment, the learning device performs data expansion to pad the learning images used in learning the second model NN2.
図20は、本実施の形態に係る検査装置1Eで行われるデータ拡張処理の概要を説明するための図である。図20の破線枠DAに示される画像データは、食材間の配置関係の正誤を分類する第2モデルNN2を学習するための学習用データセットである。各学習用画像tには、食材間の配置関係が正しい、または誤っていることを示すラベル情報(「良」、「不良」)が付与されている。第2モデルNN2の分類精度を向上させる場合、食材間の配置関係の正しい(以下、「良品」または「良」という場合がある。)、および配置関係が誤っている(以下、「不良品」または「不良」という場合がある。)両方のラベルに係る学習用画像の数を増やして学習を行うことが有効であると考えられる。 Figure 20 is a diagram for explaining an overview of the data expansion process performed by the inspection device 1E according to this embodiment. The image data shown in the dashed frame DA in Figure 20 is a training data set for training the second model NN2, which classifies whether the positional relationship between ingredients is correct or incorrect. Each training image t is assigned label information ("good" or "bad") indicating whether the positional relationship between ingredients is correct or incorrect. When improving the classification accuracy of the second model NN2, it is considered effective to increase the number of training images associated with both labels indicating correct positional relationships between ingredients (hereinafter sometimes referred to as "good" or "good") and incorrect positional relationships (hereinafter sometimes referred to as "defective" or "bad") and to perform training.
しかし、検査装置1Eを食品の製造ラインの検査に用いた場合、良品に係る学習用画像を多数取得することは比較的容易であるが、不良品に係る学習用画像はほとんど取得できない。特に、本実施の形態に係る第2モデルNN2は、良品および不良品の2つのクラスを分類する分類器であり、精度の確保およびその向上のためには十分な量の不良品に係る学習用画像を用意して学習を行うことが望ましい。 However, when the inspection device 1E is used to inspect food production lines, it is relatively easy to obtain a large number of learning images of good products, but it is difficult to obtain learning images of defective products. In particular, the second model NN2 according to this embodiment is a classifier that classifies two classes, good products and defective products, and in order to ensure and improve accuracy, it is desirable to prepare a sufficient number of learning images of defective products and perform learning.
例えば、非特許文献1から3は、学習用画像をデータ拡張処理によって生成する技術を開示している。また、特許文献2は、画像データの特徴部分の境界が不自然となることを防ぐため、拡張対象物の位置形態情報を特定してデータ拡張処理を行い、学習用画像を生成する技術を開示している。また、特許文献3は、画像の特徴部分を加工して、加工データに基づいてデータ拡張を行い、学習用画像を効率的に生成する技術を開示している。 For example, Non-Patent Documents 1 to 3 disclose techniques for generating learning images by data augmentation processing. Patent Document 2 discloses a technique for identifying position and morphological information of an augmented object, performing data augmentation processing, and generating learning images in order to prevent unnatural boundaries of characteristic parts of image data. Patent Document 3 discloses a technique for processing characteristic parts of an image, performing data augmentation based on the processed data, and efficiently generating learning images.
しかし、非特許文献1から3、および特許文献2、3が開示する従来技術はいずれも、所謂良品画像のデータ拡張を行って、同じラベルである良品画像を大量に生成するものであり、良品画像に基づいたデータ拡張を行ってラベルの異なる不良品画像を大量に生成することは困難であった。 However, the conventional technologies disclosed in Non-Patent Documents 1 to 3 and Patent Documents 2 and 3 all perform so-called data expansion of good product images to generate a large number of good product images with the same label, and it is difficult to perform data expansion based on good product images to generate a large number of defective product images with different labels.
これに対し、本実施の形態では、第2モデルNN2の学習用画像に特有の性質を利用することで、製造ラインで取得することが比較的困難な不良品に係る学習用画像を生成することを可能とする。より詳細には、本実施の形態では、第2モデルNN2の学習用画像が、食材を互いに区別して食材が存在する画像内の領域をピクセル単位で識別するインスタンス・セグメンテーションで得られたカラーパターンの画像であること、および、学習用画像のラベル情報が食材間の相対的な位置関係の正誤であるということに着目する。 In contrast, in this embodiment, by utilizing the unique properties of the training images of the second model NN2, it is possible to generate training images of defective products that are relatively difficult to obtain on a production line. More specifically, in this embodiment, attention is paid to the fact that the training images of the second model NN2 are images of color patterns obtained by instance segmentation, which distinguishes ingredients from one another and identifies, on a pixel-by-pixel basis, areas in the image where the ingredients are present, and that the label information of the training images is the correctness or incorrectness of the relative positional relationships between the ingredients.
本実施の形態に係る検査装置1Eでは、これらの着目点に基づいて、比較的容易に取得可能な良品に係る対象画像のデータ拡張を行って、実際の製造ラインで取得することが比較的困難な不良品に係る学習用画像を大量に生成することを可能とする。 Based on these points of focus, the inspection device 1E according to this embodiment performs data expansion of target images of relatively easily obtainable non-defective products, making it possible to generate a large number of learning images of defective products that are relatively difficult to obtain on an actual production line.
[検査装置の機能ブロック]
図19は、本実施の形態に係る検査装置1Eの構成を示すブロック図である。検査装置1Eは、取得部10、第1推定部11、第1判断部12、検査部13、提示部14、メモリ15、第2推定部16、第2判断部17、第1学習部18、第2学習部19、抽出部22、およびデータ拡張部23を備える。検査装置1Eは、学習装置において抽出部22およびデータ拡張部23をさらに備える点で、特に、第3から第5の実施の形態の構成と異なる。以下、第3から第5の実施の形態と異なる構成を中心に説明する。
[Functional block of the inspection device]
19 is a block diagram showing the configuration of an inspection device 1E according to the present embodiment. The inspection device 1E includes an acquisition unit 10, a first estimation unit 11, a first judgment unit 12, an inspection unit 13, a presentation unit 14, a memory 15, a second estimation unit 16, a second judgment unit 17, a first learning unit 18, a second learning unit 19, an extraction unit 22, and a data extension unit 23. The inspection device 1E is different from the configurations of the third to fifth embodiments in that the learning device further includes the extraction unit 22 and the data extension unit 23. The following mainly describes the configurations different from the third to fifth embodiments.
抽出部22は、データ拡張を行う対象の画像(対象画像)から、食材の種類ごとの領域を抽出する。対象画像とは、後述のデータ拡張部23がデータ拡張を行う対象の画像であり、予め食材間の相対的な位置関係の正誤に係るラベル情報が付与された画像である。例えば、第1推定部11が出力した第1推定結果に含まれる、推定された食材の領域および種類が画像に関連付けられた出力画像を対象画像として用いることができる。あるいは、ユーザや技術者等が事前に作成した画像を対象画像として用いる場合等、ラベル情報が付与された画像を予め外部から取得して対象画像として用いることもできる。本実施の形態では、特に、食材ごとの領域がカラーパターンとして表される出力画像に、ラベル情報が付与された画像を対象画像として用いるものとする。抽出部22は、設定に応じて、予め指定されたカラーパターンに係る食材の領域のみを対象画像から抽出することもできる。 The extraction unit 22 extracts regions for each type of ingredient from an image (target image) for which data expansion is to be performed. The target image is an image for which data expansion is to be performed by the data expansion unit 23 described below, and is an image to which label information relating to the accuracy of the relative positional relationship between ingredients has been added in advance. For example, an output image in which the estimated areas and types of ingredients are associated with the image, which is included in the first estimation result output by the first estimation unit 11, can be used as the target image. Alternatively, an image to which label information has been added can be obtained in advance from outside and used as the target image, such as when an image created in advance by a user, engineer, etc. is used as the target image. In this embodiment, in particular, an image to which label information has been added is used as the target image from an output image in which the areas for each ingredient are represented as a color pattern. The extraction unit 22 can also extract only the areas of ingredients related to a previously specified color pattern from the target image according to the settings.
例えば、図21の対象画像データDA0のフォルダに含まれる3枚の画像のうち、抽出部22は、太枠で囲われた画像p(以下、「対象画像p」ということがある。)に含まれる食材a、b、c、およびdの領域a1、b1、c1、およびd1を抽出する。対象画像pには、予め食材間の相対的な配置関係が正しいことを示す第1ラベル「良」が付与されている。また、抽出部22が抽出する食材a、b、c、およびdの領域a1、b1、c1、およびd1の情報には、それぞれの領域の色情報および座標情報が含まれる。 For example, of the three images included in the folder of target image data DA0 in FIG. 21, the extraction unit 22 extracts areas a1, b1, c1, and d1 of ingredients a, b, c, and d included in image p (hereinafter sometimes referred to as "target image p") surrounded by a thick frame. Target image p has been assigned a first label "good" indicating that the relative positional relationship between the ingredients is correct. Furthermore, the information on areas a1, b1, c1, and d1 of ingredients a, b, c, and d extracted by the extraction unit 22 includes color information and coordinate information for each area.
対象画像は、カラーパターンの出力画像である場合に限らず、例えば、第4の実施の形態で説明したように、カラーパターンの出力画像をさらに単純化した形状のオブジェクトに置き換えた変換画像を用いることもできる。同様に、対象画像として、第5の実施の形態で説明した、カラーパターンに含まれる不連続な部分を連続なものに補完した加工画像を用いることもできる。 The target image is not limited to the output image of a color pattern. For example, as described in the fourth embodiment, a converted image in which the output image of a color pattern is replaced with an object of a further simplified shape can be used. Similarly, the target image can be a processed image in which discontinuous parts in a color pattern are complemented to make them continuous, as described in the fifth embodiment.
データ拡張部23は、食材の領域および種類が画像に関連付けられた対象画像のデータ拡張を行って学習用画像(第2学習用画像)を生成する。より具体的には、データ拡張部23は、対象画像に付与されている、複数の食材の間の相対的な配置関係の妥当性に関するラベル情報に基づいて学習用画像を生成する。なお、ラベル情報は、第2判断部17が、食品の容器等に配置された複数の種類の食材相互の相対的な配置関係の妥当性を判断するための第2基準に対応する情報である。つまり、第2基準を満たす画像には、予め第1ラベル「良」が付与され、第2基準を満たさない画像には、第2ラベル「不良」が付与される。 The data expansion unit 23 performs data expansion of a target image in which the area and type of ingredient are associated with the image to generate a learning image (second learning image). More specifically, the data expansion unit 23 generates the learning image based on label information regarding the validity of the relative positional relationship between multiple ingredients that is assigned to the target image. The label information is information corresponding to the second criterion that the second judgment unit 17 uses to judge the validity of the relative positional relationship between multiple types of ingredients arranged in a food container or the like. In other words, an image that satisfies the second criterion is assigned the first label "good" in advance, and an image that does not satisfy the second criterion is assigned the second label "poor".
データ拡張部23は、対象画像における複数の食材の間の相対的な配置関係が妥当であることを示す第1ラベル「良」が付与された対象画像のデータ拡張を行って、複数の食材の間の相対的な配置関係が妥当でないことを示す第2ラベル「不良」が付与された学習用画像を生成することができる。さらに、データ拡張部23は、第1ラベル「良」が付与された対象画像のデータ拡張を行って、同じラベル情報である第1ラベル「良」が付与された学習用画像を生成することもできる。同様に、データ拡張部23は、第2ラベル「不良」が付与された対象画像のデータ拡張を行って、さらに、第2ラベル「不良」が付与された学習用画像を生成することもできる。 The data expansion unit 23 can perform data expansion of a target image to which a first label "good" has been assigned, indicating that the relative positional relationship between multiple ingredients in the target image is appropriate, to generate a learning image to which a second label "bad" has been assigned, indicating that the relative positional relationship between multiple ingredients is not appropriate. Furthermore, the data expansion unit 23 can also perform data expansion of a target image to which a first label "good" has been assigned, to generate a learning image to which the same label information, the first label "good", has been assigned. Similarly, the data expansion unit 23 can perform data expansion of a target image to which a second label "bad" has been assigned, to further generate a learning image to which a second label "bad" has been assigned.
例えば、データ拡張部23は、対象画像における複数の食材の間の相対的な配置関係を維持しつつ、抽出部22が抽出した領域を加工して学習用画像を生成することができる。具体的には、図21のデータ拡張DA1に示すように、太枠で囲われた第1ラベル「良」が付与された対象画像pに含まれる領域a1、b1、c1、およびd1の互いの位置関係は維持したまま、領域a1、b1、c1、およびd1の各々を回転させて、連番で第1ラベル「良」の学習用画像を生成することができる。図21のデータ拡張DA1の例では、左側に示す学習用画像は、対象画像pの領域a1を、中心座標を起点として、乱数角度分を回転させており、真ん中に示す学習用画像は、さらに領域b1を回転させ、右側に示す学習用画像は、さらに領域c1を回転させている。 For example, the data expansion unit 23 can generate learning images by processing the areas extracted by the extraction unit 22 while maintaining the relative positional relationship between the multiple ingredients in the target image. Specifically, as shown in data expansion DA1 in FIG. 21, while maintaining the relative positions of areas a1, b1, c1, and d1 included in the target image p to which the first label "good" surrounded by a thick frame is assigned, each of the areas a1, b1, c1, and d1 can be rotated to generate learning images with the first label "good" in consecutive numbers. In the example of data expansion DA1 in FIG. 21, the learning image shown on the left rotates area a1 of the target image p by a random number angle from the center coordinates, the learning image shown in the middle further rotates area b1, and the learning image shown on the right further rotates area c1.
このように、データ拡張部23は、第1ラベル「良」が付与された1枚の対象画像pから領域a1、b1、c1、およびd1の各々の領域を回転させて、各領域を同じ位置に再配置することで、同じラベルに係る第1ラベル「良」が付与された学習用画像を連番で大量に生成することができる。図21に示したデータ拡張DA1では、各領域を回転させる場合を例示したが、領域間の位置関係を維持しつつ行うことができる加工処理であれば、領域の大きさや形状を変更して、同じ位置に再配置する他の処理も含まれる。 In this way, the data expansion unit 23 rotates each of the regions a1, b1, c1, and d1 from one target image p to which the first label "good" has been assigned, and rearranges each region to the same position, thereby generating a large number of consecutive learning images to which the first label "good" associated with the same label has been assigned. In the data expansion DA1 shown in FIG. 21, an example is given of rotating each region, but other processing that can be performed while maintaining the positional relationship between the regions includes changing the size or shape of the regions and rearranging them in the same position.
次に、第1ラベル「良」が付与された対象画像のデータ拡張を行って、第2ラベル「不良」が付与された学習用画像を生成する例について説明する。この場合、データ拡張部23は、抽出部22が抽出した領域のうち、2つ以上の互いに異なる種類の食材に対応する領域の位置を互いに置き換えて学習用画像を生成することができる。 Next, an example will be described in which data expansion is performed on a target image to which a first label "good" has been assigned, to generate a learning image to which a second label "bad" has been assigned. In this case, the data expansion unit 23 can generate a learning image by mutually replacing the positions of areas corresponding to two or more different types of ingredients among the areas extracted by the extraction unit 22.
例えば、図21に示すデータ拡張DA2では、対象画像データDA0の第1ラベル「良」が付与された太枠の対象画像pの領域b1とc1との互いの位置を置き換え、再配置して、左側に示す第2ラベル「不良」が付与された学習用画像を生成している。同様に、真ん中に示す画像は、対象画像pの領域a1とd1とを置き換え、かつ、再配置して生成された第2ラベル「不良」が付与された学習用画像である。右側に示す画像は、対象画像pの領域b1とd1とを置き換え、かつ、再配置して生成された第2ラベル「不良」が付与された学習用画像である。 For example, in the data extension DA2 shown in FIG. 21, the positions of regions b1 and c1 of the thick-framed target image p, which have been assigned the first label "good" in the target image data DA0, are swapped and rearranged to generate a learning image with the second label "bad" shown on the left. Similarly, the image shown in the middle is a learning image with the second label "bad" generated by swapping and rearranging regions a1 and d1 of the target image p. The image shown on the right is a learning image with the second label "bad" generated by swapping and rearranging regions b1 and d1 of the target image p.
データ拡張部23は、第1ラベル「良」が付与された対象画像に対し、任意の2色を置き換える組み合わせの数を計算し、そのすべての組み合わせの画像を生成することで、大量の第2ラベル「不良」が付与された学習用画像を生成することができる。 The data expansion unit 23 calculates the number of combinations for replacing any two colors for a target image that has been assigned the first label "good" and generates images of all of these combinations, making it possible to generate a large number of learning images that have been assigned the second label "bad."
次に、第1ラベル「良」が付与された対象画像のデータ拡張を行って、第2ラベル「不良」が付与された学習用画像を生成する別の例について説明する。この場合、例えば、データ拡張部23は、抽出部22が抽出した領域のうちの1つ以上を対象画像から削除して学習用画像を生成することができる。 Next, another example will be described in which data expansion is performed on a target image to which a first label "good" has been assigned, to generate a learning image to which a second label "bad" has been assigned. In this case, for example, the data expansion unit 23 can generate a learning image by deleting one or more of the regions extracted by the extraction unit 22 from the target image.
具体的には、図21のデータ拡張DA3に示すように、データ拡張部23は、第1ラベル「良」が付与された太枠の対象画像pに含まれる領域a1、b1、c1、およびd1のうち、1つの領域のみを抜き出して、その他の領域を削除および再配置することで第2ラベル「不良」を付与した学習用画像を生成している。 Specifically, as shown in data expansion DA3 in FIG. 21, the data expansion unit 23 extracts only one of the regions a1, b1, c1, and d1 contained in the thick-framed target image p to which the first label "good" has been assigned, and deletes and rearranges the other regions to generate a learning image to which the second label "bad" has been assigned.
さらに、第1ラベル「良」が付与された対象画像のデータ拡張を行って、第2ラベル「不良」が付与された学習用画像を生成する別の例を挙げる。この場合、データ拡張部23は、抽出部22が抽出した領域の各々の反転、回転、膨張、および収縮のうちの少なくともいずれかを行って対象画像のデータ拡張を行うことができる。 Furthermore, we will give another example in which data expansion is performed on a target image to which a first label "good" has been assigned, to generate a learning image to which a second label "bad" has been assigned. In this case, the data expansion unit 23 can perform data expansion of the target image by performing at least one of inversion, rotation, expansion, and contraction of each of the regions extracted by the extraction unit 22.
例えば、図21に示すデータ拡張DA4のように、データ拡張部23は、第1ラベル「良」が付与された太枠の対象画像pを縦方向に上下反転させて再配置することで、第2ラベル「不良」を付与した学習用画像を生成することができる。 For example, as shown in data expansion DA4 in FIG. 21, the data expansion unit 23 can generate a learning image with the second label "bad" by vertically flipping and rearranging the bold-framed target image p with the first label "good" assigned.
図21に示すデータ拡張DA5では、データ拡張部23は、第1ラベル「良」が付与された太枠の対象画像pを横方向に左右反転させて再配置することで、第2ラベル「不良」を付与した学習用画像を生成している。 In the data expansion DA5 shown in FIG. 21, the data expansion unit 23 horizontally flips and rearranges the bold-framed target image p to which the first label "good" has been assigned, thereby generating a learning image to which the second label "bad" has been assigned.
データ拡張部23は、対象画像のデータ拡張を行って得られた第1ラベル「良」または第2ラベル「不良」が付与された学習用画像のデータ拡張をさらに行って、第1ラベル「良」または第2ラベル「不良」が付与された学習用画像を生成してもよい。例えば、データ拡張部23は、図21のデータ拡張DA4で示したように、第1ラベル「良」を有する対象画像を垂直軸で鏡像させた第2ラベル「不良」を有する学習用画像に対して、各カラーパターンの領域の中心座標を起点に、発生させた乱数角度分を回転させて第2ラベル「不良」を付与した学習用画像を生成することができる。 The data expansion unit 23 may further perform data expansion of the learning image to which the first label "good" or the second label "bad" has been assigned, obtained by performing data expansion of the target image, to generate a learning image to which the first label "good" or the second label "bad" has been assigned. For example, as shown in data expansion DA4 in FIG. 21, the data expansion unit 23 can generate a learning image to which the second label "bad" has been assigned by rotating the learning image to which the second label "bad" has been assigned, the learning image being obtained by mirroring the target image to which the first label "good" has been mirrored on the vertical axis, by a generated random number angle, starting from the central coordinates of the area of each color pattern.
このように、データ拡張部23は、第1ラベル「良」が付与された対象画像に基づいて、第2ラベル「不良」が付与された学習用画像を所望の枚数だけ生成することができる。なお、データ拡張部23がデータ拡張処理を繰り返して不良品に係る学習用画像を生成する際に、良品に係る学習用画像が生成される場合があるが、事前の設定により、生成される学習用画像から良品に係る学習用画像を除けばよい。 In this way, the data expansion unit 23 can generate a desired number of learning images to which the second label "bad" has been assigned, based on a target image to which the first label "good" has been assigned. Note that when the data expansion unit 23 repeats the data expansion process to generate learning images related to defective products, learning images related to good products may be generated. However, learning images related to good products can be removed from the generated learning images by using a pre-set setting.
[検査装置の動作]
次に、上述した構成を有する検査装置1Eの動作について、図22を参照して説明する。図22は、検査装置1Eにおける第2モデルNN2の学習用画像の生成から第2モデルNN2の学習処理までの各ステップを示すフローチャートである。
[Operation of the inspection device]
Next, the operation of the inspection device 1E having the above-mentioned configuration will be described with reference to Fig. 22. Fig. 22 is a flowchart showing each step from the generation of the learning image for the second model NN2 to the learning process of the second model NN2 in the inspection device 1E.
まず、学習装置は、データ拡張を行う対象の画像である対象画像を取得する(ステップS201)。例えば、学習装置は、第1推定部11による学習済みの第1モデルNN1の演算結果として得られた複数の食材の領域および種類が入力画像iに関連付けられたカラーパターンの出力画像pを、対象画像として用いることができる。 First, the learning device acquires a target image that is an image to be subjected to data augmentation (step S201). For example, the learning device can use, as the target image, an output image p of a color pattern in which the regions and types of multiple ingredients obtained as a result of the calculation of the trained first model NN1 by the first estimation unit 11 are associated with the input image i.
次に、学習装置は、ステップS201で取得した対象画像のラベル情報を取得する(ステップS202)。例えば、学習装置は、外部からの入力による対象画像のラベル情報を取得することができる。 Next, the learning device acquires label information of the target image acquired in step S201 (step S202). For example, the learning device can acquire label information of the target image by input from an external source.
次に、学習装置は、学習用画像を生成する際の事前の設定を行う(ステップS203)。具体的には、ステップS202でラベル情報を取得した対象画像のうちから、特定の対象画像を選択することができる。また、ステップS203では、対象画像に含まれる食材ごとの領域のカラー数や、抽出部22が抽出するカラーパターンの領域の色を指定することができる。さらに、ステップS203では、生成する学習用画像の枚数や、領域の回転角度範囲などを事前に設定する。 Next, the learning device performs pre-settings when generating learning images (step S203). Specifically, a specific target image can be selected from among the target images for which label information was obtained in step S202. Also, in step S203, the number of colors in the areas for each ingredient included in the target image and the colors of the areas of the color pattern extracted by the extraction unit 22 can be specified. Furthermore, in step S203, the number of learning images to be generated, the rotation angle range of the areas, etc. are set in advance.
次に、抽出部22は、ステップS203での設定情報に基づいて、食材の領域に係るカラーパターンを対象画像から抽出する(ステップS204)。続いて、データ拡張部23は、抽出部22によって抽出された領域の加工などを行い、対象画像のデータ拡張を行って、学習用画像を生成する(ステップS205)。 Next, the extraction unit 22 extracts a color pattern related to the area of the ingredient from the target image based on the setting information in step S203 (step S204). Next, the data expansion unit 23 processes the area extracted by the extraction unit 22, expands the data of the target image, and generates a learning image (step S205).
例えば、データ拡張部23は、ステップS205で、第1ラベル「良」が付与された対象画像における複数の食材の間の相対的な配置関係を維持しつつ、抽出部22がステップS202で抽出した領域を加工して学習用画像を生成することができる。この場合、データ拡張部23は、生成した学習用画像に第2ラベル「不良」を付与する(ステップS206)。 For example, in step S205, the data expansion unit 23 can generate a learning image by processing the area extracted by the extraction unit 22 in step S202 while maintaining the relative positional relationship between multiple ingredients in the target image to which the first label "good" has been assigned. In this case, the data expansion unit 23 assigns the second label "bad" to the generated learning image (step S206).
次に、第2学習部19は、ステップS206で得られた学習用画像を用いて第2モデルNN2の学習を行い、学習済み第2モデルNN2を獲得する(ステップS207)。ステップS207で用いる学習用画像には、第2モデルNN2の分類精度の観点から十分な枚数の良品画像および不良品画像を含むことができる。 Next, the second learning unit 19 learns the second model NN2 using the learning images obtained in step S206, and acquires a learned second model NN2 (step S207). The learning images used in step S207 can include a sufficient number of good and defective images from the perspective of the classification accuracy of the second model NN2.
次に、学習装置は、ステップS207で得られた学習済みの第2モデルNN2を第2メモリ15Bに記憶する(ステップS208)。その後、処理は、例えば、図8のステップS10に戻され、学習済みの第1モデルNN1およびデータ拡張によって生成された学習用画像で学習した学習済みの第2モデルNN2の演算を行い、食材の配置に関する検査を行うことができる(図8のステップS10からS19)。 Next, the learning device stores the trained second model NN2 obtained in step S207 in the second memory 15B (step S208). After that, the process returns to, for example, step S10 in FIG. 8, and calculations are performed on the trained first model NN1 and the trained second model NN2 trained with the training image generated by data augmentation, and an inspection of the arrangement of ingredients can be performed (steps S10 to S19 in FIG. 8).
以上説明したように、第6の実施の形態によれば、検査装置1Eは、インスタンス・セグメンテーションを用いた学習済み第1モデルNN1の演算で得られた対象画像のデータ拡張を行い、第2モデルNN2の学習に用いる学習用画像を水増しする。そのため、食品の製造ラインで取得することが比較的容易な良品画像に基づいて、その取得が比較的困難な不良品画像を大量に生成することができる。その結果として、十分な数の不良品に係る学習用画像を用意することができ、学習済み第2モデルNN2の分類精度を一層向上させることができる。 As described above, according to the sixth embodiment, the inspection device 1E performs data expansion of the target image obtained by the calculation of the trained first model NN1 using instance segmentation, and pads the training images used for training the second model NN2. Therefore, based on images of good products that are relatively easy to obtain on a food production line, it is possible to generate a large number of images of defective products, which are relatively difficult to obtain. As a result, it is possible to prepare a sufficient number of training images of defective products, and the classification accuracy of the trained second model NN2 can be further improved.
[第7の実施の形態]
次に、本発明の第7の実施の形態について説明する。なお、以下の説明では、上述した第1から第6の実施の形態と同じ構成については同一の符号を付し、その説明を省略する。
[Seventh embodiment]
Next, a seventh embodiment of the present invention will be described. In the following description, the same components as those in the first to sixth embodiments are given the same reference numerals, and the description thereof will be omitted.
第1から第6の実施の形態では、インスタンス・セグメンテーションを行う学習済み第1モデルNN1を用いて複数の食材の領域および種類を推定し、推定された食材の領域および種類を画像に関連付けた出力画像を含む第1推定結果を出力し、食材の配置に関する検査を行う場合について説明した。また、食材間の配置関係については、学習済み第2学習モデルNN2を用いて分類を行った。 In the first to sixth embodiments, a trained first model NN1 that performs instance segmentation is used to estimate the regions and types of multiple ingredients, a first estimation result including an output image in which the estimated regions and types of ingredients are associated with the image is output, and an inspection of the arrangement of ingredients is performed. In addition, the arrangement relationship between ingredients is classified using a trained second learning model NN2.
これに対し、第7の実施の形態では、第1モデルNN1として、食材の種類(クラス)と画像内での位置をバウンディングボックスで囲って物体検出を行うモデルなど、例えば、R-CNN,YOLO,Mask R-CNN,SSD等の任意のディープラーニングモデルを用いることができる。なお、バウンディングボックスとは、画像内の物体を囲む境界線または境界領域のことであり、通常は矩形状を有することが当業者には理解される。 In contrast, in the seventh embodiment, the first model NN1 can be any deep learning model, such as R-CNN, YOLO, Mask R-CNN, SSD, etc., which detects objects by enclosing the type (class) of ingredients and their position in an image with a bounding box. Note that a bounding box is a boundary line or boundary area that surrounds an object in an image, and it will be understood by those skilled in the art that it is usually rectangular.
本実施の形態では、第1モデルNN1は、取得部10によって取得された食品の画像を入力あるいは学習用画像として用い、出力にはアンカーボックスとグリッドごとのラベルである各食材とバウンディングボックスを示す領域が含まれる。より詳細には、学習済み第1モデルNN1の演算によって得られる出力は、例えば、食材を示すラベルによらずグリッド内に食材中心を含む確率(score)、グリッド内に含まれる食材中心の分類ラベルである食材のクラス(class)、およびグリッド内に食材中心があるバウンディングボックスのグリッド内での相対位置(縦、横)とサイズ(幅、高さ)を示す位置情報が含まれる。 In this embodiment, the first model NN1 uses food images acquired by the acquisition unit 10 as input or learning images, and the output includes an anchor box, each ingredient which is a label for each grid, and an area indicating a bounding box. More specifically, the output obtained by the calculation of the trained first model NN1 includes, for example, the probability (score) of including an ingredient center within a grid regardless of the label indicating the ingredient, the ingredient class (class) which is the classification label of the ingredient center included within the grid, and position information indicating the relative position (length, width) and size (width, height) within the grid of the bounding box in which the ingredient center is located within the grid.
第1学習部18は、取得部10で取得された入力画像を学習用画像として用いて、学習用画像から食材のクラスとその食材を含むバウンディングボックスを予測するような特徴量を学習する。 The first learning unit 18 uses the input images acquired by the acquisition unit 10 as learning images to learn features that predict the class of an ingredient and a bounding box that contains that ingredient from the learning images.
第1推定部11は、学習済み第1モデルNN1の演算により、入力画像に含まれる各食材の種類と、その食材を囲むバウンディングボックスを推定することが可能である。第1推定部11は、複数の食材の間の相対的な配置関係と、食材の種類とを推定し、推定された配置関係を画像に関連付けた出力画像を含む第1推定結果を出力する。 The first estimation unit 11 is capable of estimating the type of each ingredient included in the input image and the bounding box surrounding the ingredient by calculation of the trained first model NN1. The first estimation unit 11 estimates the relative positional relationship between multiple ingredients and the type of ingredient, and outputs a first estimation result including an output image that associates the estimated positional relationship with the image.
第1判断部12は、第1推定結果に基づいて、配置関係が予め設定された基準を満たすか否かを判断する。また、第1判断部12は、各食材の有無を第1推定部11による推定結果から判断することができる。 The first judgment unit 12 judges whether the layout relationship satisfies a preset criterion based on the first estimation result. The first judgment unit 12 can also judge the presence or absence of each ingredient from the estimation result by the first estimation unit 11.
ここで、同一種類の食材が複数の食材で構成される場合には、第1判断部12は、推定された複数の食材のバウンディングボックスの4頂点や中心点に基づいて、食材間の相対的な配置関係が設定された基準を満たすか否かを判断することができる。このような構成により、第1判断部12は同一種類の食材の並び方、あるいはばらけ方の程度についての妥当性を判断することができる。例えば、ピザのトッピングとして配置されるシュレッドチーズなどが一定の位置に配置されているか否かを判断することが可能となる。 Here, when the same type of food is composed of multiple ingredients, the first judgment unit 12 can judge whether the relative placement relationship between the ingredients satisfies a set criterion based on the four vertices or center point of the bounding box of the estimated multiple ingredients. With this configuration, the first judgment unit 12 can judge the appropriateness of the arrangement or degree of dispersion of ingredients of the same type. For example, it becomes possible to judge whether shredded cheese, which is placed as a pizza topping, is placed in a certain position.
検査部13は、第1判断部12による判断結果に基づいて、食品の容器等に配置されている複数の食材の配置に関する検査を行う。 The inspection unit 13 inspects the arrangement of multiple ingredients placed in a food container, etc., based on the judgment result by the first judgment unit 12.
以上説明したように、第7の実施の形態によれば、第1モデルNN1として、画像内の食材の位置を特定してバウンディングボックスで囲む物体検出モデルを用いても、食品の容器等に配置された食材の有無、および食材の配置関係の妥当性を含む食品の盛り付け検査を行うことができる。 As described above, according to the seventh embodiment, even if an object detection model that identifies the position of ingredients in an image and encloses them in a bounding box is used as the first model NN1, it is possible to perform food presentation inspection, including the presence or absence of ingredients placed in food containers, etc., and the appropriateness of the relative placement of ingredients.
[検査装置の使用例]
ここで、本発明の実施の形態に係る検査装置1の使用例を図23から図25を参照して説明する。
[Examples of using inspection equipment]
Here, a usage example of the inspection device 1 according to the embodiment of the present invention will be described with reference to FIGS.
図23は、検査装置1が備える表示装置108に表示された検査画面の一例を示している。画面左側の画像iは、カメラ105で撮影された食品を示している。また、画面右側の画像sは、インスタンス・セグメンテーションを用いて推定された食材の盛り付け位置を示すカラーパターン画像と元画像iとを合成した画像である。本例では、食品の品種は「製品B」、検査対象の食材は「わさび」、「きざみのり」、「きゅうり」、「ねぎ」の4種である。 Figure 23 shows an example of an inspection screen displayed on the display device 108 of the inspection device 1. The image i on the left side of the screen shows food photographed by the camera 105. The image s on the right side of the screen is an image obtained by combining the original image i with a color pattern image showing the presentation position of the food ingredient estimated using instance segmentation. In this example, the food variety is "Product B," and the ingredients to be inspected are four types: "Wasabi," "Chopped seaweed," "Cucumber," and "Green onion."
検査画面には、食材各々に対して設定された第1基準(「検査項目」)および判断結果(「結果総合」、「認識個数」、「認識総面積」)が表示されている。また、検査画面には、食材間における配置位置の分類結果が示されている(「場所検査(Class/Score)、「0.96076」)。また、検査対象の食品の検査結果は、合格「OK」であることが画面の右上に表示されている。食材間の配置位置に関する第2基準は項目「Score閾値」に表示されている。 The inspection screen displays the first criteria ("Inspection item") set for each ingredient and the judgment results ("Overall result", "Number recognized", "Total recognized area"). The inspection screen also shows the classification result of the placement position between ingredients ("Location inspection (Class/Score) "0.96076"). The inspection result of the food being inspected is also displayed in the top right of the screen as "OK", meaning it has passed. The second criterion for the placement position between ingredients is displayed in the "Score threshold" item.
前述したように、検査装置1において、ユーザが、学習済みの第1モデルNN1および学習済み第2モデルNN2、ならびにこれらの演算結果に対するしきい値等の判断基準を食品の品種ごとに切り替えることで、1台の検査装置1で複数の異なる食品の盛り付け検査を行うことができる。ユーザは、例えば、検査画面に表示されたアイコンmc(「検査設定変更」)をクリック、あるいは検査画面がタッチパネルである場合にはタッチ操作をして、検査対象の食品の品種の切り替え等の設定変更を行うことができる。 As described above, in the inspection device 1, a user can switch between the trained first model NN1 and trained second model NN2, as well as the judgment criteria such as thresholds for the calculation results, for each type of food, thereby enabling a single inspection device 1 to inspect the presentation of multiple different foods. For example, the user can click on the icon mc ("change inspection settings") displayed on the inspection screen, or touch the screen if it is a touch panel, to change settings such as switching the type of food being inspected.
ユーザが、図23に示す検査画面に表示されたアイコンmcをタッチ操作あるいはクリックすると、設定変更画面に遷移する前に、例えば、パスワード要求画面に切り替わる。検査対象の食品を別の品種の食品に変更する場合には、ユーザは、キーボード等を用いた入力操作を行って、ユーザ名およびパスワードを入力する。このようなパスワード要求を行うことで、ユーザに与えられた権限に応じて変更可能な設定項目を制限することができる。 When the user touches or clicks the icon mc displayed on the inspection screen shown in FIG. 23, the screen switches to, for example, a password request screen before transitioning to a setting change screen. When changing the food to be inspected to a different type of food, the user performs input operations using a keyboard or the like to input a user name and password. By requesting a password in this way, it is possible to restrict the setting items that can be changed according to the authority given to the user.
図24は、表示装置108に表示される設定変更画面の一例を示している。検査対象の食品の品種を変更する場合には、ユーザは、「検査設定ファイル」の設定画面に表示されたメニューf(「ファイル選択」)のプルダウンリストの品種から、所望とされる食品の品種を入力することができる。図20の例では、食品「製品A」、「製品B」、「製品C」の3種類の食品の品種の中から選択される。 Figure 24 shows an example of a setting change screen displayed on the display device 108. When changing the type of food to be inspected, the user can input the desired food type from the type pull-down list of menu f ("File Selection") displayed on the "Inspection Setting File" setting screen. In the example of Figure 20, the type is selected from three types of food types: "Product A", "Product B", and "Product C".
例えば、ユーザが「製品B」を選択すると、メモリ15から食品「製品B」に対応する学習済み第1モデルNN1(「Segmentationモデル」)および学習済み第2モデルNN2(「Classificationモデル」)が追従して呼び出される。さらに、学習済み第1モデルNN1および学習済み第2モデルNN2の演算結果に対する判断基準として用いられる食材毎のしきい値(「検査しきい値」、「検査項目」)なども、メモリ15から呼び出される。 For example, when the user selects "Product B," the trained first model NN1 ("Segmentation model") and trained second model NN2 ("Classification model") corresponding to the food "Product B" are subsequently called up from memory 15. In addition, thresholds for each ingredient ("Test thresholds," "Test items") used as criteria for the calculation results of the trained first model NN1 and the trained second model NN2 are also called up from memory 15.
図25の設定変更画面の一例に示すように、ユーザは、ファイル選択メニューfで「製品B」を選択し、さらに確定アイコンeによって品種の呼出しを確定する。設定変更画面の領域dl、ct等には、現在設定されている学習済み第1モデルNN1、学習済み第2モデルNN2、判断基準として用いられる食材毎のしきい値などが表示されている。また、図25の例では、食材間の配置位置の検査に用いられるモデルとして、学習済み第2モデルNN2の他に、予め用意された他の位置補正モデルが選択可能である。ユーザは、領域pcにディレクトリ表示されている位置補正モデルあるいは、領域dlに表示される学習済み第2モデルNN2の何れかを選択することができる。 As shown in the example of the setting change screen in Figure 25, the user selects "Product B" from the file selection menu f, and then confirms the call of the variety with the confirmation icon e. Areas dl, ct, etc. of the setting change screen display the currently set trained first model NN1, trained second model NN2, threshold values for each ingredient used as judgment criteria, etc. In addition, in the example of Figure 25, in addition to the trained second model NN2, other prepared position correction models can be selected as models used to inspect the placement positions of ingredients. The user can select either the position correction model displayed in the directory in area pc, or the trained second model NN2 displayed in area dl.
また、ユーザは、学習済み第1モデルNN1の演算結果に対する判断基準として用いる食材毎のしきい値を含む第1基準(「検査項目」)を、食材ごとにプルダウン選択して変更することができる。例えば、ユーザは、食材「きゅうり」に対する「検査項目」について、「個数」「単一面積」「総面積」およびこれらの組み合わせと「未検査」をプルダウンで選択することができる。同様に、ユーザは各食材の検査項目に対して設定されるしきい値を、プルダウン選択で変更できる。 The user can also change the first criteria ("test item"), which includes a threshold value for each ingredient used as a judgment criterion for the calculation results of the trained first model NN1, for each ingredient by selecting from a pull-down menu. For example, for the "test item" for the ingredient "cucumber," the user can select "quantity," "single area," "total area," or a combination of these, as well as "not tested," from a pull-down menu. Similarly, the user can change the threshold value set for the test item for each ingredient by selecting from a pull-down menu.
各食材の「検査項目」の変更、しきい値の変更などの設定変更を行った場合には、ユーザは、アイコンwをクリックして設定の上書き保存、あるいはアイコンnをクリックして新規ファイルを作成することができる。また、アイコンdで不要となったファイルを削除することができる。 When making changes to settings such as changing the "test items" for each ingredient or changing the thresholds, the user can click icon w to overwrite and save the settings, or click icon n to create a new file. In addition, the user can delete files that are no longer needed by clicking icon d.
以上、本発明の検査装置および検査方法における実施の形態について説明したが、本発明は説明した実施の形態に限定されるものではなく、請求項に記載した発明の範囲において当業者が想定し得る各種の変形を行うことが可能である。 The above describes the embodiments of the inspection device and inspection method of the present invention, but the present invention is not limited to the described embodiments, and various modifications that a person skilled in the art can imagine are possible within the scope of the invention described in the claims.
例えば、説明した実施の形態では、検査装置による検査処理が開始されると、製造ラインにおける食品の製造の流れに応じて、カメラ105で撮影された検査対象の画像を取得部10が取得する場合について説明した。しかし、検査装置は、食品の製造ラインで食品が製造されている際だけでなく、例えば、製造ラインが稼働していない場合であっても、過去に撮影された製造食品の画像を取得して、検査処理を行うこともできる。例えば、製造ラインのメンテナンスを行う場合などが挙げられる。 For example, in the embodiment described above, when the inspection process by the inspection device is started, the acquisition unit 10 acquires an image of the inspection target captured by the camera 105 in accordance with the flow of food production on the production line. However, the inspection device can acquire images of manufactured foods captured in the past and perform inspection process not only when food is being manufactured on the food production line, but also, for example, even when the production line is not in operation. For example, this can be done when performing maintenance on the production line.
また、説明した実施の形態では、検査対象の食品として、製造ラインで製造され、食材が配置されて盛り付けられる加工麺、冷凍食品、弁当、および惣菜などが含まれる。なお、検査対象の食品は、食材が容器の中に配置されているものだけでなく、容器を用いずに食材が配置されているものも含まれる。 Furthermore, in the described embodiment, the foods to be inspected include processed noodles, frozen foods, boxed lunches, and prepared foods that are produced on a production line and served with ingredients arranged inside. Note that the foods to be inspected include not only foods in which ingredients are arranged inside a container, but also foods in which ingredients are arranged without using a container.
また、説明した実施の形態では、検査対象の食材の種類の数が複数である場合を例示したが、食材の種類の数は単数であってもよい。 In addition, in the embodiment described above, a case where there are multiple types of ingredients to be inspected is exemplified, but the number of types of ingredients may be single.
なお、第1モデルNN1および第2モデルNN2の学習処理を行う学習装置は検査装置とは別個独立な構成とすることができる。 The learning device that performs the learning process for the first model NN1 and the second model NN2 can be configured separately and independently from the inspection device.
なお、ここで開示された実施の形態に関連して記述された様々の機能ブロック、モジュール、および回路は、汎用プロセッサ、GPU、デジタル信号プロセッサ(DSP)、特定用途向け集積回路(ASIC)、FPGAあるいはその他のプログラマブル論理デバイス、ディスクリートゲートあるいはトランジスタロジック、ディスクリートハードウェア部品、または上述した機能を実現するために設計された上記いずれかの組み合わせを用いて実行されうる。 It should be noted that the various functional blocks, modules, and circuits described in connection with the embodiments disclosed herein may be implemented using a general purpose processor, a GPU, a digital signal processor (DSP), an application specific integrated circuit (ASIC), an FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of the above designed to achieve the functionality described above.
汎用プロセッサとしてマイクロプロセッサを用いることが可能であるが、代わりに、従来技術によるプロセッサ、コントローラ、マイクロコントローラ、あるいは状態機器を用いることも可能である。プロセッサは、例えば、DSPとマイクロプロセッサとの組み合わせ、複数のマイクロプロセッサ、DSPコアに接続された1つ以上のマイクロプロセッサ、またはこのような任意の構成である計算デバイスの組み合わせとして実現することも可能である。 A general purpose processor may be a microprocessor, but may alternatively be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors connected to a DSP core, or any such combination of computing devices.
1…検査装置、10…取得部、11…第1推定部、12…第1判断部、13…検査部、14…提示部、15…メモリ、15A…第1メモリ、101…バス、102…プロセッサ、103…主記憶装置、104…通信I/F、105…カメラ、106…補助記憶装置、107…入出力I/O、108…表示装置、NW…ネットワーク。
1...inspection device, 10...acquisition unit, 11...first estimation unit, 12...first judgment unit, 13...inspection unit, 14...presentation unit, 15...memory, 15A...first memory, 101...bus, 102...processor, 103...main memory device, 104...communication I/F, 105...camera, 106...auxiliary memory device, 107...input/output I/O, 108...display device, NW...network.
Claims (33)
学習済み第1モデルを用いて、前記画像における前記食材の領域および種類を推定し、推定された前記食材の領域および種類を前記画像に関連付けた出力画像を含む第1推定結果を出力する第1推定部と、
前記第1推定結果に基づいて、前記食材の種類ごとに、対応する前記領域が、前記食材の有無および過不足に関して予め設定された第1基準を満たすか否かを判断する第1判断部と、
前記第1判断部による判断結果に基づいて、前記食材の配置に関する検査を行う検査部と、
前記第1推定結果に含まれる前記出力画像を入力とする学習済み第2モデルを用いて、前記出力画像における複数の前記食材の間の相対的な配置関係を推定し、推定された配置関係を前記出力画像に関連付けた第2推定結果を出力する第2推定部と、
前記第2推定結果に基づいて、前記配置関係が、前記配置関係の妥当性に関して予め設定された第2基準を満たすか否かを判断する第2判断部と
を備え、
前記検査部は、前記第2判断部による判断結果に基づいて、前記食材の配置に関する検査を行う
ことを特徴とする検査装置。 An acquisition unit that acquires an image including the arranged ingredients;
a first estimation unit that estimates a region and a type of the ingredient in the image using a trained first model and outputs a first estimation result including an output image in which the estimated region and type of the ingredient are associated with the image;
a first determination unit that determines, for each type of ingredient, whether the corresponding area satisfies a first criterion set in advance regarding the presence or absence and the excess or deficiency of the ingredient based on the first estimation result;
An inspection unit that inspects the arrangement of the ingredients based on the judgment result by the first judgment unit ;
a second estimation unit that estimates a relative positional relationship between the ingredients in the output image by using a trained second model in which the output image included in the first estimation result is input, and outputs a second estimation result in which the estimated positional relationship is associated with the output image;
a second determination unit that determines whether or not the layout relationship satisfies a second criterion that is set in advance regarding the validity of the layout relationship based on the second estimation result;
Equipped with
The inspection unit inspects the arrangement of the ingredients based on the judgment result by the second judgment unit.
An inspection device characterized by:
前記第1判断部は、前記食材の種類ごとに、前記領域の個数および大きさの少なくとも一方を特定して、前記領域の個数および大きさの少なくとも一方が前記第1基準を満たすか否かを判断する
ことを特徴とする検査装置。 2. The inspection device according to claim 1,
The first judgment unit identifies at least one of the number and size of the regions for each type of food material and judges whether or not at least one of the number and size of the regions satisfies the first criterion.
さらに、少なくとも前記検査部による検査結果を提示する提示部を備え、
前記提示部は、前記画像、前記第1推定結果、前記第1判断部による判断結果、前記第2推定結果、前記第2判断部による判断結果、および前記検査部による検査結果を含む情報のうちの少なくともいずれかを提示する
ことを特徴とする検査装置。 In the inspection device according to claim 1 or 2 ,
Further, a presentation unit is provided that presents at least the test result by the test unit,
the presentation unit presents at least one of information including the image, the first estimation result, the judgment result by the first judgment unit, the second estimation result, the judgment result by the second judgment unit, and the inspection result by the inspection unit.
さらに、予め設定されたモデルを構築するための学習処理を行う学習装置を備え、
前記学習装置は、
配置された前記食材を含む画像を第1学習用画像として用い、ニューラルネットワークの第1モデルを学習させて、前記食材の領域および種類を識別する第1特徴量を抽出し、抽出された前記第1特徴量により前記学習済み第1モデルを獲得する第1学習部と、
前記第1学習部で獲得された前記学習済み第1モデルを記憶する第1記憶部と
を備え、
前記第1推定部は、前記第1記憶部から前記学習済み第1モデルを読み込んで前記学習済み第1モデルによる前記画像における前記食材の領域および種類の推定を行う
ことを特徴とする検査装置。 4. The inspection device according to claim 1,
Further, a learning device is provided for performing a learning process for constructing a preset model,
The learning device includes:
a first learning unit that uses an image including the arranged ingredients as a first learning image, learns a first model of a neural network, extracts a first feature amount that identifies a region and a type of the ingredients, and acquires the learned first model based on the extracted first feature amount;
a first storage unit that stores the trained first model acquired by the first learning unit,
The inspection device, characterized in that the first estimation unit reads the trained first model from the first storage unit and estimates the area and type of the food ingredient in the image using the trained first model.
前記第1モデルが、インスタンス・セグメンテーションによる画像認識モデルである
ことを特徴とする検査装置。 5. The inspection device according to claim 4 ,
The inspection apparatus according to claim 1, wherein the first model is an image recognition model based on instance segmentation.
前記学習装置は、
前記第1推定部が出力する前記第1推定結果に含まれる前記出力画像を第2学習用画像として用いて、ニューラルネットワークの第2モデルを学習させて、前記第2学習用画像における複数の前記食材の間の相対的な配置関係を識別する第2特徴量を抽出し、抽出された前記第2特徴量により前記学習済みの第2モデルを獲得する第2学習部と、
前記第2学習部で獲得された前記学習済みの第2モデルを記憶する第2記憶部と
をさらに備えることを特徴とする検査装置。 In the inspection device according to claim 4 or 5 ,
The learning device includes:
a second learning unit that uses the output image included in the first estimation result output by the first estimation unit as a second learning image to learn a second model of a neural network, extracts second feature amounts that identify a relative positional relationship between the plurality of ingredients in the second learning image, and acquires the trained second model using the extracted second feature amounts;
and a second memory unit that stores the trained second model acquired by the second learning unit.
さらに、前記第1推定結果に含まれる前記出力画像を変換してより単純化した変換画像を生成する変換部を備え、
前記第2学習部は、前記変換画像を前記第2学習用画像として用いて前記第2モデルを学習させ、前記学習済みの第2モデルを獲得する
ことを特徴とする検査装置。 7. The inspection device according to claim 6 ,
a conversion unit that converts the output image included in the first estimation result to generate a more simplified converted image,
the second learning unit uses the converted image as the second learning image to learn the second model, and acquires the trained second model.
前記第1推定結果に含まれる前記出力画像は、前記食材の種類ごとに、対応する前記領域が任意の色で塗られたカラーパターン画像であり、
前記変換画像は、前記カラーパターン画像の領域各々を同一形状のオブジェクトに置き換えたカラーパターン画像である
ことを特徴とする検査装置。 8. The inspection device according to claim 7 ,
the output image included in the first estimation result is a color pattern image in which the corresponding area is painted with an arbitrary color for each type of ingredient,
The inspection device according to claim 1, wherein the converted image is a color pattern image in which each area of the color pattern image is replaced with an object of the same shape.
前記第1推定結果に含まれる前記出力画像は、前記食材の種類ごとに、対応する前記領域が任意の色で塗られたカラーパターン画像であり、
前記変換画像は、前記カラーパターン画像の領域各々を、カラーパターンの色ごとに形状の異なるオブジェクトに置き換え、かつ、置き換えた前記オブジェクトの色を形状ごとに異なる色とした画像である
ことを特徴とする検査装置。 8. The inspection device according to claim 7 ,
the output image included in the first estimation result is a color pattern image in which the corresponding area is painted with an arbitrary color for each type of ingredient,
an inspection device characterized in that the converted image is an image in which each area of the color pattern image is replaced with an object having a different shape for each color of the color pattern, and the colors of the replaced objects are made different for each shape.
前記第1推定結果に含まれる前記出力画像は、前記食材の種類ごとに、対応する前記領域が任意の色で塗られたカラーパターン画像であり、
前記変換画像は、前記カラーパターン画像の領域各々を、カラーパターンの色ごとに形状の異なるオブジェクトに置き換え、かつ、置き換えた前記オブジェクトの色をすべて同一の色とした画像である
ことを特徴とする検査装置。 8. The inspection device according to claim 7 ,
the output image included in the first estimation result is a color pattern image in which the corresponding area is painted with an arbitrary color for each type of ingredient,
an inspection device characterized in that the converted image is an image in which each area of the color pattern image is replaced with an object having a different shape for each color of the color pattern, and the colors of the replaced objects are all the same color.
さらに、前記第1推定結果に含まれる前記出力画像の前記領域の推定外形線の最長のものの内部が、当該領域であるとして、前記出力画像を加工した加工画像を生成する加工部を備え、
前記第2学習部は、前記加工画像を前記第2学習用画像として用いて前記第2モデルを学習させ、前記学習済みの第2モデルを獲得する
ことを特徴とする検査装置。 7. The inspection device according to claim 6 ,
a processing unit that processes the output image by determining that an inside of a longest estimated outline of the region of the output image included in the first estimation result is the region, and generates a processed image by processing the output image,
The second learning unit uses the processed image as the second learning image to learn the second model and acquires the trained second model.
前記学習装置は、
さらに、前記食材の領域および種類が前記画像に関連付けられた対象画像のデータ拡張を行って前記第2学習用画像を生成するデータ拡張部を備え、
前記データ拡張部は、前記対象画像に付与されている、前記対象画像における複数の前記食材の間の相対的な配置関係の妥当性に関するラベル情報に基づいて前記第2学習用画像を生成する
ことを特徴とする検査装置。 In the inspection device according to any one of claims 6 to 11 ,
The learning device includes:
Further, a data extension unit performs data extension on a target image in which the region and type of the ingredient are associated with the image to generate the second learning image,
The data augmentation unit generates the second learning image based on label information regarding the validity of a relative positional relationship between the plurality of ingredients in the target image, the label information being assigned to the target image.
前記データ拡張部は、前記対象画像における複数の前記食材の間の相対的な配置関係が妥当であることを示す第1ラベルが付与された対象画像のデータ拡張を行って、前記第1ラベルを付与した前記第2学習用画像を生成する
ことを特徴とする検査装置。 The inspection device according to claim 12 ,
The data expansion unit performs data expansion on a target image to which a first label indicating that a relative positional relationship between the multiple ingredients in the target image is valid is assigned, and generates the second learning image to which the first label is assigned.
前記データ拡張部は、前記対象画像における複数の前記食材の間の相対的な配置関係が妥当であることを示す第1ラベルが付与された対象画像のデータ拡張を行って、複数の前記食材の間の相対的な配置関係が妥当でないことを示す第2ラベルを付与した前記第2学習用画像を生成する
ことを特徴とする検査装置。 In the inspection device according to claim 1 2 or claim 1 3 ,
The data expansion unit performs data expansion on a target image to which a first label indicating that the relative positional relationship between the multiple ingredients in the target image is appropriate is assigned, and generates the second learning image to which a second label indicating that the relative positional relationship between the multiple ingredients is not appropriate is assigned.
前記データ拡張部は、複数の前記食材の間の相対的な配置関係が妥当でないことを示す第2ラベルが付与された対象画像のデータ拡張を行って、前記第2ラベルを付与した前記第2学習用画像を生成する
ことを特徴とする検査装置。 In the inspection device according to claim 1 2 or claim 1 4 ,
The data augmentation unit performs data augmentation on a target image to which a second label indicating that the relative positional relationship between the multiple ingredients is not valid is assigned, and generates the second learning image to which the second label is assigned.
さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する抽出部を備え、
前記データ拡張部は、前記対象画像における複数の前記食材の間の相対的な配置関係を維持しつつ、前記抽出部が抽出した前記領域を加工後再配置して前記第2学習用画像を生成する
ことを特徴とする検査装置。 The inspection device according to any one of claims 12 to 15 ,
Further, an extraction unit is provided that extracts the area for each type of food material from the target image,
The data expansion unit processes and rearranges the area extracted by the extraction unit while maintaining the relative positional relationship between the multiple ingredients in the target image to generate the second learning image.
さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する抽出部を備え、
前記データ拡張部は、前記抽出部が抽出した前記領域のうち、2つ以上の互いに異なる種類の前記食材に対応する領域の位置を互いに置き換えて前記第2学習用画像を生成する
ことを特徴とする検査装置。 The inspection device according to any one of claims 12 to 15 ,
Further, an extraction unit is provided that extracts the area for each type of food material from the target image,
The data expansion unit replaces positions of areas corresponding to two or more different types of ingredients among the areas extracted by the extraction unit to generate the second learning image.
さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する抽出部を備え、
前記データ拡張部は、前記抽出部が抽出した前記領域のうちの1つ以上を前記対象画像から削除して前記第2学習用画像を生成する
ことを特徴とする検査装置。 The inspection device according to any one of claims 12 to 15 ,
Further, an extraction unit is provided that extracts the area for each type of food material from the target image,
The data extension unit generates the second learning image by deleting one or more of the regions extracted by the extraction unit from the target image.
さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する抽出部を備え、
前記データ拡張部は、前記抽出部が抽出した前記領域の各々の反転、回転、膨張、および収縮のうちの少なくともいずれかを行って前記対象画像のデータ拡張を行う
ことを特徴とする検査装置。 The inspection device according to any one of claims 12 to 15 ,
Further, an extraction unit is provided that extracts the area for each type of food material from the target image,
The data expansion unit performs data expansion of the target image by performing at least one of inversion, rotation, expansion, and contraction of each of the regions extracted by the extraction unit.
学習済み第1モデルを用いて、前記画像における前記食材の領域および種類を推定し、推定された前記食材の領域および種類を前記画像に関連付けた出力画像を含む第1推定結果を出力する第2ステップと、
前記第1推定結果に基づいて、前記食材の種類ごとに、対応する前記領域が、前記食材の有無および過不足に関して予め設定された第1基準を満たすか否かを判断する第3ステップと、
前記第3ステップでの判断結果に基づいて、前記食材の配置に関する検査を行う第4ステップと、
前記第1推定結果に含まれる前記出力画像を入力とする学習済み第2モデルを用いて、前記出力画像における複数の前記食材の間の相対的な配置関係を推定し、推定された配置関係を前記出力画像に関連付けた第2推定結果を出力する第5ステップと、
前記第2推定結果に基づいて、前記配置関係が、前記配置関係の妥当性に関して予め設定された第2基準を満たすか否かを判断する第6ステップと
を備え、
前記第4ステップは、前記第6ステップでの判断結果に基づいて、前記食材の配置に関する検査を行う
ことを特徴とする検査方法。 A first step of acquiring an image including the arranged ingredients;
a second step of estimating a region and a type of the ingredient in the image using the trained first model, and outputting a first estimation result including an output image in which the estimated region and type of the ingredient are associated with the image;
a third step of determining whether or not the corresponding area for each type of ingredient satisfies a first criterion set in advance regarding the presence or absence and the excess or deficiency of the ingredient based on the first estimation result;
A fourth step of inspecting the arrangement of the ingredients based on the judgment result in the third step ;
a fifth step of estimating a relative arrangement relationship between the ingredients in the output image using a trained second model that uses the output image included in the first estimation result as an input, and outputting a second estimation result in which the estimated arrangement relationship is associated with the output image;
a sixth step of determining whether or not the layout relationship satisfies a second criterion set in advance regarding the validity of the layout relationship based on the second estimation result;
Equipped with
The fourth step is to inspect the arrangement of the ingredients based on the result of the judgment in the sixth step.
13. An inspection method comprising :
前記第3ステップは、前記食材の種類ごとに、前記領域の個数および大きさの少なくとも一方を特定して、前記領域の個数および大きさの少なくとも一方が前記第1基準を満たすか否かを判断し、
前記第4ステップは、前記判断結果に基づいて、前記食材の配置に関する検査を行う
ことを特徴とする検査方法。 The inspection method according to claim 20 ,
The third step includes identifying at least one of the number and size of the regions for each type of food ingredient and determining whether or not at least one of the number and size of the regions satisfies the first criterion;
The fourth step comprises inspecting an arrangement of the ingredients based on the result of the judgment.
さらに、予め設定されたモデルを構築するための学習処理を行う学習ステップを備え、
前記学習ステップは、
配置された前記食材が含まれる画像を第1学習用画像として用い、ニューラルネットワークの第1モデルを学習させて、前記食材の領域および種類を識別する第1特徴量を抽出し、抽出された前記第1特徴量により前記学習済み第1モデルを獲得する第7ステップと、
前記第7ステップで獲得された前記学習済み第1モデルを第1記憶部に記憶する第8ステップと
を備え、
前記第3ステップは、前記第1記憶部から前記学習済み第1モデルを読み込んで前記学習済み第1モデルによる前記画像における前記食材の領域および種類の推定を行う
ことを特徴とする検査方法。 In the inspection method according to claim 20 or claim 21 ,
Further, a learning step is provided for performing a learning process for constructing a preset model,
The learning step includes:
a seventh step of using an image including the arranged ingredients as a first learning image to train a first model of a neural network, extracting a first feature amount that identifies a region and a type of the ingredients, and acquiring the trained first model based on the extracted first feature amount;
and an eighth step of storing the trained first model acquired in the seventh step in a first storage unit,
The inspection method, characterized in that the third step reads the trained first model from the first storage unit and estimates the area and type of the food ingredient in the image using the trained first model.
前記学習ステップは、
前記第3ステップで出力する前記第1推定結果に含まれる前記出力画像を第2学習用画像として用いて、ニューラルネットワークの第2モデルを学習させて、前記第2学習用画像における複数の前記食材の間の相対的な配置関係を識別する第2特徴量を抽出し、抽出された前記第2特徴量により前記学習済みの第2モデルを獲得する第9ステップと、
前記第9ステップで獲得された前記学習済みの第2モデルを第2記憶部に記憶する第10ステップと
をさらに備えることを特徴とする検査方法。 The inspection method according to claim 22 ,
The learning step includes:
a ninth step of training a second model of a neural network using the output image included in the first estimation result output in the third step as a second training image, extracting a second feature amount that identifies a relative positional relationship between the plurality of ingredients in the second training image, and acquiring the trained second model using the extracted second feature amount;
A tenth step of storing the trained second model acquired in the ninth step in a second memory unit.
さらに、前記第1推定結果に含まれる前記出力画像の前記領域の推定外形線の最長のものの内部が、当該領域であるとして、前記出力画像を加工した加工画像を生成する第11ステップを備え、
前記第9ステップは、前記加工画像を前記第2学習用画像として用いて前記第2モデルを学習させ、前記学習済みの第2モデルを獲得する
ことを特徴とする検査方法。 In the inspection method according to claim 2 or 3 ,
and generating a processed image by processing the output image, the processed image being determined to be an area inside a longest estimated outline of the area of the output image included in the first estimation result,
The inspection method, wherein the ninth step includes using the processed image as the second learning image to learn the second model and obtain the learned second model.
前記学習ステップは、
さらに、前記食材の領域および種類が前記画像に関連付けられた対象画像のデータ拡張を行って前記第2学習用画像を生成する第12ステップを備え、
前記第12ステップは、前記対象画像に付与されている、前記対象画像における複数の前記食材の間の相対的な配置関係の妥当性に関するラベル情報に基づいて前記第2学習用画像を生成する
ことを特徴とする検査方法。 In the inspection method according to claim 2, 3 or 2 ,
The learning step includes:
Further, a twelfth step of performing data expansion of a target image in which the region and type of the ingredient are associated with the image to generate the second learning image,
The twelfth step comprises generating the second learning image based on label information regarding the validity of a relative positional relationship between the plurality of ingredients in the target image, the label information being assigned to the target image.
前記第12ステップは、前記対象画像における複数の前記食材の間の相対的な配置関係が妥当であることを示す第1ラベルが付与された対象画像のデータ拡張を行って、前記第1ラベルが付与された前記第2学習用画像を生成する
ことを特徴とする検査方法。 26. The inspection method according to claim 25 ,
The twelfth step comprises performing data augmentation on a target image to which a first label indicating that a relative positional relationship between the multiple ingredients in the target image is valid is assigned, thereby generating the second learning image to which the first label is assigned.
前記第12ステップは、前記対象画像における複数の前記食材の間の相対的な配置関係が妥当であることを示す第1ラベルが付与された対象画像のデータ拡張を行って、複数の前記食材の間の相対的な配置関係が妥当でないことを示す第2ラベルを付与した前記第2学習用画像を生成する
ことを特徴とする検査方法。 The inspection method according to claim 25 or claim 26 ,
The twelfth step comprises performing data expansion on a target image to which a first label indicating that the relative positional relationship between the multiple ingredients in the target image is valid is assigned, and generating the second learning image to which a second label indicating that the relative positional relationship between the multiple ingredients is invalid is assigned.
前記第12ステップは、複数の前記食材の間の相対的な配置関係が妥当でないことを示す第2ラベルが付与された対象画像のデータ拡張を行って、前記第2ラベルを付与した前記第2学習用画像を生成する
ことを特徴とする検査方法。 The inspection method according to claim 25 or claim 27 ,
The twelfth step comprises performing data augmentation on a target image to which a second label indicating that the relative positional relationship between the multiple ingredients is not valid is assigned, and generating the second learning image to which the second label is assigned.
さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する第13ステップを備え、
前記第12ステップは、前記対象画像における複数の前記食材の間の相対的な配置関係を維持しつつ、前記第13ステップで抽出された前記領域を加工後再配置して前記第2学習用画像を生成する
ことを特徴とする検査方法。 The inspection method according to any one of claims 25 to 26 ,
Further, a thirteenth step of extracting the area for each type of food material from the target image,
The twelfth step comprises processing and rearranging the area extracted in the thirteenth step while maintaining the relative positional relationship between the plurality of ingredients in the target image, to generate the second learning image.
さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する第13ステップを備え、
前記第12ステップは、前記第13ステップで抽出された前記領域のうち、2つ以上の互いに異なる種類の前記食材に対応する領域の位置を互いに置き換えて前記第2学習用画像を生成する
ことを特徴とする検査方法。 The inspection method according to any one of claims 5 to 28 ,
Further, a thirteenth step of extracting the area for each type of food material from the target image,
The twelfth step is to mutually replace positions of areas corresponding to two or more different types of ingredients among the areas extracted in the thirteenth step to generate the second learning image.
さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する第13ステップを備え、
前記第12ステップは、前記第13ステップで抽出された前記領域のうちの1つ以上を前記対象画像から削除して前記第2学習用画像を生成する
ことを特徴とする検査方法。 The inspection method according to any one of claims 5 to 28 ,
Further, a thirteenth step of extracting the area for each type of food material from the target image,
The inspection method, wherein the twelfth step generates the second learning image by deleting one or more of the regions extracted in the thirteenth step from the target image.
さらに、前記食材の種類ごとの前記領域を、前記対象画像から抽出する第13ステップを備え、
前記第12ステップは、前記第13ステップで抽出された前記領域の各々の反転、回転、膨張、および収縮のうちの少なくともいずれかを行って前記対象画像のデータ拡張を行う
ことを特徴とする検査方法。 The inspection method according to any one of claims 5 to 28 ,
Further, a thirteenth step of extracting the area for each type of food material from the target image,
The inspection method according to claim 1, wherein the twelfth step performs at least one of inversion, rotation, expansion, and contraction of each of the regions extracted in the thirteenth step to perform data expansion of the target image.
さらに、少なくとも前記第4ステップでの検査結果を提示する第14ステップを備え、
前記第14ステップは、前記画像、前記第1推定結果、前記第3ステップでの判断結果、および前記第4ステップでの検査結果を含む情報のうちの少なくともいずれかを提示する
ことを特徴とする検査方法。 The inspection method according to any one of claims 20 to 32 ,
Further, a fourteenth step of presenting at least the test result in the fourth step is provided,
an inspection method comprising: presenting at least one of information including the image, the first estimation result, the judgment result in the third step, and the inspection result in the fourth step;
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2021010028 | 2021-01-26 | ||
| JP2021010028 | 2021-01-26 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2022114462A JP2022114462A (en) | 2022-08-05 |
| JP7702892B2 true JP7702892B2 (en) | 2025-07-04 |
Family
ID=82658644
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2022009890A Active JP7702892B2 (en) | 2021-01-26 | 2022-01-26 | Inspection device and inspection method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7702892B2 (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP7703229B2 (en) * | 2022-07-19 | 2025-07-07 | 株式会社ユニバーサルエンターテインメント | Gaming Machines |
| JP7703228B2 (en) * | 2022-07-19 | 2025-07-07 | 株式会社ユニバーサルエンターテインメント | Gaming Machines |
| CN118038444B (en) * | 2023-12-29 | 2024-11-15 | 杭州正跃信息技术有限公司 | A dish recognition method based on cascade feature fusion network |
| WO2025258029A1 (en) * | 2024-06-13 | 2025-12-18 | 富士通株式会社 | Information processing program, information processing method, and information processing device |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2016024036A (en) | 2014-07-18 | 2016-02-08 | 株式会社イシダ | Inspection device |
| JP2019086914A (en) | 2017-11-02 | 2019-06-06 | 株式会社富士通アドバンストエンジニアリング | Article inspection device, article inspection method and article inspection program |
-
2022
- 2022-01-26 JP JP2022009890A patent/JP7702892B2/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2016024036A (en) | 2014-07-18 | 2016-02-08 | 株式会社イシダ | Inspection device |
| JP2019086914A (en) | 2017-11-02 | 2019-06-06 | 株式会社富士通アドバンストエンジニアリング | Article inspection device, article inspection method and article inspection program |
Non-Patent Citations (3)
| Title |
|---|
| Kanjanapan Sukvichai;Pruttapon Maolanon;Kittinon sawanyawat;Warayut Muknumporn,Food categories classification and Ingredients estimation using CNNs on Raspberry Pi 3,2019 10th International Conference of Information and Communication Technology for Embedded Systems,米国,IEEE,2019年,https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8695967 |
| 大羽 剛瑠,浮田 宗伯,インスタンスセグメンテーションのための半教師あり学習を用いた画像合成,情報処理学会 研究報告 コンピュータビジョンとイメージメディア,日本,情報処理学会,2019年05月23日,p.1-8 |
| 牛垣 雅人,世界最先端画像処理ライブラリ「HALCON」が解決するマシンビジョンアプリケーション,機械設計,日本,日刊工業新聞社,2020年09月01日,第64巻 第10号,p.40-45 |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2022114462A (en) | 2022-08-05 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7702892B2 (en) | Inspection device and inspection method | |
| JP5953842B2 (en) | Image inspection method and inspection area setting method | |
| EP3480735A1 (en) | Inspection apparatus, data generation apparatus, data generation method, and data generation program | |
| JP7621586B2 (en) | Production line smart monitoring system and monitoring method | |
| JP5929238B2 (en) | Image inspection method and image inspection apparatus | |
| CN119810080A (en) | A stainless steel surface defect detection method based on machine vision | |
| JP7492240B2 (en) | Analytical device and analytical method | |
| KR20110086111A (en) | Methods, systems, and software for providing image sensor based human machine interfacing | |
| JP2013224833A (en) | Visual inspection device, visual inspection method and computer program | |
| CN106290375A (en) | Non-contact online defect automatic detection system based on laser selective sintering technology | |
| US20240070847A1 (en) | Component inspection device | |
| CN106406693B (en) | Image chooses method and device | |
| CN108133900A (en) | A kind of Defect Scanning board and its automatic defect classification method | |
| JP5405245B2 (en) | Image inspection method and image inspection apparatus | |
| JP2020067308A (en) | Image processing method and image processing apparatus | |
| TWI849144B (en) | Inspection device, inspection method, and recording medium recording inspection program, as well as learning device, learning method, and recording medium recording learning program | |
| CN118608649B (en) | Product image production method, device, storage medium and equipment | |
| JP5855961B2 (en) | Image processing apparatus and image processing method | |
| JP7416071B2 (en) | Judgment device and judgment program | |
| JP2018049584A (en) | Meal size estimation program, meal size estimation method, and meal size estimation apparatus | |
| CN117788444A (en) | SMT patch offset detection method, SMT patch offset detection device and SMT patch offset detection system | |
| CN117665006A (en) | Green oil plug hole defect detection method | |
| JP2023147677A (en) | Method of detecting abnormal area, system, and program | |
| CN114359177A (en) | Image display method and device for panel to be detected, electronic equipment and storage medium | |
| WO2024090054A1 (en) | Image processing method, program, and image processing device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20220214 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20220616 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A821 Effective date: 20220616 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20240610 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20250221 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20250228 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20250425 |
|
| 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: 20250529 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20250624 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7702892 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |