JP2024077434A - Image processing device, image processing method, program, and storage medium - Google Patents
Image processing device, image processing method, program, and storage medium Download PDFInfo
- Publication number
- JP2024077434A JP2024077434A JP2022189529A JP2022189529A JP2024077434A JP 2024077434 A JP2024077434 A JP 2024077434A JP 2022189529 A JP2022189529 A JP 2022189529A JP 2022189529 A JP2022189529 A JP 2022189529A JP 2024077434 A JP2024077434 A JP 2024077434A
- Authority
- JP
- Japan
- Prior art keywords
- image
- neural network
- image processing
- processing device
- output
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012545 processing Methods 0.000 title claims abstract description 93
- 238000003860 storage Methods 0.000 title claims description 30
- 238000003672 processing method Methods 0.000 title claims description 7
- 238000013528 artificial neural network Methods 0.000 claims abstract description 140
- 230000013016 learning Effects 0.000 claims abstract description 44
- 238000004364 calculation method Methods 0.000 claims abstract description 37
- 238000011156 evaluation Methods 0.000 claims abstract description 36
- 238000012549 training Methods 0.000 claims abstract description 35
- 230000009467 reduction Effects 0.000 claims abstract description 9
- 238000007781 pre-processing Methods 0.000 claims description 18
- 230000015556 catabolic process Effects 0.000 claims description 13
- 238000006731 degradation reaction Methods 0.000 claims description 13
- 238000003384 imaging method Methods 0.000 claims description 5
- 238000013139 quantization Methods 0.000 abstract description 73
- 238000013135 deep learning Methods 0.000 abstract description 9
- 238000000034 method Methods 0.000 description 41
- 230000006870 function Effects 0.000 description 30
- 230000008569 process Effects 0.000 description 25
- 238000012937 correction Methods 0.000 description 19
- 210000002569 neuron Anatomy 0.000 description 15
- 230000004913 activation Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 9
- 238000013527 convolutional neural network Methods 0.000 description 5
- 238000009826 distribution Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000005457 optimization Methods 0.000 description 3
- 238000011176 pooling Methods 0.000 description 3
- 238000004131 Bayer process Methods 0.000 description 2
- 102100030148 Integrator complex subunit 8 Human genes 0.000 description 2
- 101710092891 Integrator complex subunit 8 Proteins 0.000 description 2
- 239000000872 buffer Substances 0.000 description 2
- 238000011084 recovery Methods 0.000 description 2
- 230000000306 recurrent effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 1
- 101710092887 Integrator complex subunit 4 Proteins 0.000 description 1
- 102100037075 Proto-oncogene Wnt-3 Human genes 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000001174 ascending effect Effects 0.000 description 1
- 230000000593 degrading effect Effects 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 238000003702 image correction Methods 0.000 description 1
- 238000011423 initialization method Methods 0.000 description 1
- 238000012886 linear function Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011158 quantitative evaluation Methods 0.000 description 1
- 238000005549 size reduction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
Abstract
【課題】ディープラーニングにおける量子化による演算精度の低下を抑制できる画像処理装置を提供する。【解決手段】ニューラルネットワークの学習に使用される訓練画像をニューラルネットワークに入力して得られた出力画像の特徴を表す評価値を取得する取得手段と、評価値に基づいて、出力画像の特徴を簡易的に表わす入力画像を生成する生成手段と、生成された入力画像をニューラルネットワークに入力して、ニューラルネットワークの層を構成するパラメータのビット数を削減する削減手段と、を備える。【選択図】図2[Problem] To provide an image processing device capable of suppressing a decrease in calculation accuracy due to quantization in deep learning. [Solution] The image processing device includes an acquisition means for acquiring an evaluation value representing the characteristics of an output image obtained by inputting a training image used for learning the neural network into the neural network, a generation means for generating an input image that simply represents the characteristics of the output image based on the evaluation value, and a reduction means for inputting the generated input image into the neural network and reducing the number of bits of the parameters that constitute the layers of the neural network. [Selected Figure] Figure 2
Description
本発明は、ニューラルネットワークの層を構成するパラメータのビット数を削減する技術に関するものである。 The present invention relates to a technology for reducing the number of bits in the parameters that make up the layers of a neural network.
近年、ディープラーニングを用いた画像処理技術が数多く提案されている。一般的にディープラーニングの推論に利用されているニューラルネットワークの演算には多大な時間がかかる。そのため、ニューラルネットワークの演算におけるメモリ使用量の削減や推論速度の高速化のために、ニューラルネットワークの軽量化が求められている。 In recent years, many image processing technologies using deep learning have been proposed. Generally, the calculations of neural networks used for deep learning inference take a long time. Therefore, there is a demand for lightweight neural networks to reduce memory usage in neural network calculations and increase inference speed.
ニューラルネットワークの軽量化の手法の一つとして、ニューラルネットワークの層を構成するパラメータのビット数を削減する手法が提案されている。ここではその手法を量子化と呼ぶ。特に、ニューラルネットワークが組み込まれる組み込み機器(カメラ、自動車など)では、ニューラルネットワークに用いることができる計算リソースが制限されるので、ニューラルネットワークの軽量化のアプローチとして量子化が多く採用されている。 One method that has been proposed for making neural networks lighter is to reduce the number of bits in the parameters that make up the layers of the neural network. Here, this method is called quantization. In particular, in embedded devices (cameras, automobiles, etc.) in which neural networks are incorporated, the computing resources available for the neural network are limited, so quantization is often used as an approach to making neural networks lighter.
また、特許文献1には、量子化によるニューラルネットワークの演算精度の低下の影響度を導出する方法が開示されている。
しかしながら、上記の従来技術では、量子化による演算精度の低下のばらつきを確認することはできるものの、演算精度の低下のばらつきを抑制することができない。そのため、ノイズ除去や超解像などの画像回復を目的とするディープラーニングにおいて、量子化による演算精度の低下のばらつきが大きくなるという問題があった。 However, with the above conventional technology, although it is possible to confirm the variation in the decrease in calculation accuracy due to quantization, it is not possible to suppress the variation in the decrease in calculation accuracy. Therefore, in deep learning aimed at image restoration such as noise removal and super-resolution, there is a problem in that the variation in the decrease in calculation accuracy due to quantization becomes large.
本発明は上述した課題に鑑みてなされたものであり、その目的は、ディープラーニングにおける量子化による演算精度の低下を抑制できる画像処理装置を提供することである。 The present invention has been made in consideration of the above-mentioned problems, and its purpose is to provide an image processing device that can suppress the decrease in calculation accuracy due to quantization in deep learning.
本発明に係わる画像処理装置は、ニューラルネットワークの学習に使用される訓練画像を前記ニューラルネットワークに入力して得られた出力画像の特徴を表す評価値を取得する取得手段と、前記評価値に基づいて、前記出力画像の特徴を簡易的に表わす入力画像を生成する生成手段と、生成された前記入力画像を前記ニューラルネットワークに入力して、前記ニューラルネットワークの層を構成するパラメータのビット数を削減する削減手段と、を備えることを特徴とする。 The image processing device according to the present invention is characterized by comprising: an acquisition means for acquiring an evaluation value representing the characteristics of an output image obtained by inputting a training image used for learning the neural network into the neural network; a generation means for generating an input image that simply represents the characteristics of the output image based on the evaluation value; and a reduction means for inputting the generated input image into the neural network and reducing the number of bits of the parameters that constitute the layers of the neural network.
本発明によれば、ディープラーニングにおける量子化による演算精度の低下を抑制することが可能となる。 The present invention makes it possible to suppress the decrease in computational accuracy caused by quantization in deep learning.
以下、添付図面を参照して実施形態を詳しく説明する。なお、以下の実施形態は特許請求の範囲に係る発明を限定するものではない。実施形態には複数の特徴が記載されているが、これらの複数の特徴の全てが発明に必須のものとは限らず、また、複数の特徴は任意に組み合わせられてもよい。さらに、添付図面においては、同一若しくは同様の構成に同一の参照番号を付し、重複した説明は省略する。 The following embodiments are described in detail with reference to the attached drawings. Note that the following embodiments do not limit the invention according to the claims. Although the embodiments describe multiple features, not all of these multiple features are necessarily essential to the invention, and multiple features may be combined in any manner. Furthermore, in the attached drawings, the same reference numbers are used for the same or similar configurations, and duplicate explanations are omitted.
<第1の実施形態>
図1は、本発明の第1の実施形態におけるニューラルネットワークの学習と量子化を行う画像処理装置100の構成を示す図である。
First Embodiment
FIG. 1 is a diagram showing the configuration of an
図1において、画像処理装置100は、ストレージ駆動部103、ROM104、画像処理部105、RAM106、CPU107、GPU108を備え、それらが内部バス109で接続されて構成されている。画像処理装置100を構成する各構成要素は、内部バス109を介して互いにデータのやりとりを行うことができる。
In FIG. 1, the
ストレージ装置101は、膨大な画像データを学習用画像として記憶させるため、及び学習時に作成したネットワークパラメータを記憶させるために用いられる。また、量子化に用いる画像を記憶させるため、量子化時に作成したネットワークパラメータを記憶させるためなどに用いてもよい。画像処理装置100は、ストレージ接続部102、ストレージ駆動部103を介して、ストレージ装置101とデータのやり取りを行う。
The
画像処理部105は、ストレージ装置101から読み出された画像に対して、様々な画像処理を行う。また、画像処理部105の処理は、CPU107により制御されることで実行される。例えば、ニューラルネットワークの学習時の訓練画像や量子化時の入力画像を生成する処理を行う。具体的には、ノイズ除去を目的としたニューラルネットワークであれば、ノイズ付加処理などを行い、超解像を目的としたニューラルネットワークであれば、サイズ縮小などの劣化処理を行う。また、画像の輝度、色に関する補正を行ったり、画像のヒストグラム算出などを行うこともできる。
The
画像処理装置100の各機能を制御するためのユニットとして、CPU(Central Processing Unit)107が配置されており、主に画像処理や量子化を行うために使用される。CPU107を駆動するために、ROM(Read Only Memory)104及びRAM(Random Access Memory)106が接続されている。
A CPU (Central Processing Unit) 107 is arranged as a unit for controlling each function of the
RAM106は揮発性の素子であり、画像データや演算結果を一時的に記憶し、必要な時に読み出すことが可能である。近年では、DDR4-SDRAM(Dual Data Rate 4 - Synchronous Dynamic RAM)などが用いられることが多い。
ROM104は不揮発性の素子であり、CPU107を動作させるためのプログラムや、各種調整パラメータなどが記憶されている。ROM104から読み出されたプログラムは、揮発性のRAM106に展開されて実行される。
GPU108は、ディープラーニングによるニューラルネットワークの処理を行うために使用される。学習時には膨大な計算を並列して処理することが必要とされるため、CPUに比べて並列処理能力の高いGPUを用いることが好適である。また、量子化を行うために使用してもよい。
The
次に、図2~図10を参照して、画像処理装置100で行う量子化工程について説明する。
Next, the quantization process performed by the
図2は、本実施形態における量子化工程を示すフローチャートである。図3は、図2のステップS201をより詳細に説明した、ニューラルネットワークの初期化の処理を示すフローチャートである。また、図4は、ニューラルネットワークの構造を示す概念図である。図5は、図2のステップS204をより詳細に説明した、ニューラルネットワークの処理を示すフローチャートである。 Figure 2 is a flowchart showing the quantization process in this embodiment. Figure 3 is a flowchart showing the process of initializing the neural network, explaining step S201 in Figure 2 in more detail. Figure 4 is a conceptual diagram showing the structure of the neural network. Figure 5 is a flowchart showing the process of the neural network, explaining step S204 in Figure 2 in more detail.
図2において、まずステップS201では、CPU107は、ニューラルネットワークの構造に関するデータとパラメータを初期化し、GPU108に展開する。構造に関するデータとパラメータについては後述する。なお、構造に関するデータとパラメータは、ストレージ装置101に保存したり、RAM106に展開してもよい。ステップS201で行われるニューラルネットワークの処理に関して、図3のフローチャートを用いて説明する。
In FIG. 2, first, in step S201, the
まず、ステップS301では、CPU107は、ニューラルネットワークの構造に関するデータを作成する。本実施形態では、CNN(Convolutional Neural Network)を用いる場合を例に、図4を用いて説明する。
First, in step S301, the
図4において、ニューラルネットワーク601は、複数のニューロン603を含む入力層605、隠れ層606、出力層607の階層構造を有し、各層のニューロンのノードを結合して構成されている。ニューラルネットワーク601では、入力ノード602からデータが入力されると、複数のニューロン603で計算が行われ、計算結果が出力ノード604に出力される。各ニューロンで計算される計算式の例を式(1)および式(2)に示す。
In FIG. 4,
Y=f(Z) …(1)
Z=W×X+b …(2)
ここで、式(1)のYはニューロンの出力データ、f(Z)は活性化関数(activation)を表す。式(2)のZは、式(1)の活性化関数の入力データ、Wは重み(weight)、Xはニューロンの入力データ、bはバイアス(bias)を表す。
Y = f(Z) ... (1)
Z = W × X + b ... (2)
Here, Y in formula (1) represents the output data of the neuron, f(Z) represents the activation function, Z in formula (2) represents the input data of the activation function in formula (1), W represents the weight, X represents the input data of the neuron, and b represents the bias.
ここで、ニューラルネットワーク601の構造に関するデータとは、CNNで行われる畳み込み演算やプーリング演算、アップサンプリング演算などの各階層の演算、各階層での活性化関数の演算、階層の層数、ニューロン603の数、ノードの結合情報などを含んだものである。また、本実施形態では、ニューロン603の数をチャネルと定義する。
Here, data related to the structure of the
なお、本実施形態はあくまで一例であり、ニューラルネットワークはCNNに限定されるものではない。例えば、GAN(Generative Adversarial Network)などを用いてもよいし、スキップコネクションなどを有してもよいし、RNN(Recurrent Neural Network)などのように再帰型であってもよい。また、図4は概念図であるため、隠れ層やチャネルを少なく表現しているが、これに限定されるものではない。例えば、入力層605、隠れ層606、出力層607はこれに限らずに、各層のチャネルを変えてもよいし、隠れ層606の数を増やしてもよい。
Note that this embodiment is merely an example, and the neural network is not limited to CNN. For example, a Generative Adversarial Network (GAN) may be used, a skip connection may be included, or a recurrent type such as a Recurrent Neural Network (RNN) may be used. Also, since FIG. 4 is a conceptual diagram, the number of hidden layers and channels is small, but this is not limiting. For example, the
次に、ステップS302では、CPU107は、ステップS301でGPU108に展開されたニューラルネットワークのパラメータを初期化する。ここで、ニューラルネットワークのパラメータは、式(1)、式(2)で用いられる重みと、バイアスと、活性化関数のパラメータである。例えば、ニューラルネットワークのパラメータの初期化では、He初期化の手法を用いて、FLOAT32のビット精度でパラメータの初期値を設定する。
Next, in step S302, the
なお、本実施形態は、あくまで一例であり、ニューラルネットワークパラメータの初期化の手法は、He初期化に限られず、それ以外の手法を用いてもよい。また、ニューラルネットワークのパラメータのビット精度は、FLOAT32に限らず、FLOAT64やFLOAT16などのデータ形式であってもよい。 Note that this embodiment is merely an example, and the method for initializing the neural network parameters is not limited to He initialization, and other methods may be used. Furthermore, the bit precision of the neural network parameters is not limited to FLOAT32, and may be a data format such as FLOAT64 or FLOAT16.
ステップS303では、CPU107は、ステップS301で作成したニューラルネットワークの構造に関するデータと、ステップS302で設定したニューラルネットワークのパラメータとを、GPU108に展開する。
In step S303, the
ここで、ニューラルネットワークの構造に関するデータとパラメータは、GPU108に限らず、ストレージ装置101やROM104やRAM106に一時的に保存してもよい。また、ニューラルネットワークの構造に関するデータとパラメータは、Protocol Buffersのデータ形式のファイルを用いて同一ファイルに保存してもよいし、個別に保存してもよい。また、保存するファイルのデータ形式は、Protocol Buffersに限定されず、HDF(Hierarchical Data Format)など他のデータ形式でもよい。
Here, the data and parameters related to the structure of the neural network may be temporarily stored not only in the
図2の説明に戻り、ステップS202では、CPU107は、ストレージ装置101から学習用画像を取得し、RAM106に展開する。ここで、学習用画像とは、ニューラルネットワークの学習時の入力画像となる訓練画像や正解画像の元となる画像のことである。本実施形態では、学習用画像はR、Gr、Gb、Bのカラーチャネルを持つベイヤー配列のRAW画像であり、取りうる値が0~16383の14bitであることを例に説明する。ここで、ベイヤー配列のRAW画像をカラー画像に変換する処理を、ディベイヤー処理と呼ぶ。学習用画像はベイヤー配列のRAW画像に限るものではなく、ディベイヤー処理を行った後のRGB、XYZ、L*a*b*、HSVなどの色空間の画像でもよいし、YUV、YCbCr、YPbPrなどの輝度信号および色差信号をもつ画像でもよい。また、学習用画像は1枚取得してRAM106に展開もよいし、複数枚まとめて取得してRAM106に展開してもよい。
Returning to the explanation of FIG. 2, in step S202, the
ステップS203では、CPU107は、画像処理部105を用いて、RAM106に展開された学習用画像から正解画像と訓練画像を作成し、RAM106に展開する。正解画像とは学習時にニューラルネットワークの出力画像の期待値となる画像である。訓練画像とは学習時にニューラルネットワークに入力される画像である。例えば、ノイズ除去を目的とするニューラルネットワークの場合、ノイズの非常に少ない画像を正解画像とする。本実施形態では、正解画像は学習用画像に対して前処理を行うことで作成する。前処理の例として、ガンマ補正やホワイトバランス補正などの画像の補正処理を行う。
In step S203, the
次に、訓練画像とは、学習時にニューラルネットワークに入力する画像である。例えば、ノイズ除去を目的とするニューラルネットワークの場合、正解画像と比べてノイズを多く含んだ画像を訓練画像とする。本実施形態では、訓練画像は学習用画像に対して劣化処理と前処理を行うことで作成する。劣化処理の例として、画像にノイズパターンを付与する。また、訓練画像を作成するために行う前処理として、補正処理を行った後の画像をニューラルネットワークに入力することを前提とする場合に、ガンマ補正やホワイトバランス補正などの補正処理が行われる。また、ニューラルネットワークに画像回復の機能に加えて補正処理の機能を持たせるために、正解画像のみに前処理を行ってもよい。さらに、正解画像を作成するための前処理と訓練画像を作成するための前処理は異なる処理を行ってもよい。あるいは、前処理を行わず、学習用画像を正解画像として使用してもよいし、学習用画像に劣化処理のみを行った画像を訓練画像として使用してもよい。 Next, a training image is an image input to a neural network during learning. For example, in the case of a neural network for noise removal, an image containing more noise than a correct answer image is used as a training image. In this embodiment, a training image is created by performing degradation processing and preprocessing on a learning image. As an example of degradation processing, a noise pattern is added to an image. In addition, as a preprocessing performed to create a training image, correction processing such as gamma correction and white balance correction is performed on the assumption that an image after correction processing is input to the neural network. In addition, in order to give the neural network a correction processing function in addition to the image recovery function, preprocessing may be performed only on the correct answer image. Furthermore, different processing may be performed for the preprocessing for creating the correct answer image and the preprocessing for creating the training image. Alternatively, the learning image may be used as the correct answer image without performing preprocessing, or an image after only degradation processing is performed on the learning image may be used as the training image.
なお、前処理として、ガンマ補正やホワイトバランス補正を例に挙げたが、前処理はこれらに限定されるものではない。また、劣化処理はノイズパターンの付与に限らず、ニューラルネットワークが実現する機能の目的に応じて、画像の縮小処理やぼかし処理などを行ってもよい。 Note that, although gamma correction and white balance correction have been given as examples of pre-processing, pre-processing is not limited to these. Furthermore, degradation processing is not limited to adding noise patterns, and image reduction processing or blurring processing may also be performed depending on the purpose of the function realized by the neural network.
本実施形態では、ステップS202で取得した学習用画像に対して、ステップS203で正解画像と訓練画像を作成する手法を例として挙げたが、あらかじめ学習用画像に前処理を行った正解画像と劣化処理と前処理を行った訓練画像をストレージ装置101に保存しておいてもよい。また、同一の撮像装置、画角、被写体において、劣化が生じないあるいは劣化が軽微な条件の画像と、劣化が大きく生じる条件の画像とを撮影し、それぞれを正解画像と訓練画像としてもよい。
In this embodiment, a method of creating a correct image and a training image in step S203 from a learning image acquired in step S202 has been given as an example, but a correct image obtained by preprocessing the learning image and a training image obtained by degrading and preprocessing may be stored in the
ステップS204では、CPU107は、ステップS203でRAM106に展開された訓練画像を、ステップS201またはステップS209でGPU108に展開されたニューラルネットワークに入力する。そして、さらにニューラルネットワークの処理を行い、出力画像をRAM106に展開する。ここで、訓練画像をニューラルネットワークの入力画像と定義する。ステップS204で行われるニューラルネットワークの処理に関して、図5のフローチャートを用いて説明する。
In step S204, the
まず、ステップS401では、CPU107は、ステップS201またはステップS209で保存されたニューラルネットワークの構造に関するデータとパラメータを取得し、ニューラルネットワークをGPU108に展開する。ここで、ステップS201またはステップS209で既にニューラルネットワークをGPU108に展開している場合、この処理は省略する。
First, in step S401, the
本実施形態では、図4のように入力画像608をニューラルネットワーク601の入力ノード602に入力し、ニューラルネットワーク601で演算した結果をニューラルネットワーク601の出力ノード604から出力画像609として出力する例を説明する。また、本実施形態では、ニューラルネットワークはU-Netである場合を例に説明する。ここで、U-Netは、畳み込み演算、プーリング演算、アップサンプリング演算、および活性化関数の演算などを行うCNNの一種である。なお、U-Netで行う演算については、後述する。
In this embodiment, an example will be described in which an
ステップS402では、CPU107は、ステップS203でRAM106に展開されたニューラルネットワークの入力画像をステップS401でGPU108に展開されたニューラルネットワークに入力する。本実施形態では、図6のようにベイヤー配列のRAW画像であるニューラルネットワークの入力画像からR、Gr、Gb、Bのカラーチャネルに分離した画像を、図4のニューラルネットワーク601に入力する入力画像608とする。ここで、図4を例に説明すると、入力画像608のデータを入力ノード602に入力し、さらに、入力層605のニューロンに入力する。
In step S402, the
ステップS403では、GPU108は、入力層605に入力されたデータに対してニューラルネットワーク601の各ニューロンで演算を行い、出力層607から出力データを出力する。
In step S403, the
ここで、ニューラルネットワーク601の演算の例として、縦3画素×横3画素のフィルタを用いた畳み込み演算について図7を用いて説明する。畳み込み演算とは、図7において、まず、入力データ801の縦3画素×横3画素のフィルタ802の領域の9画素に対して、重み803を用いた積和演算を行い、バイアス804を加算する計算のことを指すものとする。畳み込み演算の例を式(3)に示す。
As an example of the computation of the
ここで、式(3)のZ(x,y)は座標位置(x,y)における畳み込み演算結果805、Xは入力データ801の画素値、Wは重み803、bはバイアス804である。
Here, Z(x, y) in formula (3) is the
また、図7を例に説明すると、まず、入力データ801の注目画素X(x,y)を中心とした縦3画素×横3画素の9画素に対して、W(0,0)を中心とした縦3画素×横3画素の重み803をもつフィルタ802を用いて積和演算を行う。次に、積和演算結果にさらに、バイアス804を加えた結果を入力データ801の注目画素X(x,y)に対する畳み込み演算結果805とする。
Using Figure 7 as an example, first, a product-sum operation is performed on 9 pixels (3 pixels vertical x 3 pixels horizontal) centered on the pixel of interest X(x,y) of the
次に、注目画素X(x,y)に対する畳み込み演算結果805を活性化関数806に入力して、ニューロンの出力データを出力する。また、活性化関数806には、Leaky ReLU関数を用いる。Leaky ReLU関数の式を式(4)に示す。
Next, the
f(Z(x,y))=max(Z(x,y),Z(x,y)×a) …(4)
ここで、式(4)のf(Z(x,y))は座標(x,y)における活性化関数の結果、Z(x,y)は式(3)の畳み込み演算結果805、aはLeaky ReLU関数の係数、maxは、引数のうち最大値を出力する関数である。そして、式(3)、式(4)を用いた畳み込み演算を入力データ801の全ての画素に対して行い、その結果を出力データ807とする。
f(Z(x,y))=max(Z(x,y),Z(x,y)×a) ... (4)
Here, f(Z(x, y)) in formula (4) is the result of the activation function at coordinates (x, y), Z(x, y) is the
以上のように、ニューラルネットワーク601の各ニューロンで畳み込み演算、プーリング演算、アップサンプリング演算、および活性化関数の演算などの演算が行われ、出力層607から出力データが出力される。
As described above, each neuron in the
なお、本実施形態では、U-Netを例として、ニューラルネットワークの演算について説明したが、これに限らず、他の演算を行ってもよい。また、畳み込み演算のフィルタ802は縦3画素、横3画素とは異なる大きさとしてもよい。また、活性化関数806はLeaky ReLU関数以外のものでもよい。
In this embodiment, the neural network calculations have been described using U-Net as an example, but other calculations may be performed without being limited to this. Also, the
次に、ステップS404では、CPU107は、ニューラルネットワーク601で行われた演算の出力データを取得し、ニューラルネットワークの出力画像をRAM106に展開する。本実施形態では、図8のように、図4のニューラルネットワーク601からR、Gr、Gb、Bのカラーチャネルに分離した画像である出力画像609が出力され、出力画像609をベイヤー配列のRAW画像に戻すことを例に説明する。
Next, in step S404, the
ここで、図4を例に説明すると、出力層607のニューロンの出力データは出力ノード604に出力され、さらに、出力画像609が出力される。そして、出力画像609をベイヤー配列のRAW画像に戻した画像を、ニューラルネットワークの出力画像としてRAM106に展開する。なお、本実施形態では、ニューラルネットワークへ入力する訓練画像を、ベイヤー配列のRAW画像をR、Gr、Gb、Bのカラーチャネルに分離した画像にしている。しかし、本実施形態はあくまで一例であり、カラーチャネルに分離しなくてもよいし、複数枚まとめて入力してもよい。さらに、本実施形態では、ニューラルネットワーク601の出力は出力層607のニューロンからの出力のみとしているが、これに加えて、隠れ層606のニューロンの出力を特徴マップとして出力し、RAM106に展開してもよい。
Here, taking FIG. 4 as an example, the output data of the neurons in the
図2の説明に戻り、ステップS205では、画像処理部105は、ステップS204でRAM106に展開された出力画像に画像処理を行い、画像処理の行われた出力画像をRAM106に展開する。例えば、出力画像に行う画像処理としては、ニューラルネットワークの出力画像に対して補正処理を行った画像を使用することを前提とする場合に、ガンマ補正やホワイトバランス補正などの補正処理を行う。ここで、補正処理としてガンマ補正やホワイトバランス補正を例に挙げたが、補正処理はこれらに限定されるものではない。
Returning to the explanation of FIG. 2, in step S205, the
ステップS206では、CPU107は、ステップS205でRAM106に展開された出力画像と、ステップS203でRAM106に展開された正解画像の誤差を算出する。本実施形態では、出力画像と出力画像に対応する正解画像の画素値を損失関数に入力し、損失関数の出力結果を誤差とする。損失関数の例として平均二乗誤差を求める式を式(5)に示す。
In step S206, the
ここで、式(5)のMは平均二乗誤差、mは画像の水平の画素数、nは画像の垂直の画素数、Y(x,y)は出力画像の注目画素の画素値、J(x,y)は正解画像の注目画素の画素値である。なお、損失関数は式(5)に限らない。また、損失関数は平均絶対誤差や交差エントロピー誤差などの他の関数を用いてもよい。 In equation (5), M is the mean square error, m is the number of horizontal pixels in the image, n is the number of vertical pixels in the image, Y(x, y) is the pixel value of the pixel of interest in the output image, and J(x, y) is the pixel value of the pixel of interest in the correct image. Note that the loss function is not limited to equation (5). Other functions such as mean absolute error and cross entropy error may also be used as the loss function.
ステップS207では、CPU107は、ステップS204でRAM106に展開されている出力画像を、画素に関する評価値の算出に使用するか否かを判定する。例えば、ステップS206で算出された誤差を判定基準として、誤差が一定の値より小さい場合はステップS208に進み、画素に関する評価値を算出することを選択する。一方で誤差が一定の値より大きい場合はステップS209に進み、画素に関する評価値を算出しない。なお、判定基準はこれに限られるものではなく、学習回数やSSIM(Structural Similarity Index Measure)などの評価値を用いてもよい。
In step S207, the
ステップS208では、CPU107は、画像処理部105を用いて、ステップS204でRAM106に展開された出力画像の画素に関する評価値を算出する。画素に関する評価値とは出力画像の画素値から算出した統計分布である。本実施形態では、画素に関する評価値を、RAW画像の画素値の出現回数から平均ヒストグラムを逐次算出して得る場合を例に説明する。また、ステップS204で出力画像を1枚取得した場合を例に説明する。
In step S208, the
まず、出力画像の14ビットの取りうる値である0~16383の画素値ごとに出現回数をカウントする。次に、RAM106に展開されているこれまでの計算に使用した出力画像の枚数と現状算出されている平均ヒストグラムを取得する。ここで、出力画像が1枚目の場合は、出力画像の枚数と平均ヒストグラムの全ての画素値の出現回数は0とする。次に、0~16383の画素値ごとに、式(6)を用いて逐次計算することで平均ヒストグラムを算出する。逐次計算の式の例を式(6)に示す。
First, the number of occurrences is counted for each pixel value from 0 to 16383, which are the possible 14-bit values of the output image. Next, the number of output images used in the calculations up to now and the currently calculated average histogram are obtained, which are expanded in
Xn+1=(n×Xn + xn+1)/(n+1) …(6)
ここで、式(6)のnは計算時までに平均値算出に使用した合計画像枚数、Xnはn番目の平均値、Xn+1はn+1番目の平均値、xn+1はn+1番目に使用した画像における画素値の出現回数を表す。
Xn+1=(n×Xn+xn+1)/(n+1) ... (6)
Here, n in equation (6) represents the total number of images used to calculate the average value up to the time of calculation, Xn represents the nth average value, Xn+1 represents the (n+1)th average value, and xn+1 represents the number of times the pixel value appears in the (n+1)th image used.
最後に、これまでの計算に使用した出力画像の枚数と現状算出されている平均ヒストグラムをRAM106に展開する。ここで、画素に関する評価値は平均ヒストグラムに限定せず、ディベイヤー処理を行った画像から画像の定量的な評価値である明度、彩度、コントラスト、シャープネスを算出し、出力画像の各画像の評価値から統計分布を算出してもよい。また、画素に関する評価値は、RAW画像の全ての画素値から算出してもよいし、図6のようにRAW画像をR、Gr、Gb、Bのカラーチャネルに分離してカラーチャネルごとに算出してもよい。また、ステップS204にてRAM106に展開されている特徴マップから画素に関する評価値を算出してもよい。
Finally, the number of output images used in the calculations up to this point and the currently calculated average histogram are loaded into
ステップS209では、CPU107は、ステップS206で算出された誤差に基づいて、GPU108に展開されているニューラルネットワークのパラメータを更新する。例えば、確率的勾配降下法などの最適化手法を用いて、ステップS206で算出された誤差が小さくなるようにパラメータを更新する。そして、ステップS202~S209の処理を繰り返し実行することで、ニューラルネットワークのパラメータが最適化される。なお、ニューラルネットワークのパラメータの最適化手法は確率的勾配降下法に限定されず、Adamなど他の最適化手法でもよい。また、更新したニューラルネットワークのパラメータをストレージ装置101に一時的に保存してもよい。
In step S209, the
ステップS210では、CPU107は、ニューラルネットワークの学習終了条件を満たすか否かを判定する。例えば、学習回数が既定の回数に達しているかを確認し、達している場合は、学習終了条件を満たしていると判断して、ステップS211へ進み学習を終了する。学習終了条件を満たしていない場合は、ステップS202へ戻り、学習を継続する。なお、学習終了条件はこれに限るものではない。例えば、ステップS206で算出された誤差が閾値以下となった場合に学習を終了してもよい。
In step S210, the
ステップS211では、CPU107は、学習が終了したニューラルネットワークのパラメータをストレージ装置101に保存する。また、パラメータの保存先はこれに限らず、ROM104やRAM106を用いてもよい。
In step S211, the
ステップS212では、CPU107は、画像処理部105を用いて、ステップS208で算出された画素に関する評価値に基づいて量子化用画像を作成し、RAM106に展開する。ここで、量子化用画像とは量子化時の入力画像の元となる画像のことである。例えば、ステップS208で画素に関する評価値として、図9のような出力画像の平均ヒストグラムを算出し、その結果に基づいて量子化用画像を10枚作成する場合を例に図9を用いて説明する。
In step S212, the
ここで、図9は横軸を画素値、縦軸を画素数としたヒストグラムのグラフである。また、本実施形態において、出力画像は縦128×横128のサイズで、合計画素数が16384である画像を例に説明する。 Here, FIG. 9 is a histogram graph with the horizontal axis representing pixel values and the vertical axis representing pixel counts. In this embodiment, an output image having a size of 128 vertical x 128 horizontal, and a total number of pixels of 16,384, will be described as an example.
まず、平均ヒストグラムとして、図9のような統計分布データから、画素値で昇順に並び替えた16384個のデータを持つ一次元配列データを作成する。次に、平均ヒストグラムの一次元配列データから端のデータを除外する。例えば、データの開始位置から192個、データの終了位置から192個のデータを除外し、16000個のデータを持つ一次元配列データを作成する。次に、代表値の1個を求めるために使用するデータ数を算出する。ここで、代表値とは平均ヒストグラムを代表するような値でかつ、量子化用画像の作成する枚数と同じ個数のデータを持つ配列データである。そのため、本実施形態では代表値を10個算出するので、代表値の1個を求めるために16000を10で割った1600個のデータを使用する。次に、式(7)を用いて、代表値を算出する。 First, one-dimensional array data having 16,384 pieces of data sorted in ascending order by pixel value is created as an average histogram from the statistical distribution data as shown in FIG. 9. Next, the data at the ends is excluded from the one-dimensional array data of the average histogram. For example, 192 pieces of data from the start position of the data and 192 pieces of data from the end position of the data are excluded to create one-dimensional array data having 16,000 pieces of data. Next, the number of pieces of data used to find one representative value is calculated. Here, a representative value is a value that represents the average histogram, and is array data having the same number of pieces of data as the number of images to be created for quantization. Therefore, in this embodiment, 10 representative values are calculated, so 1600 pieces of data, obtained by dividing 16,000 by 10, are used to find one representative value. Next, the representative value is calculated using formula (7).
ここで、式(7)のd[i]はインデックスiにおける代表値の値、nは代表値の1個を求めるために使用するデータ数、Xは端のデータを除外した後の平均ヒストグラムの一次元配列データを表す。本実施形態では、nが1600で、1600個のデータ毎に平均値を算出し、10個データを持つ代表値dを算出する。 Here, d[i] in formula (7) represents the value of the representative value at index i, n represents the number of data points used to find one representative value, and X represents the one-dimensional array data of the average histogram after excluding the data points at the ends. In this embodiment, n is 1600, and the average value is calculated for every 1600 data points, and a representative value d having 10 data points is calculated.
次に、代表値に基づいて量子化用画像を作成する。例えば、量子化用画像は全ての画素の画素値を代表値にした画像を10枚作成する。その結果、出力画像の平均ヒストグラムの特徴を少ない枚数で再現するような、出力画像の特徴を簡易的に表わす量子化用画像を作成することができる。ここで、出力画像の画素数と、端のデータとして除外するデータ数と、作成する量子化用画像の枚数は一意の値に限定されるものではない。また、平均ヒストグラムから除外するデータは、画素値が500以下または14000以上のデータは除外するといったように、画素値の条件に基づいて決定してもよいし、除外するデータをなくしてもよい。また、代表値の算出方法は、本実施形態の方法に限定されず、0~500の画素値から1個の代表値を算出するといったように、画素値の範囲を指定してその範囲の中から代表値を算出してもよい。また、代表値は、平均値だけではなく、中央値など、それ以外の方法で算出してもよい。また、ステップS208で画素に関する評価値をチャネルごとなど複数算出している場合、代表値はチャネルごとに算出してもよい。また、RAM106から出力画像またはそれ以外の画像を取得し、代表値を、取得した画像の画素値の平均値で割った値を補正係数とし、補正係数を取得した画像に掛けることで、代表値と同等の値になるような画像を作成してもよい。また、代表値はチャネルごとに算出した場合、チャネルごとに上記の処理を行い、量子化用画像を作成してもよい。
Next, a quantization image is created based on the representative value. For example, ten images for quantization are created in which the pixel values of all pixels are set to the representative value. As a result, a quantization image that simply represents the characteristics of the output image, such as reproducing the characteristics of the average histogram of the output image with a small number of images, can be created. Here, the number of pixels of the output image, the number of data to be excluded as edge data, and the number of images for quantization to be created are not limited to unique values. In addition, the data to be excluded from the average histogram may be determined based on pixel value conditions, such as excluding data with pixel values of 500 or less or 14,000 or more, or the excluded data may be eliminated. In addition, the method of calculating the representative value is not limited to the method of this embodiment, and a range of pixel values may be specified and a representative value may be calculated from within the range, such as calculating one representative value from pixel values of 0 to 500. In addition, the representative value may be calculated not only by the average value but also by other methods such as the median. In addition, if multiple evaluation values related to pixels are calculated in step S208, such as for each channel, the representative value may be calculated for each channel. Alternatively, an output image or another image may be obtained from the
次に、ステップS213では、CPU107は、画像処理部105を用いて、ステップS212でRAM106に展開された量子化用画像に基づいて量子化のための入力画像を作成し、RAM106に展開する。本実施形態では、量子化のための入力画像が、量子化用画像に対してニューラルネットワーク学習時の入力画像である訓練画像を作成する際と同様の劣化処理と前処理を行うことで作成される場合を例に説明する。まず、量子化用画像に対して、ステップS203の訓練画像を作成するために行う劣化処理と同様の処理を行う。次に、劣化処理を行った量子化用画像に対して、ステップS203の訓練画像を作成するために行う前処理と同様の処理を行う。ここで、ニューラルネットワークの学習時に訓練画像を作成するための前処理を行わない場合、量子化用画像に前処理を行わなくてもよい。
Next, in step S213, the
ステップS214では、CPU107は、ステップS211でストレージ装置101に保存されたニューラルネットワークのパラメータを取得し、ステップS212でRAM106に展開された量子化のための入力画像を使用して、パラメータの量子化を行う。
In step S214, the
ステップS213の処理に関して、学習後量子化(PostTrainingQuantization)を静的量子化(static quantization)で行う場合を例に図10のフローチャートを用いて説明する。本実施形態では、量子化で、ニューラルネットワークの層を構成するパラメータである重み(weight)、バイアス(bias)、活性化関数(activation)のビット精度をFLOAT32からINT8へ変換することを前提に説明する。 The process of step S213 will be described with reference to the flowchart in FIG. 10, taking as an example a case where post-training quantization is performed using static quantization. In this embodiment, the description will be given on the premise that the bit precision of the weights, biases, and activation functions, which are parameters constituting the layers of the neural network, is converted from FLOAT32 to INT8 in quantization.
まず、ステップS501では、CPU107は、量子化のための入力画像を学習済みのニューラルネットワークに入力する。ステップS502では、CPU107は、ニューラルネットワークの層ごとに出力データの最大値と最小値を算出する。ステップS503では、CPU107は、最大値と最小値に基づいて、ニューラルネットワークの層ごとの出力データのスケールとオフセットを算出する。ステップS504では、CPU107は、スケールとオフセットに基づいて、重みとバイアスを量子化し、さらに活性化関数は、量子化後のビット精度で再現できる個数以下の線形関数に近似することで、量子化する。
First, in step S501, the
ステップS505では、CPU107は、ニューラルネットワークのパラメータを量子化した場合のニューラルネットワークの層ごとの出力データのスケールとオフセットを算出する。ステップS506では、CPU107は、量子化前の場合のスケールとオフセットとの一致精度の評価を行い、量子化したニューラルネットワークのパラメータをRAM106に展開する。
In step S505, the
ステップS507では、CPU107は、量子化の終了条件を満たすか否かを判定し、条件を満たさない場合、ステップS501に戻り、新たな量子化のための入力画像を用いて量子化を進める。一方、量子化の終了条件を満たす場合、ステップS508に進む。量子化の終了条件とは、量子化回数が規定値に達した場合でもよいし、量子化後の結果を確認し、ユーザの判断で終了してもよい。
In step S507, the
最後に、ステップS508では、CPU107は、ステップS506の結果に基づいて、層ごとにスケールとオフセットの一致精度が最も高い評価となったときの量子化されたパラメータに更新する。
Finally, in step S508, the
なお、本実施形態では、CPU107で量子化を行うと説明したが、GPU108で量子化を行ってもよい。また、学習後量子化を静的量子化で行う場合を例に説明したが、量子化の方法はそれに限定されるものではなく、量子化を考慮した学習(QuantizationAwareTraining)などでもよい。また、量子化は、重み、バイアス、活性化関数のいずれか1つ以上に対して行ってもよい。また、量子化するビット精度は、INT8に限らず、FLOAT16、INT16、INT4など、ニューラルネットワークの学習時のビット精度より低いビット精度のデータ形式であればよい。
In the present embodiment, the quantization is performed by the
図2の説明に戻り、ステップS215では、CPU107は、ステップS213で量子化したニューラルネットワークのパラメータをストレージ装置101に記憶させる。本実施形態においては、ストレージ装置に記憶させる前提で説明しているが、その他の記憶媒体に記憶させてもよい。
Returning to the explanation of FIG. 2, in step S215, the
以上説明したように、本実施形態では、ニューラルネットワークの出力画像の画素に関する評価値に基づいて、量子化のための入力画像を作成する。これにより、ニューラルネットワークの出力画像の特徴を少ない枚数で精度良く再現した(出力画像に近似した)量子化のための入力画像を作成することができる。そして、作成した量子化のための入力画像を用いて量子化を行うことで、画像回復を目的とするディープラーニングにおいて、量子化による演算精度の低下のばらつきを抑え、さらに、演算精度の低下を抑制することが可能となる。 As described above, in this embodiment, an input image for quantization is created based on evaluation values for pixels of an output image of a neural network. This makes it possible to create an input image for quantization that accurately reproduces the characteristics of the output image of a neural network with a small number of images (approximates the output image). Then, by performing quantization using the created input image for quantization, it becomes possible to suppress the variation in the decrease in calculation accuracy due to quantization in deep learning aimed at image restoration, and further suppress the decrease in calculation accuracy.
<第2の実施形態>
次に、本発明の第2の実施形態の画像処理装置100で行う量子化工程について、図11を用いて説明する。図11は第2の実施形態の量子化工程を示すフローチャートである。図11のフローチャートにおいて、図2のフローチャートと同様の処理をするステップは図2と同じステップ番号を付加し、説明は省略する。
Second Embodiment
Next, the quantization process performed by the
また前提として、ニューラルネットワークは学習が完了し、構造に関するデータとパラメータがストレージ装置101に保存されているものとする。ここで、学習が完了しているニューラルネットワークとは、前述の図2において、ステップS202からステップS206までと、ステップS209と、ステップS211がそれぞれ1回以上実施され、パラメータが更新された状態のニューラルネットワークのことである。
It is also assumed that the neural network has completed learning, and that data and parameters related to the structure are stored in the
ステップS1101では、CPU107は、学習済みのニューラルネットワークの構造に関するデータおよびパラメータをストレージ装置101から取得しニューラルネットワークをGPU108に展開する。なお、学習済みのニューラルネットワークの構造に関するデータやパラメータがRAM106やROM104などの他の記憶装置に保存されている場合は、ROM104やRAM106などの他の記憶装置から取得してもよい。また、ニューラルネットワークの構造は、ストレージ装置101から取得せずに、学習時と同一のものを再構築してもよい。
In step S1101, the
ステップS1102では、CPU107は、ストレージ装置101から推論用画像を取得して、RAM106に展開する。推論用画像とは、学習済みニューラルネットワークの推論時の入力画像の元となる画像である。推論用画像は1枚または複数枚でもよい。また、学習用画像の一部を推論用画像として使用してもよい。あるいは、第1の実施形態で示した方法で作成した出力画像や量子化用画像を使用してもよい。
In step S1102, the
次にステップS1103では、CPU107は、画像処理部105を用いて、ステップS1102でRAM106に展開されている推論用画像に対して画像処理を行い、ニューラルネットワークの入力画像としてRAM106に展開する。画像処理はステップS203の訓練画像を作成するための処理と同様の処理を行う。
Next, in step S1103, the
ステップS1104では、CPU107は、ステップS1103でRAM106に展開されている入力画像を取得し、GPU108に展開されているニューラルネットワークに入力し、ステップS204と同様の処理を行う。ニューラルネットワークの出力画像はRAM106に展開される。
In step S1104, the
ステップS208では、CPU107は、図2と同様に、出力画像に基づいて画素に関する評価値を算出する。
In step S208, the
ステップS1105では、CPU107は、すべての推論用画像をニューラルネットワークに入力したかを判定する。すべての推論用画像をニューラルネットワークに入力した場合はステップS212に進み、画素に関する評価値から量子化用画像を作成する。一方でニューラルネットワークに入力していない推論用画像が存在する場合は、ステップS1102に戻り、次の推論用画像を取得してニューラルネットワークに入力する。
In step S1105, the
ステップS212からステップS215までは、図2と同様の処理である。 Steps S212 to S215 are the same as those in FIG. 2.
以上説明したように、本実施形態によれば、推論用画像を学習済みニューラルネットワークに入力した際に得られる出力画像に基づいて、第1の実施形態と同様の手法により、量子化のための入力画像を作成する。これにより、ニューラルネットワークの出力画像の特徴を少ない枚数で精度良く再現した(出力画像に近似した)量子化のための入力画像を作成することができる。そして、作成した量子化のための入力画像を用いて量子化を行うことで、画像回復を目的とするディープラーニングにおいて、量子化による演算精度の低下のばらつきを抑え、さらに、演算精度の低下を抑制することが可能となる。 As described above, according to this embodiment, an input image for quantization is created using a method similar to that of the first embodiment, based on the output image obtained when an image for inference is input to a trained neural network. This makes it possible to create an input image for quantization that accurately reproduces the characteristics of the output image of the neural network with a small number of images (approximates the output image). Then, by performing quantization using the created input image for quantization, it is possible to suppress the variation in the decrease in calculation accuracy due to quantization in deep learning aimed at image recovery, and further suppress the decrease in calculation accuracy.
なお、上記の2つの実施形態で説明した画像処理装置100を撮像装置が備える構成であってもよく、撮像装置が撮像して取得した画像データに対して各種の画像処理を実行するようにしてもよい。
The
本明細書の開示は、以下の画像処理装置、方法、プログラムおよび記憶媒体を含む。 The disclosure of this specification includes the following image processing device, method, program, and storage medium.
(項目1)
ニューラルネットワークの学習に使用される訓練画像を前記ニューラルネットワークに入力して得られた出力画像の特徴を表す評価値を取得する取得手段と、
前記評価値に基づいて、前記出力画像の特徴を簡易的に表わす入力画像を生成する生成手段と、
生成された前記入力画像を前記ニューラルネットワークに入力して、前記ニューラルネットワークの層を構成するパラメータのビット数を削減する削減手段と、
を備えることを特徴とする画像処理装置。
(Item 1)
an acquisition means for acquiring an evaluation value representing a feature of an output image obtained by inputting a training image used for learning the neural network into the neural network;
a generating means for generating an input image simply expressing the characteristics of the output image based on the evaluation value;
a reduction means for inputting the generated input image to the neural network and reducing the number of bits of parameters constituting a layer of the neural network;
An image processing device comprising:
(項目2)
前記削減手段は、前記入力画像を学習済みの前記ニューラルネットワークに入力して、前記ビット数を削減することを特徴とする項目1に記載の画像処理装置。
(Item 2)
2. The image processing device according to
(項目3)
前記評価値は、前記出力画像の平均ヒストグラムであることを特徴とする項目1または2に記載の画像処理装置。
(Item 3)
3. The image processing device according to
(項目4)
前記平均ヒストグラムは、逐次計算することによって算出されることを特徴とする項目3に記載の画像処理装置。
(Item 4)
4. The image processing device according to
(項目5)
前記生成手段は、前記評価値の代表値に基づいて、前記入力画像を生成することを特徴とする項目1乃至4のいずれか1項目に記載の画像処理装置。
(Item 5)
5. The image processing device according to
(項目6)
前記代表値は、前記入力画像と同じ個数のデータであることを特徴とする項目5に記載の画像処理装置。
(Item 6)
6. The image processing device according to
(項目7)
前記訓練画像と、前記ニューラルネットワークの出力画像の期待値である正解画像とは、1つの元になる画像から生成されることを特徴とする項目1乃至6のいずれか1項目に記載の画像処理装置。
(Item 7)
7. The image processing device according to any one of
(項目8)
前記訓練画像は、前記元になる画像に、ノイズ付加処理または劣化処理を施すことにより生成されることを特徴とする項目7に記載の画像処理装置。
(Item 8)
8. The image processing device according to
(項目9)
前記正解画像は、前記元になる画像に、前処理を施すことにより生成されることを特徴とする項目7に記載の画像処理装置。
(Item 9)
8. The image processing device according to
(項目10)
前記出力画像と前記ニューラルネットワークの出力画像の期待値である正解画像の誤差を算出する算出手段と、前記誤差に基づいて前記出力画像から前記評価値を取得するか否かを選択する選択手段とをさらに備えることを特徴とする項目1乃至9のいずれか1項目に記載の画像処理装置。
(Item 10)
The image processing device according to any one of
(項目11)
項目1乃至10のいずれか1項目に記載の画像処理装置を備えることを特徴とする撮像装置。
(Item 11)
11. An imaging device comprising the image processing device according to any one of
(項目12)
ニューラルネットワークの学習に使用される訓練画像を前記ニューラルネットワークに入力して得られた出力画像の特徴を表す評価値を取得する取得工程と、
前記評価値に基づいて、前記出力画像の特徴を簡易的に表わす入力画像を生成する生成工程と、
生成された前記入力画像を前記ニューラルネットワークに入力して、前記ニューラルネットワークの層を構成するパラメータのビット数を削減する削減工程と、
を有することを特徴とする画像処理方法。
(Item 12)
an acquisition step of acquiring an evaluation value representing a feature of an output image obtained by inputting a training image used for learning the neural network into the neural network;
a generating step of generating an input image simply expressing the characteristics of the output image based on the evaluation value;
a reduction step of inputting the generated input image to the neural network and reducing the number of bits of parameters constituting a layer of the neural network;
13. An image processing method comprising:
(項目13)
項目12に記載の画像処理方法の各工程をコンピュータに実行させるためのプログラム。
(Item 13)
Item 13. A program for causing a computer to execute each step of the image processing method according to item 12.
(項目14)
項目12に記載の画像処理方法の各工程をコンピュータに実行させるためのプログラムを記憶したコンピュータが読み取り可能な記憶媒体。
(Item 14)
13. A computer-readable storage medium storing a program for causing a computer to execute each step of the image processing method according to item 12.
(他の実施形態)
また本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現できる。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現できる。
Other Embodiments
The present invention can also be realized by a process in which a program for realizing one or more of the functions of the above-described embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) for realizing one or more of the functions.
発明は上記実施形態に制限されるものではなく、発明の精神及び範囲から離脱することなく、様々な変更及び変形が可能である。従って、発明の範囲を公にするために請求項を添付する。 The invention is not limited to the above-described embodiment, and various modifications and variations are possible without departing from the spirit and scope of the invention. Therefore, the following claims are appended to disclose the scope of the invention.
100:画像処理装置、101:ストレージ装置、102:ストレージ接続部、103:ストレージ駆動部、104:ROM、105:画像処理部、106:RAM、107:CPU、108:GPU、109:内部バス 100: Image processing device, 101: Storage device, 102: Storage connection unit, 103: Storage drive unit, 104: ROM, 105: Image processing unit, 106: RAM, 107: CPU, 108: GPU, 109: Internal bus
Claims (14)
前記評価値に基づいて、前記出力画像の特徴を簡易的に表わす入力画像を生成する生成手段と、
生成された前記入力画像を前記ニューラルネットワークに入力して、前記ニューラルネットワークの層を構成するパラメータのビット数を削減する削減手段と、
を備えることを特徴とする画像処理装置。 an acquisition means for acquiring an evaluation value representing a feature of an output image obtained by inputting a training image used for learning the neural network into the neural network;
a generating means for generating an input image simply expressing the characteristics of the output image based on the evaluation value;
a reduction means for inputting the generated input image to the neural network and reducing the number of bits of parameters constituting a layer of the neural network;
An image processing device comprising:
前記評価値に基づいて、前記出力画像の特徴を簡易的に表わす入力画像を生成する生成工程と、
生成された前記入力画像を前記ニューラルネットワークに入力して、前記ニューラルネットワークの層を構成するパラメータのビット数を削減する削減工程と、
を有することを特徴とする画像処理方法。 an acquisition step of acquiring an evaluation value representing a feature of an output image obtained by inputting a training image used for learning the neural network into the neural network;
a generating step of generating an input image simply expressing the characteristics of the output image based on the evaluation value;
a reduction step of inputting the generated input image to the neural network and reducing the number of bits of parameters constituting a layer of the neural network;
13. An image processing method comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2022189529A JP2024077434A (en) | 2022-11-28 | 2022-11-28 | Image processing device, image processing method, program, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2022189529A JP2024077434A (en) | 2022-11-28 | 2022-11-28 | Image processing device, image processing method, program, and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2024077434A true JP2024077434A (en) | 2024-06-07 |
Family
ID=91334325
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2022189529A Pending JP2024077434A (en) | 2022-11-28 | 2022-11-28 | Image processing device, image processing method, program, and storage medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2024077434A (en) |
-
2022
- 2022-11-28 JP JP2022189529A patent/JP2024077434A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5007228B2 (en) | Image cleanup and precoding | |
KR0154739B1 (en) | Fractal image compression device and method | |
CN112396645B (en) | Monocular image depth estimation method and system based on convolution residual learning | |
CN111914997B (en) | Method for training neural network, image processing method and device | |
JP2018055259A (en) | Information processing apparatus, information processing method and program | |
US11663707B2 (en) | Method and system for image enhancement | |
CN111835983B (en) | Multi-exposure-image high-dynamic-range imaging method and system based on generation countermeasure network | |
CN114677412B (en) | Optical flow estimation method, device and equipment | |
WO2019008951A1 (en) | Convolutional neural network | |
CN114067007A (en) | Image processing method and device and neural network training method and device | |
Vaksman et al. | Patch ordering as a regularization for inverse problems in image processing | |
KR102177247B1 (en) | Apparatus and method for determining manipulated image | |
CN114930824A (en) | Depth palette prediction | |
EP4024343A1 (en) | Viewpoint image processing method and related device | |
JP2020014042A (en) | Image quality evaluation device, learning device and program | |
US20120038785A1 (en) | Method for producing high resolution image | |
JP7398938B2 (en) | Information processing device and its learning method | |
CN114078149A (en) | Image estimation method, electronic equipment and storage medium | |
JP2024077434A (en) | Image processing device, image processing method, program, and storage medium | |
JP2024077435A (en) | Image processing device, image processing method, program, and storage medium | |
JP2021090129A (en) | Image processing device, imaging apparatus, image processing method and program | |
CN115018726A (en) | U-Net-based image non-uniform blur kernel estimation method | |
CN114820363A (en) | Image processing method and device | |
KR102537207B1 (en) | Method for processing image based on machine learning and apparatus therefof | |
CN114862699A (en) | Face repairing method, device and storage medium based on generation countermeasure network |