JP6951913B2 - Classification model generator, image data classification device and their programs - Google Patents
Classification model generator, image data classification device and their programs Download PDFInfo
- Publication number
- JP6951913B2 JP6951913B2 JP2017170806A JP2017170806A JP6951913B2 JP 6951913 B2 JP6951913 B2 JP 6951913B2 JP 2017170806 A JP2017170806 A JP 2017170806A JP 2017170806 A JP2017170806 A JP 2017170806A JP 6951913 B2 JP6951913 B2 JP 6951913B2
- Authority
- JP
- Japan
- Prior art keywords
- classification
- image data
- filter
- main direction
- region
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Image Analysis (AREA)
Description
本発明は、画像データを分類するための畳み込みニューラルネットワークで構成される分類モデルを生成する分類モデル生成装置、分類モデルにより画像データを分類する画像データ分類装置およびそれらのプログラムに関する。 The present invention relates to a classification model generator that generates a classification model composed of a convolutional neural network for classifying image data, an image data classification device that classifies image data by the classification model, and a program thereof.
従来、画像データを分類する手法として、畳み込みニューラルネットワーク(Convolutional Neural Network:CNN)を用いた手法が用いられている(非特許文献1,2等)。
ここで、図12,図13を参照して、CNNの一例についてその概要を説明する。CNNは、図12に示すように、入力層Iと、隠れ層Hと、出力層Oとの各層で構成される。各層は、複数のノード(ユニット)をエッジで結んだ構造を有する。なお、図12ではCNNの説明を簡易にするため、各層の数を少なくし、入力画像の大きさを小さくして説明している。
Conventionally, as a method for classifying image data, a method using a convolutional neural network (CNN) has been used (Non-Patent
Here, an outline of an example of CNN will be described with reference to FIGS. 12 and 13. As shown in FIG. 12, the CNN is composed of an input layer I, a hidden layer H, and an output layer O. Each layer has a structure in which a plurality of nodes (units) are connected by edges. In FIG. 12, in order to simplify the explanation of CNN, the number of each layer is reduced and the size of the input image is reduced.
入力層Iは、分類対象となる画像データ(入力画像)を入力する層である。
隠れ層Hは、複数の畳み込み層C(C1,C2,…)およびプーリング層P(P1,P2,…)と、全結合層F(F1,F2,…)とを介して、入力画像から特徴量(特徴マップ)を抽出する層である。なお、隠れ層Hは、畳み込み層Cを連続して設けたり、正規化層を設けたり等、図12の構成には限定されない。
The input layer I is a layer for inputting image data (input image) to be classified.
The hidden layer H is provided via a plurality of convolution layers C (C 1 , C 2 , ...), a pooling layer P (P 1 , P 2 , ...), And a fully connected layer F (F 1 , F 2 , ...). This is a layer for extracting features (feature maps) from the input image. The hidden layer H is not limited to the configuration shown in FIG. 12, such as providing a convolution layer C continuously or providing a normalized layer.
畳み込み層Cは、入力画像、あるいは、前層の出力となる特徴マップに対して、複数の畳み込みフィルタによって画像の畳み込み演算を行うものである。図12では、例えば、畳み込み層C1において、24×24画素の入力画像に対して、4つの畳み込みフィルタによって畳み込み演算を行うことで、4つの20×20画素の特徴マップM1(4@20×20)を生成した例を示している。 The convolution layer C performs an image convolution calculation on the input image or the feature map that is the output of the previous layer by a plurality of convolution filters. In FIG. 12, for example, in the convolution layer C 1 , a feature map M 1 (4 @ 20) of four 20 × 20 pixels is performed by performing a convolution operation on an input image of 24 × 24 pixels by four convolution filters. An example of generating × 20) is shown.
この畳み込み層Cは、図13に示すように、畳み込みフィルタCfの大きさ(ここでは、3×3画素)に対応する前の層(第L層)の画像に対して、順次、畳み込みフィルタCfを移動させて畳み込み処理を行い、活性化関数f(例えば、正規化線形関数max(0,x))による演算を行うことで、次の層(第(L+1)層)の画素値を求める。なお、ここでは、畳み込みフィルタCfを4つとし、第L層の画像から、4つの第(L+1)層の特徴マップを生成した例を示している。 As shown in FIG. 13, the convolution layer C sequentially refers to the image of the previous layer (Lth layer) corresponding to the size of the convolution filter Cf (here, 3 × 3 pixels). Is moved to perform a convolution process, and an operation is performed by the activation function f (for example, the normalized linear function max (0, x)) to obtain the pixel value of the next layer (third (L + 1) layer). Here, an example is shown in which the convolution filters Cf are set to four and the feature maps of the four (L + 1) layers are generated from the image of the L layer.
プーリング層Pは、畳み込み層Cで生成される特徴マップMをサブサンプリングするものである。図12では、例えば、プーリング層P1において、4つの20×20画像の特徴マップM1(4@20×20)に対して、水平垂直にそれぞれ1/2のサブサンプリングを行うことで、4つの10×10画像の特徴マップM2(4@10×10)を生成した例を示している。 The pooling layer P subsamples the feature map M generated by the convolution layer C. In FIG. 12, for example, in the pooling layer P 1, with respect to the four 20 × 20 image feature map M 1 (4 @ 20 × 20), by performing half the subsampling horizontally vertically, respectively, 4 An example of generating a feature map M 2 (4 @ 10 × 10) of two 10 × 10 images is shown.
全結合層Fは、複数の畳み込み層Cおよびプーリング層Pを介して生成される特徴マップを1次元のベクトルとする多層パーセプトロンである。この全結合層Fは、複数の層(F1,F2,…)で構成され、各層のノードは次の層のノードとすべて繋がっている。
出力層Oは、入力画像の分類結果を確率値として出力する層である。この出力層Oは、全結合層Fの出力をすべて接続した分類対象と同じノード数を持ち、活性化関数(例えばソフマックス関数)により、ノードごとの確率値を出力する。
このCNNは、学習段階において、分類が既知の複数の画像データにより、各層のパラメータ(ネットワーク)を学習し、分類段階において、学習したパラメータにより、分類が未知の画像データを分類する。
The fully connected layer F is a multi-layer perceptron having a feature map generated through a plurality of convolution layers C and a pooling layer P as a one-dimensional vector. This fully connected layer F is composed of a plurality of layers (F 1 , F 2 , ...), And the nodes of each layer are all connected to the nodes of the next layer.
The output layer O is a layer that outputs the classification result of the input image as a probability value. This output layer O has the same number of nodes as the classification target to which all the outputs of the fully connected layer F are connected, and outputs the probability value for each node by the activation function (for example, the Sofmax function).
This CNN learns the parameters (network) of each layer from a plurality of image data whose classification is known in the learning stage, and classifies the image data whose classification is unknown by the learned parameters in the classification stage.
前記したCNNは、画像データから特徴量を抽出するために、畳み込みフィルタを移動させながら畳み込み処理を行っている。この畳み込みフィルタは、画像データの内容に依存せず、常にフィルタの向きは一定である。
例えば、図14に示すように、同じオブジェクト(一例として、「家」の画像)が異なる画像データ内で傾いた状態であった場合、図14(a),(b),(c)において、オブジェクトの同一領域(「煙突部分」の画像領域)で畳み込みフィルタCfにより畳み込み処理を行って特徴量を抽出すると、同じオブジェクトの同一領域であっても、それぞれ異なった特徴量が抽出されることになる。
そのため、従来のCNNは、図14(a),(b),(c)の各画像データに同一のオブジェクトが含まれていても、オブジェクトが傾くことで異なるオブジェクトを含んだ画像データとして分類してしまうことになる。
The CNN described above performs a convolution process while moving the convolution filter in order to extract a feature amount from the image data. This convolution filter does not depend on the content of the image data, and the direction of the filter is always constant.
For example, as shown in FIG. 14, when the same object (for example, an image of “house”) is tilted in different image data, in FIGS. 14 (a), (b), and (c), When features are extracted by performing convolution processing with the convolution filter Cf in the same area of the object (image area of the "chimney part"), different features are extracted even in the same area of the same object. Become.
Therefore, the conventional CNN classifies as image data including different objects by tilting the objects even if the same objects are included in the image data of FIGS. 14 (a), (b), and (c). Will end up.
これらの画像データ内のオブジェクトを同一のオブジェクトとして認識するためには、オブジェクトを様々な方向に傾けた画像データを学習データとして、CNNを学習する必要がある。
このように、従来のCNNを用いた画像データの分類手法は、様々な方向のオブジェクトを含んだ画像データを学習データとして準備する必要があり、学習データの量と学習に要する時間が膨大になってしまうという問題がある。
In order to recognize the objects in these image data as the same object, it is necessary to learn CNN by using the image data in which the objects are tilted in various directions as learning data.
As described above, in the conventional image data classification method using CNN, it is necessary to prepare image data including objects in various directions as learning data, and the amount of training data and the time required for learning become enormous. There is a problem that it will end up.
そこで、本発明は、1つの方向のオブジェクトの画像データからCNN(分類モデル)を学習するだけで、画像データ内のオブジェクトの向きに関わらず同一のオブジェクトとして認識し、画像データを分類することが可能な分類モデルを生成する分類モデル生成装置、その分類モデルを用いて画像データを分類する画像データ分類装置およびそれらのプログラムを提供することを課題とする。 Therefore, in the present invention, it is possible to classify the image data by recognizing it as the same object regardless of the orientation of the objects in the image data only by learning the CNN (classification model) from the image data of the objects in one direction. An object of the present invention is to provide a classification model generator that generates a possible classification model, an image data classification device that classifies image data using the classification model, and a program thereof.
前記課題を解決するため、本発明に係る分類モデル生成装置は、分類が既知の複数の画像データから、分類が未知の画像データを分類するための畳み込みニューラルネットワークである分類モデルを生成する分類モデル生成装置であって、領域別主方向推定手段と、分類モデル学習手段と、を備える構成とした。 In order to solve the above problems, the classification model generator according to the present invention generates a classification model which is a convolutional neural network for classifying image data whose classification is unknown from a plurality of image data whose classification is known. The generator is configured to include a region-specific main direction estimation means and a classification model learning means.
かかる構成において、分類モデル生成装置は、領域別主方向推定手段によって、分類が既知の画像データから、畳み込みニューラルネットワークの最初の畳み込み層の畳み込みフィルタを適用するフィルタ領域ごとに、画像のエッジ成分の主たる方向(主方向)を推定する。なお、エッジ成分の主方向は、ソーベルフィルタ等を用いて推定することができる。 In such a configuration, the classification model generator uses the region-specific main direction estimation means to apply the convolution filter of the first convolutional layer of the convolutional neural network from the image data whose classification is known, for each filter region of the image. Estimate the main direction (main direction). The main direction of the edge component can be estimated by using a Sobel filter or the like.
そして、分類モデル生成装置は、分類モデル学習手段によって、分類が既知の画像データと分類内容を示す教師データとから、畳み込みニューラルネットワークを学習し分類モデルを生成する。このとき、分類モデル学習手段は、最初の畳み込み層において、フィルタ領域ごとに、フィルタ領域の予め定めた基準の向きが、領域別主方向推定手段で推定されたエッジ成分の主方向に対して一定方向となるようフィルタ領域を回転させ、その回転した領域に対して、空間フィルタである畳み込みフィルタを適用して畳み込み演算を行う。
これによって、分類モデル学習手段は、最初の畳み込み層において、画像データ内のオブジェクトの向きに対してほぼ不変な特徴量を抽出することができる。
なお、分類モデル生成装置は、コンピュータを、前記した各手段として機能させるための分類モデル生成プログラムで動作させることができる。
Then, the classification model generation device learns the convolutional neural network from the image data whose classification is known and the teacher data indicating the classification contents by the classification model learning means, and generates the classification model. At this time, in the classification model learning means, in the first convolution layer, the orientation of the predetermined reference of the filter region is constant with respect to the main direction of the edge component estimated by the region-specific main direction estimation means for each filter region. The filter area is rotated so as to be in the direction, and a convolution filter, which is a spatial filter, is applied to the rotated area to perform a convolution operation.
As a result, the classification model learning means can extract features that are almost invariant to the orientation of the objects in the image data in the first convolutional layer.
The classification model generation device can be operated by a classification model generation program for operating the computer as each of the above-mentioned means.
また、前記課題を解決するため、本発明に係る画像データ分類装置は、モデル生成装置で生成された畳み込みニューラルネットワークである分類モデルを用いて、分類が未知の画像データを分類する画像データ分類装置であって、領域別主方向推定手段と、分類手段と、を備える構成とした。 Further, in order to solve the above problems, the image data classification device according to the present invention is an image data classification device that classifies image data whose classification is unknown by using a classification model which is a convolutional neural network generated by the model generation device. Therefore, the configuration is provided with a region-specific main direction estimation means and a classification means.
かかる構成において、画像データ分類装置は、領域別主方向推定手段によって、分類が未知の画像データから、畳み込みニューラルネットワークの最初の畳み込み層の畳み込みフィルタを適用するフィルタ領域ごとに、画像のエッジ成分の主方向を推定する。なお、エッジ成分の主方向は、ソーベルフィルタ等を用いて推定することができる。 In such a configuration, the image data classification device uses the region-specific main direction estimation means to apply the convolution filter of the first convolutional layer of the convolutional neural network from the image data whose classification is unknown, to the edge component of the image for each filter region. Estimate the main direction. The main direction of the edge component can be estimated by using a Sobel filter or the like.
そして、画像データ分類装置は、分類手段によって、分類モデルである畳み込みニューラルネットワークにより、分類が未知の画像データを分類する。このとき、分類手段は、最初の畳み込み層において、フィルタ領域ごとに、フィルタ領域の予め定めた基準の向きが、領域別主方向推定手段で推定されたエッジ成分の主方向に対して一定方向となるようにフィルタ領域を回転させ、その回転した領域に対して、空間フィルタである畳み込みフィルタを適用して畳み込み演算を行う。
これによって、分類手段は、最初の畳み込み層において、画像データ内のオブジェクトの向きに対してほぼ不変な特徴量を抽出することができる。
なお、画像データ分類装置は、コンピュータを、前記した各手段として機能させるための画像データ分類プログラムで動作させることができる。
Then, the image data classification device classifies the image data whose classification is unknown by the classification means and the convolutional neural network which is a classification model. At this time, in the first convolution layer, the classification means sets the orientation of the predetermined reference of the filter region as a constant direction with respect to the main direction of the edge component estimated by the region-specific main direction estimation means for each filter region. The filter area is rotated so as to be, and a convolution filter, which is a spatial filter, is applied to the rotated area to perform a convolution operation.
As a result, the classification means can extract features that are almost invariant to the orientation of the objects in the image data in the first convolution layer.
The image data classification device can be operated by an image data classification program for operating the computer as each of the above-mentioned means.
また、前記課題を解決するため、本発明に係る画像データ分類装置は、分類が既知の複数の画像データから、分類が未知の画像データを分類するための畳み込みニューラルネットワークである分類モデルを生成し、分類が未知の画像データを分類する画像データ分類装置であって、領域別主方向推定手段と、分類モデル学習手段と、分類手段と、を備える構成としてもよい。 Further, in order to solve the above problems, the image data classification device according to the present invention generates a classification model which is a convolutional neural network for classifying image data whose classification is unknown from a plurality of image data whose classification is known. , An image data classification device for classifying image data whose classification is unknown, and may be configured to include a region-specific main direction estimation means, a classification model learning means, and a classification means.
本発明は、以下に示す優れた効果を奏するものである。
本発明によれば、最初の畳み込み層において、畳み込みフィルタのフィルタ領域の予め定めた基準の向きを、フィルタ領域に対応する画像のエッジ成分の主方向に対して一定方向となるように回転して畳み込み演算を行うことで、画像データ内のオブジェクトの向きに対してほぼ不変な特徴量を抽出することができる。
これによって、本発明は、1つの方向のオブジェクトの画像データを学習データとして用いて分類モデルを学習すればよく、学習データの量と学習に要する時間を抑えることができる。また、本発明は、画像データ内のオブジェクトが傾いているか否かに関わらず同一のオブジェクトとして認識し、画像データを分類することができる。
The present invention has the following excellent effects.
According to the present invention, in the first convolution layer, the orientation of a predetermined reference of the filter region of the convolution filter is rotated so as to be a constant direction with respect to the main direction of the edge component of the image corresponding to the filter region. By performing the convolution operation, it is possible to extract a feature amount that is almost invariant with respect to the orientation of the object in the image data.
Thereby, in the present invention, the classification model may be learned by using the image data of the object in one direction as the learning data, and the amount of the learning data and the time required for the learning can be suppressed. Further, the present invention can classify the image data by recognizing the objects in the image data as the same object regardless of whether or not the objects are tilted.
以下、本発明の実施形態について図面を参照して説明する。
<画像データ分類装置の構成>
まず、図1を参照して、本発明の実施形態に係る画像データ分類装置1の構成について説明する。
画像データ分類装置1は、画像データを、画像データ内のオブジェクトにより分類するための畳み込みニューラルネットワーク(CNN;以下、分類モデルという)を学習し、その分類モデルを用いて、画像データを分類するものである。この画像データ分類装置1は、分類モデルを学習するモード(以下、「学習モードという」)と、画像データを分類するモード(以下、「分類モード」という)の2つの異なる動作モードを有する。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
<Configuration of image data classification device>
First, the configuration of the image
The image
学習モードにおいて、画像データ分類装置1は、分類が既知の画像データと、その分類内容を示す教師データとを学習データとして複数入力し、分類モデルを学習する。ここで、教師データは、例えば、分類対象が人物であれば、それぞれの人物を一意に特定する情報(例えば、人物名等)である。
分類モードにおいて、画像データ分類装置1は、分類が未知の画像データを入力し、分類モデルを用いて分類した結果(分類結果)を出力する。
以下、この2つの動作モードで動作する画像データ分類装置1の構成を詳細に説明する。
In the learning mode, the image
In the classification mode, the image
Hereinafter, the configuration of the image
画像データ分類装置1は、学習用データ入力手段10と、分類用データ入力手段11と、領域別主方向推定手段12と、領域別主方向記憶手段13と、分類モデル学習手段14と、分類モデル記憶手段15と、分類手段16と、を備える。
The image
学習用データ入力手段10は、学習データとして、分類が既知の画像データと、その分類内容を示す教師データとを入力するものである。この学習用データ入力手段10は、入力した画像データを、領域別主方向推定手段12および分類モデル学習手段14に出力する。また、学習用データ入力手段10は、入力した教師データを、分類モデル学習手段14に出力する。 The learning data input means 10 inputs image data whose classification is known and teacher data indicating the classification contents as learning data. The learning data input means 10 outputs the input image data to the area-specific main direction estimation means 12 and the classification model learning means 14. Further, the learning data input means 10 outputs the input teacher data to the classification model learning means 14.
分類用データ入力手段11は、分類が未知の画像データを入力するものである。この分類用データ入力手段11は、入力した画像データを、領域別主方向推定手段12および分類手段16に出力する。 The classification data input means 11 inputs image data whose classification is unknown. The classification data input means 11 outputs the input image data to the area-specific main direction estimation means 12 and the classification means 16.
領域別主方向推定手段12は、分類モデル(CNN)の最初の畳み込み層で行う畳み込み処理において畳み込みフィルタを適用する画像領域(フィルタ領域)ごとに、画像データのエッジ成分の主方向を推定するものである。この領域別主方向推定手段12は、学習モードにおいては画像データを学習用データ入力手段10から入力し、分類モードにおいては画像データを分類用データ入力手段11から入力する。 The area-specific main direction estimating means 12 estimates the main direction of the edge component of the image data for each image area (filter area) to which the convolution filter is applied in the convolution process performed in the first convolution layer of the classification model (CNN). Is. The region-specific main direction estimation means 12 inputs image data from the learning data input means 10 in the learning mode, and inputs image data from the classification data input means 11 in the classification mode.
図2に、畳み込み層において適用するフィルタ領域の大きさと移動量の例を示す。ここでは、畳み込みフィルタの大きさ(ここでは、3×3画素)と同じで、畳み込みフィルタの移動幅(ストライド:ここでは、水平・垂直方向ともに1画素)で移動させたフィルタ領域R,R,…,Rの例を示す。もちろん、畳み込みフィルタの大きさおよび移動幅は、これに限定されるものではない。
領域別主方向推定手段12は、図2に例示したフィルタ領域Rごとに、エッジ成分の主方向を推定する。なお、エッジ成分の主方向を推定する手法は、ソーベル(Sobel)フィルタを用いる等の一般的な手法を用いることができる。
FIG. 2 shows an example of the size and movement amount of the filter region applied in the convolution layer. Here, the size of the convolution filter (here, 3 × 3 pixels) is the same, and the filter areas R, R, which are moved by the movement width of the convolution filter (stride: here, 1 pixel in both the horizontal and vertical directions). ..., an example of R is shown. Of course, the size and movement width of the convolution filter are not limited to this.
The region-specific main direction estimating means 12 estimates the main direction of the edge component for each of the filter regions R illustrated in FIG. As a method for estimating the main direction of the edge component, a general method such as using a Sobel filter can be used.
ここで、ソーベルフィルタを用いて、フィルタ領域Rのエッジ成分の主方向を推定する手法について簡単に説明する。
まず、領域別主方向推定手段12は、図3に例示したソーベルフィルタ((a)縦方向ソーベルフィルタ、(b)横方向ソーベルフィルタ)を用い、フィルタ領域Rの画素ごとに、近接画素の画素値からエッジ成分の勾配強度および勾配方向を演算する。
ここで、フィルタ領域Rの(x,y)座標の画素に、図3(a)の縦方向ソーベルフィルタを適用した値をfx(x,y)、図3(b)の横方向ソーベルフィルタを適用した値をfy(x,y)としたとき、領域別主方向推定手段12は、以下の式(1)により、(x,y)座標の画素のエッジ成分の勾配強度G(x,y)を求め、以下の式(2)により、(x,y)座標の画素のエッジ成分の勾配方向θ(x,y)を求める。
Here, a method of estimating the main direction of the edge component of the filter region R using the Sobel filter will be briefly described.
First, the area-specific main direction estimating means 12 uses the sobel filter ((a) vertical sobel filter, (b) horizontal sobel filter) illustrated in FIG. 3, and is close to each pixel of the filter area R. The gradient strength and gradient direction of the edge component are calculated from the pixel value of the pixel.
Here, the values obtained by applying the vertical sobel filter of FIG. 3 (a) to the pixels of the (x, y) coordinates of the filter area R are fx (x, y), and the horizontal saw of FIG. 3 (b). When the value to which the bell filter is applied is set to f y (x, y), the region-specific main direction estimation means 12 uses the following equation (1) to determine the gradient intensity G of the edge component of the pixel at the (x, y) coordinate. (X, y) is obtained, and the gradient direction θ (x, y) of the edge component of the pixel at the (x, y) coordinate is obtained by the following equation (2).
これによって、図4(a)に示すように、フィルタ領域Rの画素ごとに、エッジ成分の勾配強度(ベクトルの長さ)および勾配方向(ベクトルの方向)を求めることができる。そして、領域別主方向推定手段12は、図4(a)に示した画素ごとのエッジ成分の勾配方向を、図4(b)に示すように量子化(例えば、5°単位で量子化)して、勾配方向ごとの勾配強度を累計したヒストグラムを生成する。 Thereby, as shown in FIG. 4A, the gradient intensity (vector length) and the gradient direction (vector direction) of the edge component can be obtained for each pixel of the filter region R. Then, the region-specific main direction estimating means 12 quantizes the gradient direction of the edge component for each pixel shown in FIG. 4 (a) as shown in FIG. 4 (b) (for example, quantized in units of 5 °). Then, a histogram that accumulates the gradient intensities for each gradient direction is generated.
そして、領域別主方向推定手段12は、図4(b)に示したヒストグラムにおける勾配強度の累計がピークとなる勾配方向を、フィルタ領域Rのエッジ成分の主方向として推定する。なお、領域別主方向推定手段12は、明確なピークを検出できない場合、エッジ成分の主方向が存在しないこととし、例えば、主方向を0°とする。ここで、ヒストグラムに明確なピークが存在するか否かは、例えば、勾配強度の最も大きい累計値に対する2番目に大きい累計値の割合が予め定めた割合よりも大きい場合等とすればよい。
図1に戻って、画像データ分類装置1の構成について説明を続ける。
Then, the region-specific main direction estimating means 12 estimates the gradient direction at which the cumulative gradient intensity in the histogram shown in FIG. 4B peaks as the main direction of the edge component of the filter region R. If the region-specific main direction estimation means 12 cannot detect a clear peak, it is assumed that the main direction of the edge component does not exist, and for example, the main direction is set to 0 °. Here, whether or not a clear peak exists in the histogram may be determined, for example, when the ratio of the second largest cumulative value to the highest cumulative value of the gradient intensity is larger than a predetermined ratio.
Returning to FIG. 1, the configuration of the image
領域別主方向推定手段12は、フィルタ領域R,R,…,R(図2)ごとのエッジ成分の主方向を、フィルタ領域Rの位置に対応付けて領域別主方向記憶手段13に記憶する。
この領域別主方向推定手段12は、画像データのすべてのフィルタ領域Rについてエッジ成分の主方向を推定した段階で、推定が完了したことを示す「推定完了通知」を、学習モードにおいては分類モデル学習手段14に通知し、分類モードにおいては分類手段16に通知する。
The area-specific main direction estimation means 12 stores the main direction of the edge component for each of the filter areas R, R, ..., R (FIG. 2) in the area-specific main direction storage means 13 in association with the position of the filter area R. ..
The region-specific main direction estimation means 12 provides a "estimation completion notification" indicating that the estimation is completed at the stage where the main directions of the edge components are estimated for all the filter regions R of the image data, in the learning mode, as a classification model. Notify the learning means 14, and in the classification mode, notify the classification means 16.
領域別主方向記憶手段13は、画像データのフィルタ領域の位置と、領域別主方向推定手段12で推定されたフィルタ領域に対応するエッジ成分の主方向とを対応付けて記憶するものである。この領域別主方向記憶手段13は、ハードディスク、半導体メモリ等の一般的な記憶媒体で構成することができる。
この領域別主方向記憶手段13に記憶されているフィルタ領域ごとのエッジ成分の主方向を、学習モードにおいては分類モデル学習手段14が参照し、分類モードにおいては分類手段16が参照する。
The area-specific main direction storage means 13 stores the position of the filter area of the image data in association with the main direction of the edge component corresponding to the filter area estimated by the area-specific main direction estimation means 12. The area-specific main direction storage means 13 can be configured by a general storage medium such as a hard disk or a semiconductor memory.
The classification model learning means 14 refers to the main direction of the edge component for each filter region stored in the region-specific main direction storage means 13 in the learning mode, and the classification means 16 refers to the edge component in the classification mode.
分類モデル学習手段14は、学習用データ入力手段10から入力される複数の学習データ(画像データ、教師データ)と、領域別主方向記憶手段13に記憶されているフィルタ領域ごとのエッジ成分の主方向とを用いて、分類が未知の画像データを分類する分類モデルである畳み込みニューラルネットワーク(CNN)を学習するものである。なお、分類モデルのパラメータ等の初期値は分類モデル記憶手段15に記憶されており、分類モデル学習手段14は、学習により、分類モデル記憶手段15に記憶されている分類モデルのパラメータを更新する。 The classification model learning means 14 is mainly composed of a plurality of learning data (image data, teacher data) input from the learning data input means 10 and edge components for each filter area stored in the area-specific main direction storage means 13. A convolutional neural network (CNN), which is a classification model for classifying image data whose classification is unknown, is learned by using directions. Initial values such as parameters of the classification model are stored in the classification model storage means 15, and the classification model learning means 14 updates the parameters of the classification model stored in the classification model storage means 15 by learning.
この分類モデル学習手段14は、CNNの最初の畳み込み層における畳み込み処理において、画像データのそれぞれのフィルタ領域を、エッジ成分の主方向に応じて所定角度回転させて、回転後のフィルタ領域に対して、畳み込み演算を行う。
図5(a)に示すように、例えば、画像データ内におけるあるフィルタ領域Rのエッジ成分の主方向が予め定めた基準方向(ここでは、画像の水平右方向〔0°方向〕とする)から30°の方向であった場合、分類モデル学習手段14は、図5(b)に示すように、フィルタ領域Rの中心Oを基準に30°回転させた領域を新たなフィルタ領域RNとする。なお、フィルタ領域Rの回転は、畳み込み対象のエリアを所定角度回転させるのみであり、領域内の画像を回転させるわけではない。
In the convolution process in the first convolution layer of the CNN, the classification model learning means 14 rotates each filter region of the image data by a predetermined angle according to the main direction of the edge component, and refers to the rotated filter region. , Performs a convolution operation.
As shown in FIG. 5A, for example, the main direction of the edge component of a certain filter region R in the image data is from a predetermined reference direction (here, the horizontal right direction [0 ° direction] of the image). In the case of the direction of 30 °, as shown in FIG. 5B, the classification model learning means 14 sets a region rotated by 30 ° with respect to the center O of the filter region R as a new filter region RN . .. Note that the rotation of the filter area R only rotates the area to be convolved by a predetermined angle, and does not rotate the image in the area.
そして、分類モデル学習手段14は、図5(c)に示すように、回転前のフィルタ領域Rの画素領域(a1,a2,…,a9)の画素値の代わりに、回転後のフィルタ領域RNの画素領域(b1,b2,…,b9)の画素値に対して、畳み込みフィルタを適用して畳み込み演算を行う。なお、厳密には、回転後のフィルタ領域RNの画素領域(b1,b2,…,b9)の画素値とは、フィルタ領域RNの画素領域(b1,b2,…,b9)のそれぞれの中心位置に対応する画素の画素値である。
これによって、分類モデル学習手段14は、フィルタ領域Rのエッジ成分の主方向がどの方向であっても、主方向に対して、畳み込みフィルタを適用する方向を同じにすることができる。
Then, as shown in FIG. 5C, the classification model learning means 14 replaces the pixel values of the pixel regions (a1, a2, ..., A9) of the filter region R before rotation with the filter region R after rotation. A convolution filter is applied to the pixel values in the N pixel region (b1, b2, ..., B9) to perform a convolution operation. Strictly speaking, the filter region R N of the pixel region after the rotation (b1, b2, ..., b9 ) and the pixel value of the pixel area of the filter region R N (b1, b2, ..., b9 ) of each It is a pixel value of a pixel corresponding to the center position.
As a result, the classification model learning means 14 can make the direction in which the convolution filter is applied the same as the main direction regardless of the main direction of the edge component of the filter region R.
そして、分類モデル学習手段14は、図6に示すように、画像データのフィルタ領域を順次移動させる際に、エッジ成分の主方向に応じてフィルタ領域を回転させ、回転したフィルタ領域に畳み込みフィルタCfを適用して畳み込み処理を行う。
このように、分類モデル学習手段14は、CNNの最初の畳み込み層において、すべてのフィルタ領域Rで、エッジ成分の主方向に対して畳み込みフィルタの向きが一定となるように畳み込み処理を行う。これにより、画像データ内のオブジェクトが傾いているか否かに関わらず、フィルタ領域ごとにほぼ不変な特徴量としてCNNの次の層に伝播させることができる。
図1に戻って、画像データ分類装置1の構成について説明を続ける。
Then, as shown in FIG. 6, the classification model learning means 14 rotates the filter area according to the main direction of the edge component when the filter area of the image data is sequentially moved, and convolves the filter Cf into the rotated filter area. Is applied to perform the convolution process.
As described above, the classification model learning means 14 performs the convolution process in the first convolution layer of the CNN so that the direction of the convolution filter is constant with respect to the main direction of the edge component in all the filter regions R. As a result, regardless of whether the object in the image data is tilted or not, it can be propagated to the next layer of the CNN as a feature amount that is almost invariant for each filter region.
Returning to FIG. 1, the configuration of the image
分類モデル学習手段14は、最初の畳み込み層においてのみ、エッジ成分の主方向に応じた畳み込み処理を行い、以降の処理(2段目以降の畳み込み層、プーリング層、全結合層、出力層;図12参照)は、従来のCNNと同じ処理を行う。
そして、分類モデル学習手段14は、入力された画像データに対応して出力層から出力される分類結果と、教師データである既知の分類結果との誤差をなくす方向(誤差関数の値が“0”に漸近するよう)に、例えば、誤差逆伝播法を用いて、分類モデルのパラメータ(畳み込みフィルタ、全結合層の層間の重み〔重み行列〕等)を更新する。この分類モデルのパラメータの更新は、一般的なCNNの手法であるため、ここでは詳細な説明を省略する。
なお、後述するように、誤差逆伝播法によって、フィルタ領域を所定角度回転させた畳み込みフィルタの更新が可能である。
The classification model learning means 14 performs the convolution processing according to the main direction of the edge component only in the first convolution layer, and the subsequent processing (the second and subsequent convolution layers, the pooling layer, the fully connected layer, the output layer; 12) performs the same processing as the conventional CNN.
Then, the classification model learning means 14 has a direction of eliminating an error between the classification result output from the output layer corresponding to the input image data and the known classification result which is the training data (the value of the error function is "0"). The parameters of the classification model (convolution filter, weights between layers of fully connected layers [weight matrix], etc.) are updated using, for example, the error back propagation method. Since updating the parameters of this classification model is a general CNN method, detailed description thereof will be omitted here.
As will be described later, the convolution filter in which the filter region is rotated by a predetermined angle can be updated by the back-propagation method.
分類モデル記憶手段15は、分類モデル学習手段14で学習した分類モデルを記憶するものである。この分類モデル記憶手段15は、ハードディスク、半導体メモリ等の一般的な記憶媒体で構成することができる。学習後の分類モデルは、分類手段16によって参照される。
この分類モデル記憶手段15には、予め分類モデルの構造(畳み込み層、プーリング層、全結合層等の構造、畳み込みフィルタの大きさ、数、移動幅等)を記憶するとともに、分類モデルのパラメータ(畳み込みフィルタ、全結合層の層間の重み〔重み行列〕等)の初期値を記憶しておく。なお、分類モデルのパラメータは、分類モデル学習手段14によって、学習モードの動作時に更新される。
The classification model storage means 15 stores the classification model learned by the classification model learning means 14. The classification model storage means 15 can be configured by a general storage medium such as a hard disk or a semiconductor memory. The classification model after learning is referred to by the classification means 16.
The classification model storage means 15 stores in advance the structure of the classification model (structure of convolutional layer, pooling layer, fully connected layer, etc., size, number, movement width, etc. of the convolutional filter), and parameters of the classification model (convolutional model storage means 15). Store the initial values of the convolutional filter, the weight between the layers of the fully connected layer [weight matrix], etc.). The parameters of the classification model are updated by the classification model learning means 14 when the learning mode is operated.
分類手段16は、領域別主方向記憶手段13に記憶されているフィルタ領域ごとのエッジ成分の主方向と、分類モデル記憶手段15に記憶されている分類モデルとを用いて、分類用データ入力手段11から入力される画像データを分類するものである。
この分類手段16は、分類モデルの最初の畳み込み層における畳み込み処理において、画像データのそれぞれのフィルタ領域を、エッジ成分の主方向に応じて所定角度回転させて、回転後のフィルタ領域に対して、畳み込み演算を行う。
The classification means 16 uses the main direction of the edge component for each filter area stored in the region-specific main direction storage means 13 and the classification model stored in the classification model storage means 15 to input data for classification. The image data input from 11 is classified.
In the convolution process in the first convolution layer of the classification model, the classification means 16 rotates each filter region of the image data by a predetermined angle according to the main direction of the edge component, and refers to the rotated filter region with respect to the rotation filter region. Performs a convolution operation.
なお、この分類モデルの最初の畳み込み層における畳み込み処理は、分類モデル記憶手段15に記憶されている学習済みの畳み込み係数を用いる以外は、図5、図6を用いて説明した分類モデル学習手段14の処理と同じであるため、説明を省略する。
また、分類手段16は、最初の畳み込み層における畳み込み処理以降、分類モデル記憶手段15に記憶されている分類モデルを用いて、画像データの特徴を伝播させ、分類モデルの出力層のノードで最も高い確率値となるノードの対応する分類結果を出力する。
The convolution process in the first convolution layer of this classification model is the classification model learning means 14 described with reference to FIGS. 5 and 6, except that the learned convolution coefficient stored in the classification model storage means 15 is used. Since it is the same as the process of, the description will be omitted.
Further, the classification means 16 propagates the features of the image data by using the classification model stored in the classification model storage means 15 after the convolution processing in the first convolutional layer, and is the highest in the node of the output layer of the classification model. Outputs the corresponding classification result of the node that becomes the probability value.
以上、本発明の実施形態に係る画像データ分類装置1の構成について説明したが、画像データ分類装置1は、コンピュータを前記した各手段として機能させるためのプログラム(画像データ分類プログラム)で動作させることができる。
The configuration of the image
以上説明したように画像データ分類装置1を構成することで、画像データ分類装置1は、1つの方向のオブジェクトを含んだ画像データを用いて分類モデルを学習することで、オブジェクトの向きによらずに精度よく画像データを分類することができる。
By configuring the image
例えば、図7に示すように、同じオブジェクト(一例として、「家」の画像)が異なる画像データ内で傾いた状態であった場合、画像データ分類装置1は、図7(a),(b),(c)において、オブジェクトの同一領域(「煙突部分」の画像領域)で畳み込みフィルタCfを適用する際に、エッジ成分の主方向に対して同一方向となるフィルタ領域で畳み込み処理を行う。そのため、画像データ分類装置1は、同じオブジェクトの同一領域において、ほぼ同じ特徴量を抽出することができ、1つの方向のオブジェクトを含んだ画像データを用いて分類モデルを学習すればよい。
For example, as shown in FIG. 7, when the same object (for example, an image of “house”) is in a tilted state in different image data, the image
<画像データ分類装置の動作>
次に、図8,図9を参照して、本発明の実施形態に係る画像データ分類装置1の動作について説明する。ここでは、画像データ分類装置1の動作を、学習モードと、分類モードとに分けて説明する。
<Operation of image data classification device>
Next, the operation of the image
(学習モード)
図8を参照(構成については適宜図1参照)して、画像データ分類装置1の学習モードの動作について説明する。
(Learning mode)
The operation of the learning mode of the image
ステップS1において、学習用データ入力手段10は、学習データとして、分類が既知の画像データと、その分類内容を示す教師データとを入力する。
そして、領域別主方向推定手段12は、以下のステップS2からステップS6の動作により、ステップS1で入力した画像データにおいて、畳み込みフィルタを適用するフィルタ領域ごとにエッジ成分の主方向を推定する。
In step S1, the learning data input means 10 inputs image data whose classification is known and teacher data indicating the classification content as learning data.
Then, the region-specific main direction estimating means 12 estimates the main direction of the edge component for each filter region to which the convolution filter is applied in the image data input in step S1 by the following operations from step S2 to step S6.
ステップS2において、領域別主方向推定手段12は、ステップS1で入力した画像データに対して、畳み込みフィルタを適用するフィルタ領域の初期位置(例えば、画像の左上)を設定する。 In step S2, the area-specific main direction estimation means 12 sets the initial position (for example, the upper left of the image) of the filter area to which the convolution filter is applied with respect to the image data input in step S1.
ステップS3において、領域別主方向推定手段12は、フィルタ領域において、画像のエッジ成分の主方向を推定する。具体的には、領域別主方向推定手段12は、ソーベルフィルタを用いて、フィルタ領域内の画像の各画素の勾配強度および勾配方向を求める。そして、領域別主方向推定手段12は、勾配方向を量子化し、量子化した勾配方向ごとの勾配強度を累計し、勾配強度の累計がピークとなる勾配方向を、エッジ成分の主方向とする。なお、勾配強度の最も大きい累計値に対する2番目に大きい累計値の割合が予め定めた割合よりも大きい場合は、主方向が存在しないもの(主方向=0°)とする。 In step S3, the region-specific main direction estimation means 12 estimates the main direction of the edge component of the image in the filter region. Specifically, the region-specific main direction estimation means 12 uses a Sobel filter to obtain the gradient intensity and the gradient direction of each pixel of the image in the filter region. Then, the region-specific main direction estimating means 12 quantizes the gradient direction, accumulates the gradient intensities for each of the quantized gradient directions, and sets the gradient direction at which the cumulative gradient intensity peaks as the main direction of the edge component. If the ratio of the second largest cumulative value to the highest cumulative value of the gradient intensity is larger than the predetermined ratio, it is assumed that the main direction does not exist (main direction = 0 °).
ステップS4において、領域別主方向推定手段12は、フィルタ領域の位置と、ステップS3で推定したエッジ成分の主方向とを対応付けて領域別主方向記憶手段13に記憶する。
ステップS5において、領域別主方向推定手段12は、画像データ内のすべてのフィルタ領域の画像に対して、エッジ成分の主方向を推定したか否かを判定する。
In step S4, the area-specific main direction estimation means 12 stores the position of the filter region and the main direction of the edge component estimated in step S3 in association with each other in the area-specific main direction storage means 13.
In step S5, the region-specific main direction estimating means 12 determines whether or not the main direction of the edge component has been estimated for the images of all the filter regions in the image data.
ここで、まだ、すべてのフィルタ領域の画像に対してエッジ成分の主方向を推定していない場合(ステップS5でNo)、ステップS6において、領域別主方向推定手段12は、フィルタ領域を、畳み込みフィルタの移動幅に応じた位置に移動させる。そして、領域別主方向推定手段12は、ステップS3に戻って、次のフィルタ領域の画像に対して、エッジ成分の主方向を推定する。
一方、すべてのフィルタ領域の画像に対してエッジ成分の主方向を推定した場合(ステップS5でYes)、分類モデル学習手段14がステップS7以降の動作を行う。
Here, when the main directions of the edge components have not yet been estimated for the images of all the filter regions (No in step S5), in step S6, the region-specific main direction estimation means 12 convolves the filter region. Move to a position according to the movement width of the filter. Then, the region-specific main direction estimating means 12 returns to step S3 and estimates the main direction of the edge component with respect to the image of the next filter region.
On the other hand, when the main direction of the edge component is estimated for the images of all the filter regions (Yes in step S5), the classification model learning means 14 performs the operations after step S7.
分類モデル学習手段14は、以下のステップS7からステップS11の動作により、最初の畳み込み層の処理を行う。 The classification model learning means 14 processes the first convolution layer by the following operations from step S7 to step S11.
ステップS7において、分類モデル学習手段14は、ステップS1で入力した画像データに対して、畳み込みフィルタを適用するフィルタ領域の初期位置を設定する。
ステップS8において、分類モデル学習手段14は、フィルタ領域の位置に対応するエッジ成分の主方向を、領域別主方向記憶手段13から読み出し、フィルタ領域の予め定めた基準方向が主方向となるように回転させた領域を新たなフィルタ領域とする。
In step S7, the classification model learning means 14 sets the initial position of the filter area to which the convolution filter is applied with respect to the image data input in step S1.
In step S8, the classification model learning means 14 reads out the main direction of the edge component corresponding to the position of the filter area from the area-specific main direction storage means 13, so that the predetermined reference direction of the filter area becomes the main direction. The rotated region is used as a new filter region.
ステップS9において、分類モデル学習手段14は、ステップS8で主方向の向きに所定角度回転させたフィルタ領域に対して畳み込みフィルタを適用して畳み込み演算を行う。
ステップS10において、分類モデル学習手段14は、画像データ内のすべてのフィルタ領域に対して、畳み込み演算を行ったか否かを判定する。
In step S9, the classification model learning means 14 applies a convolution filter to the filter region rotated by a predetermined angle in the direction of the main direction in step S8 to perform a convolution operation.
In step S10, the classification model learning means 14 determines whether or not the convolution operation has been performed on all the filter areas in the image data.
ここで、まだ、すべてのフィルタ領域に対して畳み込み演算を行っていない場合(ステップS10でNo)、ステップS11において、分類モデル学習手段14は、フィルタ領域を、畳み込みフィルタの移動幅に応じた位置に移動させる。そして、分類モデル学習手段14は、ステップS8に戻って、次のフィルタ領域に対して、畳み込み演算を行う。 Here, when the convolution operation has not yet been performed on all the filter areas (No in step S10), in step S11, the classification model learning means 14 positions the filter area according to the movement width of the convolution filter. Move to. Then, the classification model learning means 14 returns to step S8 and performs a convolution operation on the next filter area.
一方、すべてのフィルタ領域に対して畳み込み演算を行った場合(ステップS10でYes)、分類モデル学習手段14は、ステップS12に動作を進める。なお、図示は省略するが、最初の畳み込み層において、複数の畳み込みフィルタを用いる場合、分類モデル学習手段14は、ステップS7からステップS11までの動作を、畳み込みフィルタの数だけ実行する。 On the other hand, when the convolution operation is performed on all the filter areas (Yes in step S10), the classification model learning means 14 proceeds to step S12. Although not shown, when a plurality of convolution filters are used in the first convolution layer, the classification model learning means 14 executes the operations from step S7 to step S11 by the number of convolution filters.
ステップS12において、分類モデル学習手段14は、ステップS11までの動作で最初の畳み込み層により生成された特徴マップに対して、後段の2段目以降の畳み込み層、プーリング層、全結合層、出力層の処理を実行する。
ステップS13において、分類モデル学習手段14は、ステップS12の出力層から出力される分類結果と、ステップS1で入力した教師データとの誤差から、誤差逆伝播法を用いて、分類モデルのパラメータを更新し、分類モデル記憶手段15に記憶する。
In step S12, the classification model learning means 14 refers to the convolution layer, the pooling layer, the fully connected layer, and the output layer of the second and subsequent convolution layers in the subsequent stage with respect to the feature map generated by the first convolution layer in the operations up to step S11. Executes the processing of.
In step S13, the classification model learning means 14 updates the parameters of the classification model by using the error backpropagation method from the error between the classification result output from the output layer in step S12 and the teacher data input in step S1. Then, it is stored in the classification model storage means 15.
ステップS14において、分類モデル学習手段14は、分類モデルの学習を完了したか否かを判定する。ここで、分類モデルの学習の判定は、ステップS13における誤差が予め定めた閾値よりも小さくなった場合である。
ここで、分類モデルの学習が完了していない場合(ステップS14でNo)、ステップS1において、学習用データ入力手段10が新たな学習データを入力することで、分類モデル学習手段14は、分類モデルの学習を継続する。
一方、分類モデルの学習が完了した場合(ステップS14でYe)、画像データ分類装置1は、動作を終了する。
In step S14, the classification model learning means 14 determines whether or not the learning of the classification model has been completed. Here, the determination of learning of the classification model is a case where the error in step S13 becomes smaller than the predetermined threshold value.
Here, when the learning of the classification model is not completed (No in step S14), in step S1, the learning data input means 10 inputs new learning data, so that the classification model learning means 14 uses the classification model. Continue learning.
On the other hand, when the learning of the classification model is completed (Ye in step S14), the image
以上の動作によって、画像データ分類装置1は、CNNの分類モデルを学習する際に、最初の畳み込み層の処理において、フィルタ領域のエッジ成分の主方向に対して、一定方向となるように畳み込みフィルタを適用して畳み込み処理を行う。
これによって、画像データ分類装置1は、画像データのオブジェクトの傾きに対してほぼ不変な特徴量を抽出して学習を行うことができるため、様々な向きでオブジェクトが映った画像データを学習データとする必要がなく、学習データの量と学習時間とを従来に比べて軽減することができる。
By the above operation, when the image
As a result, the image
(分類モード)
次に、図9を参照(構成については適宜図1参照)して、画像データ分類装置1の画像データの分類モードの動作について説明する。
(Classification mode)
Next, the operation of the image data classification mode of the image
ステップS20において、分類用データ入力手段11は、分類が未知の画像データを入力する。
そして、領域別主方向推定手段12は、ステップS21からステップS25の動作により、ステップS20で入力した画像データにおいて、畳み込みフィルタを適用するフィルタ領域ごとにエッジ成分の主方向を推定する。なお、ステップS21からステップS25の動作は、図8で説明したステップS2からステップS6の動作と同じであるため、説明を省略する。
In step S20, the classification data input means 11 inputs image data whose classification is unknown.
Then, the region-specific main direction estimating means 12 estimates the main direction of the edge component for each filter region to which the convolution filter is applied in the image data input in step S20 by the operation of steps S21 to S25. Since the operations of steps S21 to S25 are the same as the operations of steps S2 to S6 described with reference to FIG. 8, the description thereof will be omitted.
そして、分類手段16は、ステップS26からステップS30の動作により、最初の畳み込み層の処理を行う。なお、ステップS26からステップS30の動作は、動作主体が分類モデル学習手段14から分類手段16に替わるだけ、図8で説明したステップS7からステップS11の動作と同じであるため、説明を省略する。 Then, the classification means 16 processes the first convolution layer by the operations of steps S26 to S30. The operation of steps S26 to S30 is the same as the operation of steps S7 to S11 described with reference to FIG. 8 except that the action subject changes from the classification model learning means 14 to the classification means 16. Therefore, the description thereof will be omitted.
ステップS31において、分類手段16は、ステップS30までの動作で最初の畳み込み層により生成された特徴マップに対して、後段の2段目以降の畳み込み層、プーリング層、全結合層、出力層の処理を実行する。
ステップS32において、分類手段16は、ステップS31における出力層のノードで最も高い確率値となるノードの対応する分類結果を出力する。
In step S31, the classification means 16 processes the convolution layer, the pooling layer, the fully connected layer, and the output layer of the second and subsequent convolution layers in the subsequent stage with respect to the feature map generated by the first convolution layer in the operations up to step S30. To execute.
In step S32, the classification means 16 outputs the corresponding classification result of the node having the highest probability value among the nodes of the output layer in step S31.
以上の動作によって、画像データ分類装置1は、CNNの分類モデルにより画像データを分類する際に、最初の畳み込み層の処理において、フィルタ領域のエッジ成分の主方向に対して、一定方向となるように畳み込みフィルタを適用して畳み込み処理を行う。
これによって、画像データ分類装置1は、画像データのオブジェクトの傾きに対してほぼ不変な特徴量を抽出するため、異なる向きで同じオブジェクトが映った画像データであっても、同じ内容として画像データを分類することができる。
By the above operation, when the image
As a result, the image
<変形例>
以上、本発明の実施形態に係る画像データ分類装置1の構成および動作について説明したが、本発明は、この実施形態に限定されるものではない。
(変形例1)
画像データ分類装置1は、分類モデルを学習するモード(学習モード)と、画像データを分類するモード(分類モード)との2つの異なる動作モードの処理を1つの装置で実行するものである。しかし、これらの処理は、別々の装置で行うようにしても構わない。
<Modification example>
Although the configuration and operation of the image
(Modification example 1)
The image
具体的には、分類モデルを学習する装置は、図10に示す分類モデル生成装置2として構成することができる。
分類モデル生成装置2は、図10に示すように、学習用データ入力手段10と、領域別主方向推定手段12と、領域別主方向記憶手段13と、分類モデル学習手段14と、分類モデル記憶手段15と、を備える。この構成は、図1で説明した画像データ分類装置1の構成から、分類用データ入力手段11と、分類手段16とを削除したものである。
この分類モデル生成装置2は、分類モデルを学習する動作のみを行う。分類モデル生成装置2の動作は、図8で説明した動作と同じである。
なお、分類モデル生成装置2は、コンピュータを前記した各手段として機能させるためのプログラム(分類モデル生成プログラム)で動作させることができる。
Specifically, the device for learning the classification model can be configured as the classification
As shown in FIG. 10, the classification
The classification
The classification
(変形例2)
また、分類モデルを用いて、画像データを分類する装置は、図11に示す画像データ分類装置1Bとして構成することができる。
画像データ分類装置1Bは、分類用データ入力手段11と、領域別主方向推定手段12と、領域別主方向記憶手段13と、分類モデル記憶手段15と、分類手段16と、を備える。この構成は、図1で説明した画像データ分類装置1の構成から、学習用データ入力手段10と、分類モデル学習手段14とを削除したものである。また、分類モデル記憶手段15に記憶する分類モデルは、図10の分類モデル生成装置2で生成されたものである。
この画像データ分類装置1Bは、画像データを分類する動作のみを行う。画像データ分類装置1Bの動作は、図9で説明した動作と同じである。
なお、画像データ分類装置1Bは、コンピュータを前記した各手段として機能させるためのプログラム(画像データ分類プログラム)で動作させることができる。
(Modification 2)
Further, the device for classifying the image data using the classification model can be configured as the image
The image
The image
The image
このように、分類モデルを学習する動作と、分類モデルを用いて画像データを分類する動作とを、異なる装置(分類モデル生成装置2,画像データ分類装置1B)で動作させることで、1つの分類モデル生成装置2で生成した分類計モデルを、複数の画像データ分類装置1Bで利用することが可能になる。
In this way, by operating the operation of learning the classification model and the operation of classifying the image data using the classification model by different devices (classification
(変形例3)
また、ここでは、領域別主方向推定手段12がソーベルフィルタを用いてエッジ成分の主方向を推定することとしたが、これに限定されるものではない。
例えば、領域別主方向推定手段12は、SIFT(Scale-Invariant Feature Transform)、SURF(Speed-Up Robust Features)等の画像データの特徴量であるエッジ成分の勾配強度、勾配方向を用いてもよい。あるいは、畳み込みフィルタの大きさの画像を、予めエッジ成分の主方向が既知の複数のパターンで機械学習した結果を用いて、領域別主方向推定手段12が、入力された画像データの主方向を推定することとしてもよい。
(Modification example 3)
Further, here, the region-specific main direction estimation means 12 estimates the main direction of the edge component using a sobel filter, but the present invention is not limited to this.
For example, the region-specific main direction estimation means 12 may use the gradient intensity and gradient direction of the edge component, which is a feature amount of image data such as SIFT (Scale-Invariant Feature Transform) and SURF (Speed-Up Robust Features). .. Alternatively, using the result of machine learning the image of the size of the convolution filter with a plurality of patterns in which the main direction of the edge component is known in advance, the region-specific main direction estimation means 12 determines the main direction of the input image data. It may be estimated.
<畳み込みフィルタの更新について>
最後に、分類モデル学習手段14(図1)において、誤差逆伝播法によって、フィルタ領域を所定角度だけ回転させた畳み込みフィルタの更新(学習)が可能であることを説明する。
CNNにおける第L層の座標(i,j)における出力値(重み付き和)をuij L、活性化関数をfとすると、活性(活性化関数の値)zij Lは、以下の式(3)で表すことができる。
<About updating the convolution filter>
Finally, in the classification model learning means 14 (FIG. 1), it will be described that the convolution filter in which the filter region is rotated by a predetermined angle can be updated (learned) by the error back propagation method.
Assuming that the output value (weighted sum) at the coordinates (i, j) of the Lth layer in the CNN is uij L and the activation function is f, the activity (value of the activation function) z ij L is the following equation ( It can be represented by 3).
ここで、畳み込みフィルタの係数をhpqとすると従来の畳み込み層における出力値uij Lは、以下の式(4)で表すことができる。なお、(p,q)は、畳み込みフィルタの座標を示す。 Here, assuming that the coefficient of the convolution filter is h pq , the output value uij L in the conventional convolution layer can be expressed by the following equation (4). Note that (p, q) indicates the coordinates of the convolution filter.
一方、本発明において、畳み込みフィルタの畳み込み対象となる座標(i+p,j+q)はエッジ成分の主方向に応じて所定角度回転することになる。この回転角度は、領域別主方向推定手段12によって、分類モデル学習手段14におけるCNNの学習以前に既知の情報である。ここで、回転後の座標を((i+p)′,(j+q)′)とすると、分類モデル学習手段14における最初の畳み込み層の出力値uij Lは、以下の式(5)で表すことができる。 On the other hand, in the present invention, the coordinates (i + p, j + q) to be convoluted by the convolution filter are rotated by a predetermined angle according to the main direction of the edge component. This rotation angle is information known before the learning of the CNN in the classification model learning means 14 by the region-specific main direction estimating means 12. Here, assuming that the coordinates after rotation are ((i + p)', (j + q)'), the output value u ij L of the first convolution layer in the classification model learning means 14 can be expressed by the following equation (5). can.
本発明において、誤差逆伝播法によって所定角度回転させた畳み込みフィルタの更新が可能であるか否かは、誤差関数が微分可能(誤差関数の勾配を求めることが可能)であるか否かと同義である。以下、本発明において、誤差関数が微分可能であることを示す。
ここで、誤差関数をEとする。誤差関数Eの勾配は、偏微分の連鎖法則から以下の式(6)で表すことができる。
In the present invention, whether or not the convolution filter rotated by a predetermined angle by the error backpropagation method can be updated is synonymous with whether or not the error function is differentiable (the gradient of the error function can be obtained). be. Hereinafter, it is shown that the error function is differentiable in the present invention.
Here, let the error function be E. The gradient of the error function E can be expressed by the following equation (6) from the chain rule of partial differentiation.
ここで、誤差関数Eを重み付き和uij Lで偏微分した結果を以下の式(7)に示すδij Lとする。 Here, the result of partially differentiating the error function E with the weighted sum u ij L is defined as δ ij L shown in the following equation (7).
すると、前記式(5)から、前記式(6)は以下の式(8)に書き換えることができる。 Then, from the equation (5), the equation (6) can be rewritten to the following equation (8).
この式(8)のz(i+p)′,(j+q)′ L−1は、前の層(第(L−1)層)の出力値であり、回転後の座標の値は、エッジ成分の主方向がすでに決定されていることから、確定した値となる。そこで、誤差伝播を行うためには、δij Lを求めることができればよいことになる。なお、δij Lを求めることができか否かは、畳み込みフィルタが所定角度回転しているか否かによらず、従来と同様の手法で求めることができる。
まず、偏微分の連鎖法則によって、δij Lは、以下の式(9)のように変形することができる。なお、座標(s,t)における重み付き和をust Lとする。
The z (i + p)'and (j + q)' L-1 of this equation (8) are the output values of the previous layer (the (L-1) layer), and the coordinate values after rotation are the edge components. Since the main direction has already been determined, it will be a fixed value. Therefore, in order to carry out error propagation, it is sufficient if δ ij L can be obtained. Whether or not δ ij L can be obtained can be obtained by the same method as in the conventional method regardless of whether or not the convolution filter is rotated by a predetermined angle.
First, according to the chain rule of partial differentiation, δ ij L can be transformed as shown in the following equation (9). The weighted sum at the coordinates (s, t) is ust L.
ここで、前記式(3)および前記式(5)から、前記式(9)の(∂ust L+1/∂uij L)は、以下の式(10)に変形することができる。 Here, from the above formula (3) and the above formula (5), (∂u st L + 1 / ∂u ij L ) of the above formula (9) can be transformed into the following formula (10).
前記式(9)を前記式(10)で置き換えると、以下の式(11)となる。 When the formula (9) is replaced with the formula (10), the following formula (11) is obtained.
この式(11)における∂(…)/∂uij Lは、uij Lで偏微分していることから、us+p,t+q L=uij L、すなわち、s+p=i,t+q=jとなる(s,t)および(p,q)の組み合わせだけを考えればよい(他の値は“0”になる)ため、前記式(11)は以下の式(12)となる。 Since ∂ (...) / ∂u ij L in this equation (11) is partially differentiated with respect to u ij L , it becomes us + p, t + q L = u ij L , that is, s + p = i, t + q = j. Since only the combination of (s, t) and (p, q) needs to be considered (other values are "0"), the above equation (11) becomes the following equation (12).
ここで、f′(…)は、既知の活性化関数fの微分であり、δi−p,j−q L+1は、後ろの層から伝播される値であることから、δij Lを求めることができる。
このように、本発明によっても、誤差関数Eは微分可能であり、CNNにおける順伝播および逆伝播の処理を行うことで、分類モデルを学習することができる。
Here, f'(...) is the derivative of the known activation function f, and δ ip and j-q L + 1 are values propagated from the subsequent layer, so that δ ij L is obtained. be able to.
As described above, also in the present invention, the error function E is differentiable, and the classification model can be learned by performing the forward propagation and back propagation processing in the CNN.
1,1B 画像データ分類装置
2 分類モデル生成装置
10 学習用データ入力手段
11 分類用データ入力手段
12 領域別主方向推定手段
13 領域別主方向記憶手段
14 分類モデル学習手段
15 分類モデル記憶手段
16 分類手段
1,1B Image
Claims (7)
前記分類が既知の画像データから、前記畳み込みニューラルネットワークの最初の畳み込み層の畳み込みフィルタを適用するフィルタ領域ごとに、画像のエッジ成分の主方向を推定する領域別主方向推定手段と、
前記分類が既知の画像データと分類内容を示す教師データとから、前記畳み込みニューラルネットワークを学習し前記分類モデルを生成する分類モデル学習手段と、を備え、
前記分類モデル学習手段は、最初の畳み込み層において、前記フィルタ領域ごとに、前記フィルタ領域の予め定めた基準の向きが、前記領域別主方向推定手段で推定されたエッジ成分の主方向に対して一定方向となるようにフィルタ領域を回転させて、畳み込み演算を行うことを特徴とする分類モデル生成装置。 A classification model generator that generates a classification model, which is a convolutional neural network for classifying image data whose classification is unknown, from a plurality of image data whose classification is known.
From the image data whose classification is known, a region-specific main direction estimating means for estimating the main direction of the edge component of the image for each filter region to which the convolution filter of the first convolutional layer of the convolutional neural network is applied.
A classification model learning means for learning the convolutional neural network and generating the classification model from image data whose classification is known and teacher data indicating the classification contents is provided.
In the classification model learning means, in the first convolution layer, for each of the filter regions, the orientation of the predetermined reference of the filter region is relative to the main direction of the edge component estimated by the region-specific main direction estimation means. A classification model generator characterized in that a convolution operation is performed by rotating a filter area so as to have a certain direction.
前記分類が未知の画像データから、前記畳み込みニューラルネットワークの最初の畳み込み層の畳み込みフィルタを適用するフィルタ領域ごとに、画像のエッジ成分の主方向を推定する領域別主方向推定手段と、
前記分類モデルである畳み込みニューラルネットワークにより、前記分類が未知の画像データを分類する分類手段と、を備え、
前記分類手段は、最初の畳み込み層において、前記フィルタ領域ごとに、前記フィルタ領域の予め定めた基準の向きが、前記領域別主方向推定手段で推定されたエッジ成分の主方向に対して一定方向となるようにフィルタ領域を回転させて、畳み込み演算を行うことを特徴とする画像データ分類装置。 An image data classification device for classifying image data whose classification is unknown by using a classification model which is a convolutional neural network generated by the model generation device according to claim 1 or 2.
A region-specific main direction estimation means for estimating the main direction of the edge component of the image for each filter region to which the convolution filter of the first convolutional layer of the convolutional neural network is applied from the image data whose classification is unknown.
The convolutional neural network, which is the classification model, is provided with a classification means for classifying image data whose classification is unknown.
In the first convolutional layer, the classification means has a predetermined reference orientation of the filter region for each of the filter regions in a fixed direction with respect to the main direction of the edge component estimated by the region-specific main direction estimation means. An image data classification device characterized in that a convolution operation is performed by rotating a filter area so as to become.
画像データから、前記畳み込みニューラルネットワークの最初の畳み込み層の畳み込みフィルタを適用するフィルタ領域ごとに、画像のエッジ成分の主方向を推定する領域別主方向推定手段と、
前記分類が既知の画像データと分類内容を示す教師データとから、前記畳み込みニューラルネットワークを学習し前記分類モデルを生成する分類モデル学習手段と、
前記分類モデルである畳み込みニューラルネットワークにより、前記分類が未知の画像データを分類する分類手段と、を備え、
前記分類モデル学習手段は、最初の畳み込み層において、前記フィルタ領域ごとに、前記フィルタ領域の予め定めた基準の向きが、前記領域別主方向推定手段で推定されたエッジ成分の主方向に対して一定方向となるようにフィルタ領域を回転させて、畳み込み演算を行い、
前記分類手段は、最初の畳み込み層において、前記フィルタ領域ごとに、前記フィルタ領域の予め定めた基準の向きが、前記領域別主方向推定手段で推定されたエッジ成分の主方向に対して一定方向となるようにフィルタ領域を回転させて、畳み込み演算を行うことを特徴とする画像データ分類装置。 An image data classification device that generates a classification model, which is a convolutional neural network for classifying image data whose classification is unknown, from a plurality of image data whose classification is known, and classifies the image data whose classification is unknown.
From the image data, for each filter region to which the convolution filter of the first convolution layer of the convolutional neural network is applied, a region-specific main direction estimation means for estimating the main direction of the edge component of the image, and a region-specific main direction estimation means.
A classification model learning means that learns the convolutional neural network and generates the classification model from image data whose classification is known and teacher data indicating the classification contents.
The convolutional neural network, which is the classification model, is provided with a classification means for classifying image data whose classification is unknown.
In the classification model learning means, in the first convolution layer, for each of the filter regions, the orientation of the predetermined reference of the filter region is relative to the main direction of the edge component estimated by the region-specific main direction estimation means. Rotate the filter area so that it is in a fixed direction, perform the convolution operation, and perform the convolution operation.
In the first convolutional layer, the classification means has a predetermined reference orientation of the filter region for each of the filter regions in a fixed direction with respect to the main direction of the edge component estimated by the region-specific main direction estimation means. An image data classification device characterized in that a convolution operation is performed by rotating a filter area so as to become.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017170806A JP6951913B2 (en) | 2017-09-06 | 2017-09-06 | Classification model generator, image data classification device and their programs |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017170806A JP6951913B2 (en) | 2017-09-06 | 2017-09-06 | Classification model generator, image data classification device and their programs |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2019046334A JP2019046334A (en) | 2019-03-22 |
| JP6951913B2 true JP6951913B2 (en) | 2021-10-20 |
Family
ID=65814448
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2017170806A Active JP6951913B2 (en) | 2017-09-06 | 2017-09-06 | Classification model generator, image data classification device and their programs |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6951913B2 (en) |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2020181404A (en) * | 2019-04-25 | 2020-11-05 | 住友電気工業株式会社 | Image classifier, image classification method and computer program |
| JP7240997B2 (en) * | 2019-09-30 | 2023-03-16 | Kddi株式会社 | Model generation device, learning model and object recognition device |
| KR102743251B1 (en) * | 2020-02-25 | 2024-12-17 | 삼성전자주식회사 | Electronic apparatus and control method thereof |
| CN112364899A (en) * | 2020-10-27 | 2021-02-12 | 西安科技大学 | Abrasive grain ferrographic image intelligent identification method based on virtual image and transfer learning |
| WO2022097195A1 (en) * | 2020-11-04 | 2022-05-12 | 日本電信電話株式会社 | Training method, training device, and program |
| JP7663341B2 (en) * | 2020-11-19 | 2025-04-16 | セコム株式会社 | DATA PROCESSING APPARATUS, DATA PROCESSING METHOD, DATA PROCESSING PROGRAM, AND LEARNING MODEL GENERATION METHOD |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5865687B2 (en) * | 2011-12-07 | 2016-02-17 | 日本放送協会 | Image feature extraction device and program thereof |
| JP6767966B2 (en) * | 2014-04-09 | 2020-10-14 | エントルピー インコーポレーテッドEntrupy Inc. | Authenticity of objects using machine learning from microscopic differences |
| JP6492603B2 (en) * | 2014-12-09 | 2019-04-03 | 日本電気株式会社 | Image processing apparatus, system, image processing method, and program |
| EP3311364B1 (en) * | 2015-09-30 | 2018-12-26 | FotoNation Limited | A method and system for tracking an object |
-
2017
- 2017-09-06 JP JP2017170806A patent/JP6951913B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2019046334A (en) | 2019-03-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6951913B2 (en) | Classification model generator, image data classification device and their programs | |
| CN110852349B (en) | An image processing method, detection method, related equipment and storage medium | |
| CN112001488B (en) | Training generation type antagonism network | |
| KR101969050B1 (en) | Pose estimation | |
| JP5206517B2 (en) | Feature point selection system, feature point selection method, and feature point selection program | |
| CN109145766B (en) | Model training method and device, recognition method, electronic device and storage medium | |
| WO2016054779A1 (en) | Spatial pyramid pooling networks for image processing | |
| JP5227629B2 (en) | Object detection method, object detection apparatus, and object detection program | |
| CN108038435B (en) | A feature extraction and target tracking method based on convolutional neural network | |
| KR102217020B1 (en) | Object detection device in very high-resolution aerial images baseo om single-stage digh-density pyramid feature network | |
| KR20160096460A (en) | Recognition system based on deep learning including a plurality of classfier and control method thereof | |
| WO2011086889A1 (en) | Feature point selection system, feature point selection method and feature point selection program | |
| CN114462490B (en) | Image target retrieval methods, retrieval devices, electronic devices and storage media | |
| JP2010238226A (en) | Method and system for tracking object | |
| CN118429388B (en) | Visual tracking method and device based on image processing | |
| CN109919971B (en) | Image processing method, apparatus, electronic device, and computer-readable storage medium | |
| CN107248174A (en) | A kind of method for tracking target based on TLD algorithms | |
| CN111783997B (en) | A data processing method, device and equipment | |
| WO2021010342A1 (en) | Action recognition device, action recognition method, and action recognition program | |
| JP5674550B2 (en) | Status tracking apparatus, method, and program | |
| CN110992404A (en) | Target tracking method, device and system and storage medium | |
| EP3973501A1 (en) | Dynamic image resolution assessment | |
| CN111353325B (en) | Key point detection model training method and device | |
| JP2016071872A (en) | Method and device for tracking object and tracking feature selection method | |
| CN109726769B (en) | A target classification and angle estimation method based on convolution kernel weight parameters |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200731 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20210819 |
|
| 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: 20210831 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210927 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6951913 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |