JP7498421B2 - Machine learning model training method, data generation device, and trained machine learning model - Google Patents

Machine learning model training method, data generation device, and trained machine learning model Download PDF

Info

Publication number
JP7498421B2
JP7498421B2 JP2019092211A JP2019092211A JP7498421B2 JP 7498421 B2 JP7498421 B2 JP 7498421B2 JP 2019092211 A JP2019092211 A JP 2019092211A JP 2019092211 A JP2019092211 A JP 2019092211A JP 7498421 B2 JP7498421 B2 JP 7498421B2
Authority
JP
Japan
Prior art keywords
data
machine learning
learning model
input
teacher
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2019092211A
Other languages
Japanese (ja)
Other versions
JP2020187582A (en
Inventor
航平 渡邉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2019092211A priority Critical patent/JP7498421B2/en
Priority to PCT/JP2020/018931 priority patent/WO2020230776A1/en
Publication of JP2020187582A publication Critical patent/JP2020187582A/en
Application granted granted Critical
Publication of JP7498421B2 publication Critical patent/JP7498421B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Image Analysis (AREA)

Description

本明細書は、機械学習モデルや該機械学習モデルを用いてデータを生成する技術に関する。 This specification relates to a machine learning model and a technique for generating data using the machine learning model.

近年、ニューラルネットワークやサポートベクタマシンなどの機械学習モデルの利用や開発が進んでいる。例えば、特許文献1に開示された技術では、入力データに、ある属性を有するか否かを示すポジティブまたはネガティブ情報をラベル付けして教師データとする。そして、該教師データの特徴量をサポートベクタマシンに学習させることによって、サポートベクタマシンをトレーニングする。 In recent years, the use and development of machine learning models such as neural networks and support vector machines has progressed. For example, in the technology disclosed in Patent Document 1, input data is labeled with positive or negative information indicating whether or not it has a certain attribute, and used as training data. The support vector machine is then trained by having it learn the features of the training data.

特開2013-25398号公報JP 2013-25398 A

ところで、他の機械学習モデルの学習の進み具合等との関係で、機械学習モデルのトレーニングの進み具合を調整することが好ましい場合がある。上記技術では、このようなトレーニングの進み具合を適切に調整できない可能性があった。 However, it may be desirable to adjust the progress of training of a machine learning model in relation to the learning progress of other machine learning models. With the above technology, it may not be possible to appropriately adjust the progress of such training.

本明細書は、機械学習モデルの学習の進み具合を調整する技術を開示する。 This specification discloses a technique for adjusting the learning progress of a machine learning model.

本明細書に開示された技術は、上述の課題の少なくとも一部を解決するためになされたものであり、以下の適用例として実現することが可能である。 The technology disclosed in this specification has been made to solve at least some of the problems described above, and can be realized as the following application examples.

[適用例1]機械学習モデルのトレーニング方法であって、第1の入力データを第1の機械学習モデルに入力することによって、前記第1の入力データに対応する第1の出力データを出力させる第1工程であって、前記第1の機械学習モデルは、前記第1の入力データに対して複数個の第1の演算パラメータを用いる演算処理を実行して前記第1の出力データを出力するモデルである、前記第1工程と、前記第1の出力データと教師データとを用いて、前記複数個の第1の演算パラメータを調整する第2工程であって、前記教師データは、前記第1の入力データに対応する前記第1の出力データの目標値を示す、前記第2工程と、を備え、前記第1工程と前記第2工程とをコンピュータが複数回繰り返すことによって、前記第1の機械学習モデルをトレーニングし、前記第2工程は、前記複数個の第1の演算パラメータの調整のために用いられる値を、乱数を用いて変動させる変動工程を含む、方法。 [Application Example 1] A method for training a machine learning model, comprising: a first step of inputting first input data into a first machine learning model to output first output data corresponding to the first input data, the first machine learning model being a model that performs an arithmetic process on the first input data using a plurality of first arithmetic parameters to output the first output data; and a second step of adjusting the plurality of first arithmetic parameters using the first output data and teacher data, the teacher data indicating a target value of the first output data corresponding to the first input data, wherein a computer repeats the first step and the second step multiple times to train the first machine learning model, and the second step includes a varying step of varying values used for adjusting the plurality of first arithmetic parameters using random numbers.

上記構成によれば、第2工程は、複数個の第1の演算パラメータの調整のために用いられる値を、乱数を用いて変動させる変動工程を含むので、複数個の第1の演算パラメータの調整量を、乱数を用いない場合に算出される調整量とは異なる量に変動させることができる。この結果、第1の機械学習モデルのトレーニングの進み具合を調整することができる。
[適用例2]
適用例1に記載の方法であって、
前記変動工程は、前記複数個の教師データに含まれる少なくとも一部の値を、前記乱数を用いて変動させる工程であり、
前記第2工程は、前記第1の出力データと、少なくとも一部の値が変動された後の前記教師データと、を用いて、前記複数個の第1の演算パラメータを調整する工程である、方法。
[適用例3]
適用例1に記載の方法であって、
前記変動工程は、前記第1の出力データに含まれる少なくとも一部の値を、前記乱数を用いて変動させる工程であり、
前記第2工程は、少なくとも一部の値が変動された後の前記第1の出力データと、前記教師データと、を用いて、前記複数個の第1の演算パラメータを調整する工程である、方法。
[適用例4]
適用例1に記載の方法であって、
前記第2工程は、
前記第1の出力データと前記教師データとを用いて、所定の損失関数に基づく評価値を算出する工程と、
前記評価値を、前記乱数を用いて変動させる前記変動工程と、
変動後の前記評価値を用いて、前記複数個の第1の演算パラメータを調整する工程と、
を含む、方法。
[適用例5]
適用例1~4のいずれかに記載の方法であって、さらに、
第2の入力データを前記第1の機械学習モデルとは異なる第2の機械学習モデルに入力することによって、前記第2の入力データに対応する第2の出力データを出力させる第3工程であって、前記第2の機械学習モデルは、前記第2の入力データに対して複数個の第2の演算パラメータを用いる演算処理を実行して前記第2の出力データを出力するモデルである、前記第3工程と、
前記第2の出力データを用いて、前記複数個の第2の演算パラメータを調整する第4工程と、
を備え、
前記第1工程と前記第2工程と前記第3工程と前記第4工程とを複数回繰り返すことによって、前記第1の機械学習モデルと前記第2の機械学習モデルとを並行してトレーニングし、
前記第4工程は、前記複数個の第2の演算パラメータを調整するために用いられる値を、乱数を用いて変動させる工程を含まない、方法。
[適用例6]
適用例5に記載の方法であって、
前記第1の入力データは、実データと、偽データとしての前記第2の出力データと、を含む複数個のデータであり、
前記教師データは、複数個の前記第1の入力データのそれぞれが前記実データであるか前記偽データであるかを示すデータであり、
前記第1の機械学習モデルは、前記複数個の第1の入力データのそれぞれが前記実データと前記偽データとのいずれであるかを識別するためのモデルであり、
前記第1の出力データは、前記第1の機械学習モデルによる識別結果を示すデータであり、
前記第2の機械学習モデルは、前記偽データとしての前記第2の出力データを生成するためのモデルであり、
前記第2工程では、前記第1の出力データと前記教師データとを用いて、前記第1の出力データと前記教師データとの差分が小さくなるように、前記複数個の第1の演算パラメータを調整し、
前記第4工程では、前記偽データとしての前記第2の出力データを前記第1の機械学習モデルに入力することによって得られる前記第1の出力データと前記教師データとの差分が大きくなるように、前記複数個の第2の演算パラメータを調整する、方法。
[適用例7]
適用例1~6のいずれかに記載の方法であって、
前記変動工程では、変動後の値が0以上の値となるように、前記複数個の第1の演算パラメータの調整のために用いられる値を変動させる、方法。
According to the above configuration, the second step includes a varying step of varying the values used for adjusting the plurality of first calculation parameters by using random numbers, so that the adjustment amounts of the plurality of first calculation parameters can be varied to amounts different from the adjustment amounts calculated when no random numbers are used. As a result, the progress of training of the first machine learning model can be adjusted.
[Application Example 2]
The method according to Application Example 1,
The varying step is a step of varying at least a part of values included in the plurality of teacher data by using the random numbers;
The method, wherein the second step is a step of adjusting the plurality of first calculation parameters using the first output data and the teacher data after at least a portion of the values have been varied.
[Application Example 3]
The method according to Application Example 1,
the varying step is a step of varying at least a part of values included in the first output data by using the random number;
The method, wherein the second step is a step of adjusting the plurality of first calculation parameters using the first output data after at least some of the values have been changed and the teacher data.
[Application Example 4]
The method according to Application Example 1,
The second step comprises:
Calculating an evaluation value based on a predetermined loss function using the first output data and the teacher data;
the varying step of varying the evaluation value by using the random number;
adjusting the plurality of first calculation parameters using the evaluation value after the change;
A method comprising:
[Application Example 5]
The method according to any one of Application Examples 1 to 4, further comprising:
a third step of inputting second input data into a second machine learning model different from the first machine learning model, thereby outputting second output data corresponding to the second input data, the second machine learning model being a model that performs a calculation process using a plurality of second calculation parameters on the second input data to output the second output data;
a fourth step of adjusting the plurality of second calculation parameters using the second output data;
Equipped with
training the first machine learning model and the second machine learning model in parallel by repeating the first step, the second step, the third step, and the fourth step a plurality of times;
The method, wherein the fourth step does not include a step of varying values used to adjust the plurality of second operational parameters using random numbers.
[Application Example 6]
The method according to application example 5,
The first input data is a plurality of data including real data and the second output data as false data,
the teacher data is data indicating whether each of the plurality of first input data is the real data or the fake data,
the first machine learning model is a model for identifying whether each of the plurality of first input data is the real data or the fake data;
The first output data is data indicating a classification result by the first machine learning model,
the second machine learning model is a model for generating the second output data as the fake data,
In the second step, the plurality of first calculation parameters are adjusted using the first output data and the teacher data so that a difference between the first output data and the teacher data becomes small;
In the fourth step, the plurality of second calculation parameters are adjusted so that a difference between the first output data obtained by inputting the second output data as the fake data into the first machine learning model and the teacher data is increased.
[Application Example 7]
The method according to any one of Application Examples 1 to 6,
The method includes varying values used for adjusting the plurality of first calculation parameters so that the values after the variation are equal to or greater than 0 in the varying step.

[適用例2]データ生成装置であって、第1の機械学習モデルを用いるトレーニング処理によってトレーニングされた学習済みの第2の機械学習モデルを用いて特定のデータを生成する生成部と、前記特定のデータを出力する出力部と、を備え、前記第1の機械学習モデルは、第1の入力データに対して複数個の第1の演算パラメータを用いる演算処理を実行して、前記第1の入力データが実データと偽データとのいずれかであるかを識別した結果を示す識別データを出力するモデルであり、前記第2の機械学習モデルは、第2の入力データに対して複数個の第2の演算パラメータを用いる演算処理を実行して、前記第2の入力データに対応する前記偽データを生成するモデルであり、前記トレーニング処理は、前記第2の入力データを前記第2の機械学習モデルに入力して、前記偽データを生成させる偽データ生成処理と、実データと、前記第2の機械学習モデルによって生成された前記偽データと、を含む複数個の前記第1の入力データを前記第1の機械学習モデルに入力して、複数個の前記識別データを出力させる識別データ生成処理と、前記識別データと教師データとを用いて、前記識別データと前記教師データとの差が小さくなるように、前記複数個の第1の演算パラメータを調整する第1の調整処理であって、前記教師データは、前記複数個の第1の入力データのそれぞれが前記実データであるか前記偽データであるかを示すデータである、前記第1の調整処理と、前記偽データを前記第1の機械学習モデルに入力することによって得られる前記識別データと前記教師データとを用いて、前記識別データと前記教師データとの差が大きくなるように、前記複数個の第2の演算パラメータを調整する第2の調整処理と、を含み、前記偽データ生成処理と前記識別データ生成処理と前記第1の調整処理と前記第2の調整処理とを複数回繰り返すことによって、前記第1の機械学習モデルと前記第2の機械学習モデルとを並行してトレーニングする処理であり、
前記第1調整処理は、前記複数個の第1の演算パラメータを調整するために用いられる値を、乱数を用いて変動させる処理を含み、前記第2調整処理は、前記複数個の第2の演算パラメータを調整するために用いられる値を、乱数を用いて変動させる処理を含まない、データ生成装置。

[Application Example 2] A data generating device includes a generation unit that generates specific data using a learned second machine learning model trained by a training process using a first machine learning model, and an output unit that outputs the specific data, wherein the first machine learning model is a model that performs a calculation process using a plurality of first calculation parameters on first input data, and outputs identification data indicating a result of identifying whether the first input data is real data or fake data, and the second machine learning model is a model that performs a calculation process using a plurality of second calculation parameters on second input data, and generates the fake data corresponding to the second input data, and the training process includes a fake data generation process that inputs the second input data to the second machine learning model to generate the fake data, and a fake data output process that outputs identification data indicating a result of identifying whether the first input data is real data or fake data generated by the second machine learning model. a first adjustment process for adjusting the plurality of first calculation parameters using the identification data and teacher data so as to reduce a difference between the identification data and the teacher data, the teacher data being data indicating whether each of the plurality of first input data is the real data or the fake data; and a second adjustment process for adjusting the plurality of second calculation parameters using the identification data and the teacher data obtained by inputting the fake data into the first machine learning model so as to increase a difference between the identification data and the teacher data, the fake data generation process, the identification data generation process, the first adjustment process, and the second adjustment process being repeated a plurality of times to train the first machine learning model and the second machine learning model in parallel,
A data generating device, wherein the first adjustment process includes a process of varying values used to adjust the plurality of first calculation parameters using random numbers, and the second adjustment process does not include a process of varying values used to adjust the plurality of second calculation parameters using random numbers.

上記構成によれば、第1調整処理は、複数個の第1の演算パラメータを調整するために用いられる値を、乱数を用いて変動させる処理を含み、第2調整処理は、前記複数個の第2の演算パラメータを調整するために用いられる値を、乱数を用いて変動させる処理を含まない。この結果、第1の機械学習モデルのトレーニングの進み具合を調整することによって、第2の機械学習モデルは、第1の機械学習モデルのトレーニングの進み具合に対して過度に遅れないようにトレーニングされている。このために、例えば、データ生成装置は、適切な出力データを生成することができる。 According to the above configuration, the first adjustment process includes a process of varying the values used to adjust the multiple first calculation parameters using random numbers, and the second adjustment process does not include a process of varying the values used to adjust the multiple second calculation parameters using random numbers. As a result, by adjusting the progress of the training of the first machine learning model, the second machine learning model is trained so as not to lag excessively behind the progress of the training of the first machine learning model. To this end, for example, the data generation device can generate appropriate output data.

なお、本明細書に開示される技術は、種々の形態で実現することが可能であり、例えば、上記トレーニング方法を実行するトレーニング装置、学習済みの機械学習モデル、これらの方法や装置を実現するためのコンピュータプログラム、そのコンピュータプログラムを記録した記録媒体、等の形態で実現することができる。 The technology disclosed in this specification can be realized in various forms, such as a training device that executes the above-mentioned training method, a trained machine learning model, a computer program for implementing these methods and devices, a recording medium on which the computer program is recorded, etc.

データ生成装置200の構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of a data generating device 200. 画像生成処理のフローチャートである。13 is a flowchart of an image generating process. 入力画像と出力画像との一例を示す図である。FIG. 2 is a diagram showing an example of an input image and an output image. 生成ネットワークGNの構成を示すブロック図である。FIG. 2 is a block diagram showing the configuration of a generation network GN. エンコーダECの構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of an encoder EC. デコーダDCの構成を示すブロック図である。FIG. 2 is a block diagram showing the configuration of a decoder DC. トレーニング装置100の構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of a training device 100. 入力画像と実画像との一例を示す図である。FIG. 2 is a diagram showing an example of an input image and an actual image. 本実施例のネットワークシステム1000の概念図である。FIG. 1 is a conceptual diagram of a network system 1000 according to an embodiment of the present invention. 識別ネットワークDNの構成を示すブロック図である。FIG. 2 is a block diagram showing the configuration of an identification network DN. トレーニング処理のフローチャートである。13 is a flowchart of a training process. 変動誤差値算出処理のフローチャートである。13 is a flowchart of a fluctuation error value calculation process. 第1変形例の変動誤差値算出処理のフローチャートである。13 is a flowchart of a fluctuation error value calculation process according to a first modified example. 第2変形例の変動誤差値算出処理のフローチャートである。13 is a flowchart of a fluctuation error value calculation process according to a second modified example.

A.実施例
A-1.データ生成装置の構成
次に、実施の形態を実施例に基づき説明する。図1は、本実施例のデータ生成装置200の構成を示すブロック図である。
A. Example A-1 Configuration of Data Generating Device Next, an embodiment will be described based on an example. Fig. 1 is a block diagram showing the configuration of a data generating device 200 of this example.

データ生成装置200は、パーソナルコンピュータやスマートフォンなどの計算機である。データ生成装置200は、データ生成装置200のコントローラとしてのCPU210と、RAMなどの揮発性記憶装置220と、ハードディスクドライブやフラッシュメモリなどの不揮発性記憶装置230と、液晶ディスプレイなどの表示部240と、キーボードやマウスなどの操作部250と、通信インタフェース(IF)270と、を備えている。通信インタフェース270は、外部機器(例えば、プリンタ300)と接続するためのインタフェースである。通信インタフェース270は、例えば、プリンタ300が接続されたネットワークNWに接続するための有線または無線のインタフェースを含む。 The data generating device 200 is a computer such as a personal computer or a smartphone. The data generating device 200 includes a CPU 210 as a controller of the data generating device 200, a volatile storage device 220 such as a RAM, a non-volatile storage device 230 such as a hard disk drive or a flash memory, a display unit 240 such as a liquid crystal display, an operation unit 250 such as a keyboard or a mouse, and a communication interface (IF) 270. The communication interface 270 is an interface for connecting to an external device (e.g., the printer 300). The communication interface 270 includes, for example, a wired or wireless interface for connecting to a network NW to which the printer 300 is connected.

揮発性記憶装置220は、CPU210が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域を提供する。不揮発性記憶装置230には、コンピュータプログラムPGgと、後述する複数個の入力データIDを含む入力データ群IGと、が格納されている。揮発性記憶装置220や不揮発性記憶装置230は、データ生成装置200の内部メモリである。 The volatile storage device 220 provides a buffer area for temporarily storing various intermediate data generated when the CPU 210 performs processing. The non-volatile storage device 230 stores a computer program PGg and an input data group IG including multiple input data IDs, which will be described later. The volatile storage device 220 and the non-volatile storage device 230 are internal memories of the data generating device 200.

コンピュータプログラムPGgは、例えば、プリンタ300の製造者が運用するサーバからダウンロードされる形態で提供される。これに代えて、コンピュータプログラムPGgは、DVD-ROMなどに格納される形態で提供されてもよい。CPU210は、コンピュータプログラムPGgを実行することにより、後述する画像生成処理を実行する。 The computer program PGg is provided, for example, in a form that is downloaded from a server operated by the manufacturer of the printer 300. Alternatively, the computer program PGg may be provided in a form that is stored on a DVD-ROM or the like. The CPU 210 executes the computer program PGg to perform the image generation process described below.

コンピュータプログラムPGgは、後述する生成ネットワーク(generator)GNの機能をCPU210に実現させるコンピュータプログラムである生成ネットワークプログラムGNMをモジュールとして含んでいる。 The computer program PGg includes a generator network program GNM as a module, which is a computer program that causes the CPU 210 to realize the functions of the generator network GN described below.

プリンタ300は、インクジェット方式や電子写真方式の印刷装置であり、印刷材としてのインクやトナーを用いて用紙などの印刷媒体上に画像を印刷する。 The printer 300 is an inkjet or electrophotographic printing device that prints images on a printing medium such as paper using ink or toner as a printing material.

A-2.画像生成処理
図2は、画像生成処理のフローチャートである。この画像生成処理は、例えば、データ生成装置200において、ユーザの開始指示に基づいて開始される。
A-2. Image Generation Processing Fig. 2 is a flowchart of the image generation processing. This image generation processing is started, for example, in the data generating device 200 based on a start instruction from the user.

S10では、CPU210は、1個の入力データIDを取得する。この入力データIDは、例えば、不揮発性記憶装置230に格納された入力データ群IGの中から、ユーザの指定に基づいて選択された1個のデータである。入力データIDは、入力画像IIを示す画像データである。 In S10, the CPU 210 acquires one input data ID. This input data ID is, for example, one piece of data selected based on a user's specification from the input data group IG stored in the non-volatile memory device 230. The input data ID is image data indicating the input image II.

図3は、入力画像と出力画像との一例を示す図である。本実施例の入力画像IIは、第1種の書体(フォント)で特定の文字を示す画像である。入力画像IIは、縦方向および横方向にマトリクス状に配列された(H×W)個の画素を含む。Hは、入力画像IIの縦方向の画素数であり、Wは、入力画像IIの横方向の画素数である。本実施例では、H=W=256である。例えば、図3(A)の入力画像IIaは、第1種の書体で「A」の文字を示す画像である。図3(B)の入力画像IIbは、第1種の書体で「B」の文字を示す画像である。 Figure 3 shows an example of an input image and an output image. In this embodiment, input image II is an image showing a specific character in a first typeface (font). Input image II includes (H x W) pixels arranged in a matrix in the vertical and horizontal directions. H is the number of pixels in the vertical direction of input image II, and W is the number of pixels in the horizontal direction of input image II. In this embodiment, H = W = 256. For example, input image IIa in Figure 3 (A) is an image showing the character "A" in the first typeface. Input image IIb in Figure 3 (B) is an image showing the character "B" in the first typeface.

本実施例では、入力データIDは、複数個の画素を含む画像を示すビットマップデータであり、具体的には、RGB値によって画素ごとの色を表すRGB画像データである。RGB値は、3個の色成分の階調値(以下、成分値とも呼ぶ)、すなわち、R値、G値、B値を含むRGB表色系の色値である。R値、G値、B値は、例えば、所定の階調数(例えば、256)の階調値である。 In this embodiment, the input data ID is bitmap data representing an image including multiple pixels, specifically, RGB image data that represents the color of each pixel by RGB values. The RGB values are the gradation values (hereinafter also referred to as component values) of three color components, that is, the color values of the RGB color system including the R value, the G value, and the B value. The R value, the G value, and the B value are, for example, gradation values of a predetermined number of gradations (for example, 256).

S20では、CPU210は、入力データIDを生成ネットワークGNに入力して、入力データIDに対応する出力データODを生成させる。出力データODは、出力画像OIを示す画像データであり、入力データIDと同様にRGB画像データである。本実施例の出力画像OIは、第1種の書体とは異なる第2種の書体で、対応する入力画像IIと同一の文字を示す画像である。例えば、図3(A)の出力画像OIaは、入力画像IIaに対応する出力画像であり、第2種の書体で「A」の文字を示す画像である。図3(B)の出力画像OIbは、入力画像IIbに対応する出力画像であり、第2種の書体で「B」の文字を示す画像である。本実施例では、出力画像OIのサイズは、入力画像IIのサイズと同じである。生成ネットワークGNの具体的な構成については後述する。 In S20, the CPU 210 inputs the input data ID to the generation network GN to generate output data OD corresponding to the input data ID. The output data OD is image data showing the output image OI, and is RGB image data like the input data ID. The output image OI in this embodiment is an image showing the same character as the corresponding input image II in a second typeface different from the first typeface. For example, the output image OIa in FIG. 3(A) is an output image corresponding to the input image IIa, and is an image showing the character "A" in the second typeface. The output image OIb in FIG. 3(B) is an output image corresponding to the input image IIb, and is an image showing the character "B" in the second typeface. In this embodiment, the size of the output image OI is the same as the size of the input image II. The specific configuration of the generation network GN will be described later.

S30では、CPU210は、生成された出力データODを出力する。例えば、CPU210は、出力データODを用いて出力画像OIを示す印刷データを生成して、プリンタ300に送信する。プリンタ300は、印刷データを用いて出力画像OIを印刷媒体上に印刷する。あるいは、CPU210は、出力データODを用いて出力画像OIを表示部240に表示する。 In S30, the CPU 210 outputs the generated output data OD. For example, the CPU 210 generates print data indicating the output image OI using the output data OD and transmits it to the printer 300. The printer 300 prints the output image OI on a print medium using the print data. Alternatively, the CPU 210 displays the output image OI on the display unit 240 using the output data OD.

A-3.生成ネットワークGNの構成
図4は、生成ネットワークGNの構成を示すブロック図である。生成ネットワークGNは、エンコーダECとデコーダDCとを含んでいる。
A-3. Configuration of the generation network GN Fig. 4 is a block diagram showing the configuration of the generation network GN. The generation network GN includes an encoder EC and a decoder DC.

A-3-1.エンコーダECの構成
エンコーダECは、入力データIDに対して、複数個の演算パラメータPeを用いて、次元削減処理を実行して、入力データIDの特徴(すなわち、入力画像IIの特徴)を示す特徴データCDを生成する。本実施例では、入力データIDは、(256×256)個の画素のそれぞれの3個の成分値(R値、G値、B値)を含むので、(256×256×3)個の値を含むデータ、すなわち、(256×256×3)次元のデータである。特徴データCDは、本実施例では、(1×1×512)個の値を含むデータ、すなわち、512次元のデータである。このように、次元削減処理では、入力データIDの次元数が削減される。
A-3-1. Configuration of Encoder EC The encoder EC executes a dimensionality reduction process on the input data ID using a plurality of calculation parameters Pe to generate feature data CD indicating the features of the input data ID (i.e., the features of the input image II). In this embodiment, the input data ID includes three component values (R value, G value, B value) of each of the (256×256) pixels, so that the data includes (256×256×3) values, that is, data of (256×256×3) dimensions. In this embodiment, the feature data CD includes (1×1×512) values, that is, data of 512 dimensions. In this way, the number of dimensions of the input data ID is reduced in the dimensionality reduction process.

図5は、エンコーダECの構成を示すブロック図である。エンコーダECは、入力層EL_0と、複数個の畳込層EL_1~畳込層EL_8を有するニューラルネットワークである。 Figure 5 is a block diagram showing the configuration of the encoder EC. The encoder EC is a neural network that has an input layer EL_0 and multiple convolution layers EL_1 to EL_8.

入力層EL_0は、入力データIDが入力される層である。1番目の畳込層EL_1には、入力層EL_0に入力された入力データIDがそのまま入力される。畳込層EL_1は、(256×256×3)次元の入力データIDに対して、後述する演算処理を実行して(A×B×C)次元のデータを生成する(A、B、Cは正の整数)。 The input layer EL_0 is a layer to which the input data ID is input. The first convolutional layer EL_1 receives the input data ID input to the input layer EL_0 as is. The convolutional layer EL_1 performs a calculation process, described later, on the (256×256×3)-dimensional input data ID to generate (A 1 ×B 1 ×C 1 )-dimensional data (A 1 , B 1 , and C 1 are positive integers).

k番目(kは、2~8の整数)の畳込層EL_kには、(k-1)番目の畳込層EL_(k-1)によって生成される(Ak-1×Bk-1×Ck-1)次元のデータに対して、所定の後処理(後述)を実行して得られる(Ak-1、Bk-1、Ck-1)次元の処理済データが入力される。畳込層EL_kは、(Ak-1×Bk-1×Ck-1)次元の処理済データに対して、後述する演算処理を実行して(A×B×C)次元のデータを生成する(A、B、Cは正の整数)。 The kth (k is an integer from 2 to 8) convolutional layer EL_k receives (A k-1 , B k-1 , C k-1 )-dimensional processed data obtained by performing a predetermined post-processing (described later) on (A k-1 × B k-1 × C k-1 )-dimensional data generated by the (k-1)th convolutional layer EL_ (k-1 ). The convolutional layer EL_k performs arithmetic processing (described later) on the (A k-1 ×B k-1 ×C k-1 )-dimensional processed data to generate (A k ×B k ×C k )-dimensional data (A k , B k , C k are positive integers).

各畳込層EL_1~EL_8が実行する演算処理は、畳込処理(convolution)とバイアスの加算処理とを含む。畳込処理は、入力されたデータに対して、(p×q×r)次元のs個のフィルタを順次に適用して入力されたデータとフィルタとの相関を示す相関値を算出する処理である。各フィルタを適用する処理では、フィルタをスライドさせながら複数個の相関値が順次に算出される。1個のフィルタは、(p×q×r)個の重みを含んでいる。バイアスの加算処理は、算出された相関値に、1個のフィルタに対して1個ずつ準備されたバイアスを加算する処理である。s個のフィルタに含まれる(p×q×r×s)個の重みと、s個のフィルタに対応するs個のバイアスと、は、上述した複数個の演算パラメータPeであり、後述するトレーニング処理において更新される。 The computational processes performed by each of the convolutional layers EL_1 to EL_8 include convolutional processing and bias addition processing. The convolutional processing is a process of sequentially applying s filters of (p×q×r) dimensions to input data to calculate a correlation value indicating the correlation between the input data and the filters. In the process of applying each filter, multiple correlation values are sequentially calculated while sliding the filter. One filter includes (p×q×r) weights. The bias addition processing is a process of adding biases, one for each filter, to the calculated correlation value. The (p×q×r×s) weights included in the s filters and the s biases corresponding to the s filters are the multiple computational parameters Pe described above, and are updated in the training processing described below.

各畳込層EL_1~EL_8によって生成されるデータの各値は、上述した相関値にバイアスを加えた値である。各畳込層EL_1~EL_8によって生成されるデータに含まれるデータの個数(例えば、畳込層EL_1の場合は(A×B×C))は、畳込処理におけるストライド(フィルタをスライドさせる量)と、フィルタの個数sと、によって決定される。 Each value of the data generated by each of the convolution layers EL_1 to EL_8 is a value obtained by adding a bias to the correlation value described above. The number of data included in the data generated by each of the convolution layers EL_1 to EL_8 (for example, (A 1 ×B 1 ×C 1 ) in the case of the convolution layer EL_1) is determined by the stride (the amount by which the filter is slid) in the convolution process and the number of filters s.

畳込層EL_1によって生成されるデータの各値は、上述した後処理として、活性化関数に入力されて変換される。本実施例では、活性化関数には、いわゆるLeakyReLU(Leaky Rectified Linear Unit)が用いられる。 The data values generated by the convolutional layer EL_1 are input to an activation function and transformed as the post-processing described above. In this embodiment, the activation function used is the so-called LeakyReLU (Leaky Rectified Linear Unit).

畳込層EL_2~畳込層EL_8によって生成されるデータの各値は、上述した後処理として、バッチノーマライゼーション(Batch Normalization)によって変換された後に、さらに、活性化関数に入力されて変換される。バッチノーマライゼーションは、後述するトレーニング処理では、用いられる入力データの集合(バッチ)分について、各値の平均と分散を計算して、各値を正規化する処理である。画像生成処理では、トレーニング処理時にバッチごとに算出された平均と分散の移動平均値を用いて、各値が正規化される。 The data values generated by convolutional layers EL_2 to EL_8 are transformed by batch normalization as the post-processing mentioned above, and then input to an activation function for further transformation. Batch normalization is a process in which the average and variance of each value are calculated for a set (batch) of input data used in the training process described below, and each value is normalized. In the image generation process, each value is normalized using the moving average value of the average and variance calculated for each batch during the training process.

畳込層EL_8によって生成されるデータに対して、上述した後処理を実行して得られる処理済データが、上述した特徴データCDである。 The processed data obtained by performing the above-mentioned post-processing on the data generated by the convolutional layer EL_8 is the above-mentioned feature data CD.

なお、本実施例にて、各畳込層EL_1~EL_8によって生成されるデータの次元数(A×B×C)~(A×B×C)は、以下の通りである。
(A×B×C)=(128×128×64)
(A×B×C)=(64×64×128)
(A×B×C)=(32×32×256)
(A×B×C)=(16×16×512)
(A×B×C)=(8×8×512)
(A×B×C)=(4×4×512)
(A×B×C)=(2×2×512)
(A×B×C)=(1×1×512)
In this embodiment, the numbers of dimensions (A 1 ×B 1 ×C 1 ) to (A 8 ×B 8 ×C 8 ) of the data generated by each of the convolution layers EL_1 to EL_8 are as follows:
( A1 x B1 x C1 ) = (128 x 128 x 64)
( A2 x B2 x C2 ) = (64 x 64 x 128)
( A3 x B3 x C3 ) = (32 x 32 x 256)
( A4 x B4 x C4 ) = (16 x 16 x 512)
( A5 x B5 x C5 ) = (8 x 8 x 512)
( A6 x B6 x C6 ) = (4 x 4 x 512)
( A7 x B7 x C7 ) = (2 x 2 x 512)
( A8 x B8 x C8 ) = (1 x 1 x 512)

A-3-2.デコーダDCの構成
デコーダDCは、エンコーダECによって生成された特徴データCDに対して、複数個の演算パラメータPdを用いて、次元復元処理を実行して、上述した出力データODを生成する。本実施例では、特徴データCDは、上述したように(1×1×512)個の値を含むデータ、すなわち、512次元のデータである。本実施例では、出力データODは、入力データIDと同様に、(256×256×3)個の値を含むデータ、すなわち、(256×256×3)次元のデータである。本実施例では、このように、本実施例の次元復元処理では、特徴データCDの次元数が復元される。
A-3-2. Configuration of the decoder DC The decoder DC executes a dimension restoration process on the feature data CD generated by the encoder EC using a plurality of calculation parameters Pd to generate the above-mentioned output data OD. In this embodiment, the feature data CD is data including (1×1×512) values as described above, that is, 512-dimensional data. In this embodiment, the output data OD is data including (256×256×3) values, that is, (256×256×3)-dimensional data, similar to the input data ID. In this manner, in the dimension restoration process of this embodiment, the number of dimensions of the feature data CD is restored.

図6は、デコーダDCの構成を示すブロック図である。デコーダDCは、複数個の転置畳込層DL_1~転置畳込層DL_8を有するニューラルネットワークである。 Figure 6 is a block diagram showing the configuration of the decoder DC. The decoder DC is a neural network having multiple transposed convolution layers DL_1 to DL_8.

1番目の転置畳込層DL_1には、特徴データCDが入力される。転置畳込層DL_1は、特徴データCDに対して、後述する演算処理を実行して(D×E×F)次元のデータを生成する(D、E、Fは正の整数)。 Feature data CD is input to the first transposed convolutional layer DL_1. The transposed convolutional layer DL_1 performs arithmetic processing, which will be described later, on the feature data CD to generate ( D1 x E1 x F1 )-dimensional data ( D1 , E1 , F1 are positive integers).

m番目(mは、2~8の整数)の転置畳込層DL_mには、(m-1)番目の転置畳込層DL_(m-1)によって生成される(Dm-1、Em-1、Fm-1)次元のデータに対して所定の後処理(後述)を実行して得られる(Dm-1、Em-1、Fm-1)次元の処理済データが入力される。さらに、m番目の転置畳込層DL_mには、エンコーダECの(9-m)番目の畳込層EL_(9-m)によって生成されるデータに対して上述した後処理を実行して得られる(A9-m、B9-m、C9-m)次元の処理済みデータが入力される。例えば、図5、図6に示すように、デコーダDCの転置畳込層DL_2には、エンコーダECのEL_7によって生成されるデータに基づく処理済みデータが入力され、転置畳込層DL_4には、エンコーダECのEL_5によって生成されるデータに基づく処理済みデータが入力される。したがって、m番目(mは、2~8の整数)の転置畳込層DL_mには、{(Dm-1、Em-1、Fm-1)+(A9-m、B9-m、C9-m)}次元の処理済データが入力される。転置畳込層DL_mは、入力される処理済データに対して、後述する演算処理を実行して(D×E×F)次元のデータを生成する(D、E、Fは正の整数)。 The m-th (m is an integer from 2 to 8) transposed convolution layer DL_m receives processed data of (D m-1 , E m- 1 , F m-1 ) dimensions obtained by performing a predetermined post-processing (described later) on data of (D m -1 , E m-1 , F m-1 ) dimensions generated by the (m-1)th transposed convolution layer DL_( m -1 ). Furthermore, the m-th transposed convolution layer DL_m receives processed data of (A 9- m , B 9-m , C 9-m ) dimensions obtained by performing the above-mentioned post-processing on data generated by the (9-m )th convolution layer EL_ (9-m ) of the encoder EC. For example, as shown in FIG. 5 and FIG. 6, the transposed convolution layer DL_2 of the decoder DC receives processed data based on data generated by EL_7 of the encoder EC, and the transposed convolution layer DL_4 receives processed data based on data generated by EL_5 of the encoder EC. Therefore, {(D m-1 , E m-1 , F m-1 )+(A 9-m , B 9-m , C 9-m )}-dimensional processed data is input to the m-th (m is an integer from 2 to 8) transposed convolution layer DL_m. The transposed convolution layer DL_m performs arithmetic processing, described later, on the input processed data to generate (D m ×E m ×F m )-dimensional data (D m , E m , F m are positive integers).

各転置畳込層DL_1~DL_8が実行する演算処理は、転置畳込処理(transposed convolution)とバイアスの加算処理とを含む。転置畳込処理は、入力されたデータに対して、ストライドに応じて適宜に値(例えばゼロの値)を追加して次元数を増加させた後に、上述した畳込処理と同様に(p×q×r)次元のフィルタを用いた畳み込み演算を行う処理である。バイアスの加算処理は、転置畳込演算で算出された相関値に、1個のフィルタに対して1個ずつ準備されたバイアスを加算する処理である。s個のフィルタに含まれる(p×q×r×s)個の重みと、s個のフィルタに対応するs個のバイアスと、は、上述した複数個の演算パラメータPdであり、後述するトレーニング処理において更新される。 The computational processes performed by each of the transposed convolution layers DL_1 to DL_8 include transposed convolution and bias addition. The transposed convolution process is a process in which a value (e.g., a value of zero) is added to the input data as appropriate according to the stride to increase the number of dimensions, and then a convolution operation is performed using a (p×q×r)-dimensional filter, similar to the above-mentioned convolution process. The bias addition process is a process in which a bias prepared for each filter is added to the correlation value calculated by the transposed convolution operation. The (p×q×r×s) weights included in the s filters and the s biases corresponding to the s filters are the above-mentioned multiple computational parameters Pd, and are updated in the training process described below.

各転置畳込層DL_1~DL_8によって生成されるデータの各値は、上述した相関値にバイアスを加えた値である。各転置畳込層DL_1~DL_8によって生成されるデータに含まれるデータの個数(例えば、転置畳込層DL_1の場合は(D×E×F))は、転置畳込処理におけるストライド(ゼロ等の値を追加する量)と、フィルタの個数sと、によって決定される。 Each value of the data generated by each of the transposed convolution layers DL_1 to DL_8 is a value obtained by adding a bias to the correlation value described above. The number of data included in the data generated by each of the transposed convolution layers DL_1 to DL_8 (for example, (D 1 ×E 1 ×F 1 ) in the case of the transposed convolution layer DL_1) is determined by the stride (the amount of values such as zeros added) in the transposed convolution process and the number of filters s.

転置畳込層DL_1~DL_3によって生成されるデータの各値は、上述した後処理として、上述したバッチノーマライゼーションによって変換される。そして、トレーニング処理では、バッチノーマライゼーションによって変換された各値は、さらに後処理として、ドロップアウトよって変換された後に、活性化関数に入力されて変換される。ドロップアウトは、過学習を抑制するために、ランダムに一部の値を無効化(0にする)する処理である。活性化関数には、いわゆるReLU(Rectified Linear Unit)が用いられる。画像生成処理では、ドロップアウト処理は行われず、バッチノーマライゼーションによって変換された各値は、活性化関数に入力されて変換される。 The values of the data generated by the transposed convolution layers DL_1 to DL_3 are transformed by the batch normalization described above as the post-processing described above. Then, in the training process, each value transformed by batch normalization is further transformed by dropout as post-processing, and then input to the activation function and transformed. Dropout is a process that randomly invalidates (sets to 0) some values to suppress overlearning. The activation function used is the so-called ReLU (Rectified Linear Unit). In the image generation process, dropout processing is not performed, and each value transformed by batch normalization is input to the activation function and transformed.

転置畳込層DL_4~DL_7によって生成されるデータの各値は、上述した後処理として、上述したバッチノーマライゼーションによって変換され、その後に活性化関数に入力されて変換される。転置畳込層DL_4~DL_7の後処理では、トレーニング処理でも画像生成処理でもドロップアウトは行われない。 The data values generated by the transposed convolution layers DL_4 to DL_7 are transformed by the batch normalization described above as the post-processing described above, and then input to the activation function and transformed. In the post-processing of the transposed convolution layers DL_4 to DL_7, dropout is not performed in either the training process or the image generation process.

転置畳込層DL_8によって生成される(D×E×F)次元のデータが、上述した出力データODである。したがって、転置畳込層DL_8によって生成されるデータの次元数(D×E×F)は、出力データODの次元数(256×256×3)と等しい。 The ( D8 × E8 × F8 )-dimensional data generated by the transposed convolution layer DL_8 is the above-mentioned output data OD. Therefore, the number of dimensions ( D8 × E8 × F8 ) of the data generated by the transposed convolution layer DL_8 is equal to the number of dimensions (256×256×3) of the output data OD.

なお、本実施例にて、各転置畳込層DL_1~DL_8によって生成されるデータの次元数(D×E×F)~(D×E×F)は、以下の通りである。
(D×E×F)=(2×2×512)
(D×E×F)=(4×4×512)
(D×E×F)=(8×8×512)
(D×E×F)=(16×16×512)
(D×E×F)=(32×32×256)
(D×E×F)=(64×64×128)
(D×E×F)=(128×128×64)
(D×E×F)=(256×256×3)
In this embodiment, the numbers of dimensions (D 1 ×E 1 ×F 1 ) to (D 8 ×E 8 ×F 8 ) of the data generated by each of the transposed convolution layers DL_1 to DL_8 are as follows:
( D1 x E1 x F1 ) = (2 x 2 x 512)
( D2 x E2 x F2 ) = (4 x 4 x 512)
( D3 x E3 x F3 ) = (8 x 8 x 512)
( D4 x E4 x F4 ) = (16 x 16 x 512)
( D5 x E5 x F5 ) = (32 x 32 x 256)
( D6 x E6 x F6 ) = (64 x 64 x 128)
( D7 x E7 x F7 ) = (128 x 128 x 64)
( D8 x E8 x F8 ) = (256 x 256 x 3)

A-4.生成ネットワークGNのトレーニング
上述した生成ネットワークGNは、入力データIDが入力された場合に、所望の出力データODを生成できるように、トレーニングされている。以下では、生成ネットワークGNのトレーニングについて説明する。
A-4. Training of the Generative Network GN The above-mentioned generative network GN is trained so that it can generate the desired output data OD when the input data ID is input. The training of the generative network GN will be described below.

A-4-1.トレーニング装置の構成
図7は、本実施例の生成ネットワークGNのトレーニングを実行するトレーニング装置100の構成を示すブロック図である。
A-4-1. Configuration of the Training Apparatus Fig. 7 is a block diagram showing the configuration of a training apparatus 100 that executes training of the generative network GN of this embodiment.

トレーニング装置100は、パーソナルコンピュータやサーバなどの計算機である。トレーニング装置100は、トレーニング装置100のコントローラとしてのCPU110と、RAMなどの揮発性記憶装置120と、ハードディスクドライブやフラッシュメモリなどの不揮発性記憶装置130と、液晶ディスプレイなどの表示部140と、キーボードやマウスなどの操作部150と、外部機器(例えば、プリンタ300)と接続するための通信インタフェース(IF)170と、を備えている。 The training device 100 is a computer such as a personal computer or a server. The training device 100 includes a CPU 110 as a controller for the training device 100, a volatile storage device 120 such as a RAM, a non-volatile storage device 130 such as a hard disk drive or a flash memory, a display unit 140 such as a liquid crystal display, an operation unit 150 such as a keyboard or a mouse, and a communication interface (IF) 170 for connecting to an external device (e.g., a printer 300).

揮発性記憶装置120は、CPU110が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域を提供する。不揮発性記憶装置130には、コンピュータプログラムPGtと、学習用の複数個の入力データIDを含む入力データ群IGと、複数個の実データRDを含む実データ群RGと、教師データLDと、が格納されている。揮発性記憶装置120や不揮発性記憶装置130は、トレーニング装置100の内部メモリである。 The volatile memory device 120 provides a buffer area for temporarily storing various intermediate data generated when the CPU 110 performs processing. The non-volatile memory device 130 stores a computer program PGt, an input data group IG including multiple input data ID for learning, an actual data group RG including multiple actual data RD, and teacher data LD. The volatile memory device 120 and the non-volatile memory device 130 are internal memories of the training device 100.

コンピュータプログラムPGtは、例えば、プリンタ300の製造者が運用するサーバからダウンロードされる形態で提供される。これに代えて、コンピュータプログラムPGtは、DVD-ROMなどに格納される形態で提供されてもよい。CPU110は、コンピュータプログラムPGtを実行することにより、後述するトレーニング処理を実行する。 The computer program PGt is provided, for example, in a form that is downloaded from a server operated by the manufacturer of the printer 300. Alternatively, the computer program PGt may be provided in a form that is stored on a DVD-ROM or the like. The CPU 110 executes the computer program PGt to perform the training process described below.

トレーニング処理で用いられる入力データIDは、上述した画像生成処理で用いられる入力データIDと同様のRGB画像データである。入力データIDによって示される入力画像IIは、上述したように、第1の書体(フォント)で特定の文字を示す画像である。実データRDは、上述した画像生成処理で生成される出力データODと同様のRGB画像データである。複数個の実データRDは、入力データ群IGに含まれる複数個の入力データIDのそれぞれに一対一で対応している。本実施例では、実データRDによって示される実画像RIは、第2の書体で、対応する入力画像IIと同一の文字を示す画像である。 The input data ID used in the training process is RGB image data similar to the input data ID used in the image generation process described above. The input image II indicated by the input data ID is an image showing a specific character in a first typeface (font), as described above. The actual data RD is RGB image data similar to the output data OD generated in the image generation process described above. The multiple actual data RD correspond one-to-one to each of the multiple input data IDs included in the input data group IG. In this embodiment, the actual image RI indicated by the actual data RD is an image showing the same character as the corresponding input image II in a second typeface.

図8は、入力画像と実画像との一例を示す図である。図8(A)の入力画像IIcは、第1の書体で「C」の文字を示す画像である。図8(A)の入力画像IIcに対応する実画像RIcは、第2の書体で「C」の文字を示す画像である。図8(B)の入力画像IIdは、第1種の書体で「d」の文字を示す画像である。図8(B)の入力画像IIdに対応する実画像RIdは、第2の書体で「d」の文字を示す画像である。 Figure 8 shows an example of an input image and an actual image. Input image IIc in Figure 8 (A) is an image showing the letter "C" in a first typeface. Actual image RIc corresponding to input image IIc in Figure 8 (A) is an image showing the letter "C" in a second typeface. Input image IId in Figure 8 (B) is an image showing the letter "d" in a first typeface. Actual image RId corresponding to input image IId in Figure 8 (B) is an image showing the letter "d" in the second typeface.

入力データIDと実データRDとのペアは、トレーニングを実行する作業者によって、所定数、例えば、1000個準備される。 A predetermined number of pairs of input data ID and real data RD, for example 1,000, are prepared by the worker performing the training.

教師データLDは、後述する識別ネットワークDNが出力すべき識別データDDの目標値を示すデータである。教師データLDは、トレーニングを実行する作業者によって準備される。教師データLDについてはさらに後述する。 The teacher data LD is data that indicates the target value of the identification data DD that should be output by the identification network DN, which will be described later. The teacher data LD is prepared by the operator who performs the training. The teacher data LD will be described further below.

A-4-2.ネットワークシステムの構成
図9は、本実施例のネットワークシステム1000の概念図である。ネットワークシステム1000は、生成ネットワークGNをトレーニングするために利用されるシステムであり、上述した生成ネットワークGNに加えて、識別ネットワーク(discriminator)DNを含んでいる。生成ネットワークGNと識別ネットワークDNとは、いわゆる敵対的生成ネットワーク(GANs(Generative adversarial networks))を構成している。
A-4-2. Configuration of the network system FIG. 9 is a conceptual diagram of a network system 1000 of this embodiment. The network system 1000 is a system used to train the generative network GN, and includes a discriminator network DN in addition to the generative network GN described above. The generative network GN and the discriminator network DN constitute a so-called generative adversarial network (GANs (generative adversarial networks)).

識別ネットワークDNには、入力データIDと、その入力データIDに対応する実データと、から成る一対のデータ(実データペアPrとも呼ぶ)が入力される。さらに、識別ネットワークDNには、入力データIDと、その入力データIDに対応する出力データODと、から成る一対のデータ(偽データペアPfとも呼ぶ)が入力される。入力データIDに対応する出力データODは、その入力データを生成ネットワークGNに入力することによって生成される出力データODを意味する。また、敵対的生成ネットワークでは、出力データODは「偽データOD」とも呼ばれる。ここで、特定の実データRDに対応する入力データIDを生成ネットワークGNに入力することによって生成される偽データODを、該特定の実データRDに対応する偽データODとも呼ぶ。 A pair of data (also called a real data pair Pr) consisting of an input data ID and real data corresponding to the input data ID is input to the identification network DN. Furthermore, a pair of data (also called a fake data pair Pf) consisting of an input data ID and an output data OD corresponding to the input data ID is input to the identification network DN. The output data OD corresponding to the input data ID means the output data OD generated by inputting the input data to the generative network GN. In addition, in a generative adversarial network, the output data OD is also called "fake data OD". Here, the fake data OD generated by inputting the input data ID corresponding to a specific real data RD to the generative network GN is also called the fake data OD corresponding to the specific real data RD.

識別ネットワークDNは、実データペアPrと偽データペアPfとのいずれかが入力されると、入力されたデータペアの真偽を識別する。すなわち、識別ネットワークDNは、は、入力されたデータペアに対して、複数個の演算パラメータPdnを用いた演算処理を実行して、入力されたデータペアが実データペアと偽データペアとのいずれであるかを識別した結果を示す識別データDDを出力する。 When either a real data pair Pr or a false data pair Pf is input, the identification network DN identifies whether the input data pair is true or false. That is, the identification network DN performs an arithmetic process using a plurality of arithmetic parameters Pdn on the input data pair, and outputs identification data DD indicating the result of identifying whether the input data pair is a real data pair or a false data pair.

識別データDDは、本実施例では、(30×30×1)個の値を含む(30×30×1)次元のデータである。以下では、実データペアPrが入力される場合に出力される識別データDDを、実データペアPrに対応する識別データDDrとも呼び、偽データペアPfが入力される場合に出力される識別データDDを、偽データペアPfに対応する識別データDDfとも呼ぶ。識別ネットワークDNは、実データペアPrに対応する識別データDDrが、入力されたデータペアが実データペアPrであることを示し、偽データペアPfに対応する識別データDDfが、入力されたデータペアが偽データペアPfであることを示すように、トレーニングされる。 In this embodiment, the identification data DD is (30×30×1) dimensional data including (30×30×1) values. Hereinafter, the identification data DD output when a real data pair Pr is input is also referred to as the identification data DDr corresponding to the real data pair Pr, and the identification data DD output when a false data pair Pf is input is also referred to as the identification data DDf corresponding to the false data pair Pf. The identification network DN is trained so that the identification data DDr corresponding to the real data pair Pr indicates that the input data pair is the real data pair Pr, and the identification data DDf corresponding to the false data pair Pf indicates that the input data pair is the false data pair Pf.

このために、本実施例では、教師データLD(図7)として、実データペアPrに対応する教師データLDrと、偽データペアPfに対応する教師データLDfと、の2種類が準備される。教師データLDrは、入力されたデータペアが実データペアPrであることを示すデータであり、全ての値が「1」である(30×30×1)次元のデータである。教師データLDfは、入力されたデータペアが偽データペアPfであることを示すデータであり、全ての値が「0」である(30×30×1)次元のデータである。 For this reason, in this embodiment, two types of teacher data LD (Figure 7) are prepared: teacher data LDr corresponding to the real data pair Pr, and teacher data LDf corresponding to the false data pair Pf. Teacher data LDr is data indicating that the input data pair is the real data pair Pr, and is (30 x 30 x 1) dimensional data in which all values are "1". Teacher data LDf is data indicating that the input data pair is the false data pair Pf, and is (30 x 30 x 1) dimensional data in which all values are "0".

仮に、識別データDDを1次元のデータとする場合には、識別ネットワークDNにおいて1次元まで次元数を削減する過程で、入力された実データや偽データによって示される画像を大域的な特徴を示す情報が失われる可能性がある。この場合には、識別ネットワークDNのトレーニングが進まなくなる可能性がある。また、識別データDDを1次元のデータとする場合には、識別ネットワークDNの層数、ひいては、演算パラメータの個数が過度に大きくなり、トレーニングに要する時間が過度に長くなる。本実施例では、識別データDDを(30×30×1)次元のデータとすることによって、入力されたデータペアの真偽を識別するための情報が失われることを抑制し、かつ、迅速なトレーニングを実現することができる。 If the identification data DD is one-dimensional data, in the process of reducing the number of dimensions in the identification network DN to one dimension, information indicating global characteristics of the image represented by the input real data or false data may be lost. In this case, training of the identification network DN may not progress. Furthermore, if the identification data DD is one-dimensional data, the number of layers of the identification network DN, and therefore the number of calculation parameters, becomes excessively large, and the time required for training becomes excessively long. In this embodiment, by making the identification data DD data of (30 x 30 x 1) dimensions, it is possible to suppress the loss of information for identifying the authenticity of the input data pair and realize rapid training.

図10は、識別ネットワークDNの構成を示すブロック図である。識別ネットワークDNは、入力層L_0と、複数個の畳込層L_1~畳込層L_5を有するニューラルネットワークである。 Figure 10 is a block diagram showing the configuration of the classification network DN. The classification network DN is a neural network that has an input layer L_0 and multiple convolution layers L_1 to L_5.

入力層L_0は、偽データペアPfと実データペアPrとのいずれかが入力される層である。1番目の畳込層L_1には、入力層L_0に入力されたデータペアがそのまま入力される。データペアを構成する入力データIDの次元数は(256×256×3)であり、データペアを構成する実データRDまたは偽データODの次元数は(256×256×3)である。このため、データペアの次元数は、(256×256×6)である。畳込層L_1は、(256×256×6)次元の入力データIDに対して、後述する演算処理を実行して(G×H×I)次元のデータを生成する(G、H、Iは正の整数)。 The input layer L_0 is a layer to which either the false data pair Pf or the real data pair Pr is input. The data pair input to the input layer L_0 is input as is to the first convolutional layer L_1. The number of dimensions of the input data ID constituting the data pair is (256×256×3), and the number of dimensions of the real data RD or false data OD constituting the data pair is (256×256×3). Therefore, the number of dimensions of the data pair is (256×256×6). The convolutional layer L_1 performs a calculation process described later on the (256×256×6)-dimensional input data ID to generate (G 1 ×H 1 ×I 1 )-dimensional data (G 1 , H 1 , I 1 are positive integers).

n番目(nは、2~5の整数)の畳込層L_nには、(n-1)番目の畳込層L_(n-1)によって生成される(Gn-1×Hn-1×In-1)次元のデータに対して、所定の後処理(後述)を実行して得られる(Gn-1、Hn-1、In-1)次元の処理済データが入力される。畳込層L_nは、(Gn-1×Hn-1×In-1)次元の処理済データに対して、後述する演算処理を実行して(G×H×I)次元のデータを生成する(G、H、Iは正の整数)。 The nth (n is an integer from 2 to 5) convolutional layer L_n receives (G n-1 , H n-1 , I n-1 )-dimensional processed data obtained by performing a predetermined post-processing (described later) on (G n- 1 ×H n-1 × I n-1 )-dimensional data generated by the (n-1)th convolutional layer L_ (n-1 ). The convolutional layer L_n performs arithmetic processing (described later) on the (G n-1 ×H n-1 ×I n-1 )-dimensional processed data to generate (G n ×H n ×I n )-dimensional data (G n , H n , I n are positive integers).

各畳込層L_1~L_5が実行する演算処理は、エンコーダECの畳込層の演算処理と同様に、畳込処理(convolution)とバイアスの加算処理とを含む。畳込処理で用いられるフィルタに含まれる複数個の重みと、各フィルタに対応するバイアスと、は、上述した複数個の演算パラメータPeであり、後述するトレーニング処理において更新される。なお、畳込処理では、生成されるデータの次元数を調整するためにデータを補うゼロパディングが適宜に行われる。 The computational processing performed by each of the convolutional layers L_1 to L_5 includes convolutional processing and bias addition processing, similar to the computational processing of the convolutional layer of the encoder EC. The multiple weights included in the filters used in the convolutional processing and the biases corresponding to each filter are the multiple computational parameters Pe described above, and are updated in the training processing described below. In the convolutional processing, zero padding is appropriately performed to supplement the data in order to adjust the number of dimensions of the generated data.

畳込層L_1によって生成されるデータの各値は、上述した後処理として、活性化関数に入力されて変換される。本実施例では、活性化関数には、いわゆるLeakyReLU(Leaky Rectified Linear Unit)が用いられる。 The data values generated by the convolutional layer L_1 are input to an activation function and transformed as the post-processing described above. In this embodiment, the activation function used is the so-called LeakyReLU (Leaky Rectified Linear Unit).

畳込層L_2~畳込層L_4によって生成されるデータの各値は、上述した後処理として、バッチノーマライゼーション(Batch Normalization)によって変換された後に、さらに、活性化関数に入力されて変換される。バッチノーマライゼーションは、上述したデコーダDCの説明において説明した通りである。 The data values generated by convolutional layers L_2 to L_4 are transformed by batch normalization as the post-processing described above, and then input to an activation function for further transformation. Batch normalization is as described above in the description of decoder DC.

畳込層L_5によって生成される(G×H×I)次元のデータが、上述した識別データDDである。したがって、畳込層L_5によって生成されるデータの次元数(G×H×I)は、識別データDDの次元数(30×30×1)と等しい。 The ( G5 × H5 × I5 )-dimensional data generated by the convolutional layer L_5 is the above-mentioned identification data DD. Therefore, the number of dimensions ( G5 × H5 × I5 ) of the data generated by the convolutional layer L_5 is equal to the number of dimensions (30×30×1) of the identification data DD.

なお、本実施例にて、各畳込層L_1~L_8によって生成されるデータの次元数(G×H×I)~(G×H×I)は、以下の通りである。
(G×H×I)=(128×128×64)
(G×H×I)=(64×64×128)
(G×H×I)=(32×32×256)
(G×H×I)=(31×31×512)
(G×H×I)=(30×30×1)
In this embodiment, the dimensionality (G 1 ×H 1 ×I 1 ) to (G 5 ×H 5 ×I 5 ) of the data generated by each of the convolution layers L_1 to L_8 is as follows:
( G1 x H1 x I1 ) = (128 x 128 x 64)
( G2 x H2 x I2 ) = (64 x 64 x 128)
( G3 x H3 x I3 ) = (32 x 32 x 256)
( G4 x H4 x I4 ) = (31 x 31 x 512)
( G5 x H5 x I5 ) = (30 x 30 x 1)

A-4-3.トレーニング処理
以下では、トレーニング処理について説明する。トレーニング処理は、生成ネットワークGNの上述した複数個の演算パラメータPe、Pdおよび識別ネットワークDNの上述した複数個の演算パラメータPdnを調整することで、生成ネットワークGNが適切な出力データ(偽データ)ODを出力できるようにトレーニングする処理である。上述したデータ生成装置200の不揮発性記憶装置230に格納されたコンピュータプログラムPGgに組み込まれた生成ネットワークGNは、本トレーニング処理によってトレーニングされた学習済みモデルである。
A-4-3. Training process The training process will be described below. The training process is a process for training the generation network GN so that it can output appropriate output data (fake data) OD by adjusting the above-mentioned multiple calculation parameters Pe and Pd of the generation network GN and the above-mentioned multiple calculation parameters Pdn of the identification network DN. The generation network GN incorporated in the computer program PGg stored in the non-volatile storage device 230 of the above-mentioned data generation device 200 is a learned model trained by this training process.

図11は、トレーニング処理のフローチャートである。図11は、トレーニング処理のフローチャートである。S200では、生成ネットワークGNの複数個の演算パラメータPe、Pdと、識別ネットワークDNの複数個の演算パラメータPdnと、を初期化する。例えば、これらの演算パラメータPe、Pd、Pdnの初期値は、同一の分布(例えば、正規分布)から独立に取得された乱数に設定される。 Figure 11 is a flowchart of the training process. Figure 11 is a flowchart of the training process. In S200, multiple calculation parameters Pe, Pd of the generation network GN and multiple calculation parameters Pdn of the identification network DN are initialized. For example, the initial values of these calculation parameters Pe, Pd, Pdn are set to random numbers independently obtained from the same distribution (e.g., normal distribution).

S205では、CPU210は、不揮発性記憶装置230に格納された複数個(例えば、1000個)の実データペアPrから、バッチサイズ分の実データペアPr、例えば、V個(Vは、2以上の整数、例えば、V=100)の実データペアPrを選択する。不揮発性記憶装置230に格納された複数個の実データペアPrは、V個ずつの実データペアPrをそれぞれ含む複数個のグループ(バッチ)に予め分割されている。CPU210は、これらの複数個のグループから1個のグループを順次に選択することによって、V個の使用すべき実データペアPrを選択する。これに代えて、V個ずつの実データペアPrは、不揮発性記憶装置230に格納された複数個の実データペアPrから、毎回、ランダムに選択されても良い。 In S205, the CPU 210 selects a batch size of actual data pairs Pr, for example, V (V is an integer equal to or greater than 2, for example, V=100) from the multiple (e.g., 1000) actual data pairs Pr stored in the non-volatile storage device 230. The multiple actual data pairs Pr stored in the non-volatile storage device 230 are divided in advance into multiple groups (batches) each including V actual data pairs Pr. The CPU 210 selects V actual data pairs Pr to be used by sequentially selecting one group from the multiple groups. Alternatively, V actual data pairs Pr may be randomly selected each time from the multiple actual data pairs Pr stored in the non-volatile storage device 230.

S210では、CPU210は、選択されたV個の実データペアPrに含まれるV個の入力データIDをそれぞれ、生成ネットワークGNに入力して、V個の偽データODを生成する。 In S210, the CPU 210 inputs each of the V input data IDs contained in the selected V real data pairs Pr to the generation network GN to generate V fake data ODs.

S215では、CPU210は、V個の実データペアPrを識別ネットワークDNに入力して、V個の実データペアPrに対応するV個の識別データDDrを生成する。 In S215, the CPU 210 inputs V actual data pairs Pr to the identification network DN and generates V identification data DDr corresponding to the V actual data pairs Pr.

S220では、CPU210は、V個の偽データペアPfを識別ネットワークDNに入力して、V個の偽データペアPfに対応するV個の識別データDDfを生成する。V個の偽データペアPfのそれぞれは、V個の実データペアPrに含まれるV個の入力データIDのそれぞれと、該入力データIDに対応する偽データODと、のペアである。入力データIDに対応する偽データODは、S210にて該入力データIDを生成ネットワークGNに入力して生成された偽データODを意味する。 In S220, the CPU 210 inputs V false data pairs Pf to the identification network DN to generate V identification data DDf corresponding to the V false data pairs Pf. Each of the V false data pairs Pf is a pair of V input data IDs included in the V real data pairs Pr and false data OD corresponding to the input data ID. The false data OD corresponding to the input data ID means the false data OD generated by inputting the input data ID to the generation network GN in S210.

S225では、CPU210は、変動誤差値算出処理を実行する。変動誤差値算出処理は、教師データLDr、LDfと識別データDDr、DDfとに加えて、乱数を用いて、変動誤差値を算出する処理である。 In S225, the CPU 210 executes a variation error value calculation process. The variation error value calculation process is a process for calculating a variation error value using random numbers in addition to the teacher data LDr, LDf and the identification data DDr, DDf.

図12は、変動誤差値算出処理のフローチャートである。S300では、CPU210は、図11のS215にて生成されたV個の実データペアPrに対応するV個の識別データDDrから1個の注目識別データを選択する。 Figure 12 is a flowchart of the variation error value calculation process. In S300, the CPU 210 selects one target identification data from the V identification data DDr corresponding to the V actual data pairs Pr generated in S215 of Figure 11.

S305では、実データペアPrに対応する教師データLDrの次元数分の乱数Rrを取得する。本実施例では、教師データLDrは、(30×30×1)次元のデータである。このために、(30×30×1)個の乱数Rrが取得される。これらの乱数Rrは、例えば、同一の分布から独立に取得される。本実施例では、これらの乱数Rrは、平均が0で分散が0.1である正規分布から取得される。このために、乱数Rrは、概ね-0.3~0.3の範囲の値である。 In S305, random numbers Rr are obtained for the number of dimensions of the teacher data LDr corresponding to the real data pair Pr. In this embodiment, the teacher data LDr is (30 x 30 x 1) dimensional data. Therefore, (30 x 30 x 1) random numbers Rr are obtained. These random numbers Rr are obtained independently from the same distribution, for example. In this embodiment, these random numbers Rr are obtained from a normal distribution with a mean of 0 and a variance of 0.1. Therefore, the random numbers Rr are generally values in the range of -0.3 to 0.3.

S310では、CPU210は、教師データLDrの(30×30×1)個の値(本実施例では全て「1」)に、それぞれ、(30×30×1)個の乱数Rrを1個ずつ加算することによって、変動教師データLDrvを生成する。変動教師データLDrvの(30×30×1)個の値をtrvとし、(30×30×1)個の乱数RrをRrとする(iは、1以上(30×30×1)以下の整数)。この場合に、trvは、(1+Rr)である。 In S310, the CPU 210 generates the variation teacher data LDrv by adding the (30×30×1) random numbers Rr one by one to each of the (30×30×1) values (all "1" in this embodiment) of the teacher data LDr. The (30×30×1) values of the variation teacher data LDrv are defined as trv i , and the (30×30×1) random numbers Rr are defined as Rr i (i is an integer between 1 and (30×30×1)). In this case, trv i is (1+Rr i ).

S315では、CPU210は、注目識別データと、変動教師データLDrvと、を用いて、変動誤差値EVrを算出する。変動誤差値EVrには、所定の損失関数、本実施例では、シグモイドクロスエントロピー誤差が用いられる。シグモイドクロスエントロピーの式(1)は、以下に示す通りである。 In S315, the CPU 210 calculates the variation error value EVr using the target identification data and the variation teacher data LDrv. A predetermined loss function, in this embodiment, the sigmoid cross entropy error, is used for the variation error value EVr. The formula (1) for the sigmoid cross entropy is as follows:

Figure 0007498421000001
Figure 0007498421000001

ここで、pは、識別データおよび教師データの次元数(本実施例では、p=(30×30×1))である。aは、注目識別データの各値をシグモイド関数に入力して正規化した値であり、tは、値aに対応する教師データの各値である。誤差値Eganは、識別データが、対応する教師データに近づくほど大きくなる。換言すれば、誤差値Eganは、識別データと、対応する教師データと、の差分が小さくなるほど大きくなる。本ステップでは、式(1)における教師データの各値tとして、上述した変動教師データLDrvの各値trvを用いて算出される誤差値Eganが、変動誤差値EVrである。 Here, p is the number of dimensions of the recognition data and the teacher data (in this embodiment, p = (30 x 30 x 1)). a i is a value normalized by inputting each value of the recognition data of interest into a sigmoid function, and t i is each value of the teacher data corresponding to the value a i . The error value Egan becomes larger as the recognition data approaches the corresponding teacher data. In other words, the error value Egan becomes larger as the difference between the recognition data and the corresponding teacher data becomes smaller. In this step, the error value Egan calculated using each value trv i of the above-mentioned variable teacher data LDrv as each value t i of the teacher data in equation (1) is the variable error value EVr.

S320では、CPU210は、V個の識別データDDrを全て処理したか否かを判断する。未処理の識別データDDrがある場合には(S320:NO)、CPU210は、S300に戻る。V個の識別データDDrが全て処理された場合には(S320:YES)、CPU210は、S325に処理を進める。 In S320, the CPU 210 determines whether or not all V pieces of identification data DDr have been processed. If there is unprocessed identification data DDr (S320: NO), the CPU 210 returns to S300. If all V pieces of identification data DDr have been processed (S320: YES), the CPU 210 proceeds to S325.

S325に処理が進められた時点で、V個の識別データDDrに対応するV個の変動誤差値EVrが算出されている。1個の変動誤差値EVrを算出する度に、S305にて乱数Rrを取り直すので、V個の変動誤差値EVrのそれぞれが算出される際に用いられる変動教師データLDrvは、互いに異なる。 When the process advances to S325, V variation error values EVr corresponding to V pieces of identification data DDr have been calculated. Each time a variation error value EVr is calculated, the random number Rr is recalculated in S305, so the variation teacher data LDrv used when calculating each of the V variation error values EVr are different from each other.

S325では、CPU210は、図11のS220にて生成されたV個の偽データペアPfに対応するV個の識別データDDfから1個の注目識別データを選択する。 In S325, the CPU 210 selects one piece of target identification data from the V pieces of identification data DDf corresponding to the V pieces of false data pairs Pf generated in S220 of FIG. 11.

S330では、偽データペアPfに対応する教師データLDfの次元数分の乱数Rfを取得する。本実施例では、教師データLDfは、(30×30×1)次元のデータである。このために、(30×30×1)個の乱数Rfが取得される。これらの乱数Rfは、例えば、上述した乱数Rrと同様に、平均が0で分散が0.1である正規分布から独立に取得される。 In S330, random numbers Rf are obtained for the number of dimensions of the teacher data LDf corresponding to the false data pair Pf. In this embodiment, the teacher data LDf is (30 x 30 x 1) dimensional data. Therefore, (30 x 30 x 1) random numbers Rf are obtained. These random numbers Rf are obtained independently from a normal distribution with a mean of 0 and a variance of 0.1, similar to the random number Rr described above.

S335では、CPU210は、教師データLDfの(30×30×1)個の値(本実施例では全て「0」)に、それぞれ、(30×30×1)個の乱数Rfの絶対値|Rf|を1個ずつ加算することによって、変動教師データLDfvを生成する。変動教師データLDfvの(30×30×1)個の値をtfvとし、(30×30×1)個の乱数RfをRfとする(iは、1以上(30×30×1)以下の整数)。この場合に、tfvは、|Rf|である。 In S335, the CPU 210 generates the variation teacher data LDfv by adding the absolute values |Rf| of the (30×30×1) random numbers Rf one by one to each of the (30×30×1) values (all "0" in this embodiment) of the teacher data LDf. The (30×30×1) values of the variation teacher data LDfv are designated as tfv i , and the (30×30×1) random numbers Rf are designated as Rf i (i is an integer between 1 and (30×30×1)). In this case, tfv i is |Rf i |.

S340では、CPU210は、注目識別データと、変動教師データLDfvと、を用いて、変動誤差値EVfを算出する。変動誤差値EVfには、シグモイドクロスエントロピー誤差が用いられる。したがって、上述した式(1)における教師データの各値tとして、上述した変動教師データLDfvの各値tfvを用いて算出される誤差値Eganが、変動誤差値EVfである。 In S340, the CPU 210 calculates the variation error value EVf using the target identification data and the variation teacher data LDfv. The variation error value EVf uses a sigmoid cross entropy error. Therefore, the error value Egan calculated using each value tfv i of the variation teacher data LDfv described above as each value t i of the teacher data in the above formula (1) is the variation error value EVf.

S345では、CPU210は、V個の識別データDDfを全て処理したか否かを判断する。未処理の識別データDDfがある場合には(S345:NO)、CPU210は、S325に戻る。V個の識別データDDfが全て処理された場合には(S345:YES)、CPU210は、変動誤差値算出処理を終了する。 In S345, the CPU 210 determines whether or not all V pieces of identification data DDf have been processed. If there is unprocessed identification data DDf (S345: NO), the CPU 210 returns to S325. If all V pieces of identification data DDf have been processed (S345: YES), the CPU 210 ends the variation error value calculation process.

変動誤差値算出処理が終了した時点で、V個の識別データDDfに対応するV個の変動誤差値EVfが算出されている。1個の変動誤差値EVfを算出する度に、S330にて乱数Rfを取り直すので、V個の変動誤差値EVfのそれぞれが算出される際に用いられる変動教師データLDfvは、互いに異なる。 When the variation error value calculation process is completed, V variation error values EVf corresponding to V pieces of identification data DDf have been calculated. Each time a variation error value EVf is calculated, the random number Rf is retaken in S330, so the variation teacher data LDfv used when calculating each of the V variation error values EVf are different from each other.

変動誤差値算出処理が終了すると、図11のS230では、CPU210は、算出されたV個の変動誤差値EVrと、V個の変動誤差値EVfと、を用いて、識別ネットワークDNの複数個の演算パラメータPdnを調整する。具体的には、(2×V)個の変動誤差値EVr、EVfの平均値を示す損失関数Ldnがバッチ全体の損失関数として用いられる。CPU210は、CPU210は、損失関数Ldnを用いて算出される指標値が大きくなるように、所定のアルゴリズムに従って演算パラメータPdnを調整する。所定のアルゴリズムには、例えば、誤差逆伝播法と勾配降下法とを用いたアルゴリズムが用いられる。 When the variation error value calculation process is completed, in S230 of FIG. 11, the CPU 210 adjusts the multiple calculation parameters Pdn of the identification network DN using the calculated V variation error values EVr and V variation error values EVf. Specifically, a loss function Ldn indicating the average value of the (2×V) variation error values EVr and EVf is used as the loss function for the entire batch. The CPU 210 adjusts the calculation parameters Pdn according to a predetermined algorithm so that the index value calculated using the loss function Ldn becomes large. For example, an algorithm using backpropagation and gradient descent is used as the predetermined algorithm.

S235では、CPU210は、V個の偽データペアPfのそれぞれについて、識別データDDfと教師データLDfとの間の誤差値Efを算出する。教師データLDfの各値は、上述したように「0」である。このため、V個の識別データDDfのそれぞれについて、上述した式(1)における教師データの各値tとして「0」を用いて算出される誤差値Eganが、誤差値Efである。 In S235, the CPU 210 calculates an error value Ef between the identification data DDf and the teacher data LDf for each of the V false data pairs Pf. Each value of the teacher data LDf is "0" as described above. Therefore, for each of the V identification data DDf, the error value Egan calculated using "0" as each value t i of the teacher data in the above-mentioned formula (1) is the error value Ef.

S240では、CPU210は、V個の実データRDのそれぞれについて、実データRDと、該実データRDに対応する偽データODと、の間の誤差値Erfを算出する。誤差値Erfには、所定の損失関数、本実施例では、平均絶対誤差(MAE(Mean Absolute Error))が用いられる。例えば、誤差値Erfは、以下の式(2)を用いて算出される。 In S240, the CPU 210 calculates an error value Erf between the real data RD and the fake data OD corresponding to the real data RD for each of the V real data RD. A predetermined loss function, in this embodiment, the mean absolute error (MAE (Mean Absolute Error)), is used for the error value Erf. For example, the error value Erf is calculated using the following formula (2).

Figure 0007498421000002
Figure 0007498421000002

ここで、sは、実データRDおよび偽データODの次元数(本実施例では、s=(256×256×3))である。dは、実データRDの各値であり、eは、値dに対応する出力データODの各値である。式(2)から解るように、誤差値Erfは、実データRDによって示される画像と、偽データODによって示される画像と、の間の画素ごとの誤差である。誤差値Erfは、偽データODと実データRDとが近いほど小さくなる。換言すれば、誤差値Efは、偽データODと実データRDとの差分が小さくなるほど小さくなる。 Here, s is the number of dimensions of the real data RD and the fake data OD (in this embodiment, s = (256 x 256 x 3)). d i is each value of the real data RD, and e i is each value of the output data OD corresponding to the value d i . As can be seen from equation (2), the error value Erf is the error for each pixel between the image represented by the real data RD and the image represented by the fake data OD. The closer the fake data OD and the real data RD are, the smaller the error value Erf becomes. In other words, the smaller the difference between the fake data OD and the real data RD, the smaller the error value Ef becomes.

S245では、CPU210は、S235にて算出されたV個の誤差値Erと、S240にて算出されたV個の誤差値Erfと、を用いて、生成ネットワークGNの複数個の演算パラメータPe、Pdを調整する。具体的には、CPU210は、バッチ全体の損失関数として、以下の式(3)に示す損失関数Lgを用いて指標値を算出する。CPU210は、損失関数Lgを用いて算出される指標値が小さくなるように、所定のアルゴリズムに従って演算パラメータPe、Pdを調整する。所定のアルゴリズムには、例えば、誤差逆伝播法と勾配降下法とを用いたアルゴリズムが用いられる。 In S245, the CPU 210 adjusts the multiple calculation parameters Pe, Pd of the generative network GN using the V error values Er calculated in S235 and the V error values Erf calculated in S240. Specifically, the CPU 210 calculates an index value using the loss function Lg shown in the following formula (3) as a loss function for the entire batch. The CPU 210 adjusts the calculation parameters Pe, Pd according to a predetermined algorithm so that the index value calculated using the loss function Lg becomes small. For example, an algorithm using backpropagation and gradient descent is used as the predetermined algorithm.

Figure 0007498421000003
Figure 0007498421000003

ここで、上述したように、LfはV個の誤差値Efの平均値であり、LrfはV個の誤差値Erfの平均値であり、αは、所定の係数である。 Here, as described above, Lf is the average value of V error values Ef, Lrf is the average value of V error values Erf, and α is a predetermined coefficient.

S250では、CPU210は、トレーニングが完了したか否かを判断する。本実施例では、作業者からの完了指示が入力された場合にはトレーニングが完了したと判断し、トレーニングの継続指示が入力された場合にはトレーニングが完了していないと判断する。例えば、CPU210は、トレーニング用に用いられた入力データIDとは別の複数個のテスト用の入力データIDを、生成ネットワークGNに入力して、複数個の偽データODを生成する。CPU210は、生成された偽データODによって示される画像を表示部240に表示する。作業者は、表示された画像を確認して、最終的な画像として十分な画像(例えば、第2の書体で特定の文字を精度良く表現する画像)が生成されているか否かを確認し、確認結果に応じて、操作部250を介して、トレーニングの完了指示または継続指示を入力する。変形例では、例えば、S205~S245の処理が所定回数だけ繰り返された場合に、トレーニングが完了されたと判断されても良い。 In S250, the CPU 210 judges whether the training is completed. In this embodiment, if a completion instruction is input from the operator, the training is judged to be completed, and if an instruction to continue the training is input, the training is judged to be not completed. For example, the CPU 210 inputs a plurality of test input data IDs other than the input data IDs used for training to the generation network GN to generate a plurality of false data ODs. The CPU 210 displays an image represented by the generated false data OD on the display unit 240. The operator checks the displayed image to check whether an image sufficient as a final image (for example, an image that accurately expresses a specific character in the second font) has been generated, and inputs an instruction to complete or continue the training via the operation unit 250 depending on the confirmation result. In a modified example, for example, when the processes of S205 to S245 are repeated a predetermined number of times, the training may be judged to be completed.

トレーニングが完了していないと判断される場合には(S250:NO)、CPU210は、S205に処理を戻す。トレーニングが完了したと判断される場合には(S250:YES)、CPU210は、トレーニング処理を終了する。このトレーニング処理によれば、変動誤差値EVrが大きくなるように、換言すれば、識別データDDr、DDfと変動教師データLDrv、LDfvとの差分が小さくなるように、識別ネットワークDNの複数個の演算パラメータPdnが調整される(図11のS230)。すなわち、識別ネットワークDNは、入力されたデータペアの真偽を正しく識別することを目的としてトレーニングされる。そして、生成ネットワークGNは、誤差値Efが小さくなるように、換言すれば、識別データDDfと教師データLDfとの差分が大きくなるように、生成ネットワークGNの複数個の演算パラメータPe、Pdが調整される(図11のS230)。同時に、生成ネットワークGNは、誤差値Erfが小さくなるように、換言すれば、実データRDと、実データRDに対応する偽データODと、の差分が小さくなるように、トレーニングされる。すなわち、生成ネットワークGNは、識別ネットワークDNによって、偽データペアPfが実データペアPrであると誤って識別されること、および、偽データODが実データRDに近づくことを目的としてトレーニングされる。この結果、入力データIDの特定の属性(例えば、表現すべき文字の種類)を保持しつつ、変換すべき別の属性(例えば、書体)を変換できるように、生成ネットワークGNをトレーニングすることができる。トレーニング処理が終了した時点で、生成ネットワークGNは、演算パラメータPe、Pdが調整された学習済みモデルになっている。したがって、トレーニング処理は、学習済みモデルを生成(製造)する処理である、と言うことができる。 If it is determined that the training is not complete (S250: NO), the CPU 210 returns the process to S205. If it is determined that the training is complete (S250: YES), the CPU 210 ends the training process. According to this training process, a plurality of calculation parameters Pdn of the identification network DN are adjusted so that the variation error value EVr is increased, in other words, the difference between the identification data DDr, DDf and the variation teacher data LDrv, LDfv is reduced (S230 in FIG. 11). That is, the identification network DN is trained for the purpose of correctly identifying the truth or falsehood of the input data pair. Then, a plurality of calculation parameters Pe, Pd of the generation network GN are adjusted so that the error value Ef is reduced, in other words, the difference between the identification data DDf and the teacher data LDf is increased (S230 in FIG. 11). At the same time, the generative network GN is trained to reduce the error value Erf, in other words, to reduce the difference between the real data RD and the fake data OD corresponding to the real data RD. That is, the generative network GN is trained for the purpose of causing the identification network DN to erroneously identify the fake data pair Pf as the real data pair Pr, and for the fake data OD to approach the real data RD. As a result, the generative network GN can be trained to be able to convert another attribute to be converted (e.g., font) while retaining a specific attribute of the input data ID (e.g., the type of character to be represented). At the time the training process is completed, the generative network GN becomes a trained model with the calculation parameters Pe and Pd adjusted. Therefore, it can be said that the training process is a process of generating (manufacturing) a trained model.

以上説明した本実施例によれば、トレーニング処理(図11)は、実データペアPrおよび偽データペアPfを識別ネットワークDNに入力することによって、これらのデータペアに対応する識別データDDr、DDfを出力させる第1工程(図11のS215、S220)と、識別データDDr、DDfと教師データLDr、LDfとを用いて、識別ネットワークDNの複数個の演算パラメータPdnを調整する第2工程(図11のS225、S230)と、を備え、第1工程と第2工程とを複数回繰り返す(図11のS250)ことによって、識別ネットワークDNをトレーニングする。第2工程の変動誤差値算出処理(図12)は、複数個の演算パラメータPdnの調整のために用いられる値である教師データLDr、LDfを、乱数Rr、Rfを用いて変動させる変動工程(図12のS305、S310、S330、S335)を含む。この結果、変動誤差値EVrは、乱数Rr、Rfを用いない場合に算出される誤差値とは異なる量に変動する。したがって、複数個の演算パラメータPdnの調整量を、乱数Rr、Rfを用いない場合に算出される調整量とは異なる量に変動させることができる。この結果、識別ネットワークDNのトレーニングの進み具合を調整することができる。 According to the present embodiment described above, the training process (FIG. 11) includes a first step (S215, S220 in FIG. 11) of inputting the real data pair Pr and the false data pair Pf into the identification network DN to output the identification data DDr, DDf corresponding to these data pairs, and a second step (S225, S230 in FIG. 11) of adjusting the multiple calculation parameters Pdn of the identification network DN using the identification data DDr, DDf and the teacher data LDr, LDf, and trains the identification network DN by repeating the first and second steps multiple times (S250 in FIG. 11). The second step of the variation error value calculation process (FIG. 12) includes a variation step (S305, S310, S330, S335 in FIG. 12) of varying the teacher data LDr, LDf, which are values used to adjust the multiple calculation parameters Pdn, using random numbers Rr, Rf. As a result, the variation error value EVr varies by an amount different from the error value calculated when the random numbers Rr and Rf are not used. Therefore, the adjustment amount of the multiple calculation parameters Pdn can be varied by an amount different from the adjustment amount calculated when the random numbers Rr and Rf are not used. As a result, the progress of the training of the identification network DN can be adjusted.

例えば、本実施例では、さらに、入力データIDを、識別ネットワークDNとは異なる機械学習モデルである生成ネットワークGNに入力することによって、入力データIDに対応する偽データ(出力データ)ODを出力させる第3工程(図11のS210)と、偽データODを用いて(本実施例では、偽データODを識別ネットワークDNに入力して得られる識別データDDfを用いて)、生成ネットワークGNの複数個の演算パラメータPe、Pdを調整する第4工程(図11のS235~S245)と、を備え、第1工程~第4工程を複数回繰り返す(図11のS250)ことによって、識別ネットワークDNと生成ネットワークGNとを並行してトレーニングする。そして、第4工程では、乱数は用いられない。すなわち、第4工程は、生成ネットワークGNの複数個の演算パラメータPe、Pdを調整するために用いられる値を、乱数を用いて変動させる工程を含まない。このように、複数個の機械学習モデルを並行してトレーニングする場合には、例えば、一方の機械学習モデル(本実施例では、生成ネットワークGN)のトレーニングの進み具合との関係で、他方の機械学習モデル(本実施例では、識別ネットワークDN)のトレーニングの進み具合を調整したい場合がある。このような場合に、本実施例のように、一方の機械学習モデルのトレーニング(パラメータの調整)のために用いられる値には乱数を用いず、他方の機械学習モデルのトレーニングのために用いられる値には乱数を用いることで、一方の機械学習モデルのトレーニングに対して、他方の機械学習モデルのトレーニングの進み具合を遅らせることができる。 For example, in this embodiment, the method further includes a third step (S210 in FIG. 11) of inputting the input data ID into a generating network GN, which is a machine learning model different from the identification network DN, to output fake data (output data) OD corresponding to the input data ID, and a fourth step (S235 to S245 in FIG. 11) of adjusting a plurality of calculation parameters Pe and Pd of the generating network GN using the fake data OD (in this embodiment, using the identification data DDf obtained by inputting the fake data OD into the identification network DN), and by repeating the first to fourth steps a plurality of times (S250 in FIG. 11), the identification network DN and the generating network GN are trained in parallel. In addition, random numbers are not used in the fourth step. In other words, the fourth step does not include a step of varying the values used to adjust the plurality of calculation parameters Pe and Pd of the generating network GN using random numbers. In this way, when multiple machine learning models are trained in parallel, for example, it may be necessary to adjust the progress of training of one machine learning model (in this embodiment, the discrimination network DN) in relation to the progress of training of the other machine learning model (in this embodiment, the generation network GN). In such a case, as in this embodiment, random numbers are not used for the values used for training (adjusting parameters) one machine learning model, but random numbers are used for the values used for training the other machine learning model, thereby making it possible to delay the progress of training of one machine learning model relative to the training of the other machine learning model.

より具体的には、本実施例では、識別ネットワークDNと生成ネットワークGNとは、上述のように、いわゆるGANsを構成している。すなわち、識別ネットワークDNは、複数個の偽データペアPfおよび実データペアPrのそれぞれが実データRDと偽データODとのいずれを含むペアであるかを識別するためのモデルである。識別ネットワークDNが出力するデータは、当該識別結果を示す識別データDDr、DDfである。そして、生成ネットワークGNは、偽データODを生成するためのモデルである。第2工程(図11のS225、S230)では、識別データDDr、DDfと教師データLDr、LDfとの差分が小さくなるように、識別ネットワークDNの複数個の演算パラメータPdnが調整される(図11のS230)。第4工程(S235~S245)では、偽データODを識別ネットワークDNに入力することによって得られる識別データDDfと教師データLDfとの差が大きくなるように、生成ネットワークGNの複数個の演算パラメータPe、Pdが調整される。このような、GANsでは、生成ネットワークGNのタスク(例えば、画像データの生成)が識別ネットワークDNのタスク(例えば、画像データの識別)よりも重い。このために、生成ネットワークGNのトレーニングの進み具合が、識別ネットワークDNのトレーニングの進み具合よりも遅れがちである。仮に、トレーニング処理において、生成ネットワークGNのトレーニングが識別ネットワークDNのトレーニングに対して過度に遅れる可能性がある。この場合には、生成ネットワークGNの複数個の演算パラメータPe、Pdを調整する際に、勾配の消失が発生して生成ネットワークGNのトレーニングが進まなくなる不都合が発生し得る。本実施例では、第2工程にて乱数Rr、Rfを用いることによって、識別ネットワークDNのトレーニングの進み具合を遅らせることができる。この結果、生成ネットワークGNのトレーニングの進み具合が識別ネットワークDNのトレーニングの進み具合よりも過度に遅れることを抑制できる。この結果、上述の不都合を抑制して、生成ネットワークGNのトレーニングを効果的に進めることができる。 More specifically, in this embodiment, the identification network DN and the generation network GN constitute so-called GANs, as described above. That is, the identification network DN is a model for identifying whether each of the multiple false data pairs Pf and real data pairs Pr contains real data RD or false data OD. The data output by the identification network DN is identification data DDr, DDf indicating the identification result. And the generation network GN is a model for generating the false data OD. In the second step (S225, S230 in FIG. 11), multiple calculation parameters Pdn of the identification network DN are adjusted so that the difference between the identification data DDr, DDf and the teacher data LDr, LDf is reduced (S230 in FIG. 11). In the fourth step (S235 to S245), a plurality of calculation parameters Pe, Pd of the generating network GN are adjusted so that the difference between the identification data DDf obtained by inputting the false data OD to the identification network DN and the teacher data LDf becomes large. In such GANs, the task of the generating network GN (e.g., generating image data) is heavier than the task of the identification network DN (e.g., identifying image data). For this reason, the progress of the training of the generating network GN tends to lag behind the progress of the training of the identification network DN. If, in the training process, the training of the generating network GN may be excessively delayed relative to the training of the identification network DN. In this case, when adjusting the plurality of calculation parameters Pe, Pd of the generating network GN, a problem may occur in which the gradient disappears and the training of the generating network GN does not progress. In this embodiment, the progress of the training of the identification network DN can be delayed by using the random numbers Rr, Rf in the second step. As a result, it is possible to prevent the progress of training of the generation network GN from being excessively delayed compared to the progress of training of the discrimination network DN. As a result, it is possible to effectively proceed with training of the generation network GN while suppressing the above-mentioned inconveniences.

さらに、上記トレーニング処理では、変動工程(図12のS305、S310、S330、S335)は、複数個の教師データLDr、LDfに含まれる値を、乱数Rr、Rfを用いて変動させる工程である。この結果、教師データLDr、LDfに含まれる値を変動させることで、容易に識別ネットワークDNのトレーニングの進み具合を調整することができる。 Furthermore, in the above training process, the variation process (S305, S310, S330, S335 in FIG. 12) is a process in which the values contained in the multiple pieces of teacher data LDr, LDf are varied using random numbers Rr, Rf. As a result, by varying the values contained in the teacher data LDr, LDf, it is possible to easily adjust the progress of training of the identification network DN.

さらに、本実施例の変動工程では、教師データの変動後の値(すなわち、変動教師データLDrv、LDfvの値)が0以上の値となるように、教師データLDr、LDfに含まれる値を変動させる。例えば、上記実施例のS335では、教師データLDfの各値は「0」であるので、仮に、-0.3~0.3の範囲の値を取るRfをそのまま加算すれば、変動後の値は、0未満になり得る。上記実施例のS335では、教師データLDfの各値に、乱数Rfの絶対値|Rf|を加算することで、変動後の値が0以上の値になる。教師データの各値は、0以上の値(例えば、0または1)が通常は用いられるので、変動後の値が0未満であると、プログラムによる計算で誤動作が発生する可能性がある。本実施例では、このような不都合を抑制できる。 Furthermore, in the variation step of this embodiment, the values included in the teacher data LDr and LDf are varied so that the values of the teacher data after variation (i.e., the values of the varied teacher data LDrv and LDfv) are 0 or more. For example, in S335 of the above embodiment, since each value of the teacher data LDf is "0", if Rf, which has a value in the range of -0.3 to 0.3, is added as is, the value after variation may be less than 0. In S335 of the above embodiment, the absolute value |Rf| of the random number Rf is added to each value of the teacher data LDf, so that the value after variation becomes a value of 0 or more. Since values of the teacher data that are 0 or more (e.g., 0 or 1) are usually used, if the value after variation is less than 0, there is a possibility that a malfunction will occur in the calculation by the program. In this embodiment, such inconvenience can be suppressed.

さらに、本実施例のトレーニング装置100(図1)、および、学習済みの生成ネットワークGNによれば、生成ネットワークGNは、上述したトレーニング処理によって効果的にトレーニングされているので、入力データIDに応じた適切な偽データODを生成できる。例えば、本実施例では、入力データIDは、第1の属性(例えば、「A」の文字であるという属性)と第2の属性(例えば、第1の書体であるという属性)を有し、かつ、第3の属性(例えば、第2の書体であるという属性)を有しない画像データである。そして、出力データ(偽データ)ODは、第1の属性と第3の属性を有し、かつ、第2の属性を有しない画像データである。このように、本実施例によれば、学習済みの生成ネットワークGNは、入力データIDの第1の属性を維持しつつ、入力データIDの第2の属性を第3の属性に変換することによって出力データ(偽データ)ODを生成することができる。 Furthermore, according to the training device 100 (FIG. 1) and the trained generative network GN of this embodiment, the generative network GN is effectively trained by the above-mentioned training process, so that it can generate appropriate fake data OD according to the input data ID. For example, in this embodiment, the input data ID is image data that has a first attribute (e.g., an attribute of being the letter "A") and a second attribute (e.g., an attribute of being the first font), and does not have a third attribute (e.g., an attribute of being the second font). And the output data (fake data) OD is image data that has a first attribute and a third attribute, and does not have the second attribute. Thus, according to this embodiment, the trained generative network GN can generate the output data (fake data) OD by converting the second attribute of the input data ID into the third attribute while maintaining the first attribute of the input data ID.

以上の説明から解るように、本実施例の実データペアPrおよび偽データペアPfは、第1の入力データの例であり、入力データIDは、第2の入力データの例である。また、識別データDDr、DDfは、第1の出力データの例であり、偽データODは、第2の出力データの例である。また、識別ネットワークDNの演算パラメータPdnは、第1の演算パラメータの例であり、生成ネットワークGNの演算パラメータPe、Pdは、第2の演算パラメータの例である。識別ネットワークDNは、第1の機械学習モデルの例であり、生成ネットワークGNは、第2の機械学習モデルの例である。 As can be seen from the above explanation, the real data pair Pr and the fake data pair Pf in this embodiment are an example of the first input data, and the input data ID is an example of the second input data. Furthermore, the identification data DDr and DDf are an example of the first output data, and the fake data OD is an example of the second output data. Furthermore, the calculation parameters Pdn of the identification network DN are an example of the first calculation parameters, and the calculation parameters Pe and Pd of the generation network GN are an example of the second calculation parameters. The identification network DN is an example of a first machine learning model, and the generation network GN is an example of a second machine learning model.

B.変形例:
(1)上記実施例の変動工程(図12のS305、S310、S330、S335)は、複数個の教師データLDr、LDfに含まれる値を、乱数Rr、Rfを用いて変動させる工程である。これに限らず、変動工程は、複数個の演算パラメータPdnの調整のために用いられる別の値を、乱数を用いて変動させる工程であっても良い。その一例を第1変形例および第2変形例として説明する。
B. Variations:
(1) The varying step in the above embodiment (S305, S310, S330, S335 in FIG. 12) is a step of varying values included in the multiple pieces of teacher data LDr, LDf using random numbers Rr, Rf. Not limited to this, the varying step may be a step of varying another value used for adjusting the multiple calculation parameters Pdn using random numbers. An example of this will be described as a first modified example and a second modified example.

図13は、第1変形例の変動誤差値算出処理のフローチャートである。図13の変動誤差値算出処理は、図12の変動誤差値算出処理のS310、S315、S335、S340に代えて、S310B、S315B、S335B、S340Bが実行される。 Figure 13 is a flowchart of the variation error value calculation process of the first modified example. In the variation error value calculation process of Figure 13, S310B, S315B, S335B, and S340B are executed instead of S310, S315, S335, and S340 of the variation error value calculation process of Figure 12.

S310Bでは、CPU210は、注目識別データ(V個の識別データDDrのうちの1つのデータ)の(30×30×1)個の値のそれぞれに、乱数Rrを1個ずつ加算することによって、変動注目識別データを生成する。注目識別データの(30×30×1)個の値をVrとし、(30×30×1)個の乱数RrをRrとする(iは、1以上(30×30×1)以下の整数)。この場合に、変動注目識別データの各値Vrは、(Vr+Rr)である。 In S310B, the CPU 210 generates varying attention identification data by adding one random number Rr to each of the (30×30×1) values of the attention identification data (one of the V pieces of identification data DDr). The (30×30×1) values of the attention identification data are designated Vri , and the (30×30×1) random numbers Rr are designated Rri (i is an integer between 1 and (30×30×1)). In this case, each value Vri of the varying attention identification data is ( Vri + Rri ).

S315Bでは、CPU210は、S310Bにて生成された変動注目識別データと、教師データLDrと、を用いて、変動誤差値EVrbを算出する。具体的には、上記の式(1)における教師データの各値tとして、教師データLDrの各値「1」を用い、aとして、変動注目識別データの各値(Vr+Rr)をシグモイド関数に入力して正規化した値を用いて、算出される誤差値Eganが、変動誤差値EVrbである。 In S315B, the CPU 210 calculates a fluctuation error value EVrb using the fluctuation attention identification data generated in S310B and the teacher data LDr. Specifically, the error value Egan calculated using the teacher data LDr value "1" as each value t i of the teacher data in the above formula (1) and the fluctuation attention identification data value (Vr i + Rr i ) normalized by inputting it into a sigmoid function as a i is the fluctuation error value EVrb.

S335Bでは、CPU210は、注目識別データ(V個の識別データDDfのうちの1つのデータ)の(30×30×1)個の値のそれぞれに、乱数Rfを1個ずつ加算することによって、変動注目識別データを生成する。注目識別データの(30×30×1)個の値をVfとし、(30×30×1)個の乱数RfをRfとする(iは、1以上(30×30×1)以下の整数)。この場合に、変動注目識別データの各値Vfは、(Vf+Rf)である。 In S335B, the CPU 210 generates varying attention identification data by adding one random number Rf to each of the (30×30×1) values of the attention identification data (one data of the V identification data DDf). The (30×30×1) values of the attention identification data are designated Vf i , and the (30×30×1) random numbers Rf are designated Rf i (i is an integer between 1 and (30×30×1) inclusive). In this case, each value Vf i of the varying attention identification data is (Vf i +Rf i ).

S340Bでは、CPU210は、S335Bにて生成された変動注目識別データと、教師データLDfと、を用いて、変動誤差値EVfbを算出する。具体的には、上記の式(1)における教師データの各値tとして、教師データLDfの各値「0」を用い、aとして、変動注目識別データの各値(Vf+Rf)をシグモイド関数に入力して正規化した値を用いて、算出される誤差値Eganが、変動誤差値EVfbである。 In S340B, the CPU 210 calculates a fluctuation error value EVfb using the fluctuation attention identification data generated in S335B and the teacher data LDf. Specifically, the error value Egan calculated using the teacher data LDf values "0" as the teacher data values t i in the above formula (1) and the fluctuation attention identification data values (Vf i + Rf i ) normalized by inputting them into a sigmoid function as a i is the fluctuation error value EVfb.

第1変形例では、図11のS230において、(2×V)個の変動誤差値EVr、EVfに代えて、図13の変動誤差値算出処理にて算出された(2×V)個の変動誤差値EVrb、EVfbを用いて、識別ネットワークDNの複数個の演算パラメータPdnを調整する。 In the first modified example, in S230 of FIG. 11, instead of the (2×V) fluctuation error values EVr and EVf, the (2×V) fluctuation error values EVrb and EVfb calculated in the fluctuation error value calculation process of FIG. 13 are used to adjust the multiple calculation parameters Pdn of the identification network DN.

以上説明した第1変形例では、変動工程(図13のS305、S310B、S330、S335B)は、識別データDDr、DDfに含まれる値を、乱数Rr、Rfを用いて変動させる工程である。この結果、識別データDDr、DDfに含まれる値を変動させることで、実施例と同等の容易さで、識別ネットワークDNのトレーニングの進み具合を調整することができる。 In the first modified example described above, the varying step (S305, S310B, S330, S335B in FIG. 13) is a step of varying the values contained in the identification data DDr, DDf using the random numbers Rr, Rf. As a result, by varying the values contained in the identification data DDr, DDf, it is possible to adjust the progress of the training of the identification network DN with the same ease as in the embodiment.

図14は、第2変形例の変動誤差値算出処理のフローチャートである。図14の変動誤差値算出処理は、図12の変動誤差値算出処理のS305~S315、S330~S340に代えて、S305C~S315C、S330C~S340Cが実行される。 Figure 14 is a flowchart of the variation error value calculation process of the second modified example. In the variation error value calculation process of Figure 14, steps S305C to S315C and S330C to S340C are executed instead of steps S305 to S315 and S330 to S340 of the variation error value calculation process of Figure 12.

S305Cでは、CPU210は、注目識別データ(V個の識別データDDrのうちの1つのデータ)と、教師データLDrと、を用いて、誤差値Evを算出する。具体的には、上記の式(1)における教師データの各値tとして、教師データLDrの各値「1」を用い、aとして、注目識別データの各値をシグモイド関数に入力して正規化した値を用いて、算出される誤差値Eganが、誤差値Erである。 In S305C, the CPU 210 calculates an error value Ev using the target identification data (one of the V pieces of identification data DDr) and the teacher data LDr. Specifically, the error value Egan calculated using the values "1" of the teacher data LDr as the values t i of the teacher data in the above formula (1) and the values normalized by inputting the values of the target identification data into a sigmoid function as a i is the error value Er.

S310Cでは、CPU210は、1個の乱数Rrcを取得する。乱数Rrcは、例えば、所定の正規分布から独立に取得される。 In S310C, the CPU 210 obtains one random number Rrc. The random number Rrc is obtained independently from a predetermined normal distribution, for example.

S315Cでは、CPU210は、S305Cにて算出された誤差値Erに、乱数Rrcを加算して、変動誤差値EVrcを算出する(EVrc=Er+Rrc)。 In S315C, the CPU 210 adds the random number Rrc to the error value Er calculated in S305C to calculate the variation error value EVrc (EVrc = Er + Rrc).

S330Cでは、CPU210は、注目識別データ(V個の識別データDDfのうちの1つのデータ)と、教師データLDfと、を用いて、誤差値Efを算出する。具体的には、上記の式(1)における教師データの各値tとして、教師データLDfの各値「0」を用い、aとして、注目識別データの各値をシグモイド関数に入力して正規化した値を用いて、算出される誤差値Eganが、誤差値Efである。 In S330C, the CPU 210 calculates an error value Ef using the target identification data (one of the V pieces of identification data DDf) and the teacher data LDf. Specifically, the error value Ef is calculated by using the values "0" of the teacher data LDf as the values t i of the teacher data in the above formula (1) and using the values normalized by inputting the values of the target identification data into a sigmoid function as a i .

S335Cでは、CPU210は、1個の乱数Rfcを取得する。乱数Rfcは、例えば、乱数Rrcと同一の正規分布から独立に取得される。 In S335C, the CPU 210 obtains one random number Rfc. The random number Rfc is obtained, for example, independently from the same normal distribution as the random number Rrc.

S340Cでは、CPU210は、S330Cにて算出された誤差値Efに、乱数Rfcを加算して、変動誤差値EVfcを算出する(EVfc=Ef+Rfc)。 In S340C, the CPU 210 adds the random number Rfc to the error value Ef calculated in S330C to calculate the fluctuation error value EVfc (EVfc = Ef + Rfc).

第2変形例では、図11のS230において、(2×V)個の変動誤差値EVr、EVfに代えて、図14の変動誤差値算出処理にて算出された(2×V)個の変動誤差値EVrc、EVfcを用いて、識別ネットワークDNの複数個の演算パラメータPdnを調整する。 In the second modified example, in S230 of FIG. 11, instead of the (2×V) fluctuation error values EVr and EVf, the (2×V) fluctuation error values EVrc and EVfc calculated in the fluctuation error value calculation process of FIG. 14 are used to adjust the multiple calculation parameters Pdn of the identification network DN.

以上説明した第2変形例では、変動工程(図14のS310C、S315C、S335C、S340C)は、注目識別データと教師データLDr、LDfとを用いて算出される誤差値Er、Efを、乱数Rrc、Rfcを用いて変動させる工程である。誤差値Er、Efは、所定の損失関数(本実施例ではシグモイドクロスエントロピー誤差)を用いて算出される指標値と言うことができる。第2変形例によれば、より少ない個数の乱数を用いて、変動誤差値EVrc、EVfcを算出できるので、容易に識別ネットワークDNのトレーニングの進み具合を調整することができる。 In the second modified example described above, the variation process (S310C, S315C, S335C, S340C in FIG. 14) is a process of varying the error values Er and Ef calculated using the target identification data and the teacher data LDr and LDf, using random numbers Rrc and Rfc. The error values Er and Ef can be said to be index values calculated using a predetermined loss function (sigmoid cross entropy error in this embodiment). According to the second modified example, the variation error values EVrc and EVfc can be calculated using a smaller number of random numbers, so that the progress of training of the identification network DN can be easily adjusted.

(2)上記実施例および変形例では、乱数を用いて変動させる値は、教師データ、識別データ、誤差値である。これに限らず、CPU210は、識別ネットワークDNの複数個の演算パラメータPdnの調整のために用いられる他の値を、乱数を用いて変動させても良い。例えば、CPU210は、誤差逆伝播法や勾配降下法の過程で算出される微分値などの中間パラメータを、乱数を用いて変動させても良い。なお、これらの変動対象の値が負の値を取ることが許容される場合には、例えば、これらの値は負の値を含む乱数を加算することによって変動させても良い。また、これらの変動対象の値が負の値を取ることが許容されない場合には、例えば、これらの値は0以上の値の乱数を加算することによって変動させても良い。 (2) In the above embodiment and modified example, the values that are varied using random numbers are teacher data, identification data, and error values. Not limited to this, the CPU 210 may vary other values used to adjust the multiple calculation parameters Pdn of the identification network DN using random numbers. For example, the CPU 210 may vary intermediate parameters such as differential values calculated during the backpropagation method or gradient descent method using random numbers. Note that, if the values of these objects to be varied are allowed to take negative values, these values may be varied, for example, by adding random numbers that include negative values. Also, if the values of these objects to be varied are not allowed to take negative values, these values may be varied, for example, by adding random numbers that are 0 or greater.

また、上記実施例および変形例では、変動対象の値に乱数を加算することで、その値を変動させている。これに代えて、例えば、平均が1である正規分布から乱数を取得し、変動対象の値に乱数を乗算または除算することで、その値を変動させても良い。 In the above embodiment and modified example, a random number is added to the value of the object to be varied, thereby varying the value. Alternatively, for example, a random number may be obtained from a normal distribution with a mean of 1, and the value of the object to be varied may be varied by multiplying or dividing the value by the random number.

(3)上記実施例では、いわゆるGANsを構成するネットワークシステム1000において、生成ネットワークGNのトレーニングの進み具合が、識別ネットワークDNのトレーニングの進み具合に対して過度に遅れないように、識別ネットワークDNのトレーニングの進み具合を、乱数を用いて調整している。GANsとしては、様々な種類のGANs、例えば、CycleGAN、DCGAN、ConditionalGANに対して、本発明が適用されてもよい。 (3) In the above embodiment, in the network system 1000 constituting so-called GANs, the progress of training of the identification network DN is adjusted using random numbers so that the progress of training of the generation network GN does not lag too far behind the progress of training of the identification network DN. The present invention may be applied to various types of GANs, such as CycleGAN, DCGAN, and ConditionalGAN.

さらに、GANsに限らず、何らかの理由で、出力データと教師データとを用いてトレーニングされる特定の機械学習モデルのトレーニングの進み具合を調整する場合に、本発明が適用され得る。 Furthermore, the present invention can be applied to cases other than GANs where, for some reason, it is necessary to adjust the progress of training of a specific machine learning model that is trained using output data and teacher data.

(4)上記実施例では、誤差値EVr、EVf、Efには、式(1)に示すように、シグモイドクロスエントロピー誤差が用いられ、誤差値Erfには、平均絶対誤差が用いれている。これに代えて、これらの誤差値には、他の種類の誤差値が用いられても良い。例えば、誤差値EVr、EVf、Efには、ソフトマックスクロスエントロピー誤差が用いられても良い。誤差値Erfには、平均二乗誤差が用いられても良い。 (4) In the above embodiment, as shown in formula (1), the sigmoid cross entropy error is used for the error values EVr, EVf, and Ef, and the mean absolute error is used for the error value Erf. Alternatively, other types of error values may be used for these error values. For example, the softmax cross entropy error may be used for the error values EVr, EVf, and Ef. The mean squared error may be used for the error value Erf.

(5)上記実施例は、生成ネットワークGNは、一般的には、上述したように、第1の属性(例えば、「A」の文字であるという属性)と第2の属性(例えば、第1の書体であるという属性)を有し、かつ、第3の属性(例えば、第2の書体であるという属性)を有しない画像データを、第1の属性と第3の属性を有し、かつ、第2の属性を有しない画像データに変換するモデルである。このような変換は、一般的には、「スタイル変換(style transfer)」「画像翻訳(image-to-image translation)」とも呼ばれる。他の具体例としては、生成ネットワークGNは、例えば、所定の物(建物、靴などの静物や馬、犬などの動物)を示す線画(線のみで描画された画像)を、所定の物を示すカラー画像に変換するモデルであっても良い。また、生成ネットワークGNは、例えば、所定の場所を示す航空写真を、該所定の場所を示す地図に変換するモデルであっても良い。これらの場合にも、生成ネットワークGNは、第1の属性(所定の物を示すという属性、所定の場所を示すという属性)と第2の属性(線画であるという属性、航空写真であるという属性)を有し、かつ、第3の属性(カラー画像であるという属性、地図であるという属性)を有しない画像データを、第1の属性と第3の属性を有し、かつ、第2の属性を有しない画像データに変換するモデルである、と言うことができる。 (5) In the above embodiment, the generation network GN is generally a model that converts image data having a first attribute (e.g., an attribute of the character "A") and a second attribute (e.g., an attribute of the first font) and not having a third attribute (e.g., an attribute of the second font) into image data having the first attribute and the third attribute and not having the second attribute, as described above. Such conversion is generally also called "style transfer" or "image-to-image translation". As another specific example, the generation network GN may be a model that converts, for example, a line drawing (an image drawn only with lines) showing a predetermined object (still life such as a building or a shoe, or an animal such as a horse or a dog) into a color image showing the predetermined object. In addition, the generation network GN may be a model that converts, for example, an aerial photograph showing a predetermined place into a map showing the predetermined place. Even in these cases, the generative network GN can be said to be a model that converts image data that has a first attribute (an attribute indicating a specific object, an attribute indicating a specific place) and a second attribute (an attribute indicating a line drawing, an attribute indicating an aerial photograph) and does not have a third attribute (an attribute indicating a color image, an attribute indicating a map) into image data that has the first attribute and the third attribute and does not have the second attribute.

(6)上記実施例では、生成ネットワークGNでは、入力データIDと偽データODとは共に、画像データである。これに限らず、入力データIDや偽データODの両方または片方は、テキストや音声を示すデータであっても良い。例えば、生成ネットワークGNは、特定の物を表現する画像データを、特定の物を表現するテキストや音声に変換するモデルであっても良い。あるいは、生成ネットワークGNは、特定の物を表現するテキストを、特定の物を表現する画像や音声に変換するモデルであっても良い。 (6) In the above embodiment, in the generating network GN, both the input data ID and the fake data OD are image data. Not limited to this, both or either of the input data ID and the fake data OD may be data representing text or audio. For example, the generating network GN may be a model that converts image data representing a specific object into text or audio representing a specific object. Alternatively, the generating network GN may be a model that converts text representing a specific object into an image or audio representing a specific object.

(7)生成ネットワークGNや識別ネットワークDNの具体的な構成は、図5、図6に示す構成に限られず、他の様々な構成であっても良い。例えば、生成ネットワークGNや識別ネットワークDNにおいて、畳込層や転置畳込層の層数は、適宜に変更されて良い。また、生成ネットワークGNや識別ネットワークDNは、畳込層や転置畳込層の全部または一部に代えて、プーリング層や全結合層を備えても良い。また、各層で出力された値に対して実行される後処理も任意の様々な構成が採用される。例えば、後処理に用いられる活性化関数は、任意の他の関数、例えば、PReLU、ソフトマックス、シグモイドが用いられても良い。また、バッチノーマリゼイション、ドロップアウトなどの処理も後処理として適宜に追加や省略がされ得る。さらに、上記実施例の生成ネットワークGNでは、デコーダDCのm番目の転置畳込層DL_mには、エンコーダECの(9-m)番目の畳込層EL_(9-m)から出力される値が入力されるが、該入力は省略されても良い。 (7) The specific configuration of the generating network GN and the identifying network DN is not limited to the configuration shown in FIG. 5 and FIG. 6, and may be various other configurations. For example, in the generating network GN and the identifying network DN, the number of layers of the convolution layer and the transposed convolution layer may be changed as appropriate. In addition, the generating network GN and the identifying network DN may include a pooling layer or a fully connected layer instead of all or a part of the convolution layer and the transposed convolution layer. In addition, various configurations are adopted for the post-processing performed on the values output from each layer. For example, the activation function used in the post-processing may be any other function, such as PReLU, softmax, or sigmoid. In addition, processes such as batch normalization and dropout may be added or omitted as post-processing as appropriate. Furthermore, in the generating network GN of the above embodiment, the m-th transposed convolution layer DL_m of the decoder DC is input with a value output from the (9-m)-th convolution layer EL_(9-m) of the encoder EC, but this input may be omitted.

また、識別ネットワークDNは、ニューラルネットワークとは異なる機械学習モデルであって、教師データを用いてトレーニングされる機械学習モデル、例えば、サポートベクターマシーン(SVM)であっても良い。 The classification network DN may also be a machine learning model other than a neural network, such as a support vector machine (SVM), that is trained using teacher data.

(8)図1のデータ生成装置200や図7のトレーニング装置100のハードウェア構成は、一例であり、これに限られない。例えば、データ生成装置200やトレーニング装置100のプロセッサは、CPUに限らず、GPU(Graphics Processing Unit)やASIC(application specific integrated circuit)、あるいは、これらとCPUとの組み合わせであっても良い。また、トレーニング装置100やデータ生成装置200は、ネットワークを介して互いに通信可能な複数個の計算機(例えば、いわゆるクラウドサーバ)であっても良い。 (8) The hardware configuration of the data generating device 200 in FIG. 1 and the training device 100 in FIG. 7 is an example and is not limited to this. For example, the processor of the data generating device 200 and the training device 100 is not limited to a CPU, but may be a GPU (Graphics Processing Unit) or an ASIC (Application Specific Integrated Circuit), or a combination of these with a CPU. In addition, the training device 100 and the data generating device 200 may be multiple computers (for example, so-called cloud servers) that can communicate with each other via a network.

(9)上記各実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部あるいは全部をハードウェアに置き換えるようにしてもよい。例えば、生成ネットワークGNや識別ネットワークDNは、プログラムモジュールに代えて、ASIC(Application Specific Integrated Circuit)等のハードウェア回路によって実現されてよい。 (9) In each of the above embodiments, a part of the configuration realized by hardware may be replaced by software, and conversely, a part or all of the configuration realized by software may be replaced by hardware. For example, the generation network GN and the identification network DN may be realized by a hardware circuit such as an ASIC (Application Specific Integrated Circuit) instead of a program module.

以上、実施例、変形例に基づき本発明について説明してきたが、上記した発明の実施の形態は、本発明の理解を容易にするためのものであり、本発明を限定するものではない。本発明は、その趣旨並びに特許請求の範囲を逸脱することなく、変更、改良され得ると共に、本発明にはその等価物が含まれる。 The present invention has been described above based on examples and modified examples, but the above-mentioned embodiments of the invention are intended to facilitate understanding of the present invention and do not limit the present invention. The present invention may be modified or improved without departing from the spirit and scope of the claims, and the present invention includes equivalents thereof.

100…トレーニング装置、110…CPU、120…揮発性記憶装置、130…不揮発性記憶装置、140…表示部、150…操作部、200…データ生成装置、210…CPU、220…揮発性記憶装置、230…不揮発性記憶装置、240…表示部、250…操作部、270…通信インタフェース、300…プリンタ、1000…ネットワークシステム、EL_0、L_0…入力層、EL_1~EL_8、L_0~L_5…畳込層、DL_1~DL_8…転置畳込層、EC…エンコーダ、DC…デコーダ、ID…入力データ、OD…出力データ(偽データ)、CD、CDf…特徴データ、LDr、LDf…教師データ、GN…生成ネットワーク、DN…識別ネットワーク、Pd、Pe、Pdn…演算パラメータ、Pr…実データペア、PGg、PGt…コンピュータプログラム 100...Training device, 110...CPU, 120...Volatile storage device, 130...Non-volatile storage device, 140...Display unit, 150...Operation unit, 200...Data generation device, 210...CPU, 220...Volatile storage device, 230...Non-volatile storage device, 240...Display unit, 250...Operation unit, 270...Communication interface, 300...Printer, 1000...Network system, EL_0, L_0...Input layer, EL_1 to EL_8, L_0 to L_5...Convolution layer, DL_1 to DL_8...Transposed convolution layer, EC...Encoder, DC...Decoder, ID...Input data, OD...Output data (fake data), CD, CDf...Feature data, LDr, LDf...Teacher data, GN...Generative network, DN...Discrimination network, Pd, Pe, Pdn...Calculation parameters, Pr...Real data pair, PGg, PGt...Computer program

Claims (8)

機械学習モデルのトレーニング方法であって、
第1の入力データを第1の機械学習モデルに入力することによって、前記第1の入力データに対応する第1の出力データを出力させる第1工程であって、前記第1の機械学習モデルは、前記第1の入力データに対して複数個の第1の演算パラメータを用いる演算処理を実行して前記第1の出力データを出力するモデルである、前記第1工程と、
前記第1の出力データと教師データとを用いて、前記複数個の第1の演算パラメータを調整する第2工程であって、前記教師データは、前記第1の入力データに対応する前記第1の出力データの目標値を示す、前記第2工程と、
第2の入力データを前記第1の機械学習モデルとは異なる第2の機械学習モデルに入力することによって、前記第2の入力データに対応する第2の出力データを出力させる第3工程であって、前記第2の機械学習モデルは、前記第2の入力データに対して複数個の第2の演算パラメータを用いる演算処理を実行して前記第2の出力データを出力するモデルである、前記第3工程と、
前記第2の出力データを用いて、前記複数個の第2の演算パラメータを調整する第4工程と、
を備え、
前記第1工程と前記第2工程と前記第3工程と前記第4工程とをコンピュータが複数回繰り返すことによって、前記第1の機械学習モデルと前記第2の機械学習モデルとを並行してトレーニングし、
前記第2工程は、前記複数個の第1の演算パラメータの調整のために用いられる値を、乱数を用いて変動させる変動工程を含み、
前記第4工程は、前記複数個の第2の演算パラメータを調整するために用いられる値を、乱数を用いて変動させる工程を含まない、方法。
1. A method for training a machine learning model, comprising:
A first step of inputting first input data into a first machine learning model to output first output data corresponding to the first input data, the first machine learning model being a model that performs a calculation process using a plurality of first calculation parameters on the first input data to output the first output data;
a second step of adjusting the plurality of first calculation parameters using the first output data and teacher data, the teacher data indicating a target value of the first output data corresponding to the first input data;
a third step of inputting second input data into a second machine learning model different from the first machine learning model, thereby outputting second output data corresponding to the second input data, the second machine learning model being a model that performs a calculation process using a plurality of second calculation parameters on the second input data to output the second output data;
a fourth step of adjusting the plurality of second calculation parameters using the second output data;
Equipped with
The first machine learning model and the second machine learning model are trained in parallel by a computer repeating the first step, the second step, the third step, and the fourth step a plurality of times;
the second step includes a varying step of varying values used for adjusting the plurality of first calculation parameters by using random numbers;
The method, wherein the fourth step does not include a step of varying values used to adjust the plurality of second operational parameters using random numbers.
請求項1に記載の方法であって、
前記変動工程は、前記複数個の教師データに含まれる少なくとも一部の値を、前記乱数を用いて変動させる工程であり、
前記第2工程は、前記第1の出力データと、少なくとも一部の値が変動された後の前記教師データと、を用いて、前記複数個の第1の演算パラメータを調整する工程である、方法。
2. The method of claim 1 ,
The varying step is a step of varying at least a part of values included in the plurality of teacher data by using the random numbers;
The method, wherein the second step is a step of adjusting the plurality of first calculation parameters using the first output data and the teacher data after at least a portion of the values have been varied.
請求項1に記載の方法であって、
前記変動工程は、前記第1の出力データに含まれる少なくとも一部の値を、前記乱数を用いて変動させる工程であり、
前記第2工程は、少なくとも一部の値が変動された後の前記第1の出力データと、前記教師データと、を用いて、前記複数個の第1の演算パラメータを調整する工程である、方法。
2. The method of claim 1 ,
the varying step is a step of varying at least a part of values included in the first output data by using the random number;
The method, wherein the second step is a step of adjusting the plurality of first calculation parameters using the first output data after at least some of the values have been changed and the teacher data.
請求項1に記載の方法であって、
前記第2工程は、
前記第1の出力データと前記教師データとを用いて、所定の損失関数に基づく評価値を算出する工程と、
前記評価値を、前記乱数を用いて変動させる前記変動工程と、
変動後の前記評価値を用いて、前記複数個の第1の演算パラメータを調整する工程と、
を含む、方法。
2. The method of claim 1 ,
The second step comprises:
Calculating an evaluation value based on a predetermined loss function using the first output data and the teacher data;
the varying step of varying the evaluation value by using the random number;
adjusting the plurality of first calculation parameters using the evaluation value after the change;
A method comprising:
請求項1に記載の方法であって、
前記第1の入力データは、実データと、偽データとしての前記第2の出力データと、を含む複数個のデータであり、
前記教師データは、複数個の前記第1の入力データのそれぞれが前記実データであるか前記偽データであるかを示すデータであり、
前記第1の機械学習モデルは、前記複数個の第1の入力データのそれぞれが前記実データと前記偽データとのいずれであるかを識別するためのモデルであり、
前記第1の出力データは、前記第1の機械学習モデルによる識別結果を示すデータであり、
前記第2の機械学習モデルは、前記偽データとしての前記第2の出力データを生成するためのモデルであり、
前記第2工程では、前記第1の出力データと前記教師データとを用いて、前記第1の出力データと前記教師データとの差分が小さくなるように、前記複数個の第1の演算パラメータを調整し、
前記第4工程では、前記偽データとしての前記第2の出力データを前記第1の機械学習モデルに入力することによって得られる前記第1の出力データと前記教師データとの差分が大きくなるように、前記複数個の第2の演算パラメータを調整する、方法。
2. The method of claim 1 ,
the first input data is a plurality of data including real data and the second output data as false data;
the teacher data is data indicating whether each of the plurality of first input data is the real data or the fake data,
the first machine learning model is a model for identifying whether each of the plurality of first input data is the real data or the fake data;
The first output data is data indicating a classification result by the first machine learning model,
the second machine learning model is a model for generating the second output data as the fake data,
In the second step, the plurality of first calculation parameters are adjusted using the first output data and the teacher data so that a difference between the first output data and the teacher data is reduced;
In the fourth step, the plurality of second calculation parameters are adjusted so that a difference between the first output data obtained by inputting the second output data as the fake data into the first machine learning model and the teacher data is increased.
請求項1~5のいずれかに記載の方法であって、
前記変動工程では、変動後の値が0以上の値となるように、前記複数個の第1の演算パラメータの調整のために用いられる値を変動させる、方法。
The method according to any one of claims 1 to 5,
The method includes varying values used for adjusting the plurality of first calculation parameters so that the values after the variation are equal to or greater than 0 in the varying step.
データ生成装置であって、
第1の機械学習モデルを用いるトレーニング処理によってトレーニングされた学習済みの第2の機械学習モデルを用いて特定のデータを生成する生成部と、
前記特定のデータを出力する出力部と、
を備え、
前記第1の機械学習モデルは、第1の入力データに対して複数個の第1の演算パラメータを用いる演算処理を実行して、前記第1の入力データが実データと偽データとのいずれかであるかを識別した結果を示す識別データを出力するモデルであり、
前記第2の機械学習モデルは、第2の入力データに対して複数個の第2の演算パラメータを用いる演算処理を実行して、前記第2の入力データに対応する前記偽データを生成するモデルであり、
前記トレーニング処理は、
前記第2の入力データを前記第2の機械学習モデルに入力して、前記偽データを生成させる偽データ生成処理と、
実データと、前記第2の機械学習モデルによって生成された前記偽データと、を含む複数個の前記第1の入力データを前記第1の機械学習モデルに入力して、複数個の前記識別データを出力させる識別データ生成処理と、
前記識別データと教師データとを用いて、前記識別データと前記教師データとの差が小さくなるように、前記複数個の第1の演算パラメータを調整する第1の調整処理であって、前記教師データは、前記複数個の第1の入力データのそれぞれが前記実データであるか前記偽データであるかを示すデータである、前記第1の調整処理と、
前記偽データを前記第1の機械学習モデルに入力することによって得られる前記識別データと前記教師データとを用いて、前記識別データと前記教師データとの差が大きくなるように、前記複数個の第2の演算パラメータを調整する第2の調整処理と、
を含み、前記偽データ生成処理と前記識別データ生成処理と前記第1の調整処理と前記第2の調整処理とを複数回繰り返すことによって、前記第1の機械学習モデルと前記第2の機械学習モデルとを並行してトレーニングする処理であり、
前記第1の調整処理は、前記複数個の第1の演算パラメータを調整するために用いられる値を、乱数を用いて変動させる処理を含み、
前記第2の調整処理は、前記複数個の第2の演算パラメータを調整するために用いられる値を、乱数を用いて変動させる処理を含まない、データ生成装置。
A data generating device,
A generation unit that generates specific data using a learned second machine learning model trained by a training process using the first machine learning model;
an output unit that outputs the specific data;
Equipped with
the first machine learning model is a model that executes a calculation process using a plurality of first calculation parameters on first input data, and outputs identification data indicating a result of identifying whether the first input data is real data or fake data;
the second machine learning model is a model that performs a calculation process using a plurality of second calculation parameters on second input data to generate the fake data corresponding to the second input data;
The training process includes:
a fake data generation process of inputting the second input data into the second machine learning model to generate the fake data;
an identification data generation process for inputting a plurality of first input data, including real data and the fake data generated by the second machine learning model, into the first machine learning model and outputting a plurality of the identification data;
a first adjustment process for adjusting the plurality of first calculation parameters using the identification data and teacher data so that a difference between the identification data and the teacher data becomes small, the teacher data being data indicating whether each of the plurality of first input data is the real data or the fake data;
a second adjustment process for adjusting the plurality of second calculation parameters using the identification data and the teacher data obtained by inputting the false data into the first machine learning model so that a difference between the identification data and the teacher data becomes large;
a process of training the first machine learning model and the second machine learning model in parallel by repeating the fake data generation process, the identification data generation process, the first adjustment process, and the second adjustment process a plurality of times;
the first adjustment process includes a process of varying values used to adjust the plurality of first calculation parameters by using random numbers;
A data generating device, wherein the second adjustment process does not include a process of varying values used to adjust the plurality of second calculation parameters by using random numbers.
第1の機械学習モデルを用いるトレーニング処理によってトレーニングされた学習済みの第2の機械学習モデルであって、特定のデータを生成するための前記学習済みの第2の機械学習モデルであって、
前記第1の機械学習モデルは、第1の入力データに対して複数個の第1の演算パラメータを用いる演算処理を実行して、前記第1の入力データが実データと偽データとのいずれかであるかを識別した結果を示す識別データを出力するモデルであり、
前記第2の機械学習モデルは、第2の入力データに対して複数個の第2の演算パラメータを用いる演算処理を実行して、前記第2の入力データに対応する前記偽データを生成する機能をコンピュータに実現させるモデルであり、
前記トレーニング処理は、
前記第2の入力データを前記第2の機械学習モデルに入力して、前記偽データを生成させる偽データ生成処理と、
実データと、前記第2の機械学習モデルによって生成された前記偽データと、を含む複数個の前記第1の入力データを前記第1の機械学習モデルに入力して、複数個の前記識別データを出力させる識別データ生成処理と、
前記識別データと教師データとを用いて、前記識別データと前記教師データとの差が小さくなるように、前記複数個の第1の演算パラメータを調整する第1の調整処理であって、前記教師データは、前記複数個の第1の入力データのそれぞれが前記実データであるか前記偽データであるかを示すデータである、前記第1の調整処理と、
前記偽データを前記第1の機械学習モデルに入力することによって得られる前記識別データと前記教師データとを用いて、前記識別データと前記教師データとの差が大きくなるように、前記複数個の第2の演算パラメータを調整する第2の調整処理と、
を含み、前記偽データ生成処理と前記識別データ生成処理と前記第1の調整処理と前記第2の調整処理とを複数回繰り返すことによって、前記第1の機械学習モデルと前記第2の機械学習モデルとを並行してトレーニングする処理であり、
前記第1の調整処理は、前記複数個の第1の演算パラメータを調整するために用いられる値を、乱数を用いて変動させる処理を含み、
前記第2の調整処理は、前記複数個の第2の演算パラメータを調整するために用いられる値を、乱数を用いて変動させる処理を含まない、前記学習済みの第2の機械学習モデル。
A trained second machine learning model trained by a training process using a first machine learning model, the trained second machine learning model for generating specific data,
the first machine learning model is a model that executes a calculation process using a plurality of first calculation parameters on first input data, and outputs identification data indicating a result of identifying whether the first input data is real data or fake data;
the second machine learning model is a model that causes a computer to realize a function of executing a calculation process using a plurality of second calculation parameters on second input data to generate the fake data corresponding to the second input data;
The training process includes:
a fake data generation process of inputting the second input data into the second machine learning model to generate the fake data;
an identification data generation process for inputting a plurality of first input data, including real data and the fake data generated by the second machine learning model, into the first machine learning model and outputting a plurality of the identification data;
a first adjustment process for adjusting the plurality of first calculation parameters using the identification data and teacher data so that a difference between the identification data and the teacher data becomes small, the teacher data being data indicating whether each of the plurality of first input data is the real data or the fake data;
a second adjustment process for adjusting the plurality of second calculation parameters using the identification data and the teacher data obtained by inputting the false data into the first machine learning model so that a difference between the identification data and the teacher data becomes large;
a process of training the first machine learning model and the second machine learning model in parallel by repeating the fake data generation process, the identification data generation process, the first adjustment process, and the second adjustment process a plurality of times;
the first adjustment process includes a process of varying values used to adjust the plurality of first calculation parameters by using random numbers;
The second machine learning model that has been trained, wherein the second adjustment process does not include a process of varying values used to adjust the plurality of second calculation parameters using random numbers.
JP2019092211A 2019-05-15 2019-05-15 Machine learning model training method, data generation device, and trained machine learning model Active JP7498421B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2019092211A JP7498421B2 (en) 2019-05-15 2019-05-15 Machine learning model training method, data generation device, and trained machine learning model
PCT/JP2020/018931 WO2020230776A1 (en) 2019-05-15 2020-05-12 Training method for machine learning model, data generation device, and prelearned machine learning model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019092211A JP7498421B2 (en) 2019-05-15 2019-05-15 Machine learning model training method, data generation device, and trained machine learning model

Publications (2)

Publication Number Publication Date
JP2020187582A JP2020187582A (en) 2020-11-19
JP7498421B2 true JP7498421B2 (en) 2024-06-12

Family

ID=73221761

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019092211A Active JP7498421B2 (en) 2019-05-15 2019-05-15 Machine learning model training method, data generation device, and trained machine learning model

Country Status (2)

Country Link
JP (1) JP7498421B2 (en)
WO (1) WO2020230776A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022174516A (en) * 2021-05-11 2022-11-24 ブラザー工業株式会社 Image processing method, computer program, image processing apparatus, and training method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3303032B2 (en) * 1992-04-24 2002-07-15 株式会社日立製作所 Neural network learning device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ZHANG, Chiyuan ほか,Understanding Deep Learning Requires Rethinking Generalization,arXiv[online],arXiv,2017年02月26日,[retrieved on 2020.06.10], Retrieved from the Internet: <URL: https://arxiv.org/pdf/1611.03530v2.pdf>
ZHU, Jun-yan ほか,Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks,arXiv[online],arXiv,2018年11月15日,[retrieved on 2020.06.10], Retrieved from the Internet: <URL: https://arxiv.org/pdf/1703.10593v6. pdf>
柴田 克成 ほか,強化学習による能動認識能力の学習,日本神経回路学会誌[online],日本,日本神経回路学会,1996年12月05日,Vol. 3, No. 4,pp. 126-134,[retrieved on 2020.06.10], Retrieved from the Internet: <URL: https://www.jstage.jst.go.jp/article/jnns/3/4/3_4_126/_pdf/-char/ja>

Also Published As

Publication number Publication date
WO2020230776A1 (en) 2020-11-19
JP2020187582A (en) 2020-11-19

Similar Documents

Publication Publication Date Title
US9619749B2 (en) Neural network and method of neural network training
CN110799995A (en) Data recognizer training method, data recognizer training device, program, and training method
US9846826B2 (en) Image processing to generate a tone curve for processing an image by associating a model parameter of the image with another model parameter of a reference image
CN109919183A (en) A kind of image-recognizing method based on small sample, device, equipment and storage medium
WO2020230777A1 (en) Training method for machine learning model, data generation device, and trained machine learning model
CN112102176A (en) Image rain removing method based on multi-scale intensive mixed attention neural network
JP2021026191A (en) Learned machine learning model, image data generation apparatus, and method
US11325398B2 (en) Image processing device generating dot data using machine learning model and method for training machine learning model
JP7498421B2 (en) Machine learning model training method, data generation device, and trained machine learning model
JP6935868B2 (en) Image recognition device, image recognition method, and program
KR102537207B1 (en) Method for processing image based on machine learning and apparatus therefof
US11468294B2 (en) Projecting images to a generative model based on gradient-free latent vector determination
CN118261999A (en) Stylized portrait generation method, equipment and medium
CN111339734B (en) Method for generating image based on text
CN111860293B (en) Remote sensing scene classification method, device, terminal equipment and storage medium
JP7443030B2 (en) Learning method, program, learning device, and method for manufacturing learned weights
US11900564B2 (en) Storage medium storing program, image processing apparatus, and training method of machine learning model
JP7148078B2 (en) Attribute estimation device, attribute estimation method, attribute estimator learning device, and program
CN114462597A (en) Method, device, equipment and storage medium for quickly training deep neural network
JP2023005711A (en) Information processing device, information processing method and program, and system
CN108256633B (en) Method for testing stability of deep neural network
JP2021140758A5 (en)
CN111402121A (en) Image style conversion method and device, computer equipment and storage medium
CN113936320B (en) Face image quality evaluation method, electronic device and storage medium
CN114821203B (en) Fine-grained image model training and identifying method and device based on consistency loss

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220426

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230705

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230901

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20231219

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20240131

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240514

R150 Certificate of patent or registration of utility model

Ref document number: 7498421

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150