Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7627564B2 - IMAGE PROCESSING DEVICE, IMAGE PROCESSING METHOD, LEARNING MODEL GENERATION DEVICE, LEARNING MODEL PRODUCTION METHOD, LEARNED MODEL, AND PROGRAM - Google Patents
[go: Go Back, main page]

JP7627564B2 - IMAGE PROCESSING DEVICE, IMAGE PROCESSING METHOD, LEARNING MODEL GENERATION DEVICE, LEARNING MODEL PRODUCTION METHOD, LEARNED MODEL, AND PROGRAM - Google Patents

IMAGE PROCESSING DEVICE, IMAGE PROCESSING METHOD, LEARNING MODEL GENERATION DEVICE, LEARNING MODEL PRODUCTION METHOD, LEARNED MODEL, AND PROGRAM Download PDF

Info

Publication number
JP7627564B2
JP7627564B2 JP2020185265A JP2020185265A JP7627564B2 JP 7627564 B2 JP7627564 B2 JP 7627564B2 JP 2020185265 A JP2020185265 A JP 2020185265A JP 2020185265 A JP2020185265 A JP 2020185265A JP 7627564 B2 JP7627564 B2 JP 7627564B2
Authority
JP
Japan
Prior art keywords
feature map
learning model
channel
channels
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2020185265A
Other languages
Japanese (ja)
Other versions
JP2022074861A (en
Inventor
秀法 善本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Glory Ltd
Original Assignee
Glory Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Glory Ltd filed Critical Glory Ltd
Priority to JP2020185265A priority Critical patent/JP7627564B2/en
Publication of JP2022074861A publication Critical patent/JP2022074861A/en
Application granted granted Critical
Publication of JP7627564B2 publication Critical patent/JP7627564B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Description

本発明は、画像処理装置およびそれに関連する技術に関し、特に対象物の撮影画像を用いて対象物の異常を検出する技術等に関する。 The present invention relates to an image processing device and related technology, and in particular to technology for detecting abnormalities in an object using a captured image of the object.

畳み込みニューラルネットワーク(CNN:Convolutional Neural Network)を用いて、画像を解析する技術が存在する。 There is technology that uses a convolutional neural network (CNN) to analyze images.

畳み込みニューラルネットワークにおいては、一般的に、入力層の後に畳み込み層およびプーリング層等が設けられるとともに最後に全結合層が設けられる(特許文献1等参照)。また、特許文献1(その段落0040参照)等に示されるように、全結合層の前にグルーバルアベレージプーリング処理(特徴マップ内の各チャンネルに対してチャンネル全体の平均値を算出する処理)が行われることもある。 In a convolutional neural network, a convolutional layer, a pooling layer, etc. are generally provided after an input layer, and a fully connected layer is provided at the end (see Patent Document 1, etc.). Also, as shown in Patent Document 1 (see paragraph 0040), etc., a global average pooling process (a process of calculating the average value of all channels for each channel in a feature map) may be performed before the fully connected layer.

特開2020-8896号公報JP 2020-8896 A

ところで、畳み込みニューラルネットワークを用いて、対象物の撮影画像に基づく当該対象物の異常(傷(キズ)等)の有無等を検出することが可能である。 By the way, it is possible to use a convolutional neural network to detect the presence or absence of an abnormality (such as a scratch) in an object based on a photographed image of the object.

たとえば、特許文献1に記載されるような畳み込みニューラルネットワークを対象物の異常検出等に適用することも考えられる。 For example, it is possible to apply a convolutional neural network such as that described in Patent Document 1 to the detection of abnormalities in objects.

しかしながら、上述のようなグルーバルアベレージプーリング処理が行われる場合には、異常の画素と正常の画素との双方を含む複数の画素の画素値が平均化されてしまう。したがって、画像内における小さな異常(傷など)を見過ごす可能性がある。 However, when the global average pooling process described above is performed, the pixel values of multiple pixels, including both abnormal and normal pixels, are averaged. Therefore, there is a risk that small abnormalities (such as scratches) in the image may be overlooked.

そこで、この発明は、画像内における小さな異常の見過ごしを抑制し、より的確に異常を検出することが可能な技術を提供することを課題とする。 Therefore, the objective of this invention is to provide technology that can prevent small abnormalities in images from being overlooked and detect abnormalities more accurately.

上記課題を解決すべく、本発明に係る画像処理装置は、各撮影画像を入力とし前記各撮影画像内の異常に関する情報を出力とする教師データを用いて機械学習された学習モデルに基づき、対象物の撮影画像内の異常を検出する制御部、を備え、前記学習モデルは、畳み込みニューラルネットワークにおける中間的な特徴マップであって複数のチャンネルを有する特徴マップである第1特徴マップに基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合した第2特徴マップを生成するとともに当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値を使用して機械学習されたモデルであり、前記制御部は、前記学習モデルに対して前記対象物の前記撮影画像を入力することによって、前記対象物の異常を検出することを特徴とする。 In order to solve the above problem, the image processing device of the present invention includes a control unit that detects abnormalities in a captured image of an object based on a learning model machine-learned using teacher data that inputs each captured image and outputs information about abnormalities in each of the captured images, wherein the learning model is a model machine-learned using a value obtained by generating a second feature map by integrating pixel values at the same position and/or nearby positions of each channel in a first feature map, which is an intermediate feature map in a convolutional neural network and has a plurality of channels, and performing a global max pooling process on the second feature map, and the control unit detects abnormalities in the object by inputting the captured image of the object to the learning model.

前記第1特徴マップは、前記畳み込みニューラルネットワークにおいて入力層の後に設けられた複数の畳み込み層と複数のプーリング層とを含む中間層によって生成されてもよい。 The first feature map may be generated by an intermediate layer including multiple convolutional layers and multiple pooling layers arranged after an input layer in the convolutional neural network.

前記畳み込みニューラルネットワークは、前記第2特徴マップに対して前記グローバルマックスプーリング処理を施すプーリング層よりも後には全結合層を有しないものであってもよい。 The convolutional neural network may not have a fully connected layer after a pooling layer that performs the global max pooling process on the second feature map.

前記学習モデルは、前記第2特徴マップに対して前記グローバルマックスプーリング処理を施して得られる最大値、あるいは当該最大値に対して学習パラメータを乗じることなく当該最大値を変換した変換値を、正解データと比較して、機械学習されたモデルであってもよい。 The learning model may be a machine-learned model that is generated by comparing the maximum value obtained by performing the global max pooling process on the second feature map, or a transformed value obtained by transforming the maximum value without multiplying the maximum value by a learning parameter, with correct answer data.

前記学習モデルは、2以上のチャンネルを有する前記第2特徴マップに対して前記グローバルマックスプーリング処理を施してチャンネルごとに得られた複数の最大値を平均化することなく当該複数の最大値をそれぞれ変換した各変換値を、正解データと比較して、機械学習されたモデルであってもよい。 The learning model may be a machine-learned model obtained by performing the global max pooling process on the second feature map having two or more channels, converting each of the multiple maximum values obtained for each channel without averaging the multiple maximum values, and comparing the converted values with ground truth data.

前記第2特徴マップの生成処理は、前記第1特徴マップの複数のチャンネルにおける同一画素位置の画素値を重み付け加算する1×1畳み込みフィルタを用いて統合し、前記第2特徴マップのチャンネル内の各画素位置の画素値を算出する処理を含んでもよい。 The process of generating the second feature map may include integrating pixel values at the same pixel position in multiple channels of the first feature map using a 1×1 convolution filter that weights and adds them together, and calculating pixel values at each pixel position in the channels of the second feature map.

前記第2特徴マップの生成処理は、前記第1特徴マップの複数のチャンネルのそれぞれに対する畳み込み処理後の暫定特徴マップの複数のチャンネルにおける同一画素位置の画素値を重み付け加算して統合し、前記第2特徴マップのチャンネル内の各画素位置の画素値を算出する処理を含んでもよい。 The process of generating the second feature map may include a process of integrating pixel values at the same pixel position in multiple channels of the provisional feature map after the convolution process for each of the multiple channels of the first feature map by weighted addition, and calculating the pixel value of each pixel position in the channel of the second feature map.

前記第2特徴マップの生成処理は、前記第1特徴マップの複数のチャンネルにおける同一位置および/または近傍位置の画素値を統合した画素値を重み付け加算する畳み込みフィルタを用いて、前記第2特徴マップの一のチャンネル内の各画素位置の画素値を算出する処理を、所定回数実行することによって、前記第2特徴マップにおける所定数のチャンネルを生成する処理を含んでもよい。 The process of generating the second feature map may include a process of calculating pixel values at each pixel position in one channel of the second feature map a predetermined number of times using a convolution filter that weights and adds pixel values obtained by integrating pixel values at the same position and/or adjacent positions in multiple channels of the first feature map, thereby generating a predetermined number of channels in the second feature map.

前記第2特徴マップは、前記第1特徴マップのチャンネル数よりも低減された2以上のチャンネルを有し、前記学習モデルは、前記2以上のチャンネルの少なくとも一部に対して前記グローバルマックスプーリング処理を施して得られる値を使用して機械学習されたモデルであってもよい。 The second feature map may have two or more channels that are fewer than the number of channels of the first feature map, and the learning model may be a model that is machine-learned using values obtained by performing the global max pooling process on at least a portion of the two or more channels.

前記第2特徴マップは、単一チャンネルを有する特徴マップであり、前記学習モデルは、前記単一チャンネルに対して前記グローバルマックスプーリング処理を施して得られる値を使用して機械学習されたモデルであってもよい。 The second feature map may be a feature map having a single channel, and the learning model may be a model trained by machine learning using values obtained by performing the global max pooling process on the single channel.

前記制御部は、前記第2特徴マップに基づき可視化した情報を所定の表示部に表示してもよい。 The control unit may display the information visualized based on the second feature map on a specified display unit.

上記課題を解決すべく、本発明に係る画像処理方法は、a)各撮影画像を入力とし前記各撮影画像内の異常に関する情報を出力とする教師データを用いて機械学習された学習モデルに基づき、対象物の撮影画像内の異常を検出するステップ、を備え、前記学習モデルは、畳み込みニューラルネットワークにおける中間的な特徴マップであって複数のチャンネルを有する特徴マップである第1特徴マップに基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合した第2特徴マップを生成するとともに当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値を使用して機械学習されたモデルであり、前記ステップa)においては、前記学習モデルに対して前記対象物の前記撮影画像を入力することによって、前記対象物の異常が検出されることを特徴とする。 In order to solve the above problem, an image processing method according to the present invention includes a step of: a) detecting an abnormality in a photographed image of an object based on a learning model machine-learned using teacher data in which each photographed image is input and information regarding an abnormality in each of the photographed images is output, wherein the learning model is a model machine-learned using a value obtained by generating a second feature map by integrating pixel values at the same position and/or nearby positions of each channel in a first feature map, which is an intermediate feature map in a convolutional neural network and has a plurality of channels, and performing a global max pooling process on the second feature map, and wherein in step a), the photographed image of the object is input to the learning model to detect an abnormality in the object.

上記課題を解決すべく、本発明に係るプログラムは、a)各撮影画像を入力とし前記各撮影画像内の異常に関する情報を出力とする教師データを用いて機械学習された学習モデルに基づき、対象物の撮影画像内の異常を検出するステップ、をコンピュータに実行させるためのプログラムであって、前記学習モデルは、畳み込みニューラルネットワークにおける中間的な特徴マップであって複数のチャンネルを有する特徴マップである第1特徴マップに基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合した第2特徴マップを生成するとともに当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値を使用して機械学習されたモデルであり、前記ステップa)においては、前記学習モデルに対して前記対象物の前記撮影画像を入力することによって、前記対象物の異常が検出されることを特徴とする。 In order to solve the above problem, the present invention provides a program for causing a computer to execute the steps of: a) detecting an abnormality in a photographed image of an object based on a learning model machine-learned using teacher data in which each photographed image is input and information regarding an abnormality in each of the photographed images is output , the learning model being a model machine-learned using a value obtained by generating a second feature map by integrating pixel values at the same position and/or nearby positions of each channel in a first feature map, which is an intermediate feature map in a convolutional neural network and has a plurality of channels, and performing a global max pooling process on the second feature map, and wherein in step a), an abnormality in the object is detected by inputting the photographed image of the object to the learning model.

上記課題を解決すべく、本発明に係る学習モデル生成装置は、撮影画像を入力し前記撮影画像内の異常に関する情報を出力する学習モデルを生成する学習モデル生成装置であって、第1特徴マップ(前記学習モデルの畳み込みニューラルネットワークにおける中間的な特徴マップであって複数のチャンネルを有する特徴マップである)に基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合した第2特徴マップを生成し、当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値を使用して、前記学習モデルにおける機械学習を実行する制御部、を備えることを特徴とする。 To solve the above problem, the learning model generation device of the present invention is a learning model generation device that inputs a captured image and generates a learning model that outputs information about anomalies in the captured image, and is characterized by having a control unit that generates a second feature map by integrating pixel values at the same position and/or nearby positions of each channel in a first feature map (an intermediate feature map in a convolutional neural network of the learning model and having multiple channels) based on the first feature map, and performs machine learning in the learning model using values obtained by performing a global max pooling process on the second feature map.

上記課題を解決すべく、本発明に係る学習モデル製造方法は、撮影画像を入力し前記撮影画像内の異常に関する情報を出力する学習モデルを製造する学習モデル製造方法であって、a)第1特徴マップ(前記学習モデルの畳み込みニューラルネットワークにおける中間的な特徴マップであって複数のチャンネルを有する特徴マップである)に基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合した第2特徴マップを生成し、当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値を使用して、前記学習モデルにおける機械学習を実行するステップ、を備えることを特徴とする。 To solve the above problem, the learning model production method according to the present invention is a learning model production method for inputting a captured image and producing a learning model that outputs information about anomalies in the captured image, and is characterized by comprising the steps of: a) generating a second feature map by integrating pixel values at the same position and/or nearby positions of each channel in a first feature map (an intermediate feature map in a convolutional neural network of the learning model and having a plurality of channels) based on the first feature map, and performing machine learning in the learning model using values obtained by performing a global max pooling process on the second feature map.

上記課題を解決すべく、本発明に係る学習済みモデルは、推論対象画像の入力に対して前記推論対象画像内の異常に関する情報を出力するように機械学習された学習済みモデルであって、畳み込みニューラルネットワークにおける中間的な特徴マップであり且つ複数のチャンネルを有する特徴マップである第1特徴マップを、前記推論対象画像に対して生成する処理と、前記第1特徴マップに基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合して第2特徴マップを生成する処理と、当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値に基づき前記異常に関する情報を出力する処理と、をコンピュータに実行させるための学習済みモデルであることを特徴とする。 In order to solve the above problem, the trained model of the present invention is a trained model that has been machine-learned to output information regarding an abnormality in an inference target image in response to an input of an inference target image, and is characterized in that the trained model is for causing a computer to execute the following processes: a process of generating a first feature map for the inference target image, the first feature map being an intermediate feature map in a convolutional neural network and having a plurality of channels; a process of generating a second feature map by integrating pixel values at the same position and/or nearby positions of each channel in the first feature map based on the first feature map; and a process of outputting information regarding the abnormality based on a value obtained by performing a global max pooling process on the second feature map.

上記課題を解決すべく、本発明に係るプログラムは、a)撮影画像を入力し前記撮影画像内の異常に関する情報を出力する学習モデルの畳み込みニューラルネットワークにおける中間的な特徴マップであって複数のチャンネルを有する特徴マップである第1特徴マップに基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合した第2特徴マップを生成し、当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値を使用して、前記学習モデルにおける機械学習を実行するステップ、をコンピュータに実行させるためのプログラムであることを特徴とする。 To solve the above problem, the program of the present invention is characterized in that it is a program for causing a computer to execute the steps of: a) generating a second feature map by integrating pixel values at the same position and/or nearby positions of each channel in a first feature map, which is an intermediate feature map having multiple channels in a convolutional neural network of a learning model that inputs a captured image and outputs information about anomalies in the captured image, and performing machine learning in the learning model using values obtained by performing a global max pooling process on the second feature map.

本発明によれば、画像内における小さな異常の見過ごしを抑制し、より的確に異常を検出することが可能である。 The present invention makes it possible to prevent small abnormalities in an image from being overlooked and to detect abnormalities more accurately.

画像処理システムを示す概略図である。FIG. 1 is a schematic diagram showing an image processing system. 学習モデルの学習段階の処理を示す概念図である。FIG. 2 is a conceptual diagram showing the processing in the learning stage of a learning model. 学習モデルに基づく推論段階の処理を示す概念図である。FIG. 1 is a conceptual diagram showing the processing at the inference stage based on a learning model. 学習段階におけるコントローラの処理を示すフローチャートである。10 is a flowchart showing the process of the controller in a learning stage. 推論段階におけるコントローラの処理を示すフローチャートである。13 is a flowchart showing the process of the controller in the inference stage. 第1実施形態に係る学習モデルを示す図である。FIG. 2 is a diagram showing a learning model according to the first embodiment; 特徴抽出層の構成の一例を示す概念図である。FIG. 2 is a conceptual diagram illustrating an example of a configuration of a feature extraction layer. 1×1のサイズの畳み込みフィルタを用いて第2特徴マップが生成される様子を示す図である。FIG. 13 is a diagram showing how a second feature map is generated using a convolution filter of size 1×1. N×Nのサイズの畳み込みフィルタを用いて第2特徴マップが生成される様子を示す図である。FIG. 13 is a diagram showing how a second feature map is generated using a convolution filter of size N×N. N×Nのサイズの畳み込みフィルタを用いて第2特徴マップが生成される様子を示す図である。FIG. 13 is a diagram showing how a second feature map is generated using a convolution filter of size N×N. チャンネル内の畳み込み処理を示す図である。FIG. 1 illustrates a convolution process within a channel. 第2特徴マップに対するGMP処理によって出力値が生成される様子を示す図である。FIG. 13 is a diagram showing how output values are generated by GMP processing on a second feature map. 第2特徴マップに対するGMP処理および正規化処理によって出力値が生成される様子を示す図である。13 is a diagram showing how output values are generated by GMP processing and normalization processing on a second feature map. FIG. 第2特徴マップの一のチャンネルに対するGMP処理を示す図である。A diagram showing GMP processing for one channel of the second feature map. 第2実施形態に係る学習モデルを示す図である。FIG. 11 is a diagram showing a learning model according to the second embodiment. C2個の1×1サイズの畳み込みフィルタを用いて、C2個のチャンネルを有する第2特徴マップ250が生成される様子を示す図である。FIG. 2 shows how a second feature map 250 having C2 channels is generated using C2 convolution filters of size 1×1. C2個のN×Nサイズの畳み込みフィルタを用いて、C2個のチャンネルを有する第2特徴マップ250が生成される様子を示す図である。FIG. 2 shows how a second feature map 250 having C2 channels is generated using C2 convolution filters of size N×N. 2つのチャンネルを有する第2特徴マップに対するGMP処理等によって出力値が生成される様子を示す図である。FIG. 13 is a diagram showing how output values are generated by GMP processing or the like for a second feature map having two channels. 2つのチャンネルを有する第2特徴マップに対するGMP処理等によって出力値が生成される様子を示す図である。FIG. 13 is a diagram showing how output values are generated by GMP processing or the like for a second feature map having two channels. 第3実施形態に係る学習モデルを示す図である。FIG. 13 is a diagram showing a learning model according to the third embodiment. 第2特徴マップの5つのチャンネルのうちの一部にGMP処理等が施されて出力値が生成される様子を示す図である。A figure showing how GMP processing etc. is applied to some of the five channels of the second feature map to generate output values. 異常の有無等に関する判定結果を表示する画面を示す図である。FIG. 13 is a diagram showing a screen for displaying a determination result regarding the presence or absence of an abnormality, etc. 異常の有無等に関する判定結果を表示する別の画面を示す図である。FIG. 13 is a diagram showing another screen for displaying the determination result regarding the presence or absence of an abnormality, etc. 入力画像の一例を示す図である。FIG. 4 is a diagram illustrating an example of an input image. 比較例に係る学習モデルを示す図である。FIG. 13 is a diagram showing a learning model according to a comparative example.

以下、本発明の実施形態を図面に基づいて説明する。 The following describes an embodiment of the present invention with reference to the drawings.

<1.第1実施形態>
<1-1.システム概要>
図1は、画像処理システム1を示す概略図である。図1に示されるように、画像処理システム1は、対象物の撮影画像を撮像する撮影装置20と、撮影画像等を処理する画像処理装置30とを備えている。画像処理装置30は、対象物(たとえば機械部品)の撮影画像に基づいて当該対象物の異常を検出する装置(対象物の外観を検査する装置)であることから、異常検出装置(あるいは外観検査装置)とも称される。同様に、画像処理システム1は、異常検出システム(あるいは外観検査システム)とも称される。
1. First embodiment
<1-1. System Overview>
Fig. 1 is a schematic diagram showing an image processing system 1. As shown in Fig. 1, the image processing system 1 includes an image capture device 20 that captures an image of an object, and an image processing device 30 that processes the captured image. The image processing device 30 is also called an abnormality detection device (or an appearance inspection device) because it is a device that detects an abnormality in an object (e.g., a mechanical part) based on a captured image of the object (a device that inspects the appearance of the object). Similarly, the image processing system 1 is also called an abnormality detection system (or an appearance inspection system).

画像処理装置30は、学習モデル410(図2参照)を備えている。学習モデル410としては、たとえば、複数の層で構成されるニューラルネットワークモデルが用いられる。そして、所定の機械学習手法(ディープラーニング等)によって、ニューラルネットワークモデルにおける複数の層(入力層、複数の中間層、出力層)の層間における重み付け係数(学習パラメータ)等が調整される。 The image processing device 30 includes a learning model 410 (see FIG. 2). For example, a neural network model consisting of multiple layers is used as the learning model 410. Then, weighting coefficients (learning parameters) between multiple layers (input layer, multiple intermediate layers, output layer) in the neural network model are adjusted by a predetermined machine learning method (deep learning, etc.).

学習モデル410は、対象物(たとえば、歯車、ネジ等の部品)に関する撮影画像を入力とし当該撮影画像内の異常(当該対象物の異常)に関する情報を出力とするモデルである。学習モデル410の機械学習(学習段階)では、たとえば、各撮影画像内での異常(たとえば、対象物表面における微小な傷など)の有無がラベル(正解データ)として用いられる。換言すれば、対象物の撮影画像と当該撮影画像内における異常の有無との組合せ(データセット)が、学習モデル410の機械学習における教師データ(ラベル付きデータ)として用いられる。異常の有無は、一の種類の異常の有無であってもよく、複数の種類の異常(たとえば、「微小な傷」、「微小な裂け」、「微小な汚れ」等)のそれぞれの有無であってもよい。 The learning model 410 is a model that takes a photographed image of an object (for example, a part such as a gear or screw) as input and outputs information about an abnormality in the photographed image (an abnormality of the object). In the machine learning (learning stage) of the learning model 410, for example, the presence or absence of an abnormality in each photographed image (for example, a minute scratch on the surface of the object) is used as a label (correct answer data). In other words, a combination (dataset) of a photographed image of the object and the presence or absence of an abnormality in the photographed image is used as teacher data (labeled data) in the machine learning of the learning model 410. The presence or absence of an abnormality may be the presence or absence of one type of abnormality, or may be the presence or absence of each of multiple types of abnormalities (for example, "minute scratches," "minute tears," "minute stains," etc.).

なお、機械学習によって学習された後の学習モデル410は、学習済みモデル420とも称される。具体的には、学習モデル410(学習器)の学習パラメータが所定の機械学習手法を用いて調整され、学習済みの学習モデル410(学習済みモデル420)が生成される(図2参照)。 The learning model 410 after being trained by machine learning is also referred to as a trained model 420. Specifically, the learning parameters of the learning model 410 (learner) are adjusted using a predetermined machine learning method, and a trained learning model 410 (trained model 420) is generated (see FIG. 2).

この実施形態では、画像処理装置30が学習モデル410の学習処理(学習段階の処理)と学習モデル410に基づく推論処理(推論段階の処理)との双方を実行する。 In this embodiment, the image processing device 30 executes both the learning process of the learning model 410 (learning stage processing) and the inference process based on the learning model 410 (inference stage processing).

図2は、学習モデル410の学習段階の処理を示す概念図である。図2に示されるように、学習モデル410の学習段階において、画像処理装置30は、各撮影画像を入力とし当該各撮影画像内の異常に関する情報(対象物の異常の有無等)を出力とする教師データ(多数の教師データ)を用いて、学習モデル410を生成する。なお、画像処理装置30は、学習段階の処理(学習モデル410の生成処理)を実行する装置、すなわち、学習モデル410(420)を生成する処理装置でもあることから、学習モデル生成装置とも称される。 Figure 2 is a conceptual diagram showing the learning stage processing of the learning model 410. As shown in Figure 2, in the learning stage of the learning model 410, the image processing device 30 generates the learning model 410 using teacher data (a large number of teacher data) that takes each captured image as input and outputs information about anomalies in each captured image (such as the presence or absence of anomalies in the object). Note that the image processing device 30 is also a device that executes the learning stage processing (generation processing of the learning model 410), that is, a processing device that generates the learning model 410 (420), and is therefore also referred to as a learning model generation device.

図3は、学習モデル410に基づく推論段階の処理を示す概念図である。図3に示されるように、当該推論段階において、画像処理装置30は、上述のような教師データを用いて機械学習された学習モデル410に基づき、対象物の撮影画像内の異常を検出する。具体的には、画像処理装置30は、対象物(異常の有無の判定対象の対象物)の撮影画像を学習モデル410に対して入力することによって、当該対象物の異常の有無を判定する。 Figure 3 is a conceptual diagram showing the processing of the inference stage based on the learning model 410. As shown in Figure 3, in the inference stage, the image processing device 30 detects abnormalities in the captured image of the object based on the learning model 410 that has been machine-learned using the teacher data described above. Specifically, the image processing device 30 inputs a captured image of the object (an object to be determined for the presence or absence of an abnormality) to the learning model 410, thereby determining the presence or absence of an abnormality in the object.

<1-2.画像処理装置30>
図1に示されるように、画像処理装置30は、コントローラ31(制御部とも称される)と記憶部32と通信部34と操作部35とを備える。
<1-2. Image processing device 30>
As shown in FIG. 1, the image processing device 30 includes a controller 31 (also referred to as a control unit), a storage unit 32, a communication unit 34, and an operation unit 35.

コントローラ31は、画像処理装置30に内蔵され、画像処理装置30の動作を制御する制御装置である。 The controller 31 is a control device that is built into the image processing device 30 and controls the operation of the image processing device 30.

コントローラ31は、1又は複数のハードウェアプロセッサ(例えば、CPU(Central Processing Unit)およびGPU(Graphics Processing Unit))等を備えるコンピュータシステムとして構成される。コントローラ31は、CPU等において、記憶部(ROMおよび/またはハードディスクなどの不揮発性記憶部)32内に格納されている所定のソフトウエアプログラム(以下、単にプログラムとも称する)を実行することによって、各種の処理を実現する。なお、当該プログラム(詳細にはプログラムモジュール群)は、USBメモリなどの可搬性の記録媒体に記録され、当該記録媒体から読み出されて画像処理装置30にインストールされるようにしてもよい。あるいは、当該プログラムは、通信ネットワーク等を経由してダウンロードされて画像処理装置30にインストールされるようにしてもよい。 The controller 31 is configured as a computer system including one or more hardware processors (e.g., a central processing unit (CPU) and a graphics processing unit (GPU)). The controller 31 realizes various processes by executing a predetermined software program (hereinafter also simply referred to as a program) stored in a storage unit (a non-volatile storage unit such as a ROM and/or a hard disk) 32 in the CPU, etc. The program (more specifically, a group of program modules) may be recorded on a portable recording medium such as a USB memory, read from the recording medium, and installed in the image processing device 30. Alternatively, the program may be downloaded via a communication network, etc., and installed in the image processing device 30.

具体的には、コントローラ31は、学習モデル410の学習段階に関する処理(図2参照)を実行する。さらに、コントローラ31は、学習モデル410を利用した推論段階に関する処理(図3参照)を実行する。 Specifically, the controller 31 executes processing related to the learning stage of the learning model 410 (see FIG. 2). Furthermore, the controller 31 executes processing related to the inference stage using the learning model 410 (see FIG. 3).

記憶部32は、ハードディスクドライブ(HDD)および/またはソリッドステートドライブ(SSD)等の記憶装置で構成される。記憶部32は、学習モデル410(学習モデルに関する学習パラメータおよびプログラムを含む)(ひいては学習済みモデル420)等を記憶する。 The storage unit 32 is configured with a storage device such as a hard disk drive (HDD) and/or a solid state drive (SSD). The storage unit 32 stores the learning model 410 (including learning parameters and programs related to the learning model) (and thus the learned model 420) and the like.

通信部34は、ネットワークを介したネットワーク通信を行うことが可能である。このネットワーク通信では、たとえば、TCP/IP(Transmission Control Protocol / Internet Protocol)等の各種のプロトコルが利用される。当該ネットワーク通信を利用することによって、画像処理装置30は、所望の相手先(たとえば、撮影装置20あるいは不図示の情報格納装置等)との間で各種のデータ(教師データ(撮影画像データおよび正解データ等))を授受することが可能である。 The communication unit 34 is capable of performing network communication via a network. In this network communication, various protocols such as TCP/IP (Transmission Control Protocol/Internet Protocol) are used. By using this network communication, the image processing device 30 can send and receive various data (teacher data (photographed image data, correct answer data, etc.)) to and from a desired destination (for example, the photographing device 20 or an information storage device (not shown)).

操作部35は、画像処理装置30に対する操作入力を受け付ける操作入力部35aと、各種情報の表示出力を行う表示部35bとを備えている。操作入力部35aとしてはマウスおよびキーボード等が用いられ、表示部35bとしてはディスプレイ(液晶ディスプレイ等)が用いられる。また、操作入力部35aの一部としても機能し且つ表示部35bの一部としても機能するタッチパネルが設けられてもよい。 The operation unit 35 includes an operation input unit 35a that accepts operation input to the image processing device 30, and a display unit 35b that displays and outputs various information. A mouse and a keyboard are used as the operation input unit 35a, and a display (such as a liquid crystal display) is used as the display unit 35b. A touch panel that functions as both a part of the operation input unit 35a and a part of the display unit 35b may also be provided.

<1-3.本実施形態に係る学習モデル>
図6は、第1実施形態に係る学習モデル410を示す図である。学習モデル410は、畳み込みニューラルネットワーク(CNN:Convolutional Neural Network)200を用いて構築される。
<1-3. Learning model according to this embodiment>
6 is a diagram showing a learning model 410 according to the first embodiment. The learning model 410 is constructed using a convolutional neural network (CNN) 200.

図6に示されるように、学習モデル410は、複数の層(階層)が階層的に接続される階層構造を有している。具体的には、学習モデル410は、入力層310と特徴抽出層320と畳み込み層340とプーリング層360と出力層370とを備えている。特に、学習モデル410は、GMP処理(後述)を行うプーリング層360を畳み込み層340の直後に備えるとともに、プーリング層360よりも後(出力側)には全結合層を備えない。 As shown in FIG. 6, the learning model 410 has a hierarchical structure in which multiple layers (layers) are hierarchically connected. Specifically, the learning model 410 includes an input layer 310, a feature extraction layer 320, a convolutional layer 340, a pooling layer 360, and an output layer 370. In particular, the learning model 410 includes a pooling layer 360 that performs GMP processing (described below) immediately after the convolutional layer 340, and does not include a fully connected layer after the pooling layer 360 (on the output side).

<入力層310>
入力層310は、入力画像210を受け付ける層である。入力画像210は、ここでは対象物(たとえば、歯車などの部品、あるいは完成品)の撮影画像である。たとえば、幅(横)W0画素および高さ(縦)H0画素の画素配列(矩形形状の画素配列)を有するカラー画像(3チャンネル)が入力画像210として入力される。換言すれば、入力画像210は、W0×H0×C0のボクセルデータ(ただし、C0=3)として生成される。
<Input Layer 310>
The input layer 310 is a layer that accepts an input image 210. Here, the input image 210 is a photographed image of an object (for example, a part such as a gear, or a finished product). For example, a color image (3 channels) having a pixel array (rectangular pixel array) with a width (horizontal) of W0 pixels and a height (vertical) of H0 pixels is input as the input image 210. In other words, the input image 210 is generated as voxel data of W0×H0×C0 (where C0=3).

図24は、入力画像210の一例を示す模式図である。図24の入力画像210においては、その内部の左下部分(円形破線内参照)に微小な「キズ」(傷)が存在している。このような入力画像210が入力層310に入力される。 Figure 24 is a schematic diagram showing an example of an input image 210. In the input image 210 in Figure 24, there is a tiny "flaw" (scratch) in the lower left part of the image (see the circle with the dashed line). Such an input image 210 is input to the input layer 310.

<特徴抽出層320>
図6に示されるように、学習モデル410の畳み込みニューラルネットワーク200は、入力層310の後(次)に特徴抽出層320を備えている。入力画像210に対して特徴抽出層320の処理を施すことによって、第1特徴マップ230が生成される。
<Feature Extraction Layer 320>
6, the convolutional neural network 200 of the learning model 410 includes a feature extraction layer 320 following the input layer 310. The first feature map 230 is generated by processing the input image 210 through the feature extraction layer 320.

特徴抽出層320は、複数の畳み込み層と複数のプーリング層(最大プーリングおよび/または平均プーリング等)とを含む中間層である。この畳み込みニューラルネットワーク200においては、入力層310と出力層370との間に複数の中間層が設けられる。特徴抽出層320は、当該複数の中間層の一部である。特徴抽出層320としては、たとえば、各種の畳み込みニューラルネットワーク構成(VGGあるいはResNet等)の一部(特徴抽出部分)が利用され得る。 The feature extraction layer 320 is an intermediate layer that includes multiple convolutional layers and multiple pooling layers (max pooling and/or average pooling, etc.). In this convolutional neural network 200, multiple intermediate layers are provided between the input layer 310 and the output layer 370. The feature extraction layer 320 is a part of the multiple intermediate layers. As the feature extraction layer 320, for example, a part (feature extraction part) of various convolutional neural network configurations (VGG, ResNet, etc.) can be used.

たとえば、VGG16において全結合層(3層)の直前までに設けられる特徴抽出層(13層の畳み込み層および5層のプーリング層)(図7参照)が、畳み込みニューラルネットワーク200における特徴抽出層320として設けられる。図7においては、特徴抽出層320として、VGG16(13層の畳み込み層と5層のプーリング層と3層の全結合層とを有する)の構成の一部((全結合層の直前までの)特徴抽出部分)が例示されている。なお、図7においては、活性化関数等は適宜省略されている。 For example, the feature extraction layer (13 convolutional layers and 5 pooling layers) (see FIG. 7) provided just before the fully connected layer (3 layers) in VGG16 is provided as feature extraction layer 320 in convolutional neural network 200. In FIG. 7, a part of the configuration of VGG16 (having 13 convolutional layers, 5 pooling layers, and 3 fully connected layers) (the feature extraction part (just before the fully connected layer)) is illustrated as an example of feature extraction layer 320. Note that activation functions and the like are omitted as appropriate in FIG. 7.

あるいは、ResNet(Residual Network)(残差ネットワーク)などの他の畳み込みニューラルネットワークにおいて設けられる特徴抽出層の全部(または一部)が、畳み込みニューラルネットワーク200における特徴抽出層320として設けられてもよい。ResNetは、層間で残差を足し合わせることを含む畳み込みニューラルネットワークである。ResNetにおける特徴抽出層は、畳み込み層と活性化関数とスキップコネクション(ショートカットコネクション)との組合せ等で構成される複数の残差ブロック等で構成される。ここにおいて、一般的な畳み込みニューラルネットワークにおいては、特徴抽出層の後に、当該特徴抽出層にて抽出された特徴量に基づく分類処理を実行する層(分類層とも称する)として全結合層等が設けられる。そのような全結合層の直前までに設けられる特徴抽出層の全部(または一部)が、畳み込みニューラルネットワーク200における特徴抽出層320として設けられてもよい。 Alternatively, all (or a part) of the feature extraction layer provided in other convolutional neural networks such as ResNet (Residual Network) (residual network) may be provided as the feature extraction layer 320 in the convolutional neural network 200. ResNet is a convolutional neural network that includes adding up residuals between layers. The feature extraction layer in ResNet is composed of multiple residual blocks, etc., which are composed of a combination of a convolutional layer, an activation function, and a skip connection (shortcut connection). Here, in a general convolutional neural network, a fully connected layer or the like is provided after the feature extraction layer as a layer (also called a classification layer) that performs classification processing based on the features extracted in the feature extraction layer. All (or a part) of the feature extraction layer provided immediately before such a fully connected layer may be provided as the feature extraction layer 320 in the convolutional neural network 200.

第1特徴マップ230は、学習モデル410の畳み込みニューラルネットワーク200における中間的な特徴マップである。第1特徴マップ230は、複数のチャンネルを有する特徴マップとして生成される。第1特徴マップ230は、それぞれ幅W1画素および高さH1画素の画素配列(矩形形状の画素配列)の2次元配列データで構成されるチャンネルをC1個備える3次元配列データ(W1×H1×C1のボクセルデータ)として生成される。第1特徴マップ230のチャンネル数C1は、たとえば、512である。ただし、これに限定されず、256、あるいは1024などであってもよい。 The first feature map 230 is an intermediate feature map in the convolutional neural network 200 of the learning model 410. The first feature map 230 is generated as a feature map having multiple channels. The first feature map 230 is generated as three-dimensional array data (voxel data of W1×H1×C1) having C1 channels each composed of two-dimensional array data of a pixel array (rectangular pixel array) of width W1 pixels and height H1 pixels. The number of channels C1 of the first feature map 230 is, for example, 512. However, it is not limited to this and may be 256, 1024, etc.

ここにおいて、特徴抽出層320は、1又は複数の畳み込み層と1のプーリング層とが繰り返し配置されること等によって構成される。各畳み込み層では、畳み込み処理を実行するフィルタにより画像内の特徴が抽出される。また、各プーリング層では、微小画素範囲(たとえば、2×2の画素範囲)毎の最大画素値等を抽出する処理(最大プーリング処理等)が行われ、画素サイズが低減(たとえば、縦横の各方向に1/2)される(情報量が凝縮される)。 Here, the feature extraction layer 320 is constructed by repeatedly arranging one or more convolution layers and one pooling layer. In each convolution layer, features in the image are extracted by a filter that performs convolution processing. In addition, in each pooling layer, a process (such as maximum pooling process) is performed to extract the maximum pixel value for each small pixel range (for example, a 2 x 2 pixel range), and the pixel size is reduced (for example, by 1/2 in both the vertical and horizontal directions) (the amount of information is condensed).

そして、このような特徴抽出層320による処理(畳み込み処理およびプーリング処理)が入力画像210に対して施されることによって、第1特徴マップ230が生成される。このように、第1特徴マップ230は、畳み込みニューラルネットワーク200において入力層310の後に設けられた複数の畳み込み層と複数のプーリング層とを含む中間層によって生成される。これによれば、入力画像210における画像の特徴(微小な傷等)は、第1特徴マップ230における各チャンネルの2次元画像内において、その大まかな位置が保持された状態で抽出される。なお、特徴抽出層320に含まれるプーリング層においては、最大プーリング処理(あるいは平均プーリング処理)等が実行される。微小な傷等の検出漏れをより適切に回避するためには、最大プーリング処理が施されることが好ましい。 Then, the first feature map 230 is generated by performing the processing (convolution processing and pooling processing) by the feature extraction layer 320 on the input image 210. In this way, the first feature map 230 is generated by an intermediate layer including multiple convolution layers and multiple pooling layers provided after the input layer 310 in the convolutional neural network 200. According to this, image features (microscopic scratches, etc.) in the input image 210 are extracted in a state where their rough positions are maintained in the two-dimensional image of each channel in the first feature map 230. Note that in the pooling layer included in the feature extraction layer 320, a maximum pooling process (or an average pooling process) or the like is performed. In order to more appropriately avoid missing detection of microscopic scratches, etc., it is preferable to perform a maximum pooling process.

<畳み込み層340>
さらに、第1実施形態における学習モデル410においては、第1特徴マップ230に対して畳み込み処理が施されることによって第2特徴マップ250が生成される。換言すれば、特徴抽出層320の次に畳み込み層340が設けられることによって、第1特徴マップ230に基づき第2特徴マップ250が生成される。このような処理によれば、入力画像210における画像の特徴(微小な傷等)は、第2特徴マップ250における各チャンネルの2次元画像内においても、その大まかな位置が引き続き保持された状態で抽出される。なお、畳み込み層340は、畳み込みニューラルネットワーク200における中間層の一部である、とも表現される。
<Convolutional Layer 340>
Furthermore, in the learning model 410 in the first embodiment, the second feature map 250 is generated by performing a convolution process on the first feature map 230. In other words, the convolution layer 340 is provided next to the feature extraction layer 320, and the second feature map 250 is generated based on the first feature map 230. According to such a process, image features (such as minute scratches) in the input image 210 are extracted in a state where their rough positions are still maintained in the two-dimensional image of each channel in the second feature map 250. The convolution layer 340 is also expressed as being a part of the intermediate layer in the convolutional neural network 200.

第2特徴マップ250は、第1特徴マップ230における各チャンネルの同一位置および/または近傍位置の画素値を(重み付け等して)統合して生成される。第2特徴マップ250は、たとえば、(それぞれ)幅W2画素および高さH2画素の画素配列(矩形形状の画素配列)の2次元配列データで構成されるチャンネルをC2個備える3次元配列データ(W2×H2×C2のボクセルデータ)として生成される。第2特徴マップ250は、N×N×C1サイズのC2個のフィルタ(後述)を用いることによって生成される。 The second feature map 250 is generated by integrating (by weighting, etc.) pixel values at the same position and/or nearby positions of each channel in the first feature map 230. The second feature map 250 is generated, for example, as three-dimensional array data (W2×H2×C2 voxel data) having C2 channels each made up of two-dimensional array data of pixel arrays (rectangular pixel arrays) (each) of width W2 pixels and height H2 pixels. The second feature map 250 is generated by using C2 filters (described below) of size N×N×C1.

ただし、第1実施形態では、第2特徴マップ250が単一のチャンネルを有する場合(すなわち、C2=1の場合)について例示する。また、W2=W1、H2=H1、の場合について主に例示する。なお、第2特徴マップ250が複数のチャンネルを有する場合については、第2実施形態にて説明する。 However, in the first embodiment, the case where the second feature map 250 has a single channel (i.e., when C2 = 1) is exemplified. Also, the case where W2 = W1 and H2 = H1 is mainly exemplified. Note that the case where the second feature map 250 has multiple channels will be described in the second embodiment.

各値W0,H0,W1,H1,W2,H2,C0,C1,C2は、特徴抽出層320の構成に応じて適宜の値に設定され得る。たとえば、W0=H0=512、W1=H1=16、W2=H2=16であり、C0=3、C1=512、C2=1である。 The values W0, H0, W1, H1, W2, H2, C0, C1, and C2 can be set to appropriate values depending on the configuration of the feature extraction layer 320. For example, W0=H0=512, W1=H1=16, W2=H2=16, C0=3, C1=512, and C2=1.

図8および図9は、第1特徴マップ230に対する畳み込み処理によって第2特徴マップ250(ここでは単一チャンネルを有する第2特徴マップ250)が生成される様子を示す図である。 Figures 8 and 9 show how a second feature map 250 (here, a second feature map 250 having a single channel) is generated by a convolution process on a first feature map 230.

第1特徴マップ230に対する畳み込み処理においては、たとえば、図8あるいは図9のようなフィルタ(341あるいは342等)が用いられて第2特徴マップ250が生成される。 In the convolution process for the first feature map 230, for example, a filter (341 or 342, etc.) as shown in FIG. 8 or FIG. 9 is used to generate the second feature map 250.

図9は、N×N(たとえば、N=3)のサイズの畳み込みフィルタ342によって第2特徴マップ250が生成される様子を示している。一方、図8は、1×1のサイズの畳み込みフィルタ(カーネル)341によって第2特徴マップ250が生成される様子を示している。なお、図8の畳み込みフィルタ341は、図9の畳み込みフィルタ342の一態様(N=1の場合)であるとも表現できる。ただし、ここでは便宜上2つに分けて(Nが1の場合とNが2以上の場合とに分けて)説明する。 Figure 9 shows how the second feature map 250 is generated by a convolution filter 342 with a size of NxN (for example, N=3). On the other hand, Figure 8 shows how the second feature map 250 is generated by a convolution filter (kernel) 341 with a size of 1x1. Note that the convolution filter 341 in Figure 8 can also be expressed as one aspect of the convolution filter 342 in Figure 9 (when N=1). However, for convenience, the explanation will be divided into two cases (when N is 1 and when N is 2 or more).

いずれの畳み込みフィルタ341,342に関しても、その奥行き方向のサイズは、値C1(第1特徴マップ230のチャンネル数)である。換言すれば、フィルタ341は、1×1×C1のサイズ(3次元サイズ)を有しており、フィルタ342は、N×N×C1のサイズ(3次元サイズ)を有している。なお、値Nは、「3」に限定されず、「5」などの他の値であってもよい。 The size in the depth direction of both convolution filters 341 and 342 is the value C1 (the number of channels in the first feature map 230). In other words, filter 341 has a size (three-dimensional size) of 1x1xC1, and filter 342 has a size (three-dimensional size) of NxNxC1. Note that the value N is not limited to "3" and may be another value such as "5".

まず、図8を参照しつつ、1×1のサイズ(平面サイズ)の畳み込みフィルタ341を用いた第2特徴マップ250の生成処理について説明する。 First, referring to FIG. 8, we will explain the process of generating the second feature map 250 using a convolution filter 341 with a size of 1×1 (plane size).

図8の畳み込みフィルタ341は、詳細には、1×1×C1のサイズを有している。畳み込みフィルタ341は、第1特徴マップ230の複数(C1個)のチャンネルにおける同一画素位置の画素値を重み付け加算するフィルタである。具体的には、畳み込みフィルタ341は、第1特徴マップ230の各チャンネルの(i,j)画素に対する重み付け係数(チャンネルごとの重み付け係数)がチャンネル方向にC1個集合した集合体として構成される。なお、チャンネル方向は、チャンネル相互間をつなぐ方向(図8の奥行き方向)であり、チャンネル間方向などとも称される。 The convolution filter 341 in FIG. 8 has a size of 1×1×C1 in detail. The convolution filter 341 is a filter that performs weighted addition of pixel values at the same pixel position in multiple (C1) channels of the first feature map 230. Specifically, the convolution filter 341 is configured as a collection of C1 weighting coefficients (weighting coefficients for each channel) for the (i, j) pixel of each channel of the first feature map 230 in the channel direction. Note that the channel direction is the direction that connects the channels (the depth direction in FIG. 8) and is also referred to as the inter-channel direction, etc.

そして、第1特徴マップ230の複数のチャンネルのそれぞれの画素位置(i,j)に存在する合計C1個の画素値D1(i,j,h)(h=1,...,C1)に対して、フィルタ341を作用させることによって、値D2(i,j)が得られる。ここで、hはチャンネル番号である。具体的には、まず、第1特徴マップ230の第hチャンネルの(i,j)画素の画素値D1(i,j,h)に対して畳み込みフィルタ341内の対応する重み付け係数W(h)を乗じた積をそれぞれ求める。そして、C1個のチャンネルに関する当該積を合計した値(積和値)として、値D2(i,j)が算出される(式(1)参照)。 Then, a value D2(i,j) is obtained by applying filter 341 to a total of C1 pixel values D1(i,j,h) (h=1,...,C1) present at pixel positions (i,j) of each of the multiple channels of first feature map 230. Here, h is the channel number. Specifically, first, the product is calculated by multiplying pixel value D1(i,j,h) of the (i,j) pixel of the h-th channel of first feature map 230 by the corresponding weighting coefficient W(h) in convolution filter 341. Then, value D2(i,j) is calculated as the sum (sum of products) of the products for the C1 channels (see equation (1)).

Figure 0007627564000001
Figure 0007627564000001

当該積和値D2(i,j)が、第2特徴マップ250(の第1チャンネル)の(i,j)画素の画素値として算出される。換言すれば、第1特徴マップ230の各チャンネルの同一位置(i,j)の画素値が統合されて、第2特徴マップ250の(i,j)画素の画素値が算出される。端的に言えば、第1特徴マップ230の各チャンネルの同一位置(i,j)の画素値の加重平均(あるいはその定数倍の値)が、第2特徴マップ250の(i,j)画素の画素値として算出される。なお、第2特徴マップ250の第kチャンネルの値D2(i,j)は、値D2(i,j,k)とも表現される。たとえば、第2特徴マップ250の第1チャンネルの値D2(i,j)は、値D2(i,j,1)とも表現される(第1実施形態ではk=1)。 The sum-of-products value D2(i,j) is calculated as the pixel value of the (i,j) pixel of the second feature map 250 (the first channel of the second feature map 250). In other words, the pixel values of the same position (i,j) of each channel of the first feature map 230 are integrated to calculate the pixel value of the (i,j) pixel of the second feature map 250. In short, the weighted average (or a constant multiple thereof) of the pixel values of the same position (i,j) of each channel of the first feature map 230 is calculated as the pixel value of the (i,j) pixel of the second feature map 250. The value D2(i,j) of the kth channel of the second feature map 250 is also expressed as the value D2(i,j,k). For example, the value D2(i,j) of the first channel of the second feature map 250 is also expressed as the value D2(i,j,1) (k=1 in the first embodiment).

このようにして、畳み込みフィルタ341と第1特徴マップ230の複数のチャンネルにおける或る画素位置(i,j)の画素値とに基づき、第2特徴マップ250(詳細には、その第1チャンネル(k=1))の或る画素位置(i,j)の画素値を算出する処理が実行される。これにより、第1特徴マップ230の複数のチャンネルの同一位置の画素値(複数の画素値)が、第2特徴マップ250の対応画素位置の画素値に凝縮される。 In this way, a process is executed to calculate the pixel value of a certain pixel position (i, j) of the second feature map 250 (specifically, its first channel (k=1)) based on the convolution filter 341 and the pixel values of a certain pixel position (i, j) in the multiple channels of the first feature map 230. As a result, pixel values (multiple pixel values) at the same position in the multiple channels of the first feature map 230 are condensed into the pixel value of the corresponding pixel position in the second feature map 250.

そして、このような処理が、第1特徴マップ230の他の全ての画素位置の画素についてもそれぞれ同様に実行される。これによって、第2特徴マップ250(詳細には、その単一チャンネル)の他の全ての画素位置の画素値が算出される。 Then, this process is similarly performed for each of the pixels at all other pixel positions in the first feature map 230. This causes the pixel values of all other pixel positions in the second feature map 250 (specifically, its single channel) to be calculated.

このような畳み込み処理によれば、複数のチャンネルに亘る各位置(同一位置)の画素の情報が新たな一つのチャンネル内の当該各位置の画素の値に凝縮される。 This type of convolution process condenses pixel information from each position (same position) across multiple channels into the pixel value for that position within a single new channel.

次に、図9を参照しつつ、(N×N)のサイズ(平面サイズ)の畳み込みフィルタ342を用いた第2特徴マップ250の生成処理について説明する。 Next, with reference to FIG. 9, we will explain the process of generating the second feature map 250 using a convolution filter 342 with a size (plane size) of (N×N).

図9の畳み込みフィルタ342は、詳細には、N×N×C1のサイズ(立体サイズ)を有している。畳み込みフィルタ342は、第1特徴マップ230の複数(C1個)のチャンネルにおける同一画素位置およびその近傍(周辺)画素位置の画素値を重み付け加算するフィルタである。 The convolution filter 342 in FIG. 9 specifically has a size (three-dimensional size) of N×N×C1. The convolution filter 342 is a filter that weights and adds pixel values at the same pixel position and its neighboring (surrounding) pixel positions in multiple (C1) channels of the first feature map 230.

畳み込みフィルタ342は、第1特徴マップ230の各チャンネルの(i,j)画素を中心とする近傍範囲の(N×N)個の画素に対する重み付け係数群(チャンネルごとの重み付け係数群)がチャンネル方向(図9の奥行き方向)にC1個集合した集合体として構成される。チャンネルごとの重み付け係数群は、それぞれ、(N×N)(たとえば3×3)個の重み付け係数で構成される(図11も参照)。また、各チャンネルの重み付け係数群は、チャンネルごとに独立した値で構成される。換言すれば、或るチャンネルの重み付け係数群の各値は、基本的には、他のチャンネルの重み付け係数群の各値とは異なっている。 The convolution filter 342 is configured as a collection of C1 weighting coefficients (weighting coefficients for each channel) for (N x N) pixels in a neighborhood centered on the (i, j) pixel of each channel of the first feature map 230 in the channel direction (depth direction in FIG. 9). Each weighting coefficient group for each channel is composed of (N x N) (e.g., 3 x 3) weighting coefficients (see also FIG. 11). Furthermore, the weighting coefficient group for each channel is composed of independent values for each channel. In other words, the values of the weighting coefficient group for a certain channel are fundamentally different from the values of the weighting coefficient groups for other channels.

そして、第1特徴マップ230の複数のチャンネルのそれぞれの画素位置(i,j)を中心とするN×N×C1サイズのボクセル範囲(図9の破線の直方体で示される立体領域に存在する合計(N×N×C1)個の画素値群)に対して、同じサイズのフィルタ342を作用させることによって、値D2(i,j)が得られる。 Then, a value D2(i,j) is obtained by applying a filter 342 of the same size to a voxel range of size NxNxC1 (a total of (NxNxC1) pixel values that exist in the three-dimensional region indicated by the dashed rectangular parallelepiped in Figure 9) centered on each pixel position (i,j) of the multiple channels of the first feature map 230.

このフィルタ処理は、チャンネル内の処理とチャンネル相互間の処理とに分けることができる(図10参照)。なお、図10も、図9と同様、(N×N)のサイズ(平面サイズ)の畳み込みフィルタ342を用いた第2特徴マップ250の生成処理を示す図である。ただし、図9における立体的な特徴マップおよび立体的なフィルタが、図10では、チャンネル毎に分解されて(平面的の集合体として)示されている。また、図10の左右方向は図9の奥行き方向(チャンネル方向)に対応する。 This filter processing can be divided into processing within a channel and processing between channels (see FIG. 10). Like FIG. 9, FIG. 10 is a diagram showing the generation process of the second feature map 250 using a convolution filter 342 of size (planar size) (N×N). However, the three-dimensional feature map and three-dimensional filter in FIG. 9 are broken down into channels (as a planar collection) in FIG. 10. The left-right direction in FIG. 10 corresponds to the depth direction (channel direction) in FIG. 9.

具体的には、畳み込みフィルタ342を用いて、まず、第1特徴マップ230の第hチャンネルの(i,j)画素の近傍の(N×N)個の画素(中心の(i,j)画素も含む)の画素値に対するチャンネル内の重み付け処理が施される。換言すれば、第1特徴マップ230の複数のチャンネルのそれぞれに対する(平面的な)畳み込み処理が施される。これによって、図10の左右方向中央付近に示されるように、暫定的な特徴マップ(暫定特徴マップとも称する)245が生成される。図10の第1特徴マップ230の第hチャンネルの位置(i,j)の近傍範囲(破線領域)内の画素の画素値が畳み込まれることによって、暫定特徴マップ245の位置(i,j)の画素の画素値D3(i,j,h)が得られる。画素値D3(i,j,h)は、暫定特徴マップ245の第hチャンネルの(i,j)画素の画素値である(図10も参照)。 Specifically, using the convolution filter 342, first, intra-channel weighting processing is performed on the pixel values of (N×N) pixels (including the central (i, j) pixel) in the vicinity of the (i, j) pixel in the h-th channel of the first feature map 230. In other words, (planar) convolution processing is performed on each of the multiple channels of the first feature map 230. As a result, a provisional feature map (also called a provisional feature map) 245 is generated, as shown near the center in the horizontal direction of FIG. 10. The pixel values of the pixels in the vicinity range (dashed area) of the position (i, j) of the h-th channel of the first feature map 230 in FIG. 10 are convoluted to obtain the pixel value D3(i, j, h) of the pixel at the position (i, j) of the provisional feature map 245. The pixel value D3(i, j, h) is the pixel value of the (i, j) pixel in the h-th channel of the provisional feature map 245 (see also FIG. 10).

そして、暫定特徴マップ245のC1個のチャンネルに関するC1個の画素値D3(i,j,h)(ただし、hはチャンネル番号であり、h=1,..,C1)を合計した値D2(i,j)が得られる(式(2)参照)。換言すれば、チャンネル相互間の統合処理(合計処理)が行われる。 Then, a value D2(i,j) is obtained by summing C1 pixel values D3(i,j,h) (where h is the channel number, h=1,..,C1) for C1 channels of the provisional feature map 245 (see equation (2)). In other words, integration processing (summing processing) between channels is performed.

Figure 0007627564000002
Figure 0007627564000002

このような値D2(i,j)が、第2特徴マップ250(の第1チャンネル)の(i,j)画素の画素値として算出される。 Such a value D2(i, j) is calculated as the pixel value of the (i, j) pixel in the second feature map 250 (first channel).

ここにおいて、値D3(i,j,h)は、平面内成分D4(i,j,h)と平面間成分W4(h)との積でも表現できる。これを考慮すると、上記の式(2)は、次の式(3)のように変形できる。 Here, the value D3(i,j,h) can also be expressed as the product of the in-plane component D4(i,j,h) and the inter-plane component W4(h). Taking this into consideration, the above formula (2) can be transformed into the following formula (3).

Figure 0007627564000003
Figure 0007627564000003

換言すれば、畳み込みフィルタ342の平面内成分D4(i,j,h)によって各チャンネル内での平面的な畳み込み処理が実行されて暫定特徴マップ245の値D4(i,j,h)が得られる。さらに、画素値D4(i,j,h)(ただし、hはチャンネル番号であり、h=1,..,C1)に対して畳み込みフィルタ342内の対応する重み付け係数W4(h)(平面間成分)を乗じた積をそれぞれ求める。そして、C1個のチャンネルに関する当該積を合計した値(積和値)として、値D2(i,j)が算出さる(式(3)参照)。 In other words, planar convolution processing is performed in each channel using the in-plane components D4(i,j,h) of the convolution filter 342 to obtain the values D4(i,j,h) of the provisional feature map 245. Furthermore, the pixel values D4(i,j,h) (where h is the channel number, h=1,..,C1) are multiplied by the corresponding weighting coefficient W4(h) (inter-plane component) in the convolution filter 342 to obtain the product. The products for the C1 channels are then summed up to obtain a value D2(i,j) (see equation (3)).

すなわち、暫定特徴マップ245の複数のチャンネルにおける同一画素位置(i,j)を中心とする同一近傍範囲の画素値を畳み込んだ画素値D4(i,j,h)が重み付け加算して統合されて、第2特徴マップ250の(i,j)画素の画素値として算出される。端的に言えば、当該画素値D4(i,j,h)の加重平均(あるいはその定数倍の値)が、第2特徴マップ250の(i,j)画素の画素値として算出される。 That is, pixel values D4(i,j,h) obtained by convolving pixel values in the same neighborhood centered on the same pixel position (i,j) in multiple channels of the provisional feature map 245 are weighted and added together to be calculated as the pixel value of the (i,j) pixel in the second feature map 250. In short, the weighted average (or a constant multiple of it) of the pixel values D4(i,j,h) is calculated as the pixel value of the (i,j) pixel in the second feature map 250.

なお、ここでは、第1特徴マップ230の各チャンネルの周縁画素の外周側領域を適宜の値(たとえばゼロ(あるいは周縁画素と同じ値でもよい))で埋めるパディング(ゼロパディング等)が実行された後に、第1特徴マップ230に対する畳み込み処理が施されるものとする(図11参照)。これによれば、畳み込み処理後の特徴マップ(第2特徴マップ250)の画素サイズ(W×H)が小さくなることを回避できる。このようなパディング処理を伴う畳み込み処理等によれば、W2=W1、H2=H1の状況が実現され得る。ただし、W2=W1、H2=H1に限定されない。たとえば、第2特徴マップ250の平面サイズ(W2×H2)は、第1特徴マップ230の平面サイズ(W1×H1)よりも小さくてもよい。なお、図11では、図示の簡略化等のため、W2=W1=6、H2=H1=6の場合が示されている。 Note that here, the convolution process is performed on the first feature map 230 after padding (zero padding, etc.) is performed to fill the outer peripheral region of the peripheral pixels of each channel of the first feature map 230 with an appropriate value (for example, zero (or the same value as the peripheral pixels)). This makes it possible to prevent the pixel size (W x H) of the feature map (second feature map 250) after the convolution process from becoming small. Such convolution process involving padding can realize a situation where W2 = W1 and H2 = H1. However, this is not limited to W2 = W1 and H2 = H1. For example, the planar size (W2 x H2) of the second feature map 250 may be smaller than the planar size (W1 x H1) of the first feature map 230. Note that in FIG. 11, for the sake of simplicity, the case of W2 = W1 = 6 and H2 = H1 = 6 is shown.

このようにして、畳み込みフィルタ342と第1特徴マップ230の複数のチャンネルにおける或る画素位置(i,j)およびその近傍位置の画素値とに基づき、第2特徴マップ250(詳細には、その第kチャンネル)の対応画素位置(i,j)の画素値を算出する処理が実行される。これにより、第1特徴マップ230の複数のチャンネルの同一範囲の画素値(複数の画素値)が、第2特徴マップ250の対応画素位置の画素値に凝縮される。 In this way, a process is executed to calculate the pixel value of a corresponding pixel position (i, j) in the second feature map 250 (specifically, the kth channel) based on the convolution filter 342 and the pixel values of a pixel position (i, j) and its neighboring positions in the multiple channels of the first feature map 230. As a result, pixel values (multiple pixel values) in the same range in the multiple channels of the first feature map 230 are condensed into the pixel value of the corresponding pixel position in the second feature map 250.

そして、このような処理が、第1特徴マップ230の各チャンネルの他の全ての画素位置の画素についても同様に実行される。これによって、第2特徴マップ250(詳細には、その第kチャンネル(k=1))の他の全ての画素位置の画素値が算出される。 Then, this process is similarly performed for the pixels at all other pixel positions of each channel of the first feature map 230. This causes the pixel values of all other pixel positions of the second feature map 250 (specifically, its kth channel (k=1)) to be calculated.

このような畳み込み処理によれば、複数のチャンネルに亘る各位置付近(同一位置付近)の画素の情報が新たな一つのチャンネル内の当該各位置の画素の値に凝縮される。 This type of convolution process condenses pixel information near each position (near the same position) across multiple channels into the pixel value for that position within a single new channel.

以上のように(図8あるいは図9に示すように)、第2特徴マップ250は、第1特徴マップ230における各チャンネルの同一位置および/または近傍位置の画素値を統合して生成される。具体的には、第2特徴マップ250の第1チャンネル内の全ての画素位置の画素値を算出する処理(チャンネル内画素値の算出処理)が、1回実行される。当該算出処理は、畳み込みフィルタ341あるいは342を用いて行われる。当該畳み込みフィルタ341あるいは342は、第1特徴マップ230の複数(C1個)のチャンネルにおける同一位置および/または近傍位置の画素値を重み付け加算するフィルタである。これによって、第2特徴マップ250における所定数(1個)のチャンネルが生成される。 As described above (as shown in FIG. 8 or FIG. 9), the second feature map 250 is generated by integrating pixel values at the same position and/or nearby positions in each channel in the first feature map 230. Specifically, a process of calculating pixel values at all pixel positions in the first channel of the second feature map 250 (a process of calculating pixel values in a channel) is executed once. This calculation process is performed using a convolution filter 341 or 342. The convolution filter 341 or 342 is a filter that performs weighted addition of pixel values at the same position and/or nearby positions in multiple (C1) channels of the first feature map 230. In this way, a predetermined number (1) of channels in the second feature map 250 are generated.

なお、第2特徴マップ250内の各値は、さらに活性化関数等によって正規化されて修正(更新)されることが好ましい。 It is preferable that each value in the second feature map 250 is further normalized and corrected (updated) using an activation function or the like.

<プーリング層360および出力層370>
次に、第2特徴マップ250に対してグローバルマックスプーリング処理が施されることによって、学習モデル410のスコア(出力値)270が算出される(図6参照)。換言すれば、畳み込み層340の次にプーリング層360が設けられることによって、学習モデル410のスコア270(出力層370の出力値)が生成される。プーリング層360は、グローバルマックスプーリング(GMP:Global Max Pooling)処理(以下、GMP処理とも称する)を第2特徴マップ250に対して施す層である。プーリング層360は、GMP層とも称される。プーリング層(GMP層)360は、特徴抽出層320および畳み込み層340と同様に、畳み込みニューラルネットワーク200における中間層の一部である、とも表現される。
Pooling Layer 360 and Output Layer 370
Next, a global max pooling process is performed on the second feature map 250, and a score (output value) 270 of the learning model 410 is calculated (see FIG. 6). In other words, a pooling layer 360 is provided next to the convolution layer 340, and a score 270 (output value of the output layer 370) of the learning model 410 is generated. The pooling layer 360 is a layer that performs a global max pooling (GMP) process (hereinafter also referred to as a GMP process) on the second feature map 250. The pooling layer 360 is also referred to as a GMP layer. The pooling layer (GMP layer) 360, like the feature extraction layer 320 and the convolution layer 340, is also expressed as being a part of the intermediate layer in the convolution neural network 200.

最大プーリング(Max Pooling)処理は、カーネル(フィルタ)サイズに対応する複数の画素のうち最大の値(最大画素値)を特徴値(出力値)として抽出する処理である。最大プーリング処理は、一般的にはチャンネルサイズよりも小さなフィルタサイズ(たとえば、2×2サイズ)に対応する複数の画素(たとえば、4つの画素)のうちの最大値を抽出することが多い。 Max Pooling is a process that extracts the maximum value (maximum pixel value) of multiple pixels corresponding to the kernel (filter) size as a feature value (output value). Max Pooling often extracts the maximum value of multiple pixels (e.g., four pixels) corresponding to a filter size (e.g., 2x2 size) that is generally smaller than the channel size.

これに対して、グローバルマックスプーリング(GMP:Global Max Pooling)処理は、最大プーリング(Max Pooling)処理の一種であり、詳細には「チャンネル全体」を対象とする最大プーリング処理である(図14参照)。GMP処理(全体最大プーリング処理)は、チャンネルサイズと同じフィルタサイズ(たとえば、W2×H2=16×16)に対応する複数の画素(チャンネル内の全ての画素)(たとえば、256個の画素)のうちの最大値を抽出する最大プーリング処理である。 In contrast, Global Max Pooling (GMP) processing is a type of Max Pooling processing, and more specifically, it is a Max Pooling processing that targets the "entire channel" (see FIG. 14). GMP processing (global max pooling processing) is a Max Pooling processing that extracts the maximum value from multiple pixels (all pixels in a channel) (e.g., 256 pixels) corresponding to a filter size (e.g., W2×H2=16×16) that is the same as the channel size.

また、GMP処理(グローバルマックスプーリング処理)は、処理対象の特徴マップ(ここでは第2特徴マップ250)のチャンネル毎の最大画素値を(チャンネル毎に)抽出する処理である。単一チャンネルを有する特徴マップに対してGMP処理が施されると、単一の値(最大値)が出力される。一方、複数(たとえば2個)のチャンネルを有する特徴マップに対してGMP処理が施されると、複数の値(チャンネル毎の最大値)(たとえば第1チャンネル内の最大値と第2チャンネル内の最大値との2つの値)が出力される。 GMP processing (global max pooling processing) is processing that extracts (for each channel) the maximum pixel value for each channel of the feature map to be processed (here, the second feature map 250). When GMP processing is performed on a feature map with a single channel, a single value (maximum value) is output. On the other hand, when GMP processing is performed on a feature map with multiple (e.g., two) channels, multiple values (maximum values for each channel) (for example, two values, the maximum value in the first channel and the maximum value in the second channel) are output.

単一チャンネルを有する第2特徴マップ250に対してGMP処理が施される場合、当該単一チャンネルの2次元配列データ(W2×H2)内の複数((W2×H2)個)の画素値のうちの最大の値(最大値)が当該GMP処理の処理結果として出力される(図14参照)。なお、図14は、第2特徴マップの一のチャンネルに対するGMP処理を示す図である。図14では、図示の簡略化のため、第2特徴マップ250が6×6サイズである場合が例示されている。図14の場合、すなわち、W2=H2=6の場合には、6*6=36個の画素値のうちの最大値が、第2特徴マップ250(の第1チャンネル)に対するGMP処理の処理結果として出力される。あるいは、たとえば、W2=H2=16の場合には、16*16=256個の画素値のうちの最大値が、第2特徴マップ250(の第1チャンネル)に対するGMP処理の処理結果として出力される。 When the GMP process is performed on the second feature map 250 having a single channel, the maximum value (max value) of the multiple (W2×H2) pixel values in the two-dimensional array data (W2×H2) of the single channel is output as the processing result of the GMP process (see FIG. 14). Note that FIG. 14 is a diagram showing the GMP process for one channel of the second feature map. In FIG. 14, for the sake of simplicity, the second feature map 250 is illustrated as having a size of 6×6. In the case of FIG. 14, that is, when W2=H2=6, the maximum value of 6*6=36 pixel values is output as the processing result of the GMP process for the second feature map 250 (first channel). Alternatively, for example, when W2=H2=16, the maximum value of 16*16=256 pixel values is output as the processing result of the GMP process for the second feature map 250 (first channel).

第2特徴マップ250の各値が既に正規化されている場合には、GMP処理の処理結果の値(0以上1以下の値)が、そのまま畳み込みニューラルネットワーク200(出力層370)の出力値270として出力される(図12参照)。 If each value in the second feature map 250 has already been normalized, the value resulting from the GMP processing (a value between 0 and 1) is output as is as the output value 270 of the convolutional neural network 200 (output layer 370) (see FIG. 12).

一方、第2特徴マップ250の各値が未だ正規化されていない場合(たとえば、当該各値が8ビット値(0~255)のいずれかである場合)には、所定の正規化関数(活性化関数等)を用いてGMP処理の処理結果が正規化される(図13参照)。これによって、GMP処理の処理結果が、0以上1以下の値に正規化される。なお、当該活性化関数としては、シグモイド関数、あるいはReLU(Rectified Linear Unit)関数等が用いられればよい。 On the other hand, if the values in the second feature map 250 have not yet been normalized (for example, if each value is one of 8-bit values (0 to 255)), the processing result of the GMP processing is normalized using a predetermined normalization function (such as an activation function) (see FIG. 13). As a result, the processing result of the GMP processing is normalized to a value between 0 and 1. Note that the activation function may be a sigmoid function, a ReLU (Rectified Linear Unit) function, or the like.

学習モデル410は、上述のような構成を有しており、対象物の撮影画像(入力画像)210を入力すると、対象物の異常に関する情報(異常の有無等)を示す出力値が出力される。なお、後述するように、学習段階では、正規化された出力値(学習モデル410の出力値)と正解データとの両者が比較され、当該両者の差異(差分値等)を小さくするように、学習モデル410の機械学習が実行される。また、推論段階においては、正規化された出力値(学習モデル410の出力値)に基づき、正常であるか異常であるかが判定される。 The learning model 410 has the configuration described above, and when a photographed image (input image) 210 of an object is input, an output value indicating information regarding abnormalities in the object (presence or absence of abnormality, etc.) is output. As described below, in the learning stage, the normalized output value (output value of the learning model 410) is compared with the correct answer data, and machine learning of the learning model 410 is performed to reduce the difference between the two (difference value, etc.). In the inference stage, a determination is made as to whether the object is normal or abnormal based on the normalized output value (output value of the learning model 410).

ここにおいて、GMP層360では、第2特徴マップ250に対してGMP処理が施される。これによれば、学習後の学習モデル410(420)においては、第2特徴マップ250の複数(W2×H2個)の画素値のうち異常とされる画素(「1」近傍の値)が1つでもあれば、出力値270に当該画素(異常画素)の値が出力される。したがって、異常画素の見逃しを防止することが可能である。 Here, in the GMP layer 360, GMP processing is performed on the second feature map 250. According to this, in the learning model 410 (420) after learning, if there is even one pixel that is considered abnormal (a value close to "1") among the multiple (W2 x H2) pixel values of the second feature map 250, the value of that pixel (abnormal pixel) is output to the output value 270. Therefore, it is possible to prevent abnormal pixels from being overlooked.

<1-4.学習段階の処理>
次に、学習モデル410の学習段階の処理について図4を参照しつつ説明する。
<1-4. Learning stage processing>
Next, the learning stage processing of the learning model 410 will be described with reference to FIG.

図4は、学習段階におけるコントローラ31の処理を示すフローチャートである。図4は、学習済みモデルの生成方法を示す図でもある。本願において、学習済みモデル420を生成することは、学習済みモデル420を製造(生産)することを意味するとともに、「学習済みモデルの生成方法」は「学習済みモデルの製造方法」を意味する。 Figure 4 is a flowchart showing the processing of the controller 31 in the learning stage. Figure 4 is also a diagram showing a method for generating a trained model. In this application, generating a trained model 420 means manufacturing (producing) the trained model 420, and the "method for generating a trained model" means the "method for manufacturing a trained model."

図4に示されるように、コントローラ31は、まず、ステップS11において、各撮影画像を入力とし当該各撮影画像内の異常に関する情報を出力とする教師データを取得する。たとえば、各撮影画像の対象物に「微小な傷」が存在するか否かを示す情報(たとえば、異常「1」/正常「0」)がそれぞれ正解データとして当該各撮影画像に対して関連づけられた教師データ(複数の教師データ)が取得される。特に、非常に多数の教師データが準備されることが好ましい。 As shown in FIG. 4, in step S11, the controller 31 first acquires training data that takes each captured image as input and outputs information regarding abnormalities in each captured image. For example, training data (multiple training data) is acquired in which information indicating whether or not a "microscopic scratch" is present on the object in each captured image (e.g., abnormal "1"/normal "0") is associated with each captured image as correct answer data. In particular, it is preferable to prepare a very large amount of training data.

そして、ステップS12においては、コントローラ31は、ステップS11で取得された教師データを用いて、上述のような学習モデル410を機械学習する。 Then, in step S12, the controller 31 uses the training data acquired in step S11 to machine-train the learning model 410 as described above.

より詳細には、図12(および図13)に示されるように、学習モデル410からの出力値(正規化された出力値(「0」以上「1」以下の値))と正解データ(たとえば、正常の場合は「0」、異常の場合は「1」)との両者が比較される。そして、当該両者の差異(差分値等)を小さくするように、学習モデル410の機械学習が実行される。換言すれば、第2特徴マップ250の単一チャンネルに対してGMP処理を施して得られる値(出力値270)を使用して学習モデル410の機械学習が実行され、学習済みモデル420が生成される。 More specifically, as shown in FIG. 12 (and FIG. 13), the output value (normalized output value (value between "0" and "1")) from the learning model 410 is compared with the correct answer data (for example, "0" for normality and "1" for an abnormality). Then, machine learning of the learning model 410 is performed so as to reduce the difference between the two (such as a differential value). In other words, machine learning of the learning model 410 is performed using the value (output value 270) obtained by performing GMP processing on a single channel of the second feature map 250, and the learned model 420 is generated.

具体的には、誤差逆伝播法(バックプロパゲーション(Backpropagation)法)等を用いて、学習モデル410の学習パラメータ(各フィルタ(カーネル)の重み付け係数およびバイアス値等)の最適化が実行される。より詳細には、特徴抽出層320の各フィルタ(カーネル)の重み付け係数およびバイアス値、および畳み込み層340の各フィルタ(カーネル)の重み付け係数およびバイアス値等が最適化される。 Specifically, the learning parameters of the learning model 410 (weighting coefficients and bias values of each filter (kernel), etc.) are optimized using a backpropagation method or the like. More specifically, the weighting coefficients and bias values of each filter (kernel) in the feature extraction layer 320, and the weighting coefficients and bias values of each filter (kernel) in the convolution layer 340, etc. are optimized.

このような処理によって、各撮影画像と当該各撮影画像内の異常に関する情報(たとえば「微小な傷」の有無)との関係を学習した学習モデル410が生成される(ステップS13)。すなわち、学習済みの学習モデル410(学習済みモデル420)が生成される。 By this process, a learning model 410 is generated that has learned the relationship between each captured image and information about anomalies in the captured image (e.g., the presence or absence of "microscopic scratches") (step S13). In other words, a trained learning model 410 (trained model 420) is generated.

これによれば、次述するように、学習済みモデル420を利用して、判定対象物の撮影画像に基づき、当該撮影画像内の被写体(対象物)における異常(「微小な傷」等)の有無等を推定することが可能である。 As a result, as described below, it is possible to use the trained model 420 to estimate the presence or absence of abnormalities (such as "tiny scratches") in the subject (object) in a captured image based on the captured image of the object to be judged.

<1-5.推論段階の処理>
つぎに、学習済みモデル420を利用した推論段階の処理について図5を参照しつつ説明する。
<1-5. Processing in the inference stage>
Next, the processing of the inference stage using the trained model 420 will be described with reference to FIG.

図5は、推論段階におけるコントローラ31の処理を示すフローチャートである。図5は、学習済みモデルを利用した異常検出方法(異常検出のための画像処理方法等)を示す図でもある。 Figure 5 is a flowchart showing the processing of the controller 31 in the inference stage. Figure 5 also shows an anomaly detection method (such as an image processing method for anomaly detection) that uses a trained model.

コントローラ31は、まずステップS31において、対象物の撮影画像を取得する。具体的には、コントローラ31は、撮影装置20によって撮像された撮影画像(判定対象画像とも称する)を、ネットワーク等を介して撮影装置20から取得する。 First, in step S31, the controller 31 acquires a photographed image of the object. Specifically, the controller 31 acquires the photographed image (also referred to as the determination target image) captured by the photographing device 20 from the photographing device 20 via a network or the like.

次のステップS32において、コントローラ31は、ステップS31にて取得された撮影画像を学習モデル410(学習済みモデル420)に入力する。そして、コントローラ31は、学習済みモデル420からの出力結果を取得する。当該出力結果は、対象物に関する異常の有無等に関する推定結果(推論結果)である。 In the next step S32, the controller 31 inputs the captured image acquired in step S31 into the learning model 410 (trained model 420). Then, the controller 31 acquires an output result from the trained model 420. The output result is an estimation result (inference result) regarding the presence or absence of an abnormality in the target object, etc.

正規化された出力結果(出力値)として、閾値TH1(「0.5」)以上の値が出力される場合、当該撮影画像内の対象物に異常が存在すると判定される。正規化された出力結果(出力値)が「1」(異常)に近いことは、異常の存在可能性が高いこと(端的に言えば、異常が存在すること)を示している。逆に、当該出力結果が「0」(正常)に近いことは、異常の存在可能性が低いこと(異常が存在しないこと)を示している。また、コントローラ31は、当該出力結果に関する数値自体(あるいは変換値)を、その判定結果の信頼度として併せて出力する。 When a value equal to or greater than the threshold value TH1 ("0.5") is output as the normalized output result (output value), it is determined that an abnormality exists in the object in the captured image. A normalized output result (output value) closer to "1" (abnormal) indicates that the possibility of an abnormality is high (in short, that an abnormality exists). Conversely, an output result closer to "0" (normal) indicates that the possibility of an abnormality is low (that an abnormality does not exist). In addition, the controller 31 also outputs the numerical value itself (or the converted value) related to the output result as the reliability of the determination result.

たとえば、学習済みモデル420からの出力結果の値が「0.9」の時には、微小な傷が存在する旨が判定されるとともに、その信頼度(入力画像210の全体に関する異常の有無に関する信頼度)が90%であると判定される。また、学習済みモデル420からの出力結果の値が「0.2」の時には、微小な傷が存在しない旨が判定されるとともに、その信頼度が80%(=(1-0.2)*100(%))であると判定される。 For example, when the output result value from the trained model 420 is "0.9", it is determined that a microscopic flaw exists and the reliability (reliability regarding the presence or absence of anomalies in the entire input image 210) is determined to be 90%. On the other hand, when the output result value from the trained model 420 is "0.2", it is determined that a microscopic flaw does not exist and the reliability is determined to be 80% (= (1-0.2) * 100 (%)).

そして、ステップS33において、コントローラ31は、異常の有無に関する判定結果を示す画面510を表示部35bに表示する。画面510は、ステップS32にて取得された出力結果に基づく情報を含む。 Then, in step S33, the controller 31 displays a screen 510 on the display unit 35b, which shows the determination result regarding the presence or absence of an abnormality. The screen 510 includes information based on the output result obtained in step S32.

図22は、画面510の一例を示す図である。図22には、入力画像210と第2特徴マップ250のヒートマップとを左右方向に並べた画面510(511とも称する)が示されている。画面510は、第2特徴マップ250に基づき可視化した情報を表示する画面でもある。 Figure 22 is a diagram showing an example of a screen 510. Figure 22 shows a screen 510 (also referred to as 511) on which the input image 210 and a heat map of the second feature map 250 are arranged in the left-right direction. The screen 510 is also a screen that displays information visualized based on the second feature map 250.

画面511内の左側には入力画像210自体が表示されている。また、画面511内において、入力画像210の上部の表示領域520には、異常の有無に関する情報が表示される。図22では、文字列「異常有り(傷有り)」が表示されている。これにより、撮影画像の対象物に異常(「傷」)が存在することが示されている。詳細には、入力画像210の全体に関する異常の有無に関する信頼度が閾値(たとえば50%)以上である場合、「異常有り」と判定される。なお、ここでは、当該信頼度の数値は表示されていないが、これに限定されず、信頼度の数値も併せて表示されてもよい。 The input image 210 itself is displayed on the left side of the screen 511. Also, in the screen 511, information regarding the presence or absence of an abnormality is displayed in a display area 520 above the input image 210. In FIG. 22, the character string "Abnormal (Scratch)" is displayed. This indicates that an abnormality ("scratch") exists in the object of the captured image. In detail, if the reliability regarding the presence or absence of an abnormality for the entire input image 210 is equal to or greater than a threshold value (e.g., 50%), it is determined that "an abnormality exists." Note that, although the numerical value of the reliability is not displayed here, this is not limiting, and the numerical value of the reliability may also be displayed.

画面511内の右側には、第2特徴マップ250のヒートマップ530(第2特徴マップ250を可視化した情報)が表示されている。第2特徴マップ250における各画素は、当該各画素の位置における異常の存在可能性を示す画素値を有している。各画素値は、第2特徴マップ250における画素単位での信頼度(画素単位での異常の有無に関する信頼度)を示している、とも言える。 A heat map 530 of the second feature map 250 (information visualizing the second feature map 250) is displayed on the right side of the screen 511. Each pixel in the second feature map 250 has a pixel value that indicates the possibility of an abnormality being present at the position of that pixel. It can also be said that each pixel value indicates the reliability of the pixel in the second feature map 250 (the reliability of the presence or absence of an abnormality on a pixel-by-pixel basis).

ヒートマップ530では、第2特徴マップ250の各画素の画素値が複数の段階に区分され、段階毎に割り当てられた色で各画素の矩形が塗りつぶされて表示される。たとえば、画素値0.8以上1.0以下の画素は赤色(図22ではドットハッチング領域)で表示され、画素値0.5以上0.8未満の画素はオレンジ色(図22では斜線ハッチング領域)で表示され、画素値0.5未満の画素は白色(無色透明)で表示される。操作者は、ヒートマップ530の各画素の色によって、各画素位置における異常の可能性(異常の有無等)を識別することが可能である。 In the heat map 530, the pixel value of each pixel in the second feature map 250 is divided into multiple stages, and the rectangle of each pixel is displayed by filling it with a color assigned to each stage. For example, pixels with a pixel value of 0.8 or more and 1.0 or less are displayed in red (dot-hatched area in FIG. 22), pixels with a pixel value of 0.5 or more and less than 0.8 are displayed in orange (diagonal-hatched area in FIG. 22), and pixels with a pixel value less than 0.5 are displayed in white (colorless and transparent). The operator can identify the possibility of an abnormality (presence or absence of an abnormality, etc.) at each pixel position by the color of each pixel in the heat map 530.

第2特徴マップ250のヒートマップ530は、入力画像210と同じ大きさを有するように(そのサイズが調整されて)表示される。 The heat map 530 of the second feature map 250 is displayed (with its size adjusted) to have the same size as the input image 210.

ヒートマップ530の最小矩形は、第2特徴マップ250の1画素に相当する。また、当該最小矩形は、その各辺において、入力画像210の(W0/W2)画素に相当する大きさを有している。たとえば、W0=H0=512、W2=H2=16の場合、第2特徴マップ250のヒートマップ530の最小矩形の一辺は、入力画像210の32画素(=512/16)に相当する大きさを有している。 The smallest rectangle of the heat map 530 corresponds to one pixel of the second feature map 250. Furthermore, the smallest rectangle has a size equivalent to (W0/W2) pixels of the input image 210 on each side. For example, when W0 = H0 = 512 and W2 = H2 = 16, one side of the smallest rectangle of the heat map 530 of the second feature map 250 has a size equivalent to 32 pixels (= 512/16) of the input image 210.

このような画面510の表示情報(第2特徴マップ250に基づき可視化された情報)によれば、操作者は、入力画像210内の異常の大まかな位置を容易に知得することが可能である。詳細には、入力画像210とヒートマップ530(第2特徴マップ250)とを見比べることによって、入力画像210のどの位置に異常が存在するかを容易に把握することが可能である。より具体的には、入力画像210における異常が、ヒートマップ530の赤色画素位置(あるいはオレンジ色画素位置)に対応する位置付近に存在することが判る。 The display information on the screen 510 (information visualized based on the second feature map 250) allows the operator to easily ascertain the general location of the abnormality in the input image 210. In particular, by comparing the input image 210 with the heat map 530 (second feature map 250), the operator can easily grasp where the abnormality exists in the input image 210. More specifically, it can be seen that the abnormality in the input image 210 exists near a position corresponding to a red pixel position (or an orange pixel position) in the heat map 530.

なお、ここでは、入力画像210と第2特徴マップ250(詳細にはそのヒートマップ530)とが並列的に配置されて表示されているが、これに限定されない。 Note that here, the input image 210 and the second feature map 250 (specifically, its heat map 530) are displayed in parallel arrangement, but this is not limited to this.

たとえば、第2特徴マップ250を可視化した情報(ヒートマップ530等)が入力画像(撮影画像)210に重畳されて表示されてもよい。図23は、このような画面510(512)等を示す図である。図23内の右側の画面512においては、入力画像210(図23内の左上参照)と同じ大きさを有するヒートマップ530(図23内の左下参照)が、入力画像210に対して重畳されて表示されている。このような重畳表示等においては、ヒートマップ530は半透明の色で表示されることが好ましい。 For example, information (such as a heat map 530) that visualizes the second feature map 250 may be displayed superimposed on the input image (captured image) 210. FIG. 23 is a diagram showing such a screen 510 (512) or the like. In the screen 512 on the right side of FIG. 23, a heat map 530 (see the lower left in FIG. 23) having the same size as the input image 210 (see the upper left in FIG. 23) is displayed superimposed on the input image 210. In such a superimposed display, it is preferable that the heat map 530 is displayed in a semi-transparent color.

あるいは、図23(画面510参照)のような両者210,530の重畳表示状態と、入力画像210の単独表示状態とが交互に切り替わるようにしてもよい。詳細には、入力画像210が常時表示されたまま、ヒートマップ530の表示の有無が所定時間間隔(1秒間隔等)で切り替わるようにしてもよい。すなわち、入力画像210のみの表示状態と入力画像210にヒートマップ530が重畳された表示状態とが交互に繰り返されてもよい。あるいは、同じ大きさを有する入力画像210とヒートマップ530とが、同じ位置に交互に表示されてもよい。 Alternatively, the display state of the two images 210, 530 superimposed as shown in FIG. 23 (see screen 510) and the display state of the input image 210 alone may be switched alternately. In particular, the input image 210 may be constantly displayed, and the display of the heat map 530 may be switched on and off at a predetermined time interval (such as every second). That is, the display state of only the input image 210 and the display state of the heat map 530 superimposed on the input image 210 may be alternately repeated. Alternatively, the input image 210 and the heat map 530 having the same size may be alternately displayed in the same position.

また、ここでは、第2特徴マップ250内にて所定値以上の画素が所定色で塗りつぶされているが、これに限定されない。たとえば、第2特徴マップ250内にて所定値以上の画素を有する範囲が線で囲まれること等によって、第2特徴マップ250に含まれる情報(各画素位置での異常度合い等)が可視化されて表示されても良い。 In addition, here, pixels in the second feature map 250 that are equal to or greater than a predetermined value are filled with a predetermined color, but this is not limited to this. For example, the information contained in the second feature map 250 (such as the degree of abnormality at each pixel position) may be visualized and displayed by surrounding an area in the second feature map 250 that has pixels that are equal to or greater than a predetermined value with a line.

以上のように、推論段階では、学習モデル410(420)に対して対象物の撮影画像(入力画像210)を入力することによって、当該対象物の異常が検出される。 As described above, in the inference stage, an abnormality in an object is detected by inputting a captured image of the object (input image 210) into the learning model 410 (420).

<1-6.比較例>
つぎに、比較例に係る学習モデル910について説明する。
<1-6. Comparative Example>
Next, a learning model 910 according to a comparative example will be described.

図25は、比較例に係る学習モデル910を示す図である。この学習モデル910は、第1特徴マップ230の生成までは、第1実施形態に係る学習モデル410と同様の構成を有している。学習モデル910は、一般的な構成を備える畳み込みニューラルネットワーク(CNN)である。 FIG. 25 is a diagram showing a learning model 910 according to a comparative example. This learning model 910 has a similar configuration to the learning model 410 according to the first embodiment up to the generation of the first feature map 230. The learning model 910 is a convolutional neural network (CNN) having a general configuration.

学習モデル910においては、第1特徴マップ230の生成よりも後においては、学習モデル410とは異なる処理が行われる。 In learning model 910, after the generation of the first feature map 230, processing is performed differently from that in learning model 410.

具体的には、学習モデル910においては、第1特徴マップ230に対してグローバルアベレージプーリング(GAP:Global Average Pooling)処理(以下、GAP処理とも称する)が施される。換言すれば、特徴抽出層320の次に、GAP処理を実行するプーリング層940を備える。 Specifically, in the learning model 910, a global average pooling (GAP) process (hereinafter also referred to as GAP process) is performed on the first feature map 230. In other words, the feature extraction layer 320 is followed by a pooling layer 940 that performs GAP process.

GAP処理は、「チャンネル全体」を対象とする平均プーリング処理である。GAP処理は、対象の特徴マップ(ここでは第1特徴マップ230)のチャンネル毎の平均画素値を(チャンネル毎に)抽出する処理である。各チャンネルの(W1×H1)個(W1=H1=32の場合、1024個)の画素の平均値がチャンネル毎に抽出される。第1特徴マップ230がC1個(たとえば、512個)のチャンネルを有する場合には、C1個の平均値(チャンネル毎の平均値)が抽出される。 GAP processing is an average pooling process that targets "all channels." GAP processing is a process that extracts (for each channel) the average pixel value for each channel of the target feature map (here, the first feature map 230). The average value of (W1 x H1) pixels (1024 pixels when W1 = H1 = 32) in each channel is extracted for each channel. If the first feature map 230 has C1 channels (for example, 512 channels), C1 average values (average values for each channel) are extracted.

そして、これらC1個の平均値が1次元状に配列され(1次元のベクトル形式に変換され)(1次元配列950参照)、全結合層960に受け渡される。全結合層960は、複数の階層構造を有する。換言すれば、複数の全結合層960が設けられる。さらに、全結合層960の次に出力層970が設けられる。出力層970には、分類先の数に応じたノードが設けられ、各ノードに対してそれぞれ出力値が算出される。 The C1 average values are then arranged one-dimensionally (converted into one-dimensional vector format) (see one-dimensional array 950) and passed to the fully connected layer 960. The fully connected layer 960 has a multi-layer structure. In other words, multiple fully connected layers 960 are provided. Furthermore, an output layer 970 is provided next to the fully connected layer 960. The output layer 970 has nodes according to the number of classification destinations, and an output value is calculated for each node.

<1-7.実施形態の効果>
上述の比較例においては、第1特徴マップ230に対してGAP処理が施されている。チャンネル内の全体的な特徴を捉えるためには、GAP(全体平均プーリング)処理は有用である。
1-7. Effects of the embodiment
In the above comparative example, the GAP process is performed on the first feature map 230. GAP (global average pooling) process is useful for capturing the overall features within a channel.

しかしながら、撮影画像内の異常(特に微小な傷等)を検出したい場合にGAP処理を用いると、第1特徴マップ230の各チャンネル内の微小な傷等の情報が消えてしまう可能性が高い。異常の画素と正常の画素との双方を含む複数の画素の画素値が平均化されてしまうからである。特に、多数の正常画素の中に少数の異常画素が存在する場合には、当該少数の異常画素の情報は平均化処理によって消えてしまう可能性が非常に高い。それ故、画像内における微小な異常(傷など)を見過ごす可能性がある。たとえば、図14の第2特徴マップ250に対して仮にGAP処理を施すと、その出力値は、非常に微小な値(0.039(=(1+0.4)/36))になる。その結果、異常ではないと判定されてしまう。 However, if GAP processing is used to detect abnormalities (especially minute scratches, etc.) in a captured image, there is a high possibility that information about minute scratches, etc. in each channel of the first feature map 230 will be lost. This is because the pixel values of multiple pixels, including both abnormal and normal pixels, are averaged. In particular, if there are a small number of abnormal pixels among a large number of normal pixels, it is very likely that the information about the small number of abnormal pixels will be lost by the averaging process. Therefore, there is a possibility that minute abnormalities (such as scratches) in the image will be overlooked. For example, if GAP processing is performed on the second feature map 250 in FIG. 14, the output value will be a very small value (0.039 (= (1 + 0.4) / 36)). As a result, it will be determined that there is no abnormality.

一方、上記第1実施形態においては、図6および図14等に示されるようにGMP(全体最大プーリング)処理が第2特徴マップ250に対して実行されている。当該GMP処理によれば、第2特徴マップ250内の一のチャンネル内の複数((W2×H2)個の画素)のうち、1つでも異常画素が存在すれば、当該異常画素の値が出力値270として出力される。たとえば、第2特徴マップ250内の一のチャンネル内の256個の全画素のうち、1つでも異常を表す画素値(たとえば正規化された状態で「1」に近い画素値)を有する画素が存在すれば、「1」に近い当該画素値が出力値270として出力される。すなわち、出力値270として異常の情報が消えずに残る(「1」に近い最大値が出力される)。したがって、異常画素の見逃しを防止することが可能である。 On the other hand, in the first embodiment, as shown in FIG. 6 and FIG. 14, GMP (global maximum pooling) processing is performed on the second feature map 250. According to the GMP processing, if there is even one abnormal pixel among the multiple ((W2×H2) pixels) in one channel in the second feature map 250, the value of the abnormal pixel is output as the output value 270. For example, if there is even one pixel among all 256 pixels in one channel in the second feature map 250 that has a pixel value that indicates an abnormality (for example, a pixel value close to "1" in a normalized state), the pixel value close to "1" is output as the output value 270. In other words, the abnormal information remains as the output value 270 (the maximum value close to "1" is output). Therefore, it is possible to prevent abnormal pixels from being overlooked.

このように、微小な傷等の異常を見逃すことなく検出することが可能である。 In this way, it is possible to detect even the smallest defects, such as scratches, without missing them.

ここにおいて、GMP処理を用いると、微小な傷に過剰に反応する(ノイズ等を拾う)可能性もある。しかしながら、微小な傷等の異常検出においては、異常の過検出(正常であるのに異常として検出すること)よりも異常の見逃しを回避することが好ましい。換言すれば、(GAP処理等を伴うことに起因して)異常の見逃しが発生するよりは、GMP処理で過剰に異常検出される方が好ましい。 Here, if GMP processing is used, there is a possibility of overreacting to minute scratches (picking up noise, etc.). However, when detecting abnormalities such as minute scratches, it is preferable to avoid missing an abnormality rather than overdetecting an abnormality (detecting something normal as abnormal). In other words, it is preferable to have an abnormality overdetected by GMP processing rather than missing an abnormality (due to the inclusion of GAP processing, etc.).

上述の学習モデル410は、第2特徴マップ250に対してグローバルマックスプーリング(GMP)処理を施して得られる値を使用して機械学習されるので、第2特徴マップ250における異常情報が平均化処理によって失われてしまうことを回避できる。したがって、第2特徴マップ250に関する平均化処理が行われる場合に比べて、画像内における微小な異常の見過ごしを抑制し、より的確に異常を検出することが可能である。 The above-mentioned learning model 410 is machine-trained using values obtained by performing global max pooling (GMP) processing on the second feature map 250, so that it is possible to prevent abnormality information in the second feature map 250 from being lost due to averaging processing. Therefore, compared to the case where averaging processing is performed on the second feature map 250, it is possible to suppress overlooking minute abnormalities in the image and detect abnormalities more accurately.

また、上記実施形態においては、GMP処理を施すプーリング層(GMP層)360よりも後(出力側ないし後段)には全結合層が設けられない。換言すれば、学習モデル410は、GMP層360よりも後には(後の処理には)全結合層を有しない。ここで、全結合層は、その全ての入力値を1次元状に配列した入力値ベクトルと各入力値に対する重み付け係数を1次元状に配列した重み付けベクトルとの内積(あるいは当該内積に更にバイアスを加算した値)を各出力側ノードへの出力値として出力する処理が行われる層である。当該内積は、当該全ての入力値にそれぞれ重み(重み付け係数)を乗じた値を合算(加算)した積和値である、とも表現される。なお、畳み込み層は、その全ての入力値のうちの一部の入力値(或る画素位置近傍の画素値のみ)を対象にして積和値(内積)を求める処理が行われる層である点等において、全結合層と相違する。 In the above embodiment, a fully connected layer is not provided after the pooling layer (GMP layer) 360 that performs GMP processing (on the output side or in the subsequent stage). In other words, the learning model 410 does not have a fully connected layer after the GMP layer 360 (in subsequent processing). Here, the fully connected layer is a layer in which a process is performed to output the inner product (or a value obtained by further adding a bias to the inner product) of an input value vector in which all input values are arranged one-dimensionally and a weighting vector in which weighting coefficients for each input value are arranged one-dimensionally as an output value to each output side node. The inner product is also expressed as a product-sum value obtained by adding (adding) values obtained by multiplying each of the input values by a weight (weighting coefficient). Note that the convolution layer differs from the fully connected layer in that the convolution layer is a layer in which a product-sum value (inner product) is obtained for some of the input values (only pixel values in the vicinity of a certain pixel position) among all the input values.

一方、仮にGMP層360の後に全結合層が配置されると、機械学習される際に、全結合層にて最適化が行われる可能性がある。その場合、その直前の第2特徴マップ250内での位置と入力画像210内での異常位置とが対応付けて抽出されなくなる可能性がある。換言すれば、第2特徴マップ250内での画素値分布が入力画像210内での異常位置との直接的な関連性を有しなくなる可能性がある。 On the other hand, if a fully connected layer is placed after the GMP layer 360, optimization may be performed in the fully connected layer during machine learning. In that case, the immediately preceding position in the second feature map 250 and the abnormal position in the input image 210 may no longer be extracted in correspondence with each other. In other words, the pixel value distribution in the second feature map 250 may no longer have a direct correlation with the abnormal position in the input image 210.

これに対して、GMP処理を施すプーリング層360よりも後には全結合層が設けられないことによれば、第2特徴マップ250内での異常位置は、入力画像210内での異常位置との対応関係を維持している可能性が高い。したがって、入力画像210内での大まかな異常位置情報を正確に抽出することが可能である。 In contrast, since no fully connected layer is provided after the pooling layer 360 that performs GMP processing, it is highly likely that the abnormality positions in the second feature map 250 maintain a correspondence with the abnormality positions in the input image 210. Therefore, it is possible to accurately extract rough information about the abnormality positions in the input image 210.

換言すれば、上記実施形態の学習モデル410においては、第2特徴マップ250に対してGMP処理を施して得られる値(第2特徴マップ250のチャンネル内の最大値)が正解データと比較されて、学習モデル410の機械学習が実行される。あるいは、当該最大値に対して学習パラメータを乗じることなく当該最大値を変換した変換値(活性化関数(たとえば、シグモイド関数)等で正規化した値等)が正解データと比較されて、当該機械学習が実行される。すなわち、第2特徴マップ250に対してGMP処理を施して得られる最大値に対して学習パラメータが乗じられることなく(介在することなく)出力された出力値と正解データとが比較されて、学習モデル410の機械学習が実行される。それ故、第2特徴マップ250内での異常位置は、入力画像210内での異常位置との対応関係を維持している可能性が高い。したがって、入力画像210内での大まかな異常位置情報を正確に抽出することが可能である。 In other words, in the learning model 410 of the above embodiment, the value (maximum value in the channel of the second feature map 250) obtained by performing the GMP process on the second feature map 250 is compared with the correct answer data, and the machine learning of the learning model 410 is executed. Alternatively, the converted value (a value normalized by an activation function (e.g., a sigmoid function) or the like) obtained by converting the maximum value without multiplying the maximum value by the learning parameter is compared with the correct answer data, and the machine learning of the learning model 410 is executed. In other words, the output value output without multiplying (without intervening) the maximum value obtained by performing the GMP process on the second feature map 250 by the learning parameter is compared with the correct answer data, and the machine learning of the learning model 410 is executed. Therefore, it is highly likely that the abnormality position in the second feature map 250 maintains a correspondence relationship with the abnormality position in the input image 210. Therefore, it is possible to accurately extract rough abnormality position information in the input image 210.

端的に言えば、GMP層360の直後に出力層370が設けられているので、GMP層360からの出力値がほぼそのまま(そのままの値あるいは活性化関数等によって変換された値)学習モデル410の出力値として出力される。これによれば、GMP層360の直前の第2特徴マップ250において、入力画像210内での異常位置との対応関係を維持することが可能である。 In short, since the output layer 370 is provided immediately after the GMP layer 360, the output value from the GMP layer 360 is output almost as is (either as is or converted by an activation function or the like) as the output value of the learning model 410. This makes it possible to maintain a correspondence with the anomaly position in the input image 210 in the second feature map 250 immediately before the GMP layer 360.

また、上述のように、画像処理装置30は、第2特徴マップ250に基づき可視化した情報を表示部35bに表示する。したがって、ユーザ(操作者)は、入力画像210内での大まかな異常位置を容易に把握することが可能である。 As described above, the image processing device 30 displays the visualized information based on the second feature map 250 on the display unit 35b. Therefore, the user (operator) can easily grasp the rough location of the abnormality in the input image 210.

<2.第2実施形態>
上記第1実施形態では、第2特徴マップ250が単一チャンネルを有する場合について例示したが、これに限定されない。たとえば、第2特徴マップ250は複数のチャンネルで有しても良い。第2実施形態では、このような態様について説明する。
<2. Second embodiment>
In the above-described first embodiment, the second feature map 250 has a single channel, but is not limited thereto. For example, the second feature map 250 may have a plurality of channels. In the second embodiment, such an aspect will be described.

図15は、第2実施形態に係る学習モデル410(410Bとも称する)を示す概念図である。図15に示されるように、学習モデル410Bの第2特徴マップ250は、複数(C2個)のチャンネルを有している。 Figure 15 is a conceptual diagram showing a learning model 410 (also referred to as 410B) according to the second embodiment. As shown in Figure 15, the second feature map 250 of the learning model 410B has multiple (C2) channels.

上記第1実施形態では、図8あるいは図9に示すように、1個の1×1×C1サイズの畳み込みフィルタ341、あるいは1個のN×N×C1サイズの畳み込みフィルタ342を用いて、単一チャンネルのみを有する第2特徴マップ250が生成される。 In the first embodiment, as shown in FIG. 8 or FIG. 9, a second feature map 250 having only a single channel is generated using one convolution filter 341 of size 1×1×C1 or one convolution filter 342 of size N×N×C1.

一方、この第2実施形態では、図16あるいは図17に示すように、C2個の1×1×C1サイズの畳み込みフィルタ341、あるいはC2個のN×N×C1サイズの畳み込みフィルタ342を用いて、C2個(複数)のチャンネルを有する第2特徴マップ250が生成される。 On the other hand, in this second embodiment, as shown in FIG. 16 or FIG. 17, a second feature map 250 having C2 (multiple) channels is generated using C2 convolution filters 341 of size 1×1×C1 or C2 convolution filters 342 of size N×N×C1.

まず、図16を参照しつつ、C2個のチャンネルを有する第2特徴マップ250が1×1×C1のサイズの畳み込みフィルタ341を用いて生成される処理について説明する。 First, referring to FIG. 16, we will explain the process of generating a second feature map 250 having C2 channels using a convolution filter 341 of size 1×1×C1.

C2個の1×1×C1サイズの畳み込みフィルタ341のうちの第k畳み込みフィルタ341(ただし、k=1,...,C2)は、第2特徴マップ250の第kチャンネルの各画素位置の画素値を算出するためのフィルタである。第k畳み込みフィルタ341は、第1特徴マップ230の複数(C1個)のチャンネルにおける同一位置の画素値を重み付け加算するフィルタ(当該同一位置の画素値を統合するフィルタ)である。なお、C2個の畳み込みフィルタ341は、基本的には互いに異なる値で構成される。 The kth convolution filter 341 (where k = 1, ..., C2) of the C2 1x1xC1 size convolution filters 341 is a filter for calculating pixel values at each pixel position of the kth channel of the second feature map 250. The kth convolution filter 341 is a filter that performs weighted addition of pixel values at the same position in multiple (C1) channels of the first feature map 230 (a filter that integrates pixel values at the same position). Note that the C2 convolution filters 341 are basically composed of mutually different values.

第2特徴マップ250の第kチャンネルは、第k畳み込みフィルタ341によって、第1実施形態と同様に生成される。詳細には、第k畳み込みフィルタ341と第1特徴マップ230の複数のチャンネルにおける或る画素位置(i,j)の画素値とに基づき、第2特徴マップ250(詳細には、その第kチャンネル)の対応画素位置(i,j)の画素値を算出する処理が実行される。そして、そのような処理が、第1特徴マップ230の他の全ての画素位置の画素についてもそれぞれ同様に実行される。これによって、第2特徴マップ250(詳細には、その第kチャンネル)の他の全ての画素位置の画素値が算出される。 The kth channel of the second feature map 250 is generated by the kth convolution filter 341 in the same manner as in the first embodiment. In detail, a process is performed to calculate a pixel value of a corresponding pixel position (i, j) of the second feature map 250 (specifically, the kth channel) based on the kth convolution filter 341 and the pixel value of a certain pixel position (i, j) in the multiple channels of the first feature map 230. Then, such a process is similarly performed for each of the pixels at all other pixel positions of the first feature map 230. As a result, pixel values of all other pixel positions of the second feature map 250 (specifically, the kth channel) are calculated.

より具体的には、まず、第1畳み込みフィルタ341を用いて、第1実施形態と同様にして、第2特徴マップ250の第1チャンネルの全ての画素位置の画素値が算出される。 More specifically, first, the pixel values of all pixel positions in the first channel of the second feature map 250 are calculated using the first convolution filter 341 in the same manner as in the first embodiment.

つぎに、第2畳み込みフィルタ341を用いて、同様にして、第2特徴マップ250の第2チャンネルの全ての画素位置の画素値が算出される。 Then, the pixel values of all pixel positions in the second channel of the second feature map 250 are calculated in a similar manner using the second convolution filter 341.

その後、値kをインクリメントしつつ値kがC2に到達するまで同様の動作(残りの第k畳み込みフィルタ341を用いて、第2特徴マップ250の第kチャンネルを生成する処理)が実行される。これによって、C2チャンネルを有する第2特徴マップ250が生成される。 Then, the same operation (the process of generating the kth channel of the second feature map 250 using the remaining kth convolution filter 341) is performed while incrementing the value k until the value k reaches C2. This generates the second feature map 250 having the C2 channel.

このように、第k畳み込みフィルタ341を用いて第2特徴マップ250の第kチャンネル内の各画素位置の画素値(全ての画素位置の画素値)を算出する処理が、所定回数(C2回)実行される(k=1,...,C2)。これによって、第2特徴マップ250における所定数(C2個)のチャンネルが生成される。 In this manner, the process of calculating the pixel values of each pixel position (pixel values of all pixel positions) in the kth channel of the second feature map 250 using the kth convolution filter 341 is executed a predetermined number (C2 times) (k=1, ..., C2). This generates a predetermined number (C2) of channels in the second feature map 250.

次に、図17を参照しつつ、C2個のチャンネルを有する第2特徴マップ250がN×N×C1のサイズの畳み込みフィルタ342を用いて生成される処理について説明する。 Next, referring to FIG. 17, we will explain the process of generating a second feature map 250 having C2 channels using a convolution filter 342 of size N×N×C1.

C2個のN×N×C1サイズの畳み込みフィルタ342のうちの第k畳み込みフィルタ342は、第2特徴マップ250の第kチャンネルの各画素位置の画素値を算出するためのフィルタである。第k畳み込みフィルタ342は、第1特徴マップ230の複数(C1個)のチャンネルにおける同一位置およびその近傍位置の画素値を重み付け加算するフィルタ(当該同一位置およびその近傍位置の画素値を統合するフィルタ)である。なお、C2個の畳み込みフィルタ342は、基本的には互いに異なる値で構成される。 The kth convolution filter 342 of the C2 convolution filters 342 of size NxNxC1 is a filter for calculating pixel values at each pixel position of the kth channel of the second feature map 250. The kth convolution filter 342 is a filter that performs weighted addition of pixel values at the same position and its neighboring positions in multiple (C1) channels of the first feature map 230 (a filter that integrates pixel values at the same position and its neighboring positions). Note that the C2 convolution filters 342 are basically composed of different values from each other.

図17でも、第2特徴マップ250の第kチャンネルは、第k畳み込みフィルタ342によって、第1実施形態(図9参照)と同様に生成される。また、図16と比較すると、第k畳み込みフィルタ341に代えて、第k畳み込みフィルタ342を用いることによって、第2特徴マップ250の第kチャンネルが生成される。 In FIG. 17, the k-th channel of the second feature map 250 is generated by the k-th convolution filter 342 in the same manner as in the first embodiment (see FIG. 9). Also, compared to FIG. 16, the k-th channel of the second feature map 250 is generated by using the k-th convolution filter 342 instead of the k-th convolution filter 341.

詳細には、第k畳み込みフィルタ342と、第1特徴マップ230の複数のチャンネルにおける或る画素位置(i,j)およびその近傍画素位置の画素値とに基づき、第2特徴マップ250(詳細には、その第kチャンネル)の対応画素位置(i,j)の画素値を算出する処理が実行される。そして、そのような処理が、第1特徴マップ230の他の全ての画素位置の画素についてもそれぞれ同様に実行される。これによって、第2特徴マップ250(詳細には、その第kチャンネル)の他の全ての画素位置の画素値が算出される。 In detail, a process is performed in which the kth convolution filter 342 calculates a pixel value at a corresponding pixel position (i, j) in the second feature map 250 (specifically, the kth channel) based on a pixel position (i, j) and the pixel values of its neighboring pixel positions in the multiple channels of the first feature map 230. Then, the same process is similarly performed for each of the pixels at all other pixel positions in the first feature map 230. In this way, pixel values at all other pixel positions in the second feature map 250 (specifically, the kth channel) are calculated.

このような処理がC2個の畳み込みフィルタ342を用いて繰り返し実行されることによって、第2特徴マップ250のC2個のチャンネルの全てに関して、チャンネル内の全ての画素位置の画素値が算出される。より具体的には、第k畳み込みフィルタ342を用いて第2特徴マップ250の第kチャンネルを生成する処理が、値kをインクリメントしつつ値kが「1」から「C2」に到達するまでC2回実行される。これによって、C2チャンネルを有する第2特徴マップ250が生成される。 By repeatedly performing this process using C2 convolution filters 342, pixel values are calculated for all pixel positions in the channels for all C2 channels of the second feature map 250. More specifically, the process of generating the kth channel of the second feature map 250 using the kth convolution filter 342 is performed C2 times while incrementing the value k until the value k reaches "C2" from "1". This generates the second feature map 250 having C2 channels.

以上のようにして、C2個(複数)のチャンネルを有する第2特徴マップ250が生成される。ここでは、第2特徴マップ250は、第1特徴マップ230のチャンネル数C1よりも低減された2以上のチャンネルを有するものとする。すなわち、値C2は、値C1(第1特徴マップ230のチャンネル数)よりも小さい。たとえば、C2=2である。ただし、これに限定されず、値C2は、3以上であってもよい。また、値C2は、値C1と同じでもよく、或いは値C1よりも大きくてもよい。 In this manner, the second feature map 250 having C2 (multiple) channels is generated. Here, the second feature map 250 has two or more channels, which is a reduced number of channels compared to the number of channels C1 of the first feature map 230. That is, the value C2 is smaller than the value C1 (the number of channels of the first feature map 230). For example, C2=2. However, this is not limited to this, and the value C2 may be 3 or more. Furthermore, the value C2 may be the same as the value C1, or may be larger than the value C1.

図18には、2つのチャンネルを有する第2特徴マップ250(C2=2)が出力される様子が示されている。 Figure 18 shows how a second feature map 250 (C2=2) with two channels is output.

ここでは、W2×H2×2のサイズの第2特徴マップ250(2つのチャンネルを有する第2特徴マップ250)に対して、GMP処理が施される。当該GMP処理によって第2特徴マップ250内の2つのチャンネル251,252のそれぞれについて、チャンネル毎の最大画素値が抽出される。具体的には、第2特徴マップ250の第1チャンネル251内の最大値が第1チャンネル251の出力として得られるとともに、第2特徴マップ250の第2チャンネル252内の最大値が第2チャンネル252の出力として得られる。さらに、チャンネル毎の出力が活性化関数(たとえば、シグモイド関数)等によって正規化され、「0」~「1」の値に変換されて、学習モデル410の出力層370から出力される。 Here, GMP processing is performed on the second feature map 250 (second feature map 250 having two channels) with a size of W2×H2×2. The GMP processing extracts the maximum pixel value for each of the two channels 251, 252 in the second feature map 250. Specifically, the maximum value in the first channel 251 of the second feature map 250 is obtained as the output of the first channel 251, and the maximum value in the second channel 252 of the second feature map 250 is obtained as the output of the second channel 252. Furthermore, the output for each channel is normalized by an activation function (for example, a sigmoid function) or the like, converted to a value between "0" and "1", and output from the output layer 370 of the learning model 410.

学習段階では、図18に示されるように、正解データとの比較が行われる。ここで、第1チャンネル251の正解データと第2チャンネル252の正解データとは互いに異なる種類の正解データである。たとえば、第1チャンネル251の正解データは、「微小な傷」の有無に関する正解データであり、第2チャンネル252の正解データは、「微小な裂け」の有無に関する正解データである。なお、これに限定されず、各チャンネルの正解データは、他の種類の正解データ(たとえば、「微小な汚れ」等)であってもよい。 In the learning stage, as shown in FIG. 18, a comparison with correct answer data is made. Here, the correct answer data of the first channel 251 and the correct answer data of the second channel 252 are different types of correct answer data. For example, the correct answer data of the first channel 251 is correct answer data regarding the presence or absence of "microscopic scratches," and the correct answer data of the second channel 252 is correct answer data regarding the presence or absence of "microscopic tears." However, this is not limited to this, and the correct answer data of each channel may be other types of correct answer data (for example, "microscopic stains," etc.).

このような正解データに基づく機械学習を行うことによって、第1チャンネル251の出力値は「微小な傷」の有無を示す値を出力するように学習され、第2チャンネル252の出力値は「微小な裂け」の有無を示す値を出力するように学習される。 By performing machine learning based on such correct answer data, the output value of the first channel 251 is trained to output a value indicating the presence or absence of "microscopic scratches," and the output value of the second channel 252 is trained to output a value indicating the presence or absence of "microscopic tears."

このような第2実施形態によっても第1実施形態と同様の効果を得ることが可能である。また、第2実施形態の学習モデル410の機械学習においては、2以上のチャンネルを有する第2特徴マップ250に対してGMP処理を施してチャンネルごとに得られた複数の最大値は平均化されない。具体的には、当該複数の最大値を平均化することなく当該複数の最大値をそれぞれ変換(活性化関数等によって変換)した各変換値(あるいは最大値自体)が、それぞれ正解データと比較されている。これによれば、複数の種類の特徴量が平均化されずにそれぞれ抽出され得るので、複数の種類の異常(微小な傷、微小な裂け、および微小な汚れ等)のそれぞれを個別に且つ適切に検出することが可能である。 The second embodiment can achieve the same effect as the first embodiment. In the machine learning of the learning model 410 of the second embodiment, the multiple maximum values obtained for each channel by performing GMP processing on the second feature map 250 having two or more channels are not averaged. Specifically, each of the multiple maximum values is converted (by an activation function or the like) without averaging the multiple maximum values, and each converted value (or the maximum value itself) is compared with the correct answer data. In this way, multiple types of feature amounts can be extracted without averaging, so that multiple types of abnormalities (such as minute scratches, minute tears, and minute stains) can be detected individually and appropriately.

また、ここでは、GMP処理によるチャンネル毎の出力値(複数の出力値)がそれぞれ正規化されているが、これに限定されない。たとえば、図19に示されるように、GMP処理によるチャンネル毎の複数の出力値がソフトマックス関数によって纏めて正規化されてもよい。詳細には、GMP処理によるチャンネル毎の複数の出力値に対して更にソフトマックス関数による処理を施し、その処理結果を正解データと比較することによって機械学習が行われてもよい。この場合には、複数の種類の異常(たとえば、「微小な傷」と「微小な裂け」と「微小な汚れ」とを含む複数の種類の異常)のうちのいずれが発生しているかを判定するために好適な出力が得られる。換言すれば、複数の種類の異常(たとえば、「微小な傷」と「微小な裂け」と「微小な汚れ」とを含む異常)のそれぞれの発生の可能性が相対的に判定され得る。 In addition, here, the output values (multiple output values) for each channel by the GMP processing are normalized, but this is not limited to this. For example, as shown in FIG. 19, the multiple output values for each channel by the GMP processing may be normalized together by a softmax function. In detail, the multiple output values for each channel by the GMP processing may be further processed by a softmax function, and the processing result may be compared with the correct answer data to perform machine learning. In this case, an output suitable for determining which of multiple types of abnormalities (for example, multiple types of abnormalities including "micro scratches", "micro tears", and "micro stains") has occurred is obtained. In other words, the possibility of occurrence of each of multiple types of abnormalities (for example, abnormalities including "micro scratches", "micro tears", and "micro stains") can be relatively determined.

<3.第3実施形態>
上記各実施形態においては、第2特徴マップ250の全てのチャンネルに対してGMP処理が施されているが、これに限定されない。たとえば、第2特徴マップ250の全C2チャンネルのうちの一部のチャンネルに対してのみGMP処理が施されてもよい。第3実施形態では、このような態様について説明する。
<3. Third embodiment>
In each of the above embodiments, the GMP process is applied to all channels of the second feature map 250, but is not limited to this. For example, the GMP process may be applied to only some of all C2 channels of the second feature map 250. In the third embodiment, such an aspect will be described.

図20は、第3実施形態に係る学習モデル410(410Cとも称する)を示す図である。学習モデル410Cにおいては、第2実施形態に係る学習モデル410(410B)と同様に、C1チャンネルを有する第2特徴マップ250が生成される。 Figure 20 is a diagram showing a learning model 410 (also referred to as 410C) according to the third embodiment. In the learning model 410C, a second feature map 250 having a C1 channel is generated, similar to the learning model 410 (410B) according to the second embodiment.

ただし、その後、第2特徴マップ250の全C2チャンネルのうちの一部のチャンネルに対してのみGMP処理が施され、全C2チャンネルのうちの残りのチャンネルに対してはGAP処理が施される。 However, thereafter, GMP processing is applied to only a portion of all C2 channels in the second feature map 250, and GAP processing is applied to the remaining C2 channels.

具体的には、図21に示されるように、たとえば、第2特徴マップ250が全部で5つのチャンネルを有する場合(すなわちC2=5の場合)、第1チャンネルから第3チャンネルまでに対してはGMP処理が施され、第4チャンネルから第5チャンネルまでに対してはGAP処理が施される。換言すれば、第1チャンネルから第3チャンネルまでに対してはGMP層360が設けられ、第4チャンネルから第5チャンネルまでに対してはGAP層369が設けられる。 Specifically, as shown in FIG. 21, for example, when the second feature map 250 has a total of five channels (i.e., when C2=5), GMP processing is performed on the first to third channels, and GAP processing is performed on the fourth to fifth channels. In other words, a GMP layer 360 is provided for the first to third channels, and a GAP layer 369 is provided for the fourth to fifth channels.

学習段階では、第1チャンネルから第3チャンネルまでの複数のチャンネルに対してGMP処理を施して得られる値を使用して機械学習が実行される。具体的には、第1チャンネルから第3チャンネルまでに対するGMP処理後の各出力と、入力画像210の微小な異常(たとえば、微小な傷、微小な裂け、微小な汚れ)の有無に関する正解データとの差異を低減するように機械学習が行われる。これによれば、各種類の微小な異常の有無等が正確に判定可能となるような学習モデル410(学習済みモデル420)が生成される。 In the learning stage, machine learning is performed using values obtained by performing GMP processing on multiple channels from the first channel to the third channel. Specifically, machine learning is performed to reduce the difference between each output after GMP processing on the first channel to the third channel and the correct answer data regarding the presence or absence of minute abnormalities (for example, minute scratches, minute tears, minute stains) in the input image 210. This generates a learning model 410 (trained model 420) that can accurately determine the presence or absence of each type of minute abnormality.

また、第4チャンネルから第5チャンネルまでの複数のチャンネルに対してGAP処理を施して得られる値を使用して機械学習が実行される。具体的には、第4チャンネルから第5チャンネルまでに対するGAP処理後の各出力と、入力画像210の大きな異常(たとえば、大きな汚れ、全体的な歪み等)の有無に関する正解データとの差異を低減するように機械学習が行われる。これによれば、各種類の大きな異常(画像内の比較的広い範囲に亘る異常)の有無等が正確に判定可能となるような学習モデル410(学習済みモデル420)が生成される。 Machine learning is also performed using values obtained by performing GAP processing on multiple channels from the fourth channel to the fifth channel. Specifically, machine learning is performed to reduce the difference between each output after GAP processing on the fourth channel to the fifth channel and the correct answer data regarding the presence or absence of major abnormalities (e.g., large stains, overall distortion, etc.) in the input image 210. This generates a learning model 410 (trained model 420) that can accurately determine the presence or absence of each type of major abnormality (anomalies that span a relatively wide area in the image).

一方、推論段階では、第1チャンネルから第3チャンネルまでに対するGMP処理後の各出力を用いて、入力画像210の微小な異常(たとえば、微小な傷、微小な裂け、微小な汚れ)の有無等を正確に推定することが可能である。また、第4チャンネルから第5チャンネルまでに対するGAP処理後の各出力を用いて、入力画像210における大きな異常(画像内の比較的広い範囲に亘る異常)の有無等を正確に推定することが可能である。 On the other hand, in the inference stage, the presence or absence of minute abnormalities (for example, minute scratches, minute tears, minute stains) in the input image 210 can be accurately estimated using the outputs after GMP processing for the first to third channels. Also, the presence or absence of major abnormalities (abnormalities covering a relatively wide area within the image) in the input image 210 can be accurately estimated using the outputs after GAP processing for the fourth to fifth channels.

<4.変形例等>
以上、この発明の実施の形態について説明したが、この発明は上記説明した内容のものに限定されるものではない。
4. Modifications, etc.
Although the embodiment of the present invention has been described above, the present invention is not limited to the above-described contents.

たとえば、上記実施形態においては、画像処理装置30が学習処理と推論処理との双方を実行している。しかしながら、これに限定されず、学習処理と推論処理とが別々の装置(30A,30B)によって実現されてもよい。この場合、推論処理を実行する装置30Bは、たとえば、学習処理を実行した装置30Aによって生成された学習済みモデル420に関する情報(学習済みの学習パラメータ等)を当該装置30Aから取得し、当該学習済みモデル420を利用すればよい。 For example, in the above embodiment, the image processing device 30 executes both the learning process and the inference process. However, this is not limited to the above, and the learning process and the inference process may be realized by separate devices (30A, 30B). In this case, the device 30B that executes the inference process may obtain, for example, information (learned learning parameters, etc.) related to the trained model 420 generated by the device 30A that executed the learning process from the device 30A, and use the trained model 420.

1 画像処理システム
20 撮影装置
30 画像処理装置(学習モデル生成装置)
35b 表示部
200 畳み込みニューラルネットワーク
210 入力画像
230 第1特徴マップ
245 暫定特徴マップ
250 第2特徴マップ
270 スコア(出力値)
310 入力層
320 特徴抽出層
340 畳み込み層
341,342 フィルタ
360 プーリング層(GMP層)
370 出力層
410,420 学習モデル
530 ヒートマップ
1 Image processing system 20 Photographing device 30 Image processing device (learning model generating device)
35b Display unit 200 Convolutional neural network 210 Input image 230 First feature map 245 Temporary feature map 250 Second feature map 270 Score (output value)
310 Input layer 320 Feature extraction layer 340 Convolution layer 341, 342 Filter 360 Pooling layer (GMP layer)
370 Output layer 410, 420 Learning model 530 Heat map

Claims (17)

各撮影画像を入力とし前記各撮影画像内の異常に関する情報を出力とする教師データを用いて機械学習された学習モデルに基づき、対象物の撮影画像内の異常を検出する制御部、
を備え、
前記学習モデルは、畳み込みニューラルネットワークにおける中間的な特徴マップであって複数のチャンネルを有する特徴マップである第1特徴マップに基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合した第2特徴マップを生成するとともに当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値を使用して機械学習されたモデルであり、
前記制御部は、前記学習モデルに対して前記対象物の前記撮影画像を入力することによって、前記対象物の異常を検出することを特徴とする画像処理装置。
a control unit that detects an abnormality in a photographed image of an object based on a learning model that is machine-learned using teacher data in which each photographed image is input and information regarding an abnormality in each of the photographed images is output;
Equipped with
the learning model is a model that is machine-learned by generating a second feature map by integrating pixel values at the same position and/or adjacent positions of each channel in a first feature map , the second feature map being an intermediate feature map in a convolutional neural network and having a plurality of channels, and performing a global max pooling process on the second feature map;
The image processing device is characterized in that the control unit detects abnormalities in the object by inputting the captured image of the object to the learning model.
前記第1特徴マップは、前記畳み込みニューラルネットワークにおいて入力層の後に設けられた複数の畳み込み層と複数のプーリング層とを含む中間層によって生成されることを特徴とする、請求項1に記載の画像処理装置。 The image processing device according to claim 1, characterized in that the first feature map is generated by an intermediate layer including multiple convolution layers and multiple pooling layers provided after an input layer in the convolutional neural network. 前記畳み込みニューラルネットワークは、前記第2特徴マップに対して前記グローバルマックスプーリング処理を施すプーリング層よりも後には全結合層を有しないことを特徴とする、請求項1または請求項2に記載の画像処理装置。 The image processing device according to claim 1 or 2, characterized in that the convolutional neural network does not have a fully connected layer subsequent to a pooling layer that performs the global max pooling process on the second feature map. 前記学習モデルは、前記第2特徴マップに対して前記グローバルマックスプーリング処理を施して得られる最大値、あるいは当該最大値に対して学習パラメータを乗じることなく当該最大値を変換した変換値を、正解データと比較して、機械学習されたモデルであることを特徴とする、請求項3に記載の画像処理装置。 The image processing device according to claim 3, characterized in that the learning model is a machine-learned model that is machine-learned by comparing the maximum value obtained by performing the global max pooling process on the second feature map, or a transformed value obtained by transforming the maximum value without multiplying the maximum value by a learning parameter, with correct answer data. 前記学習モデルは、2以上のチャンネルを有する前記第2特徴マップに対して前記グローバルマックスプーリング処理を施してチャンネルごとに得られた複数の最大値を平均化することなく当該複数の最大値をそれぞれ変換した各変換値を、正解データと比較して、機械学習されたモデルであることを特徴とする、請求項3または請求項4に記載の画像処理装置。 The image processing device according to claim 3 or 4, characterized in that the learning model is a machine-learned model obtained by performing the global max pooling process on the second feature map having two or more channels, converting each of the multiple maximum values obtained for each channel without averaging the multiple maximum values, and comparing the converted values with correct answer data. 前記第2特徴マップの生成処理は、前記第1特徴マップの複数のチャンネルにおける同一画素位置の画素値を重み付け加算する1×1畳み込みフィルタを用いて統合し、前記第2特徴マップのチャンネル内の各画素位置の画素値を算出する処理を含むことを特徴とする、請求項1から請求項5のいずれかに記載の画像処理装置。 The image processing device according to any one of claims 1 to 5, characterized in that the process of generating the second feature map includes a process of integrating pixel values at the same pixel position in multiple channels of the first feature map using a 1x1 convolution filter that weights and adds them, and calculating a pixel value at each pixel position in the channel of the second feature map. 前記第2特徴マップの生成処理は、前記第1特徴マップの複数のチャンネルのそれぞれに対する畳み込み処理後の暫定特徴マップの複数のチャンネルにおける同一画素位置の画素値を重み付け加算して統合し、前記第2特徴マップのチャンネル内の各画素位置の画素値を算出する処理を含むことを特徴とする、請求項1から請求項5のいずれかに記載の画像処理装置。 The image processing device according to any one of claims 1 to 5, characterized in that the process of generating the second feature map includes a process of integrating pixel values at the same pixel position in multiple channels of a provisional feature map after convolution processing for each of the multiple channels of the first feature map by weighted addition, and calculating a pixel value at each pixel position in the channel of the second feature map. 前記第2特徴マップの生成処理は、前記第1特徴マップの複数のチャンネルにおける同一位置および/または近傍位置の画素値を統合した画素値を重み付け加算する畳み込みフィルタを用いて、前記第2特徴マップの一のチャンネル内の各画素位置の画素値を算出する処理を、所定回数実行することによって、前記第2特徴マップにおける所定数のチャンネルを生成する処理を含むことを特徴とする、請求項1から請求項5のいずれかに記載の画像処理装置。 The image processing device according to any one of claims 1 to 5, characterized in that the process of generating the second feature map includes a process of calculating pixel values at each pixel position in one channel of the second feature map a predetermined number of times using a convolution filter that weights and adds pixel values obtained by integrating pixel values at the same position and/or adjacent positions in multiple channels of the first feature map, thereby generating a predetermined number of channels in the second feature map. 前記第2特徴マップは、前記第1特徴マップのチャンネル数よりも低減された2以上のチャンネルを有し、
前記学習モデルは、前記2以上のチャンネルの少なくとも一部に対して前記グローバルマックスプーリング処理を施して得られる値を使用して機械学習されたモデルであることを特徴とする、請求項1から請求項8のいずれかに記載の画像処理装置。
the second feature map has two or more channels that are reduced in number from the number of channels of the first feature map;
9. The image processing device according to claim 1, wherein the learning model is a model that is machine-learned using values obtained by performing the global max pooling process on at least a portion of the two or more channels.
前記第2特徴マップは、単一チャンネルを有する特徴マップであり、
前記学習モデルは、前記単一チャンネルに対して前記グローバルマックスプーリング処理を施して得られる値を使用して機械学習されたモデルであることを特徴とする、請求項1から請求項8のいずれかに記載の画像処理装置。
the second feature map is a feature map having a single channel;
The image processing device according to claim 1 , wherein the learning model is a model machine-learned using a value obtained by performing the global max pooling process on the single channel.
前記制御部は、前記第2特徴マップに基づき可視化した情報を所定の表示部に表示することを特徴とする、請求項1から請求項10のいずれかに記載の画像処理装置。 The image processing device according to any one of claims 1 to 10, characterized in that the control unit displays the information visualized based on the second feature map on a predetermined display unit. a)各撮影画像を入力とし前記各撮影画像内の異常に関する情報を出力とする教師データを用いて機械学習された学習モデルに基づき、対象物の撮影画像内の異常を検出するステップ、
を備え、
前記学習モデルは、畳み込みニューラルネットワークにおける中間的な特徴マップであって複数のチャンネルを有する特徴マップである第1特徴マップに基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合した第2特徴マップを生成するとともに当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値を使用して機械学習されたモデルであり、
前記ステップa)においては、前記学習モデルに対して前記対象物の前記撮影画像を入力することによって、前記対象物の異常が検出されることを特徴とする画像処理方法。
a) detecting anomalies in a photographed image of an object based on a learning model machine-learned using teacher data in which each photographed image is input and information regarding anomalies in each of the photographed images is output;
Equipped with
the learning model is a model that is machine-learned by generating a second feature map by integrating pixel values at the same position and/or adjacent positions of each channel in a first feature map , the second feature map being an intermediate feature map in a convolutional neural network and having a plurality of channels, and performing a global max pooling process on the second feature map;
An image processing method characterized in that in the step a), an abnormality in the object is detected by inputting the captured image of the object to the learning model.
a)各撮影画像を入力とし前記各撮影画像内の異常に関する情報を出力とする教師データを用いて機械学習された学習モデルに基づき、対象物の撮影画像内の異常を検出するステップ、
をコンピュータに実行させるためのプログラムであって、
前記学習モデルは、畳み込みニューラルネットワークにおける中間的な特徴マップであって複数のチャンネルを有する特徴マップである第1特徴マップに基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合した第2特徴マップを生成するとともに当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値を使用して機械学習されたモデルであり、
前記ステップa)においては、前記学習モデルに対して前記対象物の前記撮影画像を入力することによって、前記対象物の異常が検出されることを特徴とするプログラム。
a) detecting anomalies in a photographed image of an object based on a learning model machine-learned using teacher data in which each photographed image is input and information regarding anomalies in each of the photographed images is output;
A program for causing a computer to execute the above,
the learning model is a model that is machine-learned by generating a second feature map by integrating pixel values at the same position and/or adjacent positions of each channel in a first feature map , the second feature map being an intermediate feature map in a convolutional neural network and having a plurality of channels, and performing a global max pooling process on the second feature map;
A program characterized in that in the step a), an abnormality in the object is detected by inputting the captured image of the object to the learning model.
撮影画像を入力し前記撮影画像内の異常に関する情報を出力する学習モデルを生成する学習モデル生成装置であって、
前記学習モデルの畳み込みニューラルネットワークにおける中間的な特徴マップであって複数のチャンネルを有する特徴マップである第1特徴マップに基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合した第2特徴マップを生成し、当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値を使用して、前記学習モデルにおける機械学習を実行する制御部、
を備えることを特徴とする学習モデル生成装置。
A learning model generation device that receives a captured image and generates a learning model that outputs information about an abnormality in the captured image,
a control unit that generates a second feature map by integrating pixel values at the same position and/or adjacent positions of each channel in a first feature map, the second feature map being an intermediate feature map in a convolutional neural network of the learning model and having a plurality of channels, based on the first feature map, and executes machine learning in the learning model using a value obtained by performing a global max pooling process on the second feature map;
A learning model generation device comprising:
撮影画像を入力し前記撮影画像内の異常に関する情報を出力する学習モデルを製造する学習モデル製造方法であって、
a)前記学習モデルの畳み込みニューラルネットワークにおける中間的な特徴マップであって複数のチャンネルを有する特徴マップである第1特徴マップに基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合した第2特徴マップを生成し、当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値を使用して、前記学習モデルにおける機械学習を実行するステップ、
を備えることを特徴とする学習モデル製造方法。
A learning model production method for producing a learning model that inputs a captured image and outputs information about an anomaly in the captured image, comprising:
a) generating a second feature map by integrating pixel values at the same position and/or adjacent positions of each channel in a first feature map, the second feature map being an intermediate feature map in a convolutional neural network of the learning model and having a plurality of channels, based on the first feature map, and performing machine learning in the learning model using values obtained by performing a global max pooling process on the second feature map;
A learning model production method comprising:
推論対象画像の入力に対して前記推論対象画像内の異常に関する情報を出力するように機械学習された学習済みモデルであって、A trained model that has been machine-learned to output information regarding an anomaly in an inference target image in response to an input of the inference target image,
畳み込みニューラルネットワークにおける中間的な特徴マップであり且つ複数のチャンネルを有する特徴マップである第1特徴マップを、前記推論対象画像に対して生成する処理と、A process of generating a first feature map for the inference target image, the first feature map being an intermediate feature map in a convolutional neural network and having a plurality of channels;
前記第1特徴マップに基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合して第2特徴マップを生成する処理と、A process of generating a second feature map by integrating pixel values at the same position and/or adjacent positions of each channel in the first feature map based on the first feature map;
当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値に基づき前記異常に関する情報を出力する処理と、a process of outputting information related to the anomaly based on a value obtained by performing a global max pooling process on the second feature map;
をコンピュータに実行させるための学習済みモデル。A trained model for running the above on a computer.
a)撮影画像を入力し前記撮影画像内の異常に関する情報を出力する学習モデルの畳み込みニューラルネットワークにおける中間的な特徴マップであって複数のチャンネルを有する特徴マップである第1特徴マップに基づき前記第1特徴マップにおける各チャンネルの同一位置および/または近傍位置の画素値を統合した第2特徴マップを生成し、当該第2特徴マップに対してグローバルマックスプーリング処理を施して得られる値を使用して、前記学習モデルにおける機械学習を実行するステップ、
をコンピュータに実行させるためのプログラム。
a) generating a second feature map by integrating pixel values at the same position and/or adjacent positions of each channel in a first feature map, the second feature map being an intermediate feature map having a plurality of channels in a convolutional neural network of a learning model that inputs a captured image and outputs information about anomalies in the captured image, and performing machine learning in the learning model using values obtained by performing a global max pooling process on the second feature map;
A program for causing a computer to execute the following.
JP2020185265A 2020-11-05 2020-11-05 IMAGE PROCESSING DEVICE, IMAGE PROCESSING METHOD, LEARNING MODEL GENERATION DEVICE, LEARNING MODEL PRODUCTION METHOD, LEARNED MODEL, AND PROGRAM Active JP7627564B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020185265A JP7627564B2 (en) 2020-11-05 2020-11-05 IMAGE PROCESSING DEVICE, IMAGE PROCESSING METHOD, LEARNING MODEL GENERATION DEVICE, LEARNING MODEL PRODUCTION METHOD, LEARNED MODEL, AND PROGRAM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020185265A JP7627564B2 (en) 2020-11-05 2020-11-05 IMAGE PROCESSING DEVICE, IMAGE PROCESSING METHOD, LEARNING MODEL GENERATION DEVICE, LEARNING MODEL PRODUCTION METHOD, LEARNED MODEL, AND PROGRAM

Publications (2)

Publication Number Publication Date
JP2022074861A JP2022074861A (en) 2022-05-18
JP7627564B2 true JP7627564B2 (en) 2025-02-06

Family

ID=81606174

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020185265A Active JP7627564B2 (en) 2020-11-05 2020-11-05 IMAGE PROCESSING DEVICE, IMAGE PROCESSING METHOD, LEARNING MODEL GENERATION DEVICE, LEARNING MODEL PRODUCTION METHOD, LEARNED MODEL, AND PROGRAM

Country Status (1)

Country Link
JP (1) JP7627564B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7431372B1 (en) 2023-05-09 2024-02-14 株式会社小野測器 Anomaly detection device and anomaly detection method
CN117650909A (en) * 2023-10-25 2024-03-05 湖北公众信息产业有限责任公司 Data security monitoring system and method for communication network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017187840A (en) 2016-04-01 2017-10-12 富士ゼロックス株式会社 Image pattern recognition device and program
JP2019118814A (en) 2017-12-28 2019-07-22 株式会社トプコン Imaging system with machine learning guide
US20200175352A1 (en) 2017-03-14 2020-06-04 University Of Manitoba Structure defect detection using machine learning algorithms
JP2020144659A (en) 2019-03-07 2020-09-10 キヤノン株式会社 Data processing device and its method, program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017187840A (en) 2016-04-01 2017-10-12 富士ゼロックス株式会社 Image pattern recognition device and program
US20200175352A1 (en) 2017-03-14 2020-06-04 University Of Manitoba Structure defect detection using machine learning algorithms
JP2019118814A (en) 2017-12-28 2019-07-22 株式会社トプコン Imaging system with machine learning guide
JP2020144659A (en) 2019-03-07 2020-09-10 キヤノン株式会社 Data processing device and its method, program

Also Published As

Publication number Publication date
JP2022074861A (en) 2022-05-18

Similar Documents

Publication Publication Date Title
KR102256181B1 (en) Method of inspecting and evaluating coating state of steel structure and system for the same
EP3948201B1 (en) Segmentation and prediction of low-level temporal plume patterns
JP6912008B2 (en) Machine vision system
CN111738344B (en) A fast target detection method based on multi-scale fusion
WO2022104178A1 (en) Inverting neural radiance fields for pose estimation
CN110168710A (en) Data for the fault detection based on convolutional neural networks expand
JP7547069B2 (en) Information processing device, information processing method and program for information processing device
JP2012026982A (en) Inspection device
den Bieman et al. Deep learning video analysis as measurement technique in physical models
JP2013224833A (en) Visual inspection device, visual inspection method and computer program
JP7481956B2 (en) Inference device, method, program and learning device
JP7627564B2 (en) IMAGE PROCESSING DEVICE, IMAGE PROCESSING METHOD, LEARNING MODEL GENERATION DEVICE, LEARNING MODEL PRODUCTION METHOD, LEARNED MODEL, AND PROGRAM
CN114187263B (en) Wear surface lambertian reflection separation method integrating priori guidance and domain adaptation
US20230005120A1 (en) Computer and Visual Inspection Method
CN117576095A (en) A metal surface defect detection and classification method for multi-scale learning tasks
Park et al. Advanced cover glass defect detection and classification based on multi-DNN model
CN113116377A (en) Ultrasonic imaging navigation method, ultrasonic device and storage medium
CN119559341B (en) AI analysis method and system based on unidirectional mirror image
JP7772067B2 (en) Gas concentration feature quantity estimation device, gas concentration feature quantity estimation method, program, and gas concentration feature quantity inference model generation device
CN113160313A (en) Transparent object grabbing control method and device, terminal and storage medium
JP2022045688A (en) Defect management device, method, and program
CN107832771A (en) The medium of the system and record process meteorological data program of process meteorological data device and method including process meteorological data device
CN115909157A (en) A recognition and detection method, device, equipment and medium based on machine vision
JP2023128940A (en) Appearance analysis system, appearance analysis method, and program
JPWO2020031422A1 (en) Object detection method, object detection device and computer program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20231016

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20240924

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20241031

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: 20250121

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20250127

R150 Certificate of patent or registration of utility model

Ref document number: 7627564

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150