JP6800656B2 - Arithmetic circuit, its control method and program - Google Patents
Arithmetic circuit, its control method and program Download PDFInfo
- Publication number
- JP6800656B2 JP6800656B2 JP2016163408A JP2016163408A JP6800656B2 JP 6800656 B2 JP6800656 B2 JP 6800656B2 JP 2016163408 A JP2016163408 A JP 2016163408A JP 2016163408 A JP2016163408 A JP 2016163408A JP 6800656 B2 JP6800656 B2 JP 6800656B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- multipliers
- filter
- arithmetic
- processing
- 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 Processing (AREA)
- Advance Control (AREA)
- Complex Calculations (AREA)
Description
本発明は、パターン認識等に使用される演算回路、その制御方法及びプログラムに関するものである。 The present invention relates to an arithmetic circuit used for pattern recognition and the like, a control method thereof, and a program.
パターン認識装置などの画像処理装置にニューラルネットワークの手法が広く応用されている。ニューラルネットワークの中でも、Convolutional Neural Networks(以下CNNと略記する)と呼ばれる演算手法が認識対象の変動に対して頑健なパターン認識を可能にする手法として注目されている。例えば、特許文献1では画像データを用いた顔認識に適用した例が提案されている。
The neural network method is widely applied to image processing devices such as pattern recognition devices. Among neural networks, a calculation method called Convolutional Neural Networks (hereinafter abbreviated as CNN) is attracting attention as a method that enables robust pattern recognition with respect to fluctuations in the recognition target. For example,
図3は簡単なCNN処理の例を示すネットワーク構成図である。入力層301は、画像データに対してCNN処理を行う場合、ラスタスキャンされた所定サイズの画像データに相当する。特徴面303a〜303cは第一階層308の特徴面を示す。特徴面とは、所定の特徴抽出演算(コンボリューション演算及び非線形処理)の処理結果に相当するデータ面である。特徴面は上位階層で所定の対象を認識するための特徴抽出結果に相当し、ラスタスキャンされた画像データに対する処理結果であるため、処理結果も面で表す。CNNでは多数の特徴面を構成するデータ群が演算処理を介して階層的に関係付けられている。
FIG. 3 is a network configuration diagram showing an example of a simple CNN process. The
特徴面303a〜303cは、入力層301に対応するコンボリューション演算及び非線形処理により生成されるものである。例えば、特徴面303aは、フィルタカーネル3021aに模式的に示す2次元のコンボリューション演算とその演算結果の非線形変換により生成する。例えば、フィルタカーネル(フィルタ係数マトリクス)のサイズがcolumnSize×rowSizeであるコンボリューション演算は以下の式に示すような積和演算により処理する。
The
ここで、「input(x,y)」は座標(x、y)での参照画素値を示し、「output(x,y)」は座標(x、y)での演算結果を示す。また、「weight(column,row)」は座標(x+column、y+row)での重み係数を示し、「columnSize」及び「rowSize」はカーネルサイズを示す。
Here, "input (x, y)" indicates a reference pixel value in coordinates (x, y), and "output (x, y)" indicates a calculation result in coordinates (x, y). Further, "weight (column, low)" indicates a weighting coefficient in coordinates (x + volume, y + low), and "columnSize" and "lowSize" indicate a kernel size.
CNN処理では複数のフィルタカーネルを画素単位で走査しながら積和演算を繰り返し、最終的な積和結果を非線形変換することで特徴面を生成する。なお、特徴面303aは前階層の一つの画像データから算出されるので、と結合数が1である。特徴面303aを算出するためのカーネル3021aは1つである。また、カーネル3021b、カーネル3021cはそれぞれ特徴面303b、303cを算出する際に使用されるフィルタカーネルである。以下、フィルタカーネルをフィルタ又はカーネルと略称することがある。また、フィルタカーネルのサイズは、カーネルサイズ又はフィルタサイズと略称することがある。
In the CNN process, the product-sum operation is repeated while scanning a plurality of filter kernels on a pixel-by-pixel basis, and the final product-sum result is non-linearly converted to generate a feature plane. Since the
図4はCNN処理における特徴面305aを算出する例である。特徴面305aは前階層308の3つの特徴面303a〜cから算出され、特徴面303a〜cと結合している。特徴面305aのデータを算出する場合、まず、特徴面303aに対しては模式的に示すカーネル3041aを用いたコンボリューション演算を行い、その結果を累積加算器401に保持する。同様に特徴面303b、特徴面303cに対してはそれぞれカーネル3042a、3043aのコンボリューション演算を行い、その結果を累積加算器401に累積加算する。
FIG. 4 is an example of calculating the
3種類のカーネルを用いたコンボリューション演算の終了後、ロジスティック関数や双曲正接関数(tanh関数)を利用した非線形変換処理402を行う。以上の処理を画像全体に対して1画素ずつ走査しながら処理する事で、特徴面305aを生成する。図4の処理と同様に、特徴面305bは前階層308の3つの特徴面のそれぞれに対してカーネル3041b、カーネル3042b及びカーネル3043bのコンボリューション演算を用いて算出する。更に、特徴面307は前階層309の特徴面305a〜bのそれぞれに対してカーネル3061及びカーネル3062のコンボリューション演算を用いて算出する。
After the convolution operation using the three types of kernels is completed, the
なお、各カーネルの係数はパーセプトロン学習やバックプロパゲーション学習等の一般的な手法を用いて予め学習により決定されているものとする。例えば、パターン認識等においては、10×10以上の大きなサイズのカーネルを使用してコンボリューション演算することがある。 It is assumed that the coefficients of each kernel are determined in advance by learning using general methods such as perceptron learning and backpropagation learning. For example, in pattern recognition or the like, a convolution operation may be performed using a kernel having a large size of 10 × 10 or more.
このように、CNN処理では多数のカーネルのコンボリューション演算を繰り返すため、膨大な回数の積和演算が必要となる。 As described above, since the CNN process repeats a large number of kernel convolution operations, a huge number of product-sum operations are required.
コンボリューション演算の高速化を目的として、例えば特許文献2では複数の積和演算ユニットに共通の重み係数を設定し、入力データをシフトさせながら並列に演算することで高速にコンボリューション演算を実行する装置が提案されている。 For the purpose of speeding up the convolution operation, for example, in Patent Document 2, a weight coefficient common to a plurality of product-sum operation units is set, and the convolution operation is executed at high speed by performing the operation in parallel while shifting the input data. A device has been proposed.
また、特許文献3では、肌色情報を利用して顔検出処理を行う顔候補領域を限定する事で、全体の処理を高速化する手法が開示されている。
Further,
さらに、特許文献4では、誤り訂正処理を実行する並列演算装置において、並列に動作する演算器の数を制御する手法が提案されている。
Further,
しかしながら、特許文献1では、コンボリューション演算を並列に処理する場合、例えば、カーネルのサイズによって参照データとなる前階層のデータを演算器に供給するデータ転送がボトルネックになる場合がある。また、特許文献2に開示されている様な並列演算処理装置を低速なメモリと組み合わせて実現した場合でも、並列に動作する演算器の数(並列度)に見合う性能が発揮できない場合がある。他にも演算回路の並列度に見合う性能が発揮できない場合があるが、ここで、一例としてデータ転送がボトルネックになる場合、並列演算器の同時動作によって処理できるデータ量に見合うデータが転送されないので、演算器の消費電力が無駄になる。これは、CNN処理に用いるカーネルのサイズによって、コンボリューション演算を行う際のデータ転送がボトルネックになる場合、特に問題となる。
However, in
また、特許文献2に開示されている様な並列演算処理装置と特許文献3に開示されている処理領域限定処理を組み合わせることで、CNN処理を高速に実現する事が可能になる。しかしながら、特許文献3の方法では処理対象領域のサイズが変更するにも係らず、特許文献2に開示されているような並列演算処理装置では、処理対象領域の如何に係らず一様な並列度で演算を実行するため、消費電力の観点から、無駄になる場合がある。
Further, by combining the parallel arithmetic processing apparatus as disclosed in Patent Document 2 and the processing area limiting processing disclosed in
本発明は上記の課題に鑑みてなされたものであり、データ転送がボトルネックになる等の場合において、並列に実行可能な複数の乗算器のうち、実行させる乗算器の数を適切に制御することによって消費電力を低減する演算回路を提供することを目的とする。また、その演算回路の制御方法及びプログラムを提供することを目的とする。 The present invention has been made in view of the above problems, and when data transfer becomes a bottleneck, the number of multipliers to be executed is appropriately controlled among a plurality of multipliers that can be executed in parallel. It is an object of the present invention to provide an arithmetic circuit for reducing power consumption. Another object of the present invention is to provide a control method and a program of the arithmetic circuit.
上記課題を解決するために、本発明に係る演算回路は、以下の構成を有する。フィルタ演算処理の参照データと該フィルタ演算処理に用いるフィルタの係数データとを保持する保持装置と接続する演算回路であって、互いに異なる前記参照データと共通の前記係数データとの乗算を繰り返し行うことにより前記フィルタ演算処理を実行する複数の乗算器と、前記複数の乗算器に対して、前記保持装置からに保持された互いに異なる前記参照データを供給する第1のデータ供給手段と、前記複数の乗算器に対して、前記保持装置に保持された共通の前記係数データを供給する第2のデータ供給手段と、前記乗算器が前記乗算を繰り返し実行する時間は、前記フィルタ演算処理のフィルタサイズが大きくなるほど増加し、前記フィルタサイズが所定値以下である場合に、前記複数の乗算器のうち、一部の乗算器に対して前記乗算を実行させ、他の乗算器に対して前記乗算を実行させないように制御する制御手段と、を有することを特徴とする。
また、本発明に係る他の態様の演算回路は、
フィルタ演算処理を実行する複数の乗算器と、
前記フィルタ演算処理におけるフィルタサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記フィルタ演算処理を実行させ、他の乗算器に対して前記フィルタ演算処理を実行させないように制御する制御手段と、
を有することを特徴とする。
また、本発明に係る他の態様の演算回路は、
フィルタ演算処理を実行する複数の乗算器と、
前記フィルタ演算処理の参照データのデータサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記フィルタ演算処理を実行させ、他の乗算器に対して前記フィルタ演算処理を実行させないように制御する制御手段と、
を有することを特徴とする。
In order to solve the above problems, the arithmetic circuit according to the present invention has the following configuration. An arithmetic circuit connected to a holding device that holds the reference data of the filter arithmetic processing and the coefficient data of the filter used for the filter arithmetic processing, and repeatedly multiplys the reference data different from each other and the common coefficient data. A plurality of multipliers for executing the filter calculation process, a first data supply means for supplying the plurality of multipliers with different reference data held by the holding device, and the plurality of multipliers. The second data supply means for supplying the common coefficient data held in the holding device to the multiplication device and the time for the multiplication device to repeatedly execute the multiplication are determined by the filter size of the filter calculation process. increases as increases, when the filter size is less than a predetermined value, among the plurality of multipliers, to execute the multiplication for some multipliers, the multiplication with respect to the other multiplier It is characterized by having a control means for controlling the execution so as not to be executed.
Further, the arithmetic circuit of another aspect according to the present invention is
Multiple multipliers that perform filter arithmetic processing,
Based on the filter size in the filter calculation process, some multipliers among the plurality of multipliers are not allowed to execute the filter calculation process, and other multipliers are not allowed to execute the filter calculation process. Control means to control
It is characterized by having.
Further, the arithmetic circuit of another aspect according to the present invention is
Multiple multipliers that perform filter arithmetic processing,
Based on the data size of the reference data of the filter calculation process, some of the plurality of multipliers are made to execute the filter calculation process, and the other multipliers are subjected to the filter calculation process. Control means to control not to execute,
It is characterized by having.
本発明によれば、データ転送がボトルネックになる等の場合において、演算回路の並列に実行可能な複数の乗算器のうち、実行させる乗算器の数を制御することによって消費電力を低減することができる。 According to the present invention, when data transfer becomes a bottleneck, power consumption is reduced by controlling the number of multipliers to be executed among a plurality of multipliers that can be executed in parallel in an arithmetic circuit. Can be done.
以下、本発明の実施形態について添付の図面を参照して具体的に説明する。 Hereinafter, embodiments of the present invention will be specifically described with reference to the accompanying drawings.
(第1の実施形態)
まず、本発明の第1の実施形態について説明する。図1は本発明の第1の実施形態に関する並列演算回路を具備した画像処理装置の構成例である。当該画像処理装置は入力された画像データから特定の物体(画像パターン)を認識又は検出する機能を有する。画像入力モジュール20は、光学系、CCD又はCMOSセンサー等の光電変換デバイス及びセンサーを制御するドライバー回路、ADコンバーター、各種画像補正を司る信号処理回路及びフレームバッファ等により構成される。
(First Embodiment)
First, the first embodiment of the present invention will be described. FIG. 1 is a configuration example of an image processing apparatus including a parallel arithmetic circuit according to the first embodiment of the present invention. The image processing device has a function of recognizing or detecting a specific object (image pattern) from the input image data. The
RAM(Random Access Memory)500は、画像バッファ及び演算回路22の演算作業バッファとして使用する。RAM500にはCNNの特徴面に相当するデータ群やフィルタ係数データなどが保持される。RAM500は、演算回路22と接続し、演算回路22に必要なデータを転送する外部のデータ保持装置としての役割を持っている。演算回路22は本実施形態ではCNN処理を並列に行うCNN処理部である。演算回路22の構成について、後述する。
The RAM (Random Access Memory) 500 is used as an image buffer and a calculation work buffer of the
DMAC(Direct Memory Access Controller)26は、画像バス23上の各モジュールや回路とCPUバス30間のデータ転送を司る。ブリッジ24は、画像バス23とCPUバス30のブリッジ機能を提供する。前処理モジュール25は、CNN処理によるパターン認識処理を効果的に行うための各種前処理を行う。具体的には色変換処理/コントラスト補正処理等の画像データ変換処理をハードウェアで処理する。
The DMAC (Direct Memory Access Controller) 26 controls data transfer between each module or circuit on the
顔候補検出モジュール31は、演算回路22での処理対象である顔候補領域を特定する。具体的には、顔候補検出モジュール31は、前処理モジュール25で変換した所定の色空間内で人物の肌色領域を特定し、当該領域を演算回路22でのCNN処理の処理対象領域とする。ここで特定した処理対象領域に関する情報はRAM500に記録し、演算回路22で使用する。
The face
CPU27は、画像処理装置全体の動作を制御するものである。ROM(Read Only Memory)28は、CPU27の動作を規定する命令や各種演算に必要なパラメータデータを格納する。RAM29はCPU27の動作に必要なメモリである。CPU27はブリッジ24を介して画像バス23上のRAM500にアクセスする事も可能である。
The
図2は演算回路22の構成を示す図であり、本実施形態では、演算回路22がCNN処理を行うCNN処理部として説明するが、演算回路22の行う演算処理はCNN処理に限らず、他の様々なフィルタ演算処理に適用することも可能である。演算回路22が演算処理の階層的な結合関係で表現される様々な処理に適用可能である。例えば、Restricted Boltzmann MachinesやRecursive Neural Network等他の階層的な処理に適用可能である。
FIG. 2 is a diagram showing the configuration of the
また、演算回路22による演算は、1段の階層から図3に示すような複数段の階層まで様々な場合に適用することができる。また、演算回路22が演算するデータは、2次元データに対する限らず、1次元データや3次元以上のデータに適用することも可能である。図2に示す演算回路22が行うCNN処理は、図3に示す様な複数のデータ群の階層的な結合関係に従って、下位の階層から特徴面を順次算出していく。即ち、演算回路22は、まず、入力画像データ301を参照データとして、順に特徴面303a、特徴面303b及び特徴面303cを算出する。次に、特徴面303aを参照データとして、順に特徴面305a及び特徴面305bを算出する。このように、演算回路22は、階層の数に制限されずに特徴面を順に算出し、最終的に特徴面307を算出する。
Further, the calculation by the
以下、本実施形態における演算回路22の動作を説明する。本実施形態では、水平方向に並列にコンボリューション演算処理する場合について説明する。即ち、コンボリューション演算の結果である特徴面を基準にして水平方向に連続する複数の位置のコンボリューション演算を複数の演算器が同時に動作して実行する。本実施形態では、同時に動作してコンボリューション演算を実行する演算器(乗算器と累積加算器のペア)の数を並列度と呼ぶ。なお、垂直方向の並列演算は水平方向の並列演算と同様にできるので、その説明は省略する。
The operation of the
図2の制御部501は図5に示すように、演算回路22の基本的な動作を決定するレジスタ群602とレジスタ群602の値を基に各種信号のタイミングを制御するシーケンサ601及びRAM500へのアクセス調停を行うメモリ制御部605等からなる。
As shown in FIG. 5, the
演算器制御部517は、内部のレジスタに保持する並列度指定情報に従って、乗算器507a〜507n及び累積加算器508a〜508nの動作を制御する信号を生成する。制御信号513a〜513nはそれぞれ乗算器507a〜507nの動作を直接制御する信号である。演算器制御部517は、演算器制御信号をラッチするマスクレジスタ511、及びマスクレジスタ511を所定のタイミングで制御する演算器制御データ生成部512からなる。演算器制御データ生成部512は制御部501のレジスタ群602にも接続されている。
The arithmetic unit control unit 517 generates a signal for controlling the operation of the
図5は制御部501の構成を説明する図である。シーケンス制御部601は、レジスタ群602に設定された情報に従って、演算回路22の動作を制御する各種制御信号604を入出力する。同様にシーケンス制御部601はメモリ制御部605を制御するための制御信号606を生成する。シーケンス制御部601はバイナリカウンタやジョンソンカウンタ等からなるシーケンサにより構成する。レジスタ群602は不図示の複数のレジスタセットからなり、階層的なCNN処理を行うための情報等が保持される。
FIG. 5 is a diagram illustrating a configuration of the
図6は、図5に示すレジスタ群602の複数のレジスタセットに設定された情報の例を示す図である。複数のレジスタセットに設定された情報の例としてのレジスタ内容1101a、レジスタ内容1101b及びレジスタ内容1101cのそれぞれが1つの特徴面を算出するために必要な情報である。レジスタ群602にはブリッジ24及び画像バス23を介してCPU27から予め所定の値が書き込まれる。
FIG. 6 is a diagram showing an example of information set in a plurality of register sets of the
なお、ここではレジスタセット内の各レジスタが32bit幅であるとする。レジスタ内容1101aにおいて、「最終層指定」は当該レジスタセットに対応する特徴面が最終層か否かを指定するレジスタ値である。「最終層指定」を示す当該レジスタ値が1の場合、算出対象の特徴面が最終層の特徴面であって、最終層の特徴面の算出処理が全て終了するとCNN処理が終了する。「参照データ面の数」は算出対象の特徴面と接続する前階層の特徴面の数を指定する値であり、例えば、図3に示す特徴面305aを演算する場合の「参照データ面の数」のレジスタ値に「3」が設定される。「非線形変換」は、非線形変換処理の有無を指定するためのレジスタ値であり、当該レジスタ値に「1」が設定されている場合、非線形変換処理を実行する。「演算結果格納先ポインタ」は対象とする特徴面の演算結果を保持するためのRAM500上の先頭ポインタを示すアドレスであり、当該ポインタ値を先頭ポインタとして演算結果をラスタスキャン順に格納する。
Here, it is assumed that each register in the register set has a width of 32 bits. In the
「カーネルの水平サイズ」及び「カーネルの垂直サイズ」は当該特徴面のコンボリューション演算に使用するカーネルのサイズを指定するレジスタ値である。「並列度」は、当該特徴面のコンボリューション演算を実行する際に並列に動作する演算器の数を指定するレジスタ値である。ここで設定する並列度はカーネルのサイズやRAM500からのデータ転送能力等に対応して予め設定する。カーネルサイズ(フィルタサイズ)と並列度の関係は後述する。
The "horizontal size of the kernel" and the "vertical size of the kernel" are register values that specify the size of the kernel used for the convolution operation of the feature plane. The "degree of parallelism" is a register value that specifies the number of arithmetic units operating in parallel when executing the convolution operation of the characteristic surface. The degree of parallelism set here is set in advance according to the size of the kernel, the data transfer capacity from the
「重み係数格納先」は、当該特徴面の演算に使用するカーネルの重み係数のRAM500上の格納先アドレスを示すレジスタ値である。重み係数データは「参照データ面の数」と同じ数の係数の組を有し、「重み係数格納先」のレジスタ値で指定されるアドレスからラスタスキャン順に格納されているものとする。即ち「カーネルの水平サイズ」×「カーネルの垂直サイズ」×「参照データ面の数」の個数の係数データがRAM500に格納されている。「参照データの垂直サイズ」のレジスタ値と、「参照データの水平サイズ」のレジスタ値とは、それぞれ参照画像データ又は参照特徴面の水平方向画素数及び垂直方向ライン数を示す情報である。
The “weight coefficient storage destination” is a register value indicating the storage destination address of the weight coefficient of the kernel used for the calculation of the characteristic surface on the
参照データは「参照データ格納先ポインタ」のレジスタ値の示すアドレスを先頭としてRAM500上にラスタスキャン順に格納されているものとする。即ち「参照データの水平サイズ」×「参照データの垂直サイズ」×「参照データ面の数」の個数の参照データがRAM500に格納されている。以上説明した複数のレジスタ値が算出する各特徴面単位に用意されている。演算の処理対象とする特徴面の「参照データ格納ポインタ」のレジスタ値が前階層結合対象特徴面の「演算結果格納先ポインタ」と等しい場合、本実施形態では、参照される前階層の特徴面と算出される特徴面とが結合されていることになる。
It is assumed that the reference data is stored in the
シーケンス制御部601は上記「カーネルの水平サイズ」、「カーネルの垂直サイズ」、「参照データの水平サイズ」、「参照データの垂直サイズ」及び「並列度」等のレジスタ値に従って演算動作に関わるシーケンス制御を行う。メモリ制御部605は、シーケンス制御部601の生成する制御信号606に従って、各データバス607〜609のRAM500からの読み出し及びRAM500への書き込みのためのアクセスを調停する。
The sequence control unit 601 is a sequence related to the calculation operation according to the register values such as "horizontal size of kernel", "vertical size of kernel", "horizontal size of reference data", "vertical size of reference data" and "parallel degree". Take control. The
具体的には、メモリ制御部605は、画像バス603を介したメモリへのアクセス、参照データ607の読み出し、重み係数データ608の読み出し、演算結果データ609の書き出しを適切に制御する。RAM500へのアクセスに関する説明は後述する。なお、RAM500のデータ幅及び各データバス607〜609のデータ幅は全て32bitであるとする。
Specifically, the
図2の記憶部502及び記憶部503は、例えば複数のレジスタやメモリにより構成する。記憶部502はRAM500に保持されたカーネルの重み係数データを一時的に保持するために使用される。重み係数が8bitで表されるデータの場合、記憶部502は8bit幅の複数のレジスタで構成する。
The storage unit 502 and the
また、記憶部502はコンボリューション演算を並列に処理する方向と同じ方向のカーネルサイズと同じ数のレジスタを有する。例えば、コンボリューション演算を水平方向に並列に処理する場合、水平方向のカーネルサイズが「11」の場合、記憶部502のレジスタの数は「11」とする。実際には、複数のカーネルサイズがあるので、記憶部502は想定する最大のカーネルサイズのレジスタ数で構成する。制御部501はシフトレジスタ504のシフト動作中にRAM500から次の行の積和演算処理に必要なカーネルの重み係数を記憶部502のレジスタにロードする。
Further, the storage unit 502 has the same number of registers as the kernel size in the same direction in which the convolution operations are processed in parallel. For example, when the convolution operation is processed in parallel in the horizontal direction, the number of registers in the storage unit 502 is "11" when the kernel size in the horizontal direction is "11". Since there are actually a plurality of kernel sizes, the storage unit 502 is configured by the number of registers having the maximum kernel size assumed. The
記憶部503はRAM500に格納された参照データを一時的に保持するために使用される。例えば参照データが8bitで表されるデータの場合、記憶部503は8bit幅の複数のレジスタで構成する。記憶部503は「並列に処理可能なデータの数」+「並列処理する方向と同じ方向のカーネルサイズ−1」以上の個数のレジスタで構成する。ここでは、「並列に処理可能なデータの数」は演算回路22の最大並列度である。ここでのレジスタ個数は、一度に複数の位置の特徴面データを算出する(並列演算する)ために必要な参照するデータを得るための値であり、当該データの個数以上のレジスタ個数であれば良い。例えば,コンボリューション演算を水平方向に並列に処理するとして、カーネルサイズが「11」、並列度が「8」の場合18個以上の8bitレジスタで記憶部503を構成することになる。
The
制御部501はシフトレジスタ505のシフト動作中にRAM500から次の列処理に必要な参照データを記憶部503にロードする。即ち、コンボリューションの積和演算処理とRAM500からのデータロードとはカーネルの行単位でパイプライン動作する。なお、実際に必要な参照データの数は「並列度」レジスタの内容に従って決まる。
The
シフトレジスタ504、シフトレジスタ505及びシフトレジスタ506はデータロード機能付のシフトレジスタである。シフトレジスタ504及びシフトレジスタ505はそれぞれ記憶部502及び記憶部503と同じbit幅の複数のレジスタで構成し、シフトレジスタ506は累積加算器出力の有効bitと同じbit幅数の複数のレジスタで構成する。また、マスクレジスタ511は乗算器507a〜507nの数と同じbit幅数の複数のレジスタで構成する。
The
シフトレジスタ504はシフト動作により、各乗算器507a〜507nに共通のパラメータデータ(重み係数)を順次供給するデータ供給部である。シフトレジスタ505はシフト動作により各乗算器507a〜507nに前階層の異なる位置の参照データを並列に供給するデータ供給部である。
The
シフトレジスタ504、シフトレジスタ505及びシフトレジスタ506は、基本的な構成は同じであるので、図7にこれらのシフトレジスタの構成例を示す。図7はレジスタ個数が4の場合の例を説明する。フリップフロップ701a〜dは多bitのフリップフロップであり、CLOCK信号に同期して所定bitのデータをラッチする。セレクタ702a〜cは、選択信号であるLoad信号の値が0である場合、フリップフロップ701a〜dの出力信号OUTx(x:0〜2)を選択し、1である場合、フリップフロップ701a〜dの入力信号INx(x:1〜3)を選択する。即ち、Load信号の値に応じてフリップフロップ701a〜dのシフト動作とロード動作との何れかを選択する。Enalbe信号はデータ遷移のイネーブル信号であり、Enalbe信号の値が1である場合、CLOCK信号の立ち上がりでデータをラッチし、0である場合、前クロックでラッチしたデータをそのまま保持する(状態遷移はしない)。
Since the
図2おけるLoad2信号、Load4信号及びLoad5信号はそれぞれ図7のLoad信号に対応し、図2におけるEnable1信号、Enable2信号及びEnable3信号は図7のEnable信号に対応するものである。 The Load2 signal, the Load4 signal, and the Load5 signal in FIG. 2 correspond to the Load signal of FIG. 7, respectively, and the Enable1, Enable2 signal, and Enable3 signal of FIG. 2 correspond to the Enable signal of FIG. 7.
シフトレジスタ504は記憶部502から重み係数の初期データを一括ロードした後、水平方向のカーネルサイズと同じクロック数シフト動作を実行し、乗算器507a〜507nに対して重み係数データを連続して供給する。シフトレジスタ504の出力信号であるOUTn信号は、シフトレジスタ最終段出力から出力され、全ての乗算器507a〜nに入力される。
The
同様に、シフトレジスタ505は記憶部503から参照データの初期データをロードした後、水平方向のカーネルサイズと同じクロック数シフト動作を実行し、乗算器507a〜507nに対して複数の異なる参照データを同時に供給する。シフトレジスタ504とシフトレジスタ505は同期して動作する。
Similarly, the
このタイミングで参照データに重み係数を乗じた値が累積加算器に送られる。カーネルサイズの1行に相当するクロックのシフト処理により、異なる特徴面位置のカーネル1行分のコンボリューション演算を並列に処理する。更に、当該動作をカーネルの行数分繰り返すことで並列度に相当する特徴面位置の2次元コンボリューション演算を処理する。各部は制御部501の出力する制御信号に従って動作する。乗算器507a〜507nは並列に動作する複数の乗算器であり、累積加算器508a〜508nは並列に動作する複数の累積加算器である。乗算器507a〜507nと累積加算器508a〜508nとは一対一に接続し、合わせて演算器と称する。
At this timing, the value obtained by multiplying the reference data by the weighting coefficient is sent to the cumulative adder. By shifting the clock corresponding to one line of the kernel size, the convolution operations for one line of the kernel at different feature plane positions are processed in parallel. Further, by repeating the operation for the number of lines of the kernel, a two-dimensional convolution operation of the feature plane position corresponding to the degree of parallelism is processed. Each unit operates according to the control signal output by the
乗算器507a〜507nの構成例を図8に示す。本実施形態の乗算器は一般的な乗算器1401及びセレクタ1402から構成される。セレクタ1402は演算制御信号1403が有効(アクティブ)でない場合、Input2の代わりに入力値0を選択する。入力値0が選択された場合、入力値Input1の如何に係らず乗算器ロジック内の信号値が遷移することは無く、信号遷移に伴う消費電流の増加はない。演算制御信号1403は図2におけるマスクレジスタ511から出力される制御信号513a〜513nの何れかである。ここで、Input2は参照データの入力でもよいし、係数データの入力でもよい。また、マスクレジスタ511の出力(演算制御信号1403)で乗算器1401への入力データをマスクする方法について説明したが、記憶部503で入力データを0にするなどの対応方法でもよい。
FIG. 8 shows a configuration example of the
累積加算器508a〜508nは図9に示すように加算器901とレジスタ902で構成し、Latch Enable信号に従って入力データの累積和を保持する。Latch Enable信号には図示しないクロック信号に同期した信号である。なお、乗算器の出力である乗算結果が0にスタックされている場合(即ち乗算器の動作が停止している場合)、累積加算器508の信号遷移が生じることもないため、乗算器同様に消費電流の増加は無い。このように、マスクレジスタ511が出力した制御信号513a〜513nによって乗算器と累積加算器との動作を停止させることで、乗算器と累積加算器との消費電流の増加を抑えることができる。即ち、本実施形態の演算回路の並列度は、マスクレジスタ511の出力した制御信号513a〜513nによって制御される。なお、演算回路の並列度は、同時に動作する演算器(乗算器又は累積加算器)の数である。演算回路の並列度が低い場合、動作する演算器が少ないので、消費電力を低く抑えることができる。
As shown in FIG. 9, the
ここで得られた累積和は、対象特徴面に対応するカーネル毎の演算終了後、シフトレジスタ506に演算結果をロードし、所定のタイミングで非線形変換処理部509に送る。シフトレジスタ506は複数個の累積加算器508a〜508nの出力を保持する事が可能なシフトレジスタである。なお、累積加算器508a〜508nの出力は所定の有効ビットのみシフトレジスタ506に接続する。
The cumulative sum obtained here is loaded into the
なお、演算回路の並列度の制御方法として、参照データや出力データの制御と共に乗算器の入力データを0にスタックさせる場合について説明したが、これに限らない。例えば、乗算器の入力データを0にスタックさせる代わりに、対応するレジスタ及び演算器の動作を制御する方法でも良い。例えば演算器毎に動作を制御する動作クロックを停止させる事で実現可能である。その場合、乗算器507a〜n及び累積加算器508a〜nのクロック毎に論理積素子を挿入し、制御信号を接続すればよい。即ち演算器毎にクロックの供給を制御する事で演算処理の並列度を制御する。更に、乗算器507a〜n及び累積加算器508a〜nに供給する電源を制御する等の方法でも良い。
As a method of controlling the degree of parallelism of the arithmetic circuit, a case where the input data of the multiplier is stacked at 0 together with the control of the reference data and the output data has been described, but the present invention is not limited to this. For example, instead of stacking the input data of the multiplier at 0, a method of controlling the operation of the corresponding register and the arithmetic unit may be used. For example, it can be realized by stopping the operation clock that controls the operation for each arithmetic unit. In that case, a logical product element may be inserted for each clock of the
図10は非線形変換処理部509の構成を示すものである。非線形変換処理部509は、ルックアップテーブルで構成する非線形変換処理器1301及びセレクタ1302を含む。非線形変換処理器1301はルックアップテーブルに基づいて、入力Inに累積加算器の出力データである積和演算結果に対応するアドレスデータとしてROM等に保持されたデータを参照する。ROMには予めアドレス値に対応する出力Outの非線形関係が記録されているものとする。セレクタ1302は、非線形処理変換しない場合、累積加算器の出力データである積和演算結果をそのままセレクタ1302の出力データとして出力する。
FIG. 10 shows the configuration of the nonlinear
セレクタ1302は選択信号Selectが制御部501に接続され、制御部501内の「非線形変換」のレジスタ値に従って制御される。ここで変換処理したデータはRAM500の所定アドレスに格納する。ここでの格納アドレスも制御部501のレジスタ群602の設定とシーケンス制御部601の動作に従って制御される。以上、制御部501はレジスタ群602の内容に従って、各タイミング信号及びデータ転送を制御することで階層的なコンボリューション演算を並列に処理する。
The selection signal Select is connected to the
図11は本実施形態の演算回路22によるコンボリューション演算の並列処理の例を説明する図である。図11はラスタスキャンされたデータ座標を示す。並列処理する参照データ面1004の各ブロック(模式的に示す最小一升)がラスタスキャン順でRAM500に格納された入力画像又は前階層の演算結果の画素を示すものであるとする。参照データ面1004の各画素は座標1001においてinput(x,y)で示し、xは水平方向位置を示し、yは垂直方向位置を示す。並列処理の算出対象となる特徴面1003の各ブロックがラスタスキャン順の演算結果の画素を示すものとする。算出対象である特徴面1003の各画素は座標1002においてoutput(x,y)で示し、xは水平方向位置を示し、yは垂直方向位置を示す。
FIG. 11 is a diagram illustrating an example of parallel processing of convolution operations by the
特徴面の領域1003は、図2の演算回路22の複数の演算器が同時にコンボリューション演算して算出する特徴面データの領域を示す。特徴面の領域1003に示す各画素は座標1002においてoutput(x,6)で示し、xは5〜12である。図11に示す例では、特徴面の8つの注目画素位置のコンボリューション演算を同時に処理する。また、それぞれの注目画素位置では、演算器番号0〜7に対応する乗算器507a〜507n、累積加算器508a〜508nがそれぞれ演算処理を実行する。並列に処理する参照データ面1004に示す各画素は、特徴面の領域1003を算出するための参照画素データの領域を示す。図11に示す例では、カーネルサイズが水平方向「11」垂直方向「13」の場合を想定している。演算回路22の並列度が8の場合、水平方向に同時に算出する幅は「18」であるので、参照データ面の領域1004のサイズは、水平方向が「18」であり、垂直方向が「13」である。演算回路22は、参照データ面の領域1004のコンボリューション演算を同時に処理し、特徴面の領域1003を同時に算出する。このように、参照データ面の水平方向に8画素単位、垂直方向に1ライン単位で走査させながら、並列に2次元のコンボリューション演算を実行する。なお、本実施形態では、水平方向に並ぶ複数の特徴面のデータを並列に算出する場合に限らず、垂直方向に連続する特徴面データを並列に算出する構成にしても良い。この場合、記憶部502にはカーネルの1列の重み係数がロードされ、記憶部503には「並列度+カーネルの垂直方向サイズ−1」個の水平方向に連続する参照データがロードされる。なお、フィルタサイズは、並列に演算する方向によってカーネルの垂直方向サイズ又は水平方向サイズである。図11では、カーネルの垂直方向サイズを例に説明した。
The
図12は本実施形態の並列演算回路22によるコンボリューション演算の動作を説明するタイムチャートである。図12は1つの特徴面を算出するためのコンボリューション演算処理の一部を説明する図である。また、図12に示す信号は全て図示しないクロック信号に基づいて同期動作し、クロック信号単位で1回の積和演算を処理するものとする。Load1信号は記憶部502にカーネルの重み係数データをロードするためのイネーブル信号を示す。制御部501は当該信号が有効(信号レベルが1)の期間にRAM500からカーネルの1行分の重み係数データを読み出し、記憶部502に書き込む。カーネルの1行の大きさ(重み係数のデータサイズ)は図5に示すレジスタ群602に保持されている。また、制御部501はレジスタ群602で指定する重み係数のアドレスポインタ情報、重み係数のデータサイズ及び参照するデータ面数等を元に読み出すデータのアドレスを決定する。ここで、RAM500のデータ幅は32bitであり、重み係数のデータ幅は8bitであるとすると、記憶部502に水平方向1行分の11個の重み係数を書き込む場合、3クロックでロード処理を完了する。
FIG. 12 is a time chart illustrating the operation of the convolution calculation by the
以降、RAM500に対する読み出し/書き込みサイクルは全て1クロックで完了するものとする。制御部501は、重み係数のロードが完了すると、次に参照データのロードを開始するためにLoad3信号を有効化する。Load3信号もLoad1信号と同様に信号レベル1の場合が有効化された状態であるとする。
After that, it is assumed that all the read / write cycles for the
制御部501はLoad3信号の有効化と同時にRAM500から参照データを取り出し、記憶部503にセットする。セットするデータの数はレジスタ群602に保持されているカーネルの大きさ及び並列度から決定する。また、制御部501は、レジスタ群602で指定する参照データのアドレスポインタ情報、参照データのサイズ及び参照データ面の数を元にRAM500から読み出すデータのアドレスを決定する。参照データの有効桁は8bitであるため、記憶部503に、例えば18個の参照データを書き込む場合、5サイクルで書き込みシーケンスを完了する。図11に示す例の場合は、カーネルの水平方向サイズが11、演算並列度が8である事から並列度11+8−1=18個の参照データをロードする必要がある。
The
*CLR信号は累積加算器508を初期化するための信号であり、当該信号の値が0の場合、累積加算器のレジスタ902の値は0に初期化される。制御部501は新たな特徴面位置のコンボリューション演算開始前に*CLR信号の値を0に設定する。
* The CLR signal is a signal for initializing the cumulative adder 508, and when the value of the signal is 0, the value of the
Load2信号はシフトレジスタ504の初期化を指示するための信号であり、当該信号の値が1でかつEnable1信号が有効(信号レベル1)の場合、記憶部502に保持する複数の重み係数データがシフトレジスタ504に一括ロードされる。Enable1信号はシフトレジスタのデータ遷移を制御する信号である。図12に示すようにEnable1信号は動作中に常に設定されているため、Load2信号の値が1の場合、クロック信号に応じて記憶部502の出力をラッチし、Load2信号の値が0の場合、クロック信号に応じてシフト処理を継続する。
The Load2 signal is a signal for instructing the initialization of the
制御部501のシーケンス制御部601はカーネルの水平方向のデータサイズに応じたクロック数をカウントするとLoad2信号を有効化する。
The sequence control unit 601 of the
更に、シフト動作を停止させると同時に記憶部502に保持する重み係数データをシフトレジスタ504に一括ロードする。即ち、カーネルの水平方向単位で一行の重み係数を一括ロードし、ロードした重み係数を動作クロックに応じてシフトアウトする。
Further, at the same time as stopping the shift operation, the weighting coefficient data held in the storage unit 502 is collectively loaded into the
Load4信号はシフトレジスタ505の初期化を指示するための信号であり、Load4信号の値が1でかつEnable2信号が有効(信号レベル1)の場合、記憶部503に保持する参照データがシフトレジスタ505に一括ロードされる。
The Load4 signal is a signal for instructing the initialization of the
なお、Enable2信号はシフトレジスタのデータ遷移を制御する信号である。図12に示すようにEnable2信号の値は動作中に1に設定されているため、Load4信号の値が1である場合、クロック信号に応じて記憶部503の出力をラッチし、Load4信号の値が0の場合、クロック信号に応じてシフト処理を継続する。
The Enable2 signal is a signal that controls the data transition of the shift register. As shown in FIG. 12, since the value of the Enable2 signal is set to 1 during operation, when the value of the Load4 signal is 1, the output of the
制御部501のシーケンス制御部601はカーネルの水平方向のデータサイズに応じたクロック数をカウントするとLoad4信号を有効化し、シフト動作を停止させると同時に記憶部503に保持する参照データを一括ロードする。
When the sequence control unit 601 of the
即ち、シーケンス制御部601はコンボリューション演算処理におけるカーネルの1行単位で必要な参照データを記憶部503からシフトレジスタ505に一括ロードし、シフトレジスタ505はロードした参照データを動作クロックに応じてシフトする。また、制御部501はLoad4信号をLoad2信号と同一タイミングで制御する。
That is, the sequence control unit 601 collectively loads the reference data required for each line of the kernel in the convolution operation processing from the
なお、Enable1信号及びEnable2信号は、図12に示す「水平方向演算サイクル」において、記憶部502及び記憶部503からシフトレジスタ504及びシフトレジスタ505へデータロードが間に合わない場合がある。この場合は、シーケンス制御部601はEnable1信号及びEnable2信号を非有効化することで演算器の動作を停止し、データロード時間を確保する。シーケンス制御部601は、その際、累積加算器508a〜508nのラッチ信号も非有効化する。累積加算器508a〜508nはクロックに同期して積和演算を継続しているため、シフトレジスタ504及びシフトレジスタ505のシフト動作に従って算出する特徴面の複数の位置に対して、同時にカーネルサイズに応じた積和演算処理を実行する。
Note that the Enable1 signal and the Enable2 signal may not be loaded in time from the storage unit 502 and the
具体的には、シフトレジスタ504及びシフトレジスタ505のシフト動作期間(図12中の水平方向演算サイクル期間)中に複数の特徴面の画素位置のカーネル1行分の積和演算がなされることになる。さらに、図12に示すカーネル演算区間において、カーネルの列単位の演算を重み係数及び参照データを入替ながら垂直方向に繰り返すことで並列度に応じた二次元のコンボリューション演算結果が得られる。
Specifically, during the shift operation period (horizontal calculation cycle period in FIG. 12) of the
このように、制御部501はカーネルサイズ及び並列度に応じて各信号を制御する事で、積和演算処理と積和演算処理に必要なデータ(重み係数データ及び参照データ)のRAM500からの供給を並行に処理する。図12に示す例の場合、水平方向演算サイクル内に、参照データのRAM500から記憶部503へのロード及び重み係数のRAM500から記憶部502へのロードが完了しているため、データロードに要する時間が演算速度に影響を与えることはない。しかしながら、コンボリューション演算のカーネルサイズによっては、RAM500から記憶部502や記憶部503へのデータロードに要する時間が水平方向演算サイクル内に収まらない場合がある。
In this way, the
図13はカーネルサイズと並列度とを変えた場合のデータロードサイクル(データロードに要する時間)と水平方向演算サイクルの関係を示す図である。図13は図12に示す水平方向演算サイクル単位のデータロードサイクルを算出する例である。 FIG. 13 is a diagram showing the relationship between the data load cycle (time required for data load) and the horizontal calculation cycle when the kernel size and the degree of parallelism are changed. FIG. 13 is an example of calculating the data load cycle for each horizontal calculation cycle shown in FIG.
並列度は同時に動作する乗算器507a〜507nと累積加算器508a〜508nのペアの数を示す。「参照データロード数」は図12に示す「水平方向演算サイクル」内に、RAM500から記憶部503にロードする次の演算に必要な参照データの数を示す。参照データロード数は「並列度+カーネルの水平方向サイズ−1」である。「重み係数ロード数」は図12に示す「水平方向演算サイクル」内に、RAM500から記憶部502にロードする重み係数のデータ数を示す。
The degree of parallelism indicates the number of pairs of
本実施形態の場合、次の演算に必要なデータロードサイクルの総数に相当する「総ロードサイクル」は以下の式を用いて算出できる。 In the case of this embodiment, the "total load cycle" corresponding to the total number of data load cycles required for the next calculation can be calculated using the following formula.
総ロードサイクル=INT((参照データロード数+3)÷4)+INT((重み係数ロード数+3)÷4) (2)
ここで、INT(n)はnを超えない最大の整数を求める関数である。参照データと重み係数データは夫々8bit(1バイト)である。
Total load cycle = INT ((reference data load number + 3) ÷ 4) + INT ((weight coefficient load number + 3) ÷ 4) (2)
Here, INT (n) is a function for finding the maximum integer that does not exceed n. The reference data and the weighting coefficient data are 8 bits (1 byte) each.
なお、式(2)は、前述した様にデータバスの幅は32bitである(即ち1回のアクセスで4バイト転送可能である)場合の算出式である。また、1回のメモリアクセスは1サイクルで完了するものとする。 The formula (2) is a calculation formula when the width of the data bus is 32 bits (that is, 4 bytes can be transferred with one access) as described above. Further, it is assumed that one memory access is completed in one cycle.
図13に示す「カーネル1行の演算サイクル」は、カーネル1行分のコンボリューション演算を行うためのサイクル数である。「カーネル1行の演算サイクル」はカーネルの水平方向サイズの値に相当する。「所要サイクル」はカーネル1行分のコンボリューション演算を行うために必要なサイクル数を示す。図13に示すように、「総ロードサイクル」が「カーネル1行の演算サイクル」より小さい場合、「カーネル1行の演算サイクル」が「所要サイクル」の値に相当する。この場合、演算処理時間が処理時間を決定することになる(即ち演算ボトルネック)。図13においてカーネルサイズが13×13の場合、「総ロードサイクル」が「カーネル1行の演算サイクル」より小さいので、「所要サイクル」の値は「カーネル1行の演算サイクル」の値と同じである。カーネルサイズが大きい場合、所要サイクルは常に「カーネル演算サイクル」に等しい。 The “calculation cycle of one kernel line” shown in FIG. 13 is the number of cycles for performing a convolution operation for one line of the kernel. The "one-line kernel operation cycle" corresponds to the horizontal size value of the kernel. "Required cycle" indicates the number of cycles required to perform the convolution operation for one kernel line. As shown in FIG. 13, when the "total load cycle" is smaller than the "calculation cycle of one kernel line", the "calculation cycle of one kernel line" corresponds to the value of the "required cycle". In this case, the arithmetic processing time determines the processing time (that is, the arithmetic bottleneck). In FIG. 13, when the kernel size is 13 × 13, the “total load cycle” is smaller than the “calculation cycle of one kernel line”, so the value of the “required cycle” is the same as the value of the “calculation cycle of one kernel line”. is there. For large kernel sizes, the required cycle is always equal to the "kernel arithmetic cycle".
一方、「総ロードサイクル」が「カーネル1行の演算サイクル」より大きい場合、「総ロードサイクル」が「所要サイクル」の値に相当する。この場合、データ転送時間が処理時間を決定する(即ちメモリアクセスボトルネック)。カーネルサイズが小さい場合(図13においてカーネルサイズが3×3である場合)、所要サイクルは並列度に応じて変化する。並列度が7を超えると、「総ロードサイクル」が「カーネル1行の演算サイクル」を超えるので、データ転送がボトルネックとなり、「所要サイクル」が「カーネル1行の演算サイクル」より大きい「総ロードサイクル」の値となる。 On the other hand, when the "total load cycle" is larger than the "calculation cycle of one kernel line", the "total load cycle" corresponds to the value of the "required cycle". In this case, the data transfer time determines the processing time (ie, the memory access bottleneck). When the kernel size is small (when the kernel size is 3 × 3 in FIG. 13), the required cycle changes according to the degree of parallelism. When the degree of parallelism exceeds 7, the "total load cycle" exceeds the "calculation cycle of one kernel line", so data transfer becomes a bottleneck, and the "required cycle" is larger than the "calculation cycle of one kernel line". It becomes the value of "load cycle".
このような場合、図2に示す演算回路の制御部501は、RAM500へアクセス完了(記憶部502及び記憶部503へのデータロード及び非線形変換処理部509のデータセーブ)を優先する。即ち、Enable1信号、Enable2信号、Enable3信号及び累積加算器のLatch Enable信号等を制御する。それによって、シフトレジスタ504とシフトレジスタ505とのシフト動作及び累積加算器508a〜508nの動作を停止し、積和演算処理の開始をデータロードの完了まで遅延させる。
In such a case, the
「1画素当たり処理時間」はカーネル1行分のコンボリューション演算を並列に実行する際の、1画素当たりの処理時間を表す値である。「1画素当たり処理時間」は以下の式で定義する。 The "processing time per pixel" is a value representing the processing time per pixel when the convolution operations for one kernel line are executed in parallel. "Processing time per pixel" is defined by the following formula.
1画素当たり処理時間=所要サイクル÷並列度 ‥ (3)
カーネルサイズが大きい場合(図13においてカーネルサイズが13×13の場合)「1画素当たり処理時間」は並列度と共に低下する。即ち、並列度が大きいほど全体の処理時間が短くなる。一方、カーネルサイズが小さい場合(図13においてカーネルサイズが3×3の場合)、例えば、並列度が7では、並列度が6に比べて「一画素当たり処理時間」が大きくなる。即ち、並列度を上げたにもかかわらず、処理時間が増大する。並列度を8にした場合であっても、「一画素当たり処理時間」は並列度が6の場合と同じである。即ち、並列度を上げたにもかかわらず、処理時間は変わらない。これは、データ転送がボトルネックとなって、RAM500から記憶部502及び記憶部503へデータをロードする時間が乗算器507a〜507n及び累積加算器508a〜508nの演算処理の時間より長いためである。
Processing time per pixel = required cycle ÷ degree of parallelism (3)
When the kernel size is large (when the kernel size is 13 × 13 in FIG. 13), the “processing time per pixel” decreases with the degree of parallelism. That is, the larger the degree of parallelism, the shorter the overall processing time. On the other hand, when the kernel size is small (when the kernel size is 3 × 3 in FIG. 13), for example, when the parallel degree is 7, the “processing time per pixel” is larger than when the parallel degree is 6. That is, the processing time increases even though the degree of parallelism is increased. Even when the degree of parallelism is 8, the "processing time per pixel" is the same as when the degree of parallelism is 6. That is, the processing time does not change even though the degree of parallelism is increased. This is because the data transfer becomes a bottleneck and the time for loading data from the
並列度が8の場合、乗算器507a〜507n及び累積加算器508a〜508nの同時動作数が8であり、並列度6の場合に比べて多いため、演算時のピーク消費電流がより大きい。デバイスのダイナミックな消費電力は電流値の2乗和に比例するため、消費電力の観点から並列度は出来るだけ低いことが望ましい。
When the degree of parallelism is 8, the number of simultaneous operations of the
従って、本実施形態では、制御部501は演算回路22の並列度の最大値に設定された場合に、演算処理時間とデータ転送時間と同じ程度同じ程度になるカーネルサイズ(フィルタサイズ)を所定値とする。カーネルサイズ(フィルタサイズ)が所定値以下である場合はメモリアクセスボトルネックになるので、フィルタサイズに基づいて制御部501は演算回路22の並列度を最大値より低く設定し、演算処理時間とデータ転送時間とを同じ程度にする。例えば、カーネルサイズ(フィルタサイズ)が3×3の場合、制御部501は、演算回路22の並列度を6に設定する。これにより、コンボリューション演算の処理速度は変わらず、消費電力を低減することが可能になる。なお、演算回路22の並列度を毎回算出するのではなく、カーネルサイズ(フィルタサイズ)と演算回路22の並列度との対応関係を示すデータテーブルを予めRAM500に保持することができる。制御部501はRAM500に保持されたデータテーブルを参照することによって、演算回路22の並列度を設定することができる。
Therefore, in the present embodiment, when the
本実施形態では、このような観点からカーネルサイズに応じて並列度を設定する。並列度の設定は、前述した様に、図6に示すレジスタの内容に従う。図2において制御部501は当該レジスタに記された並列度に従って並列演算回路の動作を制御する。例えば、並列処理が可能な演算器(乗算器507a〜507n及び累積加算器508a〜508n)の数が8であっても、カーネルサイズが3×3の場合、並列度を6に設定して演算器を動作させる。
In the present embodiment, the degree of parallelism is set according to the kernel size from such a viewpoint. As described above, the degree of parallelism is set according to the contents of the registers shown in FIG. In FIG. 2, the
制御部501は、この場合、RAM500から記憶部503には並列度が6に対応する数の参照データをロードし、演算処理を開始する。演算器制御データ生成部512は、演算処理に先立ち、レジスタ群602に記された「並列度」情報に従って、演算器制御信号514を生成する。例えば、並列度が6の場合、演算器制御データ生成部512は、演算器並列信号「11111100」を生成する。各ビットが夫々の制御信号を示し、1が動作演算器に対応し、0が停止演算器に対応する。
In this case, the
演算器制御部517はコンボリューション演算開始のタイミングでEnable4信号を有効化し、当該制御信号をマスクレジスタにラッチする。ラッチした各信号(演算器を直接制御する信号513a〜513n)はコンボリューション演算中の乗算器507a〜507nの動作を制御する。具体的には乗算器0〜乗算器5及び累積加算器0〜累積加算器5のみに演算動作をさせる。
The arithmetic unit control unit 517 activates the Enable4 signal at the timing of starting the convolution calculation, and latches the control signal in the mask register. Each latched signal (signals 513a to 513n that directly control the arithmetic unit) controls the operation of the
Load5信号は累積加算器の結果をシフトレジスタ506に並列にロードするための信号であり、制御部501は対象となる特徴面の並列処理単位の積和演算が終了するとLoad5信号及びEnable3信号の値に1を設定する。図12は結合先の特徴面が1つの場合の例(即ち1組のコンボリューション演算のみで特徴面を算出する場合)を示す。
The Load5 signal is a signal for loading the result of the cumulative adder in parallel to the
シフトレジスタ506はLoad5信号の値が1で、Enable3信号の値が1である場合、累積加算器508の出力を一括ロードする。このタイミングでは計算済みのコンボリューション演算結果がシフトレジスタ506にラッチされる。制御部501はシフトレジスタ504及びシフトレジスタ505のシフト動作中に記憶部502及び記憶部503へのデータロードが完了している場合、Enable3の信号を有効化し、シフトレジスタ506に保持する乗算結果をシフトアウトする。シフトアウトした演算結果は非線形変換処理部509で変換処理された後、制御部501により、レジスタ群602に記された演算結果格納先ポインタ及び参照データのサイズに従ってRAM500の所定のアドレスに格納される。
When the value of the Load5 signal is 1 and the value of the Enable3 signal is 1, the
RAM500から記憶部502及び記憶部503へのデータロードの間隙で制御部501はEnable3信号を有効化して、シフトレジスタ506から演算結果をシフトアウトする。ここでも、制御部501はレジスタ群602に記された「並列度」情報に従ってシフトアウトするデータ数を制御する。並列度が6の場合、6演算結果をシフトアウトする。
The
以上のように、制御部501はレジスタ群602に記された「並列度」情報に従って並列度を決定し、各部を制御する。
As described above, the
制御部501は、記憶部502と記憶部503及び非線形変換処理部509の3つの処理部のRAM500に対するアクセスを調停し、積和演算処理と当該3つの処理部のRAM500へのアクセスをパイプライン化する。
The
なお、非線形変換処理部509は記憶部502及び記憶部503に比べてRAM500に対するアクセス頻度が低いため最も低い優先順位で動作する。即ち、記憶部502及び記憶部503のアクセスの間隙となるタイムスロットで非線形変換処理部509のアクセスを行う。
The nonlinear
図14は本実施形態の演算回路22を含む画像処理装置の動作を説明するフローチャートである。以下、フローチャートは、CPU27が制御プログラムを実行することにより実現されるものとする。なお、本実施形態ではパターン認識を行う画像処理装置を例に説明するが、本実施形態の画像処理装置はパターン認識処理に限らず、オブジェクト検出などの処理にも適用できる。
FIG. 14 is a flowchart illustrating the operation of the image processing apparatus including the
ステップS101では画像処理装置のパターン認識処理の開始に先立ち、CPU27が各種初期化処理を実行する。CPU27は、画像処理装置のCNN処理部である演算回路22の動作に必要な重み係数をROM28からRAM500に転送すると共に、演算回路22の動作、即ちCNN処理のパラメータを定義する為の各種レジスタの設定を行う。具体的に、CPU27は演算回路22の制御部501に存在する複数のレジスタ群602に所定の値を設定する。
In step S101, the
更に、ステップS102はカーネルのサイズやデータ転送時間に基づいて並列度を設定する。並列度は、前述した様に、カーネルのサイズやメモリのアクセスサイクル等から予め決定するものである。ステップS102の処理が終了すると、ステップS103に進み、各ハードウェアモジュールが起動し、一連のパターン認識動作を開始する。 Further, step S102 sets the degree of parallelism based on the size of the kernel and the data transfer time. As described above, the degree of parallelism is determined in advance from the kernel size, the memory access cycle, and the like. When the process of step S102 is completed, the process proceeds to step S103, each hardware module is started, and a series of pattern recognition operations is started.
まず、ステップS104では画像入力モジュール20が、画像センサーの出力する信号をディジタルデータに変換し、フレーム単位で図示しない(画像入力モジュール20に内蔵する)フレームバッファに格納する。更に、フレームバッファへの格納が完了すると、所定の開始信号に基づいて、前処理モジュール25が画像変換処理を開始する。前処理モジュール25はフレームバッファ上の画像データから輝度データを抽出し、コントラスト補正処理を行う。輝度データは、線形変換処理により、RGB画像データからYIQ(National Television Standard Committeeが規定する表色系)画像データに線形変換する事で生成する。コントラスト補正の手法は一般的に知られているコントラスト補正処理を適用して輝度データ(Yデータ)のコントラストを強調する。
First, in step S104, the
前処理モジュール25はコントラスト補正処理後の輝度データを処理用画像としてRAM500に格納する。更にステップS104では、顔候補検出モジュール31が動作する。顔候補検出モジュール31はフレームバッファに格納されたYIQカラー画像データから肌色領域を特定し、特定結果を処理対象領域情報としてRAM500に格納し、処理対象領域の画像の取得が終了する。1枚の画像データに対する処理が終了すると、顔候補検出モジュール31は図示しない完了信号(割り込み信号)を有効にする。完了信号を受信したCPU27は、次に、ステップS105に進み、演算回路22を起動し、CNN処理によって高精度なパターン認識処理を実行する。演算回路22は、前処理モジュール25の処理結果である補正後輝度画像データと顔候補検出モジュール31の処理結果である処理対象領域に関する情報を利用して、処理対象領域の画像データに対してのみ並列にコンボリューション演算を実行する。
The
ステップS105において、演算回路22は、レジスタ群602の設定値に従ってコンボリューション演算で使用するカーネルを選択する。更に、ステップS106において、レジスタ群602の設定値に従って、並列に動作する演算器を指定する。次に、演算回路22は、ステップS107において、ステップS105で選択したコンボリューション演算用のカーネル(例えば図3に示す3041a〜b等)を用いて、ステップS106で指定した複数の演算器でコンボリューション演算を並列に処理する。ステップS108において、演算回路22は、全ての特徴面に対する処理が終了したかを判定する。全ての特徴面に対する処理が終了するとステップS109に進む。図3の例では、全ての特徴面に対する処理を終了する場合は、特徴面307の算出が終了した場合である。ステップS109において、演算回路22は、CPU27に対して全ての特徴面に対する処理の終了を通知する割り込み信号を生成する。ステップS110において、ステップS104からステップS109までの処理を画像全てに対して実行する。
In step S105, the
CPU27は制御部501からの終了通知割り込みを受信すると、DMAC26を起動し、RAM500上の最終特徴面データをCPUバス30上のRAM29に転送する。CPU27はRAM500におかれた最終層検出結果から検出対象である所定の物体の位置や大きさなどの情報を取得する。具体的には最終検出結果を二値化処理しラベリング等の処理によりオブジェクト位置やサイズを抽出する。
Upon receiving the end notification interrupt from the
一般的なコンボリューションの並列演算回路では、カーネルに対して演算器を割り付ける構成を取ることが多い。図20はカーネルサイズが2×2の4つの係数を4つの並列乗算器2100で並列処理する場合の例を示している。この場合、カーネルと並列演算器が依存関係を有しているため、参照データの供給能力等に応じて同時に動作する演算器の数(並列度)を変えることは容易ではない。一方、本実施形態の構成では、生成する特徴面の画素位置毎の並列処理であるため、そもそもカーネルと演算器に依存関係がなく、簡単な制御で動作条件に応じて演算の並列度を変更することができる。
In a general convolution parallel computing circuit, an arithmetic unit is often assigned to the kernel. FIG. 20 shows an example in which four coefficients having a kernel size of 2 × 2 are processed in parallel by four
本実施形態によれば、CNN処理を並列に高速処理する並列演算回路において、カーネルのサイズや参照データの供給能力に基づいて並列に演算する演算回路22の並列度を決定する。これによって、演算回路22の演算処理速度が低下することなく、無駄な回路動作を抑えて消費電力を低減させることが可能になる。なお、本実施形態では、データ転送がボトルネックになる場合の例として、カーネルのサイズが小さい場合について説明したが、これに限定せず、データ転送がボトルネックになる他の場合にも本件を適用できる。
According to the present embodiment, in a parallel computing circuit that performs high-speed processing in parallel in parallel, the degree of parallelism of the
(第2の実施形態)
本実施形態の画像処理装置の構成は、第1の実施形態と同じであるので、以下では、本実施形態が第1の実施形態と異なる処理について説明。図15は本発明の第2の実施形態の画像処理装置の処理例を模式的に説明する図である。図15の処理では、画像処理装置は、入力画像における顔候補領域のデータサイズに応じて演算回路の並列度を変更する。
(Second Embodiment)
Since the configuration of the image processing apparatus of the present embodiment is the same as that of the first embodiment, the processing in which the present embodiment is different from that of the first embodiment will be described below. FIG. 15 is a diagram schematically illustrating a processing example of the image processing apparatus according to the second embodiment of the present invention. In the process of FIG. 15, the image processing device changes the degree of parallelism of the arithmetic circuit according to the data size of the face candidate region in the input image.
ここで、入力画像中の顔画像領域を認識する処理を例に説明する。入力画像データ1501は、画像入力モジュール20から入力される画像データである。入力画像データ1501は顔候補検出モジュール31による顔候補の検出処理1502を経て、コンボリューション演算1506で高精度な認識処理を行う領域に関する領域限定情報1503(座標情報)が生成される。領域限定情報1503がコンボリューション演算1506の入力画像データ1501における処理対象領域に関する情報である。座標データ1504aと座標データ1504bとに示される領域(白抜き領域)にあるデータが入力画像データ1501の処理対象データとなる。顔候補の検出処理1502では、処理負荷の低い簡単な処理で入力画像における顔候補領域を取得する。顔候補領域の取得法としては、特定の色情報を含む矩形領域や楕円領域を抽出する方法や、前フレームの抽出結果(動画像に適用した場合)を利用する方法等、様々な方法が適用可能である。顔候補領域の画素データは、コンボリューション演算1506によって演算処理する処理対象データである。
Here, the process of recognizing the face image area in the input image will be described as an example. The
本実施形態では、顔候補領域の大きさに基づいて、演算回路22は各演算器1507の実行を制御する。ここで、コンボリューション演算1506は図2に示す演算回路によって実行される。具体的に、並列に演算される特徴面の各画素1507は図2における乗算器507a〜507n及び累積加算器508a〜508nによって算出され、各演算器1507の制御は図2における演算器制御部517によって実行される。また、図15では並列演算回路の並列度が8の場合の例を示している。すなわち、並列に処理する各演算器1507は水平方向に連続する8個の注目画素位置のコンボリューション演算処理を同時に実行する。なお、図15では、各演算器1507の位置を中心とした画素領域の入力画像データを参照してコンボリューション演算を行う。
In the present embodiment, the
各演算器1507は8画素単位で演算処理を繰り返し、画像データをスキャンする事で、一枚の画像データに対するコンボリューション演算を完了する。なお、CNN処理を実行する場合、複数の特徴面を算出するための複数のフィルタ係数(カーネル係数)を用いてコンボリューション演算を繰り返し実行する。
Each
なお、本実施形態の演算回路では顔の認識処理に限らず、他の物体の認識処理にも適用できる。他の物体の認識処理では、顔候補領域の検出処理を認識対象物体の候補領域の検出処理に置き換えて、同様に処理することができる。 The arithmetic circuit of the present embodiment can be applied not only to the face recognition process but also to the recognition process of other objects. In the recognition process of other objects, the detection process of the face candidate region can be replaced with the detection process of the candidate region of the recognition target object, and the same processing can be performed.
本実施形態では、演算器制御信号生成部517は、顔候補領域の検出処理1502で得られた顔候補領域(顔候補領域を示す座標データ)から並列に処理する各演算器を制御するための信号を生成する。演算器制御信号生成部517では各演算器1507の動作に同期し、かつ演算の種別(コンボリューションのカーネルサイズ等)に応じたタイミングで制御信号を出力する。
In the present embodiment, the arithmetic unit control signal generation unit 517 controls each arithmetic unit to be processed in parallel from the face candidate region (coordinate data indicating the face candidate region) obtained in the face candidate
以下、図16に示すフローチャートを用いて本実施形態の画像処理装置の処理を説明する。なお、画像処理装置の構成及び演算回路22の構成は夫々第1の実施形態と同じである。
Hereinafter, the processing of the image processing apparatus of the present embodiment will be described with reference to the flowchart shown in FIG. The configuration of the image processing device and the configuration of the
ステップS1601では画像処理装置の処理開始に先立ち、CPU27が各種初期化処理を実行する。CPU27は、画像処理装置のCNN処理部である演算回路22の動作に必要な重み係数をROM28からRAM500に転送すると共に、演算回路22の動作、即ちCNN処理のパラメータを定義する為の各種レジスタ設定を行う。具体的にはCPU27は演算回路22の制御部501に存在する複数のレジスタ群602に所定の値を設定する。
In step S1601, the
各種初期化が終了すると、ステップS1602に進み、CPU27は各ハードウェアモジュールを起動し、一連の顔認識処理を開始する。まず、ステップS1603では画像入力モジュール20が、画像センサーの出力する信号をディジタルデータに変換し、フレーム単位で図示しない(画像入力モジュール20に内蔵する)フレームバッファに格納する。更に、フレームバッファへの格納が完了すると、所定の開始信号に基づいて、前処理モジュール25が画像変換処理を開始する。前処理モジュール25は前記フレームバッファ上の画像データから輝度データを抽出し、コントラスト補正処理を行う。前処理モジュール25はコントラスト補正処理後の輝度データを検出用画像としてRAM500に格納する。
When the various initializations are completed, the process proceeds to step S1602, and the
更に、ステップS1603では、顔候補検出モジュール31が動作する。顔候補検出モジュール31はフレームバッファに格納されたYIQカラー画像データから肌色領域を特定定し、画像データにおける肌色領域を含む矩形領域を顔候補領域として取得する。また、コンボリューション演算のための顔候補領域を含む処理対象領域を取得する。1枚の画像データに対する領域取得処理が終了すると、顔候補検出モジュール31は図示しない完了信号(割り込み信号)を有効にする。完了信号を受信したCPU27は次に、ステップS1604に進み、演算回路22を起動し、高精度な顔認識処理を実行する。演算回路22は、前処理モジュール25で得られた補正後輝度画像データと、顔候補検出モジュール31で取得した顔候補領域(処理対象領域)を利用して、処理対象領域の画像データに対してのみ並列にコンボリューション演算処理を実行する。本実施形態では、顔候補検出モジュール31は、入力画像データにおける肌色領域を顔候補領域として取得する場合について説明したが、認識対象の形状情報等の他の特徴を利用した様々な方法を適用して認識対象の候補領域を取得することが可能である。また、外部から指定された領域限定情報によって認識対象の候補領域を取得してもよい。例えば、CPU27が所定の条件に従って領域限定情報を予め設定し、所定の小領域を切り出して認識対象の候補領域として取得することができる。また、候補領域が矩形領域に限らず、楕円等他の形状で表現することもできる。
Further, in step S1603, the face
本実施形態では、まず、ステップS1604では、顔候補検出モジュール31は、ステップS1603で取得した顔候補領域から顔候補領域のサイズを特定する。ここで特定する顔候補領域のサイズは、並列演算の方向と同じ方向の顔候補領域のサイズ(顔候補領域の幅方向の画素数或いは高さ方向の画素数)である。次に、ステップS1605では、取得したサイズに応じて、並列演算する際の並列度を決定する。
In the present embodiment, first, in step S1604, the face
図17は本実施形態における並列度の決定方法について説明する図である。並列度を決定する際に、参照データとなる入力画像データ及び演算結果である特徴面データの何れを用いても同じ結果であるが、説明を簡単にするために、図17では演算結果である特徴面データを用いて説明する。図17(a)は従来の並列演算の演算結果を示す図である。画像データ1701は演算結果の画像データ面(特徴面)を示す。図17(a)及び。図17(b)の白抜きの領域(マスク)は演算結果の画像データ面1701において、入力データ画像における顔候補領域に対応する特徴面の領域1702を示す。この白抜きの領域は、演算回路22が顔候補領域のデータを参照してコンボリューション演算処理して算出する特徴面であって、その大きさは入力画像データにおける顔候補領域の大きさと対応するものである。以下、この白抜きの領域を算出対象領域と称する。
FIG. 17 is a diagram illustrating a method of determining the degree of parallelism in the present embodiment. When determining the degree of parallelism, the same result is obtained regardless of whether the input image data as the reference data or the feature plane data which is the calculation result is used, but for the sake of simplicity, the calculation result is shown in FIG. This will be described using feature plane data. FIG. 17A is a diagram showing an operation result of a conventional parallel operation. The
図17(a)は、並列に演算可能な演算器(乗算器507a〜507n及び累積加算器508a〜508n)の数が8の場合を示す。算出対象領域1702に対する演算を並列に処理する場合、ブロック1703a及びブロック1703bのそれぞれで示す8個の演算器による2回の繰返しの処理で当該算出対象領域1702の1行の画素を算出する。しかしながら、ブロック1703bで示す8個の演算器が処理する場合、必要な演算は演算器番号0及び1の2点の演算器であり、演算器番号2〜7で示す演算器は不要な演算処理を実行する。
FIG. 17A shows a case where the number of arithmetic units (
本実施形態では図17(b)に示す様に、算出対象領域1702のサイズに応じて演算回路22の並列度を決定する。図17(b)の場合、並列度を5に設定する。この場合、ブロック1704aで示す5個の演算器及びブロック1704bで示す5個の演算器のどちらも、演算器(乗算器507a〜507n及び累積加算器508a〜508n)は必要な演算のみを実行する。この場合は、並列度を8とした場合と同様に、2回の繰返し処理で算出対象領域の一行の画素を算出可能である。即ち、並列度を下げた場合であっても、処理速度は同じである。
In the present embodiment, as shown in FIG. 17B, the degree of parallelism of the
算出対象領域のサイズが並列に動作可能な演算器の数(最大並列度)の整数倍でない場合、最適な並列度は、例えば、以下の式で算出できる。 When the size of the calculation target area is not an integral multiple of the number of arithmetic units that can operate in parallel (maximum degree of parallelism), the optimum degree of parallelism can be calculated by, for example, the following formula.
最適な並列度=n−INT((n−m)/(INT(w/n)+1)) ‥ (4)
ここで、Wは算出対象領域のサイズを示し、nは並列に動作可能な演算器の数(最大並列度)を示し、mはw/nの剰余を示し、INT(x)は数値xを超えない最大の整数を返す関数を示す。
Optimal degree of parallelism = n-INT ((n-m) / (INT (w / n) +1)) ... (4)
Here, W indicates the size of the calculation target area, n indicates the number of arithmetic units that can operate in parallel (maximum degree of parallelism), m indicates the remainder of w / n, and INT (x) indicates the numerical value x. Indicates a function that returns the largest integer that does not exceed.
式(4)に従えば、処理速度が低下する事なく、最も低い並列度で演算処理することが可能になる。即ち、処理速度を低下させることなく、消費電力を低減することができる。 According to the equation (4), it is possible to perform arithmetic processing with the lowest degree of parallelism without reducing the processing speed. That is, the power consumption can be reduced without reducing the processing speed.
また、上記式(4)を用いて並列度を毎回算出するのではなく、予め算出した値を保持したデータテーブルに、演算器制御部517に含まれる演算器制御データ生成部512が参照することで並列度を決定することも可能である。例えば、算出対象領域の幅又は高さと演算回路22の並列度との対応関係を保持するデータテーブルがRAM500に保持されたとする。演算器制御データ生成部512が、RAM500に保持されたテーブルにアクセスすることによって、演算回路22の並列度を制御することはできる。図18はデータテーブルの1例であり、算出対象領域の幅が9から12までの間にある場合、並列度を低くになるように制御する。特徴面における算出対象領域のデータサイズは、入力画像データにおける顔候補領域のデータサイズと対応関係にあるので、顔候補領域のデータサイズと並列度との対応関係を保持するテーブルを用いることができる。この場合は、顔候補検出モジュール31で取得した顔候補領域のデータサイズから直接に演算回路22の並列度を制御することができるので、処理が簡単である。
Further, instead of calculating the degree of parallelism each time using the above equation (4), the arithmetic unit control data generation unit 512 included in the arithmetic unit control unit 517 refers to the data table holding the pre-calculated values. It is also possible to determine the degree of parallelism with. For example, it is assumed that the
このように、演算器制御部517がテーブルを利用する場合、本実施形態に係る演算回路22の制御処理をより少ない回路規模で実現する事ができる。
As described above, when the arithmetic unit control unit 517 uses the table, the control processing of the
並列度の制御は、第1の実施形態と同様に演算器制御部517が乗算器507a〜507nの動作を制御することで実現する。また、制御部501は演算器制御部517で決定した並列度に従って、演算処理全体の動作を制御する。
The control of the degree of parallelism is realized by controlling the operation of the
ステップS1606において、演算回路22は決定した並列度でコンボリューション演算を実行する。ステップS1607において、全ての特徴面に対する演算処理が終了すると、ステップS1608に進み、演算回路22は、CPU27に対して割り込み信号を生成する。なお、全ての特徴面に対する演算処理が終了する場合は、図3に示す特徴面307の算出が終了した場合である。
In step S1606, the
ステップS1609において、ステップS1603からステップS1608までの処理を画像全てに対して実行する。 In step S1609, the processes from step S1603 to step S1608 are executed for all the images.
以上、本実施形態によれば、算出対象領域のサイズ(並列に処理する方向と同じ方向の算出対象領域のサイズ)に従って並列度を決定することで、処理速度を維持しながら、消費電力を低減させることが可能になる。 As described above, according to the present embodiment, the degree of parallelism is determined according to the size of the calculation target area (the size of the calculation target area in the same direction as the parallel processing direction), thereby reducing the power consumption while maintaining the processing speed. It becomes possible to make it.
本実施形態は、画像入力モジュール20から入力された一枚の入力画像データに対して、顔候補検出モジュール31が複数の肌色領域を特定し、一枚の入力画像データから複数の顔候補領域を取得し、処理対象領域を取得することがある。この場合は、複数の処理対象領域のそれぞれに対して、逐次に図16に示す処理を行うことによって、全ての処理対象領域に対してCNN処理を行うことができる。この場合の演算回路の並列度の制御は上述した通りである。
In the present embodiment, the face
また、複数の処理対象領域をまとめて図16に示す処理を行うことによって全ての処理対象領域に対してCNN処理を行うことができる。この場合、演算器制御部517が処理対象領域の数に応じて並列度を制御する。 Further, by collectively performing the processing shown in FIG. 16 for a plurality of processing target areas, CNN processing can be performed on all the processing target areas. In this case, the arithmetic unit control unit 517 controls the degree of parallelism according to the number of processing target areas.
例えば、複数の処理対象領域の数が少ない場合、演算回路22の処理時間が規定する時間より短い可能性がある。この場合、演算回路22の並列度を下げることで消費電力を低減させることができる。つまり、画像処理装置が規定する処理時間内で処理可能な最低の並列度を設定する。
For example, when the number of a plurality of processing target areas is small, the processing time of the
並列度の決定は、例えば、演算器制御データ生成部512にテーブルデータを持たせることで簡単に実現可能である。即ち、処理対象領域の数と対応する並列度との対応関係を保持するテーブルデータをRAM500に保持することが可能である。或いは、所定の判定しきい値を設定する複数のレジスタを有し、当該レジスタ値との比較により決定する等の方法でも良い。制御部501は演算器制御部517で決定した並列度に従って、演算処理全体の動作を制御する。
The degree of parallelism can be easily determined, for example, by having the arithmetic unit control data generation unit 512 have table data. That is, it is possible to hold the table data that holds the correspondence between the number of processing target areas and the corresponding degree of parallelism in the
以上のように、一枚の画像において複数の処理対象領域がある場合でも、処理対象領域の数に従って並列度を決定することで、消費電力を低減させる事が可能になる。 As described above, even when there are a plurality of processing target areas in one image, it is possible to reduce the power consumption by determining the degree of parallelism according to the number of processing target areas.
(第3の実施形態)
本実施形態の画像処理装置の構成は、第1の実施形態と同じであるので、以下では、本実施形態が第1の実施形態と異なる処理について説明する。本実施形態の階層的なCNN処理では、階層的に複数回のフィルタ演算処理を行うが、不図示の処理部が階層毎にサブサンプリング処理を行い、サブサンプリング処理した特徴面をRAM500に保持させる。階層的なCNN処理において、サブサンプリング処理は前階層のコンボリューション演算結果を間引いて次階層の参照データとする場合とコンボリューション演算結果に対してプーリング処理して次階層の参照データとする場合がある。プーリング処理は前階層で生成した特徴面に対して平均値フィルタや最大値フィルタを用いて特徴面を縮小する。本実施形態の処理部がサブサンプリング処理又はプーリング処理の何れか又は両方の処理を行うものである。
(Third Embodiment)
Since the configuration of the image processing apparatus of the present embodiment is the same as that of the first embodiment, the processing in which the present embodiment is different from that of the first embodiment will be described below. In the hierarchical CNN process of the present embodiment, the filter calculation process is performed hierarchically a plurality of times, but a processing unit (not shown) performs a subsampling process for each layer to hold the subsampling processed feature surface in the
一般的にサブサンプル処理では特徴面を水平方向・垂直方向に1/2倍あるいは1/4倍等に縮小処理する。CNN処理では処理部がサブサンプリング処理等の処理を行うために、後段の特徴面のサイズが入力画像に対して小さくなることが多い。図19は処理部がサブサンプリング処理を行った場合の特徴面の例を示す図である。特徴面2001、特徴面2002及び特徴面2003はそれぞれ第1層、第2層、第3層の処理対象の特徴面であり、特徴面2002は水平・垂直共に1/2倍にサブサンプリングし、特徴面2003では更に1/2倍にサブサンプリングされている。この様な場合、並列処理領域2004に示すように、水平方向8並列の演算器では、特徴面2002及び特徴2003に対して処理する場合、無駄な演算動作が発生する。なお、処理部がプーリング処理を行う場合でも同様である。
Generally, in the subsample processing, the feature plane is reduced to 1/2 times or 1/4 times in the horizontal and vertical directions. In the CNN process, since the processing unit performs processing such as subsampling processing, the size of the feature surface in the subsequent stage is often smaller than that of the input image. FIG. 19 is a diagram showing an example of a characteristic surface when the processing unit performs subsampling processing. The feature surface 2001, the feature surface 2002, and the feature surface 2003 are the feature surfaces to be processed in the first layer, the second layer, and the third layer, respectively, and the feature surface 2002 is subsampled 1/2 times both horizontally and vertically. On the feature surface 2003, the subsampling is further performed 1/2 times. In such a case, as shown in the parallel processing area 2004, in the
本実施形態では、演算器制御データ生成部512は、階層毎のサブサンプリングの状況に基づいて並列に動作する演算器の数(並列度)を制御する。即ち、演算回路22が特徴面2002に対して処理する場合、演算器6及び演算器7の動作を停止し、並列度6で処理する。また、演算回路22が特徴面2003に対して処理する場合、演算器3〜7の動作を停止し、並列度3で処理する。
In the present embodiment, the arithmetic unit control data generation unit 512 controls the number of arithmetic units (degree of parallelism) operating in parallel based on the subsampling situation for each layer. That is, when the
以上、本実施形態の並列演算回路は並列に動作する演算器の個数単位で並列度を制御可能であるため、演算対象データ(参照データ)のサイズに応じて演算器を有効に活用して消費電力を低減することが可能である。つまり、処理対象領域(参照データ)となる特徴面の大きさに基づいて、並列に動作する演算器の数(並列度)を制御することで、無駄な演算動作を排除し、消費電力を低減することができる。 As described above, since the parallel computing circuit of the present embodiment can control the degree of parallelism in units of the number of computing units operating in parallel, the computing units are effectively utilized and consumed according to the size of the calculation target data (reference data). It is possible to reduce power consumption. In other words, by controlling the number of arithmetic units operating in parallel (degree of parallelism) based on the size of the feature surface that is the processing target area (reference data), unnecessary arithmetic operations are eliminated and power consumption is reduced. can do.
(その他の実施形態)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other embodiments)
The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
500 RAM
501 制御部
502 記憶部
503 記憶部
504 シフトレジスタ
505 シフトレジスタ
506 シフトレジスタ
507a〜507n 乗算器
508a〜508n 累積加算器
509 非線形変換部
500 RAM
501 Control unit 502
Claims (29)
互いに異なる前記参照データと共通の前記係数データとの乗算を繰り返し行うことにより前記フィルタ演算処理を実行する複数の乗算器と、
前記複数の乗算器に対して、前記保持装置に保持された互いに異なる前記参照データを供給する第1のデータ供給手段と、
前記複数の乗算器に対して、前記保持装置に保持された共通の前記係数データを供給する第2のデータ供給手段と、
前記乗算器が前記乗算を繰り返し実行する時間は、前記フィルタ演算処理のフィルタサイズが大きくなるほど増加し、前記フィルタサイズが所定値以下である場合に、前記複数の乗算器のうち、一部の乗算器に対して前記乗算を実行させ、他の乗算器に対して前記乗算を実行させないように制御する制御手段と
を有することを特徴とする演算回路。 An arithmetic circuit connected to a holding device that holds reference data for filter arithmetic processing and coefficient data of a filter used for the filter arithmetic processing.
A plurality of multipliers that execute the filter calculation process by repeatedly multiplying the reference data that is different from each other and the coefficient data that is common to each other.
A first data supply means for supplying the plurality of multipliers with different reference data held in the holding device.
A second data supply means for supplying the common coefficient data held in the holding device to the plurality of multipliers, and
The time for the multiplier to repeatedly execute the multiplication increases as the filter size of the filter calculation process increases, and when the filter size is equal to or less than a predetermined value, a power of a part of the plurality of multipliers is used. An arithmetic circuit having a control means for controlling an arithmetic unit to execute the multiplication and not causing another multiplier to execute the multiplication.
前記保持装置に保持された、前記フィルタサイズに供給するための前記係数データを一時的に記憶し、記憶した該係数データが前記第2のデータ供給手段にロードされる第2記憶手段と、
をさらに有することを特徴とする請求項1に記載の演算回路。 A first storage held in the holding device for temporarily storing the reference data to be supplied to the multiplier for performing the multiplication, and the stored reference data being loaded into the first data supply means. Means and
A second storage means that temporarily stores the coefficient data held in the holding device for supplying to the filter size and loads the stored coefficient data into the second data supply means.
The arithmetic circuit according to claim 1, further comprising.
前記制御手段は、前記テーブルを参照して、前記フィルタサイズに基づいて、前記乗算を実行する前記乗算器の数を決定することを特徴とする請求項2に記載の演算回路。 The holding device holds a table showing the correspondence between the filter size and the number of multipliers that perform the multiplication.
The arithmetic circuit according to claim 2, wherein the control means refers to the table and determines the number of the multipliers that perform the multiplication based on the filter size.
前記複数の累積加算器のそれぞれの出力データと前記変換手段の出力データとの何れかを選択して出力する選択手段と、
をさらに有することを特徴とする請求項8に記載の演算回路。 A conversion means that performs non-linear conversion processing on the output data of each of the plurality of cumulative adders, and
A selection means for selecting and outputting either the output data of each of the plurality of cumulative adders and the output data of the conversion means, and
The arithmetic circuit according to claim 8, further comprising.
互いに異なる前記参照データと共通の前記係数データとの乗算を繰り返し行うことにより前記フィルタ演算処理を実行する複数の乗算器と、
前記複数の乗算器に対して、前記保持装置に保持された互いに異なる前記参照データを供給する第1のデータ供給手段と、
前記複数の乗算器に対して、前記保持装置に保持された共通の前記係数データを供給する第2のデータ供給手段と、
前記参照データとして外部から画像データを入力する入力手段と、
入力された前記画像データから処理対象領域を検出して、該処理対象領域の画素データを前記参照データとして取得する検出手段と、
前記処理対象領域のデータサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記乗算を実行させ、他の乗算器に対して前記乗算を実行させないように制御する制御手段と、
を有することを特徴とする演算回路。 An arithmetic circuit connected to a holding device that holds reference data for filter arithmetic processing and coefficient data of a filter used for the filter arithmetic processing.
A plurality of multipliers that execute the filter calculation process by repeatedly multiplying the reference data that is different from each other and the coefficient data that is common to each other.
A first data supply means for supplying the plurality of multipliers with different reference data held in the holding device.
A second data supply means for supplying the common coefficient data held in the holding device to the plurality of multipliers, and
An input means for inputting image data from the outside as the reference data, and
A detection means that detects a processing target area from the input image data and acquires pixel data of the processing target area as the reference data.
Based on the data size of the processing target area, among the plurality of multipliers, to execute the multiplication for some multipliers, controls not to execute the multiplication to the other multiplier Control means and
An arithmetic circuit characterized by having.
前記制御手段は、前記保持装置に保持された前記テーブルを参照して、前記乗算を実行する前記乗算器の数を決定することを特徴とする請求項10に記載の演算回路。 The holding device further holds a table showing the correspondence between the number of the multipliers performing the multiplication and the data size of the processing target area.
The arithmetic circuit according to claim 10, wherein the control means refers to the table held in the holding device to determine the number of multipliers that perform the multiplication.
互いに異なる前記参照データと共通の前記係数データとの乗算を繰り返し行うことにより前記フィルタ演算処理を実行する複数の乗算器と、
前記複数の乗算器に対して、前記保持装置に保持された互いに異なる前記参照データを供給する第1のデータ供給手段と、
前記複数の乗算器に対して、前記保持装置に保持された共通の前記係数データを供給する第2のデータ供給手段と、
第1のフィルタ演算処理の結果として出力された複数のデータに対して、プーリング処理又はサブサンプリング処理して得られたデータを第2のフィルタ演算処理の参照データとして取得し、前記保持装置に保持させる処理手段と、
前記第2のフィルタ演算処理の参照データのデータサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記乗算を実行させ、他の乗算器に対して前記乗算を実行させないように制御する制御手段と、
を有することを特徴とする演算回路。 It is an arithmetic circuit connected to a holding device that holds reference data of a plurality of times of filter arithmetic processing and coefficient data of a filter used for the filter arithmetic processing.
A plurality of multipliers that execute the filter calculation process by repeatedly multiplying the reference data that is different from each other and the coefficient data that is common to each other.
A first data supply means for supplying the plurality of multipliers with different reference data held in the holding device.
A second data supply means for supplying the common coefficient data held in the holding device to the plurality of multipliers, and
With respect to the plurality of data output as a result of the first filter calculation process, the data obtained by the pooling process or the subsampling process is acquired as reference data of the second filter calculation process and held in the holding device. Processing means to make
Based on the data size of the reference data of the second filtering operation, among the plurality of multipliers, to execute the multiplication for some multipliers, the multiplication with respect to the other multiplier Control means to control so that it is not executed,
An arithmetic circuit characterized by having.
前記制御手段は、前記保持装置に保持された前記テーブルを参照して、前記乗算を実行する前記乗算器の数を決定することを特徴とする請求項12に記載の演算回路。 The holding device further holds a table showing the correspondence between the number of the multipliers performing the multiplication and the data size of the reference data of the second filter calculation process.
12. The arithmetic circuit according to claim 12, wherein the control means refers to the table held in the holding device to determine the number of multipliers that perform the multiplication.
互いに異なる前記参照データと共通の前記係数データとの乗算を繰り返し行うことにより前記フィルタ演算処理を複数の乗算器によって実行する乗算工程と、
前記複数の乗算器に対して、前記保持装置に保持された互いに異なる前記参照データを第1のデータ供給手段によって供給する第1の供給工程と、
前記複数の乗算器に対して、前記保持装置に保持された共通の前記係数データを第2のデータ供給手段によって供給する第2の供給工程と、
前記乗算器が前記乗算を繰り返し実行する時間は、前記フィルタ演算処理のフィルタサイズが大きくなるほど増加し、前記フィルタサイズが所定値以下である場合に、前記複数の乗算器のうち、一部の乗算器に対して前記乗算を実行させ、他の乗算器に対して前記乗算を実行させないように制御手段によって制御する制御工程と、
を有することを特徴とする方法。 It is a control method of an arithmetic circuit connected to a holding device that holds the reference data of the filter arithmetic processing and the coefficient data of the filter used for the filter arithmetic processing.
A multiplication step in which the filter calculation process is executed by a plurality of multipliers by repeatedly multiplying the reference data that is different from each other and the coefficient data that is common to each other.
A first supply step of supplying the plurality of multipliers with different reference data held in the holding device by the first data supply means.
A second supply step of supplying the common coefficient data held by the holding device to the plurality of multipliers by the second data supply means, and
The time for the multiplier to repeatedly execute the multiplication increases as the filter size of the filter calculation process increases, and when the filter size is equal to or less than a predetermined value, a power of a part of the plurality of multipliers is used. A control step in which a control means controls so that a multiplier is made to perform the multiplication and another multiplier is not made to perform the multiplication.
A method characterized by having.
互いに異なる前記参照データと共通の前記係数データとの乗算を繰り返し行うことにより前記フィルタ演算処理を複数の乗算器によって実行する乗算工程と、
前記複数の乗算器に対して、前記保持装置に保持された互いに異なる前記参照データを第1のデータ供給手段によって供給する第1の供給工程と、
前記複数の乗算器に対して、前記保持装置に保持された共通の前記係数データを第2のデータ供給手段によって供給する第2の供給工程と、
前記参照データとして外部から画像データを入力手段によって入力する入力工程と、
入力された前記画像データから処理対象領域を検出して、該処理対象領域の画素データを前記参照データとして検出手段によって取得する取得工程と、
前記処理対象領域のデータサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記乗算を実行させ、他の乗算器に対して前記乗算を実行させないように制御手段によって制御する制御工程と、
を有することを特徴とする方法。 It is a control method of an arithmetic circuit connected to a holding device that holds the reference data of the filter arithmetic processing and the coefficient data of the filter used for the filter arithmetic processing.
A multiplication step in which the filter calculation process is executed by a plurality of multipliers by repeatedly multiplying the reference data that is different from each other and the coefficient data that is common to each other.
A first supply step of supplying the plurality of multipliers with different reference data held in the holding device by the first data supply means.
A second supply step of supplying the common coefficient data held by the holding device to the plurality of multipliers by the second data supply means, and
An input process in which image data is input from the outside as the reference data by an input means,
An acquisition step of detecting a processing target area from the input image data and acquiring pixel data of the processing target area as the reference data by a detection means.
Based on the data size of the processing target area, among the plurality of multipliers, to execute the multiplication for some multipliers, other control means so as not to execute the multiplication with respect to the multiplier Control process controlled by
A method characterized by having.
互いに異なる前記参照データと共通の前記係数データとの乗算を繰り返し行うことにより前記フィルタ演算処理を複数の乗算器によって実行する乗算工程と、
前記複数の乗算器に対して、前記保持装置に保持された互いに異なる前記参照データを第1のデータ供給手段によって供給する第1の供給工程と、
前記複数の乗算器に対して、前記保持装置に保持された共通の前記係数データを第2のデータ供給手段によって供給する第2の供給工程と、
第1のフィルタ演算処理の結果として出力されたデータに対して、プーリング処理又はサブサンプリング処理して得られたデータを第2のフィルタ演算処理の参照データとして処理手段によって取得し、前記保持装置に保持させる取得工程と、
前記第2のフィルタ演算処理の参照データのデータサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記乗算を実行させ、他の乗算器に対して前記乗算を実行させないように制御手段によって制御する制御工程と、
を有することを特徴とする方法。 It is a control method of an arithmetic circuit connected to a holding device that holds reference data of a plurality of filter arithmetic processes and coefficient data of a filter used for the multiple filter arithmetic processes.
A multiplication step in which the filter calculation process is executed by a plurality of multipliers by repeatedly multiplying the reference data that is different from each other and the coefficient data that is common to each other.
A first supply step of supplying the plurality of multipliers with different reference data held in the holding device by the first data supply means.
A second supply step of supplying the common coefficient data held by the holding device to the plurality of multipliers by the second data supply means, and
With respect to the data output as a result of the first filter calculation process, the data obtained by the pooling process or the subsampling process is acquired by the processing means as the reference data of the second filter calculation process, and is stored in the holding device. The acquisition process to hold and
Based on the data size of the reference data of the second filtering operation, among the plurality of multipliers, to execute the multiplication for some multipliers, the multiplication with respect to the other multiplier A control process that is controlled by control means so that it is not executed,
A method characterized by having.
互いに異なる前記参照データと共通の前記係数データとの乗算を繰り返し行うことにより前記フィルタ演算処理を複数の乗算器に実行させる乗算ステップと、
前記複数の乗算器に対して、前記保持装置に保持された互いに異なる前記参照データを第1のデータ供給に供給させる第1の供給ステップと、
前記複数の乗算器に対して、前記保持装置に保持された共通の前記係数データを第2のデータ供給手段に供給させる第2の供給ステップと、
前記乗算器が前記乗算を繰り返し実行する時間は、前記フィルタ演算処理のフィルタサイズが大きくなるほど増加し、前記フィルタサイズが所定値以下である場合に、前記複数の乗算器のうち、一部の乗算器に対して前記乗算を実行させ、他の乗算器に対して前記乗算を実行させないように制御手段に制御させる制御ステップと、
をコンピュータに実行させることを特徴とするプログラム。 A control program of an arithmetic circuit connected to a holding device that holds reference data for filter arithmetic processing and coefficient data of a filter used for the filter arithmetic processing.
A multiplication step in which a plurality of multipliers execute the filter calculation process by repeatedly multiplying the reference data that is different from each other and the coefficient data that is common to each other.
A first supply step of causing the plurality of multipliers to supply the first data supply with the different reference data held in the holding device .
A second supply step of causing the second data supply means to supply the common coefficient data held by the holding device to the plurality of multipliers.
The time for the multiplier to repeatedly execute the multiplication increases as the filter size of the filter calculation process increases, and when the filter size is equal to or less than a predetermined value, a power of a part of the plurality of multipliers is used. A control step that causes an arithmetic unit to execute the multiplication and a control means to control other multipliers so that the multiplication is not executed.
A program characterized by having a computer execute.
互いに異なる前記参照データと共通の前記係数データとの乗算を繰り返し行うことにより前記フィルタ演算処理を複数の乗算器に実行させる乗算ステップと、
前記複数の乗算器に対して、前記保持装置に保持された互いに異なる前記参照データを第1のデータ供給手段に供給させる第1の供給ステップと、
前記複数の乗算器に対して、前記保持装置に保持された共通の前記係数データを第2のデータ供給手段に供給させる第2の供給ステップと、
前記参照データとして外部から画像データを入力手段に入力させる入力ステップと、
力された前記画像データから処理対象領域を検出手段に検出させ、該処理対象領域の画素データを前記参照データとして取得させる取得ステップと、
前記処理対象領域のデータサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記乗算を実行させ、他の乗算器に対して前記乗算を実行させないように制御手段に制御させる制御ステップと、
をコンピュータに実行させることを特徴とするプログラム。 A control program of an arithmetic circuit connected to a holding device that holds reference data for filter arithmetic processing and coefficient data of a filter used for the filter arithmetic processing.
A multiplication step in which a plurality of multipliers execute the filter calculation process by repeatedly multiplying the reference data that is different from each other and the coefficient data that is common to each other.
A first supply step of causing the first data supply means to supply the plurality of multipliers with different reference data held in the holding device.
A second supply step of causing the second data supply means to supply the common coefficient data held by the holding device to the plurality of multipliers.
An input step in which image data is input to the input means from the outside as the reference data, and
An acquisition step of causing a detection means to detect a processing target area from the forced image data and acquiring pixel data of the processing target area as the reference data.
Based on the data size of the processing target area, among the plurality of multipliers, to execute the multiplication for some multipliers, other control means so as not to execute the multiplication with respect to the multiplier Control steps to be controlled by
A program characterized by having a computer execute.
互いに異なる前記参照データと共通の前記係数データとの乗算を繰り返し行うことにより前記フィルタ演算処理を複数の乗算器に実行させる乗算ステップと、
前記複数の乗算器に対して、前記保持装置に保持された互いに異なる前記参照データを第1のデータ供給手段に供給させる第1の供給ステップと、
前記複数の乗算器に対して、前記保持装置に保持された共通の前記係数データを第2のデータ供給手段に供給させる第2の供給ステップと、
第1のフィルタ演算処理の結果として出力されたデータに対して、プーリング処理又はサブサンプリング処理して得られたデータを第2のフィルタ演算処理の参照データとして処理手段に取得させ、前記保持装置に保持させる取得工程と、
前記第2のフィルタ演算処理の参照データのデータサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記乗算を実行させ、他の乗算器に対して前記乗算を実行させないように制御手段に制御させる制御ステップと、
をコンピュータに実行させることを特徴とするプログラム。 It is a control program of an arithmetic circuit connected to a holding device that holds reference data of a plurality of filter arithmetic processes and coefficient data of a filter used for the multiple filter arithmetic processes.
A multiplication step in which a plurality of multipliers execute the filter calculation process by repeatedly multiplying the reference data that is different from each other and the coefficient data that is common to each other.
A first supply step of causing the first data supply means to supply the plurality of multipliers with different reference data held in the holding device.
A second supply step of causing the second data supply means to supply the common coefficient data held by the holding device to the plurality of multipliers.
With respect to the data output as a result of the first filter calculation process, the processing means is made to acquire the data obtained by the pooling process or the subsampling process as the reference data of the second filter calculation process, and the holding device is used. The acquisition process to hold and
Based on the data size of the reference data of the second filtering operation, among the plurality of multipliers, to execute the multiplication for some multipliers, the multiplication with respect to the other multiplier A control step that causes the control means to control it so that it is not executed,
A program characterized by having a computer execute.
前記フィルタ演算処理におけるフィルタサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記フィルタ演算処理を実行させ、他の乗算器に対して前記フィルタ演算処理を実行させないように制御する制御手段と、Based on the filter size in the filter calculation process, some multipliers among the plurality of multipliers are not allowed to execute the filter calculation process, and other multipliers are not allowed to execute the filter calculation process. Control means to control
を有することを特徴とする演算回路。An arithmetic circuit characterized by having.
前記フィルタ演算処理の参照データのデータサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記フィルタ演算処理を実行させ、他の乗算器に対して前記フィルタ演算処理を実行させないように制御する制御手段と、Based on the data size of the reference data of the filter calculation process, some of the plurality of multipliers are made to execute the filter calculation process, and the other multipliers are subjected to the filter calculation process. Control means to control not to execute,
を有することを特徴とする演算回路。An arithmetic circuit characterized by having.
前記制御手段は、前記処理対象領域のデータサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記フィルタ演算処理を実行させ、他の乗算器に対して前記フィルタ演算処理を実行させないように制御することを特徴とする請求項22に記載の演算回路。Based on the data size of the processing target area, the control means causes some of the plurality of multipliers to execute the filter calculation process, and causes the other multipliers to perform the filter calculation process. The arithmetic circuit according to claim 22, wherein the processing is controlled so as not to be executed.
前記フィルタ演算処理におけるフィルタサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記フィルタ演算処理を実行させ、他の乗算器に対して前記フィルタ演算処理を実行させないように制御することを特徴とする演算回路の制御方法。Based on the filter size in the filter calculation process, some multipliers among the plurality of multipliers are not allowed to execute the filter calculation process, and other multipliers are not allowed to execute the filter calculation process. A method of controlling an arithmetic circuit, which is characterized in that it is controlled to.
前記フィルタ演算処理の参照データのデータサイズに基づいて、前記複数の乗算器のうち、一部の乗算器に対して前記フィルタ演算処理を実行させ、他の乗算器に対して前記フィルタ演算処理を実行させないように制御することを特徴とする演算回路の制御方法。 A control method for an arithmetic circuit having a plurality of multipliers for executing filter arithmetic processing.
Based on the data size of the reference data of the filter calculation process, some of the plurality of multipliers are made to execute the filter calculation process, and the other multipliers are subjected to the filter calculation process. A method of controlling an arithmetic circuit, which is characterized in that it is controlled so as not to be executed .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016163408A JP6800656B2 (en) | 2016-08-24 | 2016-08-24 | Arithmetic circuit, its control method and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016163408A JP6800656B2 (en) | 2016-08-24 | 2016-08-24 | Arithmetic circuit, its control method and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2018032190A JP2018032190A (en) | 2018-03-01 |
JP6800656B2 true JP6800656B2 (en) | 2020-12-16 |
Family
ID=61304315
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016163408A Active JP6800656B2 (en) | 2016-08-24 | 2016-08-24 | Arithmetic circuit, its control method and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6800656B2 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019215907A1 (en) * | 2018-05-11 | 2019-11-14 | オリンパス株式会社 | Arithmetic processing device |
KR20200082613A (en) * | 2018-12-31 | 2020-07-08 | 에스케이하이닉스 주식회사 | Processing system |
JP7292903B2 (en) * | 2019-03-01 | 2023-06-19 | キヤノン株式会社 | Image processing device and image processing method |
JP7402623B2 (en) | 2019-06-17 | 2023-12-21 | キヤノン株式会社 | Filter processing device and its control method |
WO2021070303A1 (en) * | 2019-10-09 | 2021-04-15 | オリンパス株式会社 | Computation processing device |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000308056A (en) * | 1999-04-16 | 2000-11-02 | Sanyo Electric Co Ltd | Image compressor |
JP2001092661A (en) * | 1999-09-22 | 2001-04-06 | Hitachi Ltd | Data processor |
JP2006293741A (en) * | 2005-04-12 | 2006-10-26 | Sanyo Electric Co Ltd | Processor |
JP5376920B2 (en) * | 2008-12-04 | 2013-12-25 | キヤノン株式会社 | Convolution operation circuit, hierarchical convolution operation circuit, and object recognition device |
JP6137916B2 (en) * | 2013-04-01 | 2017-05-31 | キヤノン株式会社 | Signal processing apparatus, signal processing method, and signal processing system |
JP6414458B2 (en) * | 2014-12-17 | 2018-10-31 | 株式会社デンソー | Arithmetic processing unit |
-
2016
- 2016-08-24 JP JP2016163408A patent/JP6800656B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2018032190A (en) | 2018-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6800656B2 (en) | Arithmetic circuit, its control method and program | |
US10210419B2 (en) | Convolution operation apparatus | |
US9135553B2 (en) | Convolution operation circuit and object recognition apparatus | |
JP6945986B2 (en) | Arithmetic circuit, its control method and program | |
JP6936592B2 (en) | Arithmetic processing unit and its control method | |
JP6945987B2 (en) | Arithmetic circuit, its control method and program | |
JP6532334B2 (en) | Parallel computing device, image processing device and parallel computing method | |
US11704546B2 (en) | Operation processing apparatus that calculates addresses of feature planes in layers of a neutral network and operation processing method | |
US11775809B2 (en) | Image processing apparatus, imaging apparatus, image processing method, non-transitory computer-readable storage medium | |
JP7391553B2 (en) | Information processing device, information processing method, and program | |
JP2021012596A (en) | Calculation processing device and calculation processing method | |
CN117217274B (en) | Vector processor, neural network accelerator, chip and electronic equipment | |
JP7321213B2 (en) | Information processing device, information processing method | |
JP6929734B2 (en) | Discrimination calculation device, discrimination calculation method and program | |
CN117217274A (en) | Vector processor, neural network accelerator, chip and electronic equipment | |
JP2791538B2 (en) | Image reduction method and image processing apparatus | |
JP2023156864A (en) | Image processing device and image processing method | |
CN115641264A (en) | Image preprocessing method and image preprocessing system based on CUDA | |
CN116010313A (en) | Universal and configurable image filtering calculation multi-line output system and method | |
KR20170068774A (en) | SURF Feature Extraction Method without Integral Image and Apparatus using the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20190809 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20200514 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20200602 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20200729 |
|
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: 20201027 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20201125 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6800656 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |