JP7423905B2 - 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
JP7423905B2
JP7423905B2 JP2019092212A JP2019092212A JP7423905B2 JP 7423905 B2 JP7423905 B2 JP 7423905B2 JP 2019092212 A JP2019092212 A JP 2019092212A JP 2019092212 A JP2019092212 A JP 2019092212A JP 7423905 B2 JP7423905 B2 JP 7423905B2
Authority
JP
Japan
Prior art keywords
data
machine learning
learning model
pair
input
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
JP2019092212A
Other languages
Japanese (ja)
Other versions
JP2020187583A (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 JP2019092212A priority Critical patent/JP7423905B2/en
Priority to PCT/JP2020/018932 priority patent/WO2020230777A1/en
Publication of JP2020187583A publication Critical patent/JP2020187583A/en
Application granted granted Critical
Publication of JP7423905B2 publication Critical patent/JP7423905B2/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/04Architecture, e.g. interconnection topology
    • 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

Description

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

近年、注目される機械学習モデルとして、敵対的生成ネットワーク(GANs: Generative Adversarial Networks)が知られている。敵対的生成ネットワークでは、ディスクリミネータとジェネレータと呼ばれる2つのネットワークが利用される。ディスクリミネータは実データと偽データとを識別することを目的としてトレーニングされ、ジェネレータは、ディスクリミネータが上述の識別を誤るような偽データを生成することを目的としてトレーニングされる。 Generative adversarial networks (GANs) are known as machine learning models that have received attention in recent years. A generative adversarial network uses two networks called a discriminator and a generator. The discriminator is trained for the purpose of distinguishing between real data and false data, and the generator is trained for the purpose of generating false data such that the discriminator makes the above-mentioned false identification.

非特許文献1には、条件付き敵対的生成ネットワークを利用して、特定の区分(ドメインと呼ばれる)に属する画像(例えば、線画)を、他の区分に属する画像(例えば、写真)に変換する技術が開示されている。この技術では、ジェネレータは、入力される画像をエンコードするエンコーダと、エンコードして得られたデータをデコードして変換後の画像を生成するデコーダと、を備えている。 Non-Patent Document 1 describes a method of converting an image (e.g., a line drawing) belonging to a specific category (called a domain) into an image (e.g., a photo) belonging to another category using a conditional generative adversarial network. The technology has been disclosed. In this technology, the generator includes an encoder that encodes an input image, and a decoder that decodes the encoded data to generate a converted image.

Isola, P. et al ”Image-to-Image Translation with Conditional Adversarial Networks.” IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2017)Isola, P. et al “Image-to-Image Translation with Conditional Adversarial Networks.” IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2017) Taigman, Y. et al ”Unsupervised cross-domain image generation.” arXivpreprint arXiv:1611.02200 (2016).Taigman, Y. et al “Unsupervised cross-domain image generation.” arXivpreprint arXiv:1611.02200 (2016).

上記技術では、入力データと偽データとディスクリミネータによる識別結果を用いてジェネレータとを用いてジェネレータのトレーニングが行われるが、ジェネレータのトレーニングのさらなる改善が求められている。 In the above technology, training of the generator is performed using input data, false data, and a generator using identification results by a discriminator, but there is a need for further improvement in training of the generator.

本明細書は、機械学習モデルを効果的にトレーニングして、機械学習モデルを用いて入力データの特徴が適切に反映されたデータを生成する技術を開示する。 This specification discloses a technique for effectively training a machine learning model and using the machine learning model to generate data that appropriately reflects the characteristics of input data.

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

[適用例1]機械学習モデルのトレーニング方法であって、入力データを第1の機械学習モデルに入力することによって前記入力データに対応する偽データを出力させる第1工程であって、前記第1の機械学習モデルは、前記入力データに対して、次元数を削減する次元削減処理を実行して第1の特徴データを生成するエンコーダと、前記第1の特徴データに対して、次元数を復元する次元復元処理を実行して前記偽データを生成するデコーダと、を含み、前記第1の機械学習モデルは、複数個の第1の演算パラメータを用いて前記次元削減処理および前記次元復元処理を実行する、前記第1工程と、第1のペアと第2のペアとを含む複数個のデータペアを第2の機械学習モデルに入力して、前記複数個のデータペアに対応する複数個の識別データを出力させる第2工程であって、前記第1のペアは、前記入力データと、前記入力データに対応する実データと、から成る一対のデータであり、前記第2のペアは、前記入力データと、前記入力データに対応する前記偽データと、から成る一対のデータであり、前記識別データは、対応する前記データペアが前記第1のペアと前記第2のペアとのいずれであるかを識別した結果を示し、前記第2の機械学習モデルは、複数個の第2の演算パラメータを用いた演算を実行して前記識別データを生成する、前記第2工程と、前記識別データと前記識別データの目標値を示す教師データとを用いて、前記識別データと前記教師データとの差分が小さくなるように、前記複数個の第2の演算パラメータを調整する第3工程と、前記偽データに対して、前記エンコーダによる前記次元削減処理を実行して第2の特徴データを生成する第4工程と、前記識別データと前記教師データと前記第1の特徴データと前記第2の特徴データとを用いて、前記識別データと前記教師データとの差分が大きくなり、かつ、前記第1の特徴データと前記第2の特徴データとの差分が小さくなるように、前記複数個の第1の演算パラメータを調整する第5工程と、を備え、前記第1工程~前記第5工程を複数回繰り返すことによって、前記第1の機械学習モデルと前記第2の機械学習モデルとを並行してトレーニングする、方法。 [Application example 1] A method for training a machine learning model, the first step of inputting input data to a first machine learning model to output fake data corresponding to the input data, The first machine learning model includes an encoder that performs dimension reduction processing to reduce the number of dimensions on the input data to generate first feature data, and an encoder that reduces the number of dimensions for the first feature data. a decoder that generates the fake data by performing a dimension restoration process to restore, the first machine learning model performing the dimension reduction process and the dimension restoration process using a plurality of first calculation parameters. inputting a plurality of data pairs including the first pair and the second pair into a second machine learning model, and inputting a plurality of data pairs corresponding to the plurality of data pairs. A second step of outputting identification data, wherein the first pair is a pair of data consisting of the input data and actual data corresponding to the input data, and the second pair is: A pair of data consisting of the input data and the fake data corresponding to the input data, and the identification data indicates whether the corresponding data pair is the first pair or the second pair. the second step of generating the identification data by performing a calculation using a plurality of second calculation parameters; and teacher data indicating a target value of the identification data, a third step of adjusting the plurality of second calculation parameters so that the difference between the identification data and the teacher data becomes small; a fourth step of performing the dimension reduction process by the encoder on the fake data to generate second feature data; and the identification data, the teacher data, the first feature data, and the second feature. data, so that the difference between the identification data and the teacher data becomes large and the difference between the first feature data and the second feature data becomes small. a fifth step of adjusting calculation parameters of the first machine learning model and the second machine learning model in parallel by repeating the first to fifth steps a plurality of times. How to train.

上記構成によれば、第1の機械学習モデルの第1の演算パラメータは、識別データと教師データとの差分が大きくなるように調整されるだけでなく、第1の特徴データと第2の特徴データとを用いて、これらの特徴データの差分が小さくなるように調整される。この結果、入力データの特徴が第1の特徴データに適切に反映されるように、第1の演算パラメータを調整できる。従って、第1の機械学習モデルを効果的にトレーニングできるので、上記方法を用いてトレーニングされた機械学習モデルを用いれば、入力データの特徴が反映された適切な偽データを生成できる。
[適用例2]
適用例1に記載の方法であって、さらに、
前記第1の特徴データと前記第2の特徴データとを用いて、前記識別データと前記教師データとを用いずに、前記第1の特徴データと前記第2の特徴データとの差分が小さくなるように、前記複数個の第1の演算パラメータを調整する第6工程を備え、
前記第1工程と前記第4工程と前記第6工程とを複数回繰り返すことによって、前記第1の機械学習モデルをトレーニングした後に、前記第1工程~前記第5工程を複数回繰り返すことによって、前記第1の機械学習モデルと前記第2の機械学習モデルとを並行してトレーニングする、方法。
According to the above configuration, the first calculation parameter of the first machine learning model is not only adjusted so that the difference between the identification data and the training data becomes large, but also The difference between these feature data is adjusted using the data. As a result, the first calculation parameters can be adjusted so that the characteristics of the input data are appropriately reflected in the first characteristic data. Therefore, the first machine learning model can be effectively trained, and by using the machine learning model trained using the above method, it is possible to generate appropriate fake data that reflects the characteristics of the input data.
[Application example 2]
The method described in Application Example 1, further comprising:
Using the first feature data and the second feature data, without using the identification data and the teacher data, the difference between the first feature data and the second feature data is reduced. a sixth step of adjusting the plurality of first calculation parameters,
After training the first machine learning model by repeating the first step, the fourth step, and the sixth step multiple times, by repeating the first step to the fifth step multiple times, A method of training the first machine learning model and the second machine learning model in parallel.

[適用例]機械学習モデルのトレーニング方法であって、入力データを第1の機械学習モデルに入力することによって前記入力データに対応する偽データを出力させる第1工程であって、前記第1の機械学習モデルは、前記入力データに対して、次元数を削減する次元削減処理を実行して第1の特徴データを生成するエンコーダと、前記第1の特徴データに対して、次元数を復元する次元復元処理を実行して前記偽データを生成するデコーダと、を含み、前記第1の機械学習モデルは、複数個の第1の演算パラメータを用いて前記次元削減処理および前記次元復元処理を実行する、前記第1工程と、第1のペアと第2のペアとを含む複数個のデータペアを第2の機械学習モデルに入力して、前記複数個のデータペアに対応する複数個の識別データを出力させる第2工程であって、前記第1のペアは、前記入力データと、前記入力データに対応する実データと、から成る一対のデータであり、前記第2のペアは、前記入力データと、前記入力データに対応する前記偽データと、から成る一対のデータであり、前記識別データは、対応する前記データペアが前記第1のペアと前記第2のペアとのいずれであるかを識別した結果を示し、前記第2の機械学習モデルは、複数個の第2の演算パラメータを用いた演算を実行して前記識別データを生成する、前記第2工程と、前記識別データと前記識別データの目標値を示す教師データとを用いて、前記識別データと前記教師データとの差分が小さくなるように、前記複数個の第2の演算パラメータを調整する第3工程と、前記偽データに対して、前記エンコーダによる前記次元削減処理を実行して第2の特徴データを生成する第4工程と、前記識別データと前記教師データとを用いて、前記識別データと前記教師データとの差分が大きくなるように、前記複数個の第1の演算パラメータを調整する第5工程と、前記第1の特徴データと前記第2の特徴データとを用いて、前記識別データと前記教師データとを用いずに、前記第1の特徴データと前記第2の特徴データとの差分が小さくなるように、前記複数個の第1の演算パラメータを調整する第6工程と、を備え、前記第1工程と前記第4工程と前記第6工程とを複数回繰り返すことによって、前記第1の機械学習モデルをトレーニングした後に、前記第1工程~前記第5工程を複数回繰り返すことによって、前記第1の機械学習モデルと前記第2の機械学習モデルとを並行してトレーニングする、方法。 [Application Example 3 ] A method for training a machine learning model, the first step of inputting input data to a first machine learning model to output fake data corresponding to the input data, The first machine learning model includes an encoder that performs dimension reduction processing to reduce the number of dimensions on the input data to generate first feature data, and an encoder that reduces the number of dimensions for the first feature data. a decoder that generates the fake data by performing a dimension restoration process to restore, the first machine learning model performing the dimension reduction process and the dimension restoration process using a plurality of first calculation parameters. inputting a plurality of data pairs including the first pair and the second pair into a second machine learning model, and inputting a plurality of data pairs corresponding to the plurality of data pairs. A second step of outputting identification data, wherein the first pair is a pair of data consisting of the input data and actual data corresponding to the input data, and the second pair is: A pair of data consisting of the input data and the fake data corresponding to the input data, and the identification data indicates whether the corresponding data pair is the first pair or the second pair. the second step of generating the identification data by performing a calculation using a plurality of second calculation parameters; and teacher data indicating a target value of the identification data, a third step of adjusting the plurality of second calculation parameters so that the difference between the identification data and the teacher data becomes small; a fourth step of performing the dimension reduction process by the encoder on the fake data to generate second feature data; and using the identification data and the teacher data, a fifth step of adjusting the plurality of first calculation parameters so that the difference between the identification data and the teacher data is increased; a sixth step of adjusting the plurality of first calculation parameters so that the difference between the first feature data and the second feature data is small, without using the first feature data, After training the first machine learning model by repeating the first step, the fourth step, and the sixth step multiple times, the first machine learning model is trained by repeating the first to fifth steps multiple times. A method for training a first machine learning model and a second machine learning model in parallel.

上記構成によれば、第1の特徴データと第2の特徴データとを用いて、これらの特徴データの差分が小さくなるように第1の機械学習モデルをトレーニングした後に、第1の機械学習モデルと第2の機械学習モデルとを並行してトレーニングする。この結果、入力データの特徴が第1の特徴データに適切に反映されるように、第1の機械学習モデルを効果的にトレーニングできるので、上記方法を用いてトレーニングされた機械学習モデルを用いれば、入力データの特徴が反映された適切な出力データを生成できる。
[適用例4]
適用例2または3のいずれかに記載の方法であって、
前記第6工程において、さらに、特定の前記入力データに対応する前記実データおよび前記偽データを用いて、前記実データと前記偽データとの差分が小さくなるように、前記第1の演算パラメータを調整する、方法。
[適用例5]
適用例1~4のいずれかに記載の方法であって、
前記第5工程において、さらに、特定の前記入力データに対応する前記実データおよび前記偽データを用いて、前記実データと前記偽データとの差分が小さくなるように、前記第1の演算パラメータを調整する、方法。
According to the above configuration, after the first machine learning model is trained using the first feature data and the second feature data so that the difference between these feature data becomes small, the first machine learning model is trained using the first feature data and the second feature data. and a second machine learning model in parallel. As a result, the first machine learning model can be effectively trained so that the features of the input data are appropriately reflected in the first feature data, so if the machine learning model trained using the above method is used, , it is possible to generate appropriate output data that reflects the characteristics of input data.
[Application example 4]
The method according to either Application Example 2 or 3,
In the sixth step, the first calculation parameter is further adjusted using the real data and the fake data corresponding to the specific input data so that the difference between the real data and the fake data is small. How to adjust.
[Application example 5]
The method according to any one of Application Examples 1 to 4,
In the fifth step, the first calculation parameter is further adjusted using the real data and the fake data corresponding to the specific input data so that the difference between the real data and the fake data is small. How to adjust.

[適用例]データ生成装置であって、学習済みの第1の機械学習モデルを用いて入力データに対応する出力データを生成する生成部と、前記出力データを出力する出力部と、を備え、前記第1の機械学習モデルは、前記入力データに対して、次元数を削減する次元削減処理を実行して第1の特徴データを生成するエンコーダと、前記第1の特徴データに対して、次元数を復元する次元復元処理を実行して前記出力データを生成するデコーダと、を含み、複数個の第1の演算パラメータを用いて前記次元削減処理および前記次元復元処理を実行するモデルであり、学習済みの前記第1の機械学習モデルの前記複数個の第1の演算パラメータは、トレーニング処理によって調整済みであり、前記トレーニング処理は、前記入力データを第1の機械学習モデルに入力することによって前記入力データに対応する前記出力データを偽データとして出力させる第1処理と、第1のペアと第2のペアとを含む複数個のデータペアを第2の機械学習モデルに入力して、前記複数個のデータペアに対応する複数個の識別データを出力させる第2処理であって、前記第1のペアは、前記入力データと、前記入力データに対応する実データと、から成る一対のデータであり、前記第2のペアは、前記入力データと、前記入力データに対応する前記偽データと、から成る一対のデータであり、前記識別データは、対応する前記データペアが前記第1のペアと前記第2のペアとのいずれであるかを識別した結果を示し、前記第2の機械学習モデルは、複数個の第2の演算パラメータを用いた演算を実行して前記識別データを生成する、前記第2処理と、前記識別データと前記識別データの目標値を示す教師データとを用いて、前記識別データと前記教師データとの差分が小さくなるように、前記複数個の第2の演算パラメータを調整する第3処理と、前記偽データに対して、前記エンコーダによる前記次元削減処理を実行して第2の特徴データを生成する第4処理と、前記識別データと前記教師データと前記第1の特徴データと前記第2の特徴データとを用いて、前記識別データと前記教師データとの差分が大きくなり、かつ、前記第1の特徴データと前記第2の特徴データとの差分が小さくなるように、前記複数個の第1の演算パラメータを調整する第5処理と、を備え、前記第1処理~前記第5処理を複数回繰り返すことによって、前記第1の機械学習モデルと前記第2の機械学習モデルとを並行してトレーニングする処理である、データ生成装置。 [Application Example 6 ] A data generation device, comprising a generation unit that generates output data corresponding to input data using a trained first machine learning model, and an output unit that outputs the output data. , the first machine learning model includes an encoder that performs dimension reduction processing to reduce the number of dimensions on the input data to generate first feature data; , a decoder that performs a dimension restoration process to restore the number of dimensions and generates the output data, and a model that executes the dimension reduction process and the dimension restoration process using a plurality of first calculation parameters. and the plurality of first calculation parameters of the trained first machine learning model have been adjusted by a training process, and the training process inputs the input data to the first machine learning model. a first process of outputting the output data corresponding to the input data as fake data; and inputting a plurality of data pairs including the first pair and the second pair to a second machine learning model. , a second process of outputting a plurality of identification data corresponding to the plurality of data pairs, wherein the first pair is a pair consisting of the input data and actual data corresponding to the input data. , the second pair is a pair of data consisting of the input data and the fake data corresponding to the input data, and the identification data is such that the corresponding data pair is the first pair of data. and the second pair, and the second machine learning model executes a calculation using a plurality of second calculation parameters to obtain the identification data. Using the second process to generate the identification data and the teacher data indicating the target value of the identification data, the plurality of second a fourth process of performing the dimension reduction process by the encoder on the fake data to generate second feature data; Using the first feature data and the second feature data, the difference between the identification data and the teacher data becomes large, and the difference between the first feature data and the second feature data increases. a fifth process of adjusting the plurality of first calculation parameters such that A data generation device that performs a process of training the second machine learning model in parallel.

上記構成によれば、第1の機械学習モデルの第1の演算パラメータは、トレーニング処理において、識別データと教師データとの差分が大きくなるように調整されるだけでなく、第1の特徴データと第2の特徴データとを用いて、これらの特徴データの差分が小さくなるように調整されている。これによって、入力データの特徴が第1の特徴データに適切に反映されるように、第1の機械学習モデルが効果的にトレーニングされている。従って、データ生成装置は、機械学習モデルを用いて、入力データの特徴が反映された適切な出力データを生成できる。 According to the above configuration, the first calculation parameter of the first machine learning model is not only adjusted so as to increase the difference between the identification data and the teacher data in the training process, but also adjusted to increase the difference between the identification data and the teacher data. Adjustment is made using the second feature data so that the difference between these feature data becomes small. As a result, the first machine learning model is effectively trained so that the features of the input data are appropriately reflected in the first feature data. Therefore, the data generation device can use the machine learning model to generate appropriate output data that reflects the characteristics of the input data.

[適用例]データ生成装置であって、学習済みの第1の機械学習モデルを用いて入力データに対応する出力データを生成する生成部と、前記出力データを出力する出力部と、を備え、前記第1の機械学習モデルは、前記入力データに対して、次元数を削減する次元削減処理を実行して第1の特徴データを生成するエンコーダと、前記第1の特徴データに対して、次元数を復元する次元復元処理を実行して前記出力データを生成するデコーダと、を含み、複数個の第1の演算パラメータを用いて前記次元削減処理および前記次元復元処理を実行するモデルであり、学習済みの前記第1の機械学習モデルの前記複数個の第1の演算パラメータは、トレーニング処理によって調整済みであり、前記トレーニング処理は、前記入力データを第1の機械学習モデルに入力することによって前記入力データに対応する前記出力データを偽データとして出力させる第1処理と、第1のペアと第2のペアとを含む複数個のデータペアを第2の機械学習モデルに入力して、前記複数個のデータペアに対応する複数個の識別データを出力させる第2処理であって、前記第1のペアは、前記入力データと、前記入力データに対応する実データと、から成る一対のデータであり、前記第2のペアは、前記入力データと、前記入力データに対応する前記偽データと、から成る一対のデータであり、前記識別データは、対応する前記データペアが前記第1のペアと前記第2のペアとのいずれであるかを識別した結果を示し、前記第2の機械学習モデルは、複数個の第2の演算パラメータを用いた演算を実行して前記識別データを生成する、前記第2処理と、前記識別データと前記識別データの目標値を示す教師データとを用いて、前記識別データと前記教師データとの差分が小さくなるように、前記複数個の第2の演算パラメータを調整する第3処理と、前記偽データに対して、前記エンコーダによる前記次元削減処理を実行して第2の特徴データを生成する第4処理と、前記識別データと前記教師データとを用いて、前記識別データと前記教師データとの差分が大きくなるように、前記複数個の第1の演算パラメータを調整する第5処理と、前記第1の特徴データと前記第2の特徴データとを用いて、前記識別データと前記教師データとを用いずに、前記第1の特徴データと前記第2の特徴データとの差分が小さくなるように、前記複数個の第1の演算パラメータを調整する第6処理と、を備え、前記第1処理と前記第4処理と前記第6処理とを複数回繰り返すことによって、前記第1の機械学習モデルをトレーニングした後に、前記第1処理~前記第5処理を複数回繰り返すことによって、前記第1の機械学習モデルと前記第2の機械学習モデルとを並行してトレーニングする処理である、データ生成装置。 [Application Example 7 ] A data generation device, comprising a generation unit that generates output data corresponding to input data using a trained first machine learning model, and an output unit that outputs the output data. , the first machine learning model includes an encoder that performs dimension reduction processing to reduce the number of dimensions on the input data to generate first feature data; , a decoder that performs a dimension restoration process to restore the number of dimensions and generates the output data, and a model that executes the dimension reduction process and the dimension restoration process using a plurality of first calculation parameters. and the plurality of first calculation parameters of the trained first machine learning model have been adjusted by a training process, and the training process inputs the input data to the first machine learning model. a first process of outputting the output data corresponding to the input data as fake data; and inputting a plurality of data pairs including the first pair and the second pair to a second machine learning model. , a second process of outputting a plurality of identification data corresponding to the plurality of data pairs, wherein the first pair is a pair consisting of the input data and actual data corresponding to the input data. , the second pair is a pair of data consisting of the input data and the fake data corresponding to the input data, and the identification data is such that the corresponding data pair is the first pair of data. and the second pair, and the second machine learning model executes a calculation using a plurality of second calculation parameters to obtain the identification data. Using the second process to generate the identification data and the teacher data indicating the target value of the identification data, the plurality of second a fourth process of performing the dimension reduction process by the encoder on the fake data to generate second feature data; a fifth process of adjusting the plurality of first calculation parameters so that the difference between the identification data and the teacher data becomes large using and, without using the identification data and the teacher data, calculate the plurality of first calculation parameters so that the difference between the first feature data and the second feature data becomes small. and a sixth process for adjusting, and after training the first machine learning model by repeating the first process, the fourth process, and the sixth process multiple times, the first process to the sixth process are performed. The data generation device is a process of training the first machine learning model and the second machine learning model in parallel by repeating the fifth process a plurality of times.

上記構成によれば、第1の機械学習モデルは、第1の特徴データと第2の特徴データとを用いて、これらの特徴データの差分が小さくなるようにトレーニングされた後に、第2の機械学習モデルとを並行してさらにトレーニングされている。この結果、第1の機械学習モデルは、入力データの特徴が第1の特徴データに適切に反映されるように、効果的にトレーニングされている。従って、データ生成装置は、機械学習モデルを用いて、入力データの特徴が反映された適切な偽データを生成できる。
[適用例8]
適用例6または7に記載のデータ生成装置であって、
前記入力データは、第1の属性と第2の属性を有し、かつ、第3の属性を有しない画像データであり、
前記出力データは、前記第1の属性と前記第3の属性を有し、かつ、前記第2の属性を有しない画像データである、データ生成装置。
According to the above configuration, the first machine learning model is trained using the first feature data and the second feature data so that the difference between these feature data becomes small, and then the second machine learning model The learning model is further trained in parallel. As a result, the first machine learning model is effectively trained so that the features of the input data are appropriately reflected in the first feature data. Therefore, the data generation device can generate appropriate fake data that reflects the characteristics of the input data using the machine learning model.
[Application example 8]
The data generation device according to Application Example 6 or 7,
The input data is image data having a first attribute and a second attribute and not having a third attribute,
The output data is image data having the first attribute and the third attribute and not having the second attribute.

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

本実施例のデータ生成装置200の構成を示すブロック図である。FIG. 2 is a block diagram showing the configuration of a data generation device 200 of this embodiment. 画像生成処理のフローチャートである。It is a flowchart of image generation processing. 入力画像と出力画像との一例を示す図である。FIG. 3 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 the 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 the configuration of a training device 100 according to the present embodiment. 入力画像と実画像との一例を示す図である。FIG. 3 is a diagram showing an example of an input image and a real image. 本実施例のネットワークシステム1000の概念図である。FIG. 1 is a conceptual diagram of a network system 1000 according to the present embodiment. 識別ネットワークDNの構成を示すブロック図である。FIG. 2 is a block diagram showing the configuration of an identification network DN. トレーニング処理のフローチャートである。It is a flowchart of training processing. 事前処理のフローチャートである。It is a flowchart of pre-processing. メイン処理のフローチャートである。It is a flowchart of main processing.

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

データ生成装置200は、パーソナルコンピュータやスマートフォンなどの計算機である。データ生成装置200は、データ生成装置200のコントローラとしてのCPU210と、RAMなどの揮発性記憶装置220と、ハードディスクドライブやフラッシュメモリなどの不揮発性記憶装置230と、液晶ディスプレイなどの表示部240と、キーボードやマウスなどの操作部250と、通信インタフェース(IF)270と、を備えている。通信インタフェース270は、外部機器(例えば、プリンタ300)と接続するためのインタフェースである。通信インタフェース270は、例えば、プリンタ300が接続されたネットワークNWに接続するための有線または無線のインタフェースを含む。 The data generation device 200 is a computer such as a personal computer or a smartphone. The data generation device 200 includes a CPU 210 as a controller of the data generation device 200, a volatile storage device 220 such as a RAM, a nonvolatile storage device 230 such as a hard disk drive or a flash memory, and a display unit 240 such as a liquid crystal display. It includes an operation unit 250 such as a keyboard and a mouse, and a communication interface (IF) 270. Communication interface 270 is an interface for connecting to an external device (for example, printer 300). The communication interface 270 includes, for example, a wired or wireless interface for connecting to the 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 that temporarily stores various intermediate data generated when the CPU 210 performs processing. The nonvolatile storage device 230 stores a computer program PGg and an input data group IG including a plurality of input data IDs, which will be described later. The volatile storage device 220 and the nonvolatile storage device 230 are internal memories of the data generation device 200.

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

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

プリンタ300は、インクジェット方式や電子写真方式の印刷装置であり、印刷材としてのインクやトナーを用いて用紙などの印刷媒体上に画像を印刷する。 The printer 300 is an inkjet printing device or an electrophotographic printing device, and prints an image 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 process is started, for example, in the data generation 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 obtains one input data ID. This input data ID is, for example, one piece of data selected from the input data group IG stored in the nonvolatile storage device 230 based on the user's designation. 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」の文字を示す画像である。 FIG. 3 is a diagram showing an example of an input image and an output image. The input image II of this embodiment is an image showing specific characters in a first type of font. Input image II includes (H×W) pixels arranged in a matrix in the vertical and horizontal directions. H is the number of pixels in the vertical direction of the input image II, and W is the number of pixels in the horizontal direction of the input image II. In this example, H=W=256. For example, the input image IIa in FIG. 3A is an image showing the character "A" in the first type font. The input image IIb in FIG. 3B is an image showing the character "B" in the first type font.

本実施例では、入力データ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 a plurality of pixels, and specifically, RGB image data representing the color of each pixel using RGB values. The RGB value is a color value of the RGB color system including gradation values of three color components (hereinafter also referred to as component values), that is, an R value, a G value, and a B value. The R value, G value, and 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 indicating the output image OI, and is RGB image data like the input data ID. The output image OI of this embodiment is an image showing the same characters as the corresponding input image II in a second type font different from the first type font. For example, the output image OIa in FIG. 3A is an output image corresponding to the input image IIa, and is an image showing the character "A" in the second type font. The output image OIb in FIG. 3B is an output image corresponding to the input image IIb, and is an image showing the character "B" in the second type font. 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 uses the output data OD to generate print data indicating the output image OI, and sends it to the printer 300. The printer 300 prints the output image OI on a print medium using 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 Generation Network GN FIG. 4 is a block diagram showing the configuration of 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 performs dimension reduction processing on the input data ID using a plurality of calculation parameters Pe, and calculates the characteristics representing the characteristics of the input data ID (that is, the characteristics of the input image II). Generate a data CD. In this example, the input data ID includes three component values (R value, G value, B value) for each of (256 x 256) pixels, so it has (256 x 256 x 3) values. , that is, (256×256×3) dimensional data. In this embodiment, the feature data CD is data including (1×1×512) values, that is, 512-dimensional data. In this way, in the dimension reduction process, the number of dimensions of the input data ID is reduced.

図5は、エンコーダECの構成を示すブロック図である。エンコーダECは、入力層EL_0と、複数個の畳込層EL_1~畳込層EL_8を有するニューラルネットワークである。 FIG. 5 is a block diagram showing the configuration of encoder EC. The encoder EC is a neural network having an input layer EL_0 and a plurality of convolutional 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 into which input data ID is input. The input data ID input to the input layer EL_0 is input as is to the first convolutional layer EL_1. The convolutional layer EL_1 performs arithmetic processing, which will be 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 has (A k-1 ×B k- 1) generated by the (k-1)th convolutional layer EL_(k-1). Processed data of dimensions (A k-1 , B k-1 , C k-1 ) obtained by performing predetermined post-processing (described later) on data of dimensions × C k-1 is input. Ru. The convolutional layer EL_k performs arithmetic processing to be described later on the (A k-1 ×B k-1 ×C k-1 )-dimensional processed data to obtain (A k ×B k ×C k )-dimensional processed 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 arithmetic processing executed by each of the convolutional layers EL_1 to EL_8 includes a convolution process and a bias addition process. Convolution processing is a process in which s filters of (p x q x r) dimensions are sequentially applied to input data to calculate a correlation value indicating the correlation between the input data and the filters. be. In the process of applying each filter, a plurality of correlation values are sequentially calculated while sliding the filter. One filter includes (p×q×r) weights. The bias addition process is a process of adding one bias prepared 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 plurality of calculation parameters Pe described above, and the training Updated in processing.

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

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

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

畳込層EL_8によって生成されるデータに対して、上述した後処理を実行して得られる処理済データが、上述した特徴データCDである。 Processed data obtained by performing the above-described 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 example, the number of dimensions (A 1 ×B 1 ×C 1 ) to (A 8 ×B 8 ×C 8 ) of data generated by each convolutional layer EL_1 to EL_8 is as follows. be.
(A 1 ×B 1 ×C 1 )=(128×128×64)
(A 2 ×B 2 ×C 2 )=(64×64×128)
(A 3 ×B 3 ×C 3 )=(32×32×256)
(A 4 ×B 4 ×C 4 )=(16×16×512)
(A 5 × B 5 × C 5 ) = (8 × 8 × 512)
(A 6 ×B 6 ×C 6 )=(4×4×512)
(A 7 ×B 7 ×C 7 )=(2×2×512)
(A 8 ×B 8 ×C 8 )=(1×1×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 Decoder DC The decoder DC performs dimension restoration processing 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, that is, 512-dimensional data, as described above. In this embodiment, the output data OD, like the input data ID, is data including (256×256×3) values, that is, (256×256×3) dimensional data. In this embodiment, in the dimension restoration process of this embodiment, the number of dimensions of the feature data CD is restored in this way.

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

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

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 convolutional layer DL_m includes (D m-1 , E m Processed data of dimensions (D m -1 , E m-1 , F m-1 ) obtained by performing predetermined post-processing (described later) on data of dimensions (D m-1 , E m-1 , F m -1 ) is input. be done. Furthermore, the m-th transposed convolutional layer DL_m is obtained by performing the above-mentioned post-processing on the data generated by the (9-m)th convolutional layer EL_(9-m) of the encoder EC. (A 9-m , B 9-m , C 9-m )-dimensional processed data is input. For example, as shown in FIGS. 5 and 6, processed data based on the data generated by EL_7 of the encoder EC is input to the transposed convolution layer DL_2 of the decoder DC, and the transposed convolution layer DL_4 is inputted to the transposed convolution layer DL_2 of the encoder DC. Processed data based on data generated by EC EL_5 is input. Therefore, the m-th (m is an integer from 2 to 8) transposed convolutional layer DL_m has {(D m-1 , E m-1 , F m-1 )+(A 9-m , B 9- m , C 9-m )}-dimensional processed data is input. The transposed convolutional layer DL_m performs arithmetic processing, which will be described later, on the input processed data to generate (D m ×E m ×F m )-dimensional data (D m , E m , F m is a positive integer).

各転置畳込層DL_1~DL_8が実行する演算処理は、転置畳込処理(transposed convolution)とバイアスの加算処理とを含む。転置畳込処理は、入力されたデータに対して、ストライドに応じて適宜に値(例えばゼロの値)を追加して次元数を増加させた後に、上述した畳込処理と同様に(p×q×r)次元のフィルタを用いた畳み込み演算を行う処理である。バイアスの加算処理は、転置畳込演算で算出された相関値に、1個のフィルタに対して1個ずつ準備されたバイアスを加算する処理である。s個のフィルタに含まれる(p×q×r×s)個の重みと、s個のフィルタに対応するs個のバイアスと、は、上述した複数個の演算パラメータPdであり、後述するトレーニング処理において更新される。 The arithmetic processing executed by each transposed convolution layer DL_1 to DL_8 includes transposed convolution processing and bias addition processing. In the transposed convolution process, after increasing the number of dimensions by adding an appropriate value (for example, a value of zero) to the input data according to the stride, the transpose convolution process is performed in the same way as the convolution process described above. This is a process of performing a convolution operation using a q×r)-dimensional filter. The bias addition process is a process of adding one bias prepared for each filter 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 plurality of calculation parameters Pd described above, and the training Updated in processing.

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

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

転置畳込層DL_4~DL_7によって生成されるデータの各値は、上述した後処理として、上述したバッチノーマライゼーションによって変換され、その後に活性化関数に入力されて変換される。転置畳込層DL_4~DL_7の後処理では、トレーニング処理でも画像生成処理でもドロップアウトは行われない。 Each value of the data generated by the transposed convolutional layers DL_4 to DL_7 is 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 convolutional 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 (D 8 ×E 8 ×F 8 )-dimensional data generated by the transposed convolutional layer DL_8 is the above-mentioned output data OD. Therefore, the number of dimensions (D 8 ×E 8 ×F 8 ) of the data generated by the transposed convolutional 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 example, the number of dimensions (D 1 ×E 1 ×F 1 ) to (D 8 ×E 8 ×F 8 ) of data generated by each transposed convolution layer DL_1 to DL_8 is as follows. It is.
(D 1 ×E 1 ×F 1 )=(2×2×512)
(D 2 ×E 2 ×F 2 )=(4×4×512)
(D 3 ×E 3 ×F 3 )=(8×8×512)
(D 4 ×E 4 ×F 4 )=(16×16×512)
(D 5 ×E 5 ×F 5 )=(32×32×256)
(D 6 ×E 6 ×F 6 )=(64×64×128)
(D 7 ×E 7 ×F 7 )=(128×128×64)
(D 8 ×E 8 ×F 8 )=(256×256×3)

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

A-4-1.トレーニング装置の構成
図7は、本実施例の生成ネットワークGNのトレーニングを実行するトレーニング装置100の構成を示すブロック図である。
A-4-1. Configuration of Training Device FIG. 7 is a block diagram showing the configuration of the training device 100 that executes training of the generation 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 of 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, and a keyboard and the like. It includes an operation unit 150 such as a mouse, and a communication interface (IF) 170 for connecting to an external device (for example, a printer 300).

揮発性記憶装置120は、CPU110が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域を提供する。不揮発性記憶装置130には、コンピュータプログラムPGtと、トレーニング用の複数個の入力データIDを含む入力データ群IGと、複数個の実データRDを含む実データ群RGと、教師データLDと、が格納されている。揮発性記憶装置120や不揮発性記憶装置130は、トレーニング装置100の内部メモリである。 The volatile storage device 120 provides a buffer area that temporarily stores various intermediate data generated when the CPU 110 performs processing. The nonvolatile storage device 130 includes a computer program PGt, an input data group IG including a plurality of input data IDs for training, a real data group RG including a plurality of real data RD, and teacher data LD. Stored. The volatile storage device 120 and the nonvolatile storage 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 the form of being downloaded from a server operated by the manufacturer of the printer 300. Alternatively, the computer program PGt may be provided in a form stored on a DVD-ROM or the like. The CPU 110 executes a training process, which will be described later, by executing the computer program PGt.

トレーニング処理で用いられる入力データ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. As described above, the input image II indicated by the input data ID is an image showing specific characters in the first typeface (font). The actual data RD is RGB image data similar to the output data OD generated in the image generation process described above. The plurality of real data RD correspond one-to-one to each of the plurality of input data IDs included in the input data group IG. In this embodiment, the real image RI indicated by the real data RD is an image showing the same characters as the corresponding input image II in the second font.

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

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

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

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

識別ネットワーク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 referred to as 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 referred to as a false data pair Pf) consisting of input data ID and 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 generation network GN. In addition, in a generative adversarial network, the output data OD is also called "fake data OD." Here, the fake data OD that is generated by inputting the input data ID corresponding to the specific real data RD into the generation network GN is also referred to as the fake data OD that corresponds to the specific real data RD.

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

識別データDDは、本実施例では、(30×30×1)個の値を含む(30×30×1)次元のデータである。識別ネットワークDNは、実データペアPrが入力される場合には、入力されたデータペアが実データペアPrであることを示す識別データDDを出力し、偽データペアPfが入力される場合には、入力されたデータペアが偽データペアPfであることを示す識別データDDを出力するようにトレーニングされる。 In this embodiment, the identification data DD is (30×30×1)-dimensional data including (30×30×1) values. When the real data pair Pr is input, the identification network DN outputs identification data DD indicating that the input data pair is the real data pair Pr, and when the fake data pair Pf is input, the identification network DN outputs identification data DD indicating that the input data pair is the real data pair Pr. , is trained to output identification data DD indicating that the input data pair is a 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 (FIG. 7) are prepared: teacher data LDr corresponding to the real data pair Pr and teacher data LDf corresponding to the false data pair Pf. The teacher data LDr is data indicating that the input data pair is a real data pair Pr, and is dimensional data (30×30×1) in which all values are “1”. The teacher data LDf is data indicating that the input data pair is a false data pair Pf, and is dimensional data (30×30×1) 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 to one dimension in the identification network DN, the image represented by the input real data or fake data is changed to show global characteristics. Information may be lost. In this case, there is a possibility that the training of the identification network DN will not progress. Furthermore, when the identification data DD is one-dimensional data, the number of layers of the identification network DN and, by extension, the number of calculation parameters becomes excessively large, and the time required for training becomes excessively long. In this embodiment, by setting the identification data DD to (30 x 30 x 1) dimensional data, it is possible to suppress the loss of information for identifying the authenticity of input data pairs, and to quickly training can be achieved.

図10は、識別ネットワークDNの構成を示すブロック図である。識別ネットワークDNは、入力層L_0と、複数個の畳込層L_1~畳込層L_5を有するニューラルネットワークである。 FIG. 10 is a block diagram showing the configuration of identification network DN. The identification network DN is a neural network having an input layer L_0 and a plurality of convolutional 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 into 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 making up the data pair is (256x256x3), and the number of dimensions of the real data RD or fake data OD making up the data pair is (256x256x3). Therefore, the number of dimensions of the data pair is (256×256×6). The convolution layer L_1 performs arithmetic processing, which will be 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 and 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 has (G n-1 ×H n- 1) generated by the (n-1)th convolutional layer L_(n-1). Processed data of dimensions (G n -1 , H n-1 , I n-1 ) obtained by performing predetermined post-processing (described later) on data of dimensions ×I n-1 is input. Ru. The convolutional layer L_n executes the arithmetic processing described later on the (G n-1 ×H n-1 ×I n-1 )-dimensional processed data to obtain (G n ×H n ×I n )-dimensional processed data. (G n , H n , I n are positive integers).

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

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

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

畳込層L_5によって生成される(G×H×I)次元のデータが、上述した識別データDDである。したがって、畳込層L_5によって生成されるデータの次元数(G×H×I)は、識別データDDの次元数(30×30×1)と等しい。 The (G 5 ×H 5 ×I 5 )-dimensional data generated by the convolutional layer L_5 is the above-mentioned identification data DD. Therefore, the number of dimensions (G 5 ×H 5 ×I 5 ) 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 example, the number of dimensions (G 1 ×H 1 ×I 1 ) to (G 5 ×H 5 ×I 5 ) of data generated by each convolutional layer L_1 to L_8 is as follows. be.
(G 1 ×H 1 ×I 1 )=(128×128×64)
(G 2 × H 2 × I 2 ) = (64 × 64 × 128)
(G 3 × H 3 × I 3 ) = (32 × 32 × 256)
(G 4 × H 4 × I 4 ) = (31 × 31 × 512)
(G 5 × H 5 × I 5 ) = (30 × 30 × 1)

本実施例では、識別ネットワークDNおよび生成ネットワークGNをトレーニングするために、識別データDDと教師データLDとの間の誤差値Eganが用いられる。誤差Eganは、本実施例では、シグモイドクロスエントロピー誤差が用いられる。例えば、Eganは、以下の式(1)を用いて算出される。誤差値Eganは、識別データDDが、対応する教師データLDに近づくほど大きくなる。換言すれば、誤差値Eganは、識別データDDと、対応する教師データLDと、の差分が小さくなるほど大きくなる。 In this embodiment, the error value Egan between the identification data DD and the teacher data LD is used to train the identification network DN and the generation network GN. In this embodiment, a sigmoid cross entropy error is used as the error Egan. For example, Egan is calculated using the following equation (1). The error value Egan increases as the identification data DD approaches the corresponding teacher data LD. In other words, the error value Egan becomes larger as the difference between the identification data DD and the corresponding teacher data LD becomes smaller.

Figure 0007423905000001
Figure 0007423905000001

ここで、pは、識別データDDおよび教師データLDの次元数(本実施例では、p=(30×30×1))である。aは、識別データDDの各値をシグモイド関数に入力して正規化した値であり、tは、値aに対応する教師データLDの各値(上述したように0または1)である。 Here, p is the number of dimensions of the identification data DD and the teacher data LD (in this embodiment, p=(30×30×1)). a i is a value obtained by normalizing each value of the identification data DD by inputting it into a sigmoid function, and t i is each value (0 or 1 as described above) of the teacher data LD corresponding to the value a i . be.

本実施例では、生成ネットワークGNをトレーニングするために、誤差値Eganに加えて、2種類の誤差値E1と、E2とが用いられる。誤差値E1は、上述した入力データIDの特徴データCDと、該入力データIDに対応する偽データODの特徴データCDfと、の間の誤差を示す。偽データODの特徴データCDfは、入力データIDを生成ネットワークGNに入力することによって生成された偽データODを、生成ネットワークGNのエンコーダECに入力することによって、生成されるデータである。すなわち、特徴データCDを生成する際に入力データIDに対して実行される演算と同じ演算を偽データODに対して実行することによって、特徴データCDfが生成される。誤差値E1には、平均二乗誤差(MSE(Mean Squared Error))が用いられる。例えば、誤差値E1は、以下の式(2)を用いて算出される。 In this embodiment, in addition to the error value Egan, two types of error values E1 and E2 are used to train the generation network GN. The error value E1 indicates the error between the feature data CD of the input data ID described above and the feature data CDf of the false data OD corresponding to the input data ID. The feature data CDf of the fake data OD is data generated by inputting the fake data OD generated by inputting the input data ID into the generation network GN to the encoder EC of the generation network GN. That is, the feature data CDf is generated by performing the same operation on the fake data OD as the operation performed on the input data ID when generating the feature data CD. A mean squared error (MSE) is used for the error value E1. For example, the error value E1 is calculated using the following equation (2).

Figure 0007423905000002
Figure 0007423905000002

ここで、qは、特徴データCD、CDfの次元数(本実施例では、q=(1×1×512))である。bは、特徴データCDの各値であり、cは、値bに対応する特徴データCDfの各値である。誤差値E1は、特徴データCDfが特徴データCDに近いほど小さくなる。換言すれば、誤差値E1は、特徴データCDfと特徴データCDとの差分が小さくなるほど小さくなる。 Here, q is the number of dimensions of the feature data CD and CDf (in this embodiment, q=(1×1×512)). b i is each value of the feature data CD, and c i is each value of the feature data CDf corresponding to the value b i . The error value E1 becomes smaller as the feature data CDf is closer to the feature data CD. In other words, the error value E1 becomes smaller as the difference between the feature data CDf and the feature data CD becomes smaller.

誤差値E2は、実データRDと、実データRDに対応する偽データODと、の間の誤差を示す。誤差値E2には、例えば、平均絶対誤差(MAE(Mean Absolute Error))が用いられる。例えば、誤差値E2は、以下の式(3)を用いて算出される。 The error value E2 indicates the error between the real data RD and the false data OD corresponding to the real data RD. For example, a mean absolute error (MAE) is used as the error value E2. For example, the error value E2 is calculated using the following equation (3).

Figure 0007423905000003
Figure 0007423905000003

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

識別ネットワークDNは、誤差値Eganが大きくなるようにトレーニングされる。換言すれば、識別ネットワークDNは、入力されたデータペアの真偽を正しく識別することを目的としてトレーニングされる。 The discrimination network DN is trained such that the error value Egan becomes large. In other words, the identification network DN is trained for the purpose of correctly identifying the authenticity of input data pairs.

生成ネットワークGNは、誤差値Eganが小さくなるようにトレーニングされる。同時に、生成ネットワークGNは、誤差値E1、E2が小さくなるようにトレーニングされる。換言すれば、生成ネットワークGNは、識別ネットワークDNによって、偽データペアPfが実データペアPrであると誤って識別されること、および、特徴データCDfと特徴データCDとが近づくこと、および、偽データODが実データRDに近づくことを目的としてトレーニングされる。 The generation network GN is trained so that the error value Egan is small. At the same time, the generation network GN is trained such that the error values E1, E2 are small. In other words, the generation network GN recognizes that the false data pair Pf is incorrectly identified as the real data pair Pr by the identification network DN, that the feature data CDf and the feature data CD approach each other, and that the false data pair Pf is incorrectly identified as the real data pair Pr. The purpose of training is to make the data OD closer to the real data RD.

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

図11は、トレーニング処理のフローチャートである。S100では、CPU110は、事前処理を実行する。事前処理は、識別ネットワークDNを用いることなく、生成ネットワークGNのみを用いて、生成ネットワークGNの複数個の演算パラメータPe、Pdを調整する処理である。GANsでは、生成ネットワークGNのタスク(画像データの生成)が識別ネットワークDNのタスク(画像データの識別)よりも重い。このために、生成ネットワークGNを事前にある程度トレーニングしておくことが好ましいためである。 FIG. 11 is a flowchart of the training process. In S100, CPU 110 executes pre-processing. The preprocessing is a process of adjusting a plurality of calculation parameters Pe and Pd of the generation network GN using only the generation network GN without using the identification network DN. In GANs, the task of the generation network GN (generating image data) is heavier than the task of the identification network DN (identifying image data). For this reason, it is preferable to train the generation network GN to some extent in advance.

S200では、CPU210は、メイン処理を実行する。メイン処理は、識別ネットワークDNと生成ネットワークGNとを用いて、識別ネットワークDNの複数個の演算パラメータPdnと、生成ネットワークGNの複数個の演算パラメータPe、Pdと、を調整する処理である。メイン処理が完了すると、生成ネットワークGNのトレーニングは完了し、生成ネットワークGNの学習済みモデルが完成する。 In S200, CPU 210 executes main processing. The main process is a process of adjusting a plurality of calculation parameters Pdn of the identification network DN and a plurality of calculation parameters Pe and Pd of the generation network GN using the identification network DN and the generation network GN. When the main processing is completed, the training of the generation network GN is completed, and the trained model of the generation network GN is completed.

A-4-3-1.事前処理
図12は、事前処理のフローチャートである。S110では、生成ネットワークGNの複数個の演算パラメータPe、Pdと、識別ネットワークDNの複数個の演算パラメータPdnと、を初期化する。例えば、これらの演算パラメータPe、Pd、Pdnの初期値は、同一の分布(例えば、正規分布)から独立に取得された乱数に設定される。
A-4-3-1. Pre-processing FIG. 12 is a flowchart of pre-processing. In S110, a plurality of calculation parameters Pe and Pd of the generation network GN and a plurality of calculation parameters Pdn of the identification network DN are initialized. For example, the initial values of these calculation parameters Pe, Pd, and Pdn are set to random numbers independently obtained from the same distribution (eg, normal distribution).

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

S130では、CPU210は、選択されたV個の実データペアPrに含まれるV個の入力データIDをそれぞれ、生成ネットワークGNのエンコーダECに入力して、V個の入力データIDの特徴データCDを生成する。 In S130, the CPU 210 inputs the V input data IDs included in the V selected real data pairs Pr to the encoder EC of the generation network GN, and obtains the feature data CD of the V input data IDs. generate.

S140では、CPU210は、V個の特徴データCDをそれぞれ、生成ネットワークGNのデコーダDCに入力して、V個の実データRDおよび入力データIDに対応するV個の偽データODを生成する。 In S140, the CPU 210 inputs the V feature data CD to the decoder DC of the generation network GN to generate V real data RD and V false data OD corresponding to the input data ID.

S150では、CPU210は、V個の実データRDのそれぞれについて、実データRDと、該実データRDに対応する偽データODと、の間の誤差値E2を算出する。 In S150, the CPU 210 calculates, for each of the V pieces of real data RD, an error value E2 between the real data RD and the fake data OD corresponding to the real data RD.

S160では、CPU210は、V個の偽データODのそれぞれを、生成ネットワークGNのエンコーダECに入力して、V個の偽データODの特徴データCDfを生成する。 In S160, the CPU 210 inputs each of the V pieces of fake data OD to the encoder EC of the generation network GN to generate feature data CDf of the V pieces of fake data OD.

S170では、CPU210は、V個の入力データIDの特徴データCDのそれぞれについて、特徴データCDと、対応する特徴データCDfと、の間の誤差値E1を算出する。 In S170, the CPU 210 calculates the error value E1 between the feature data CD and the corresponding feature data CDf for each of the feature data CD of the V input data IDs.

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

Figure 0007423905000004
Figure 0007423905000004

ここで、L1は、V個の誤差値E1の平均値であり、L2は、V個の誤差値E2の平均値であり、αは、所定の係数である。 Here, L1 is an average value of V error values E1, L2 is an average value of V error values E2, and α is a predetermined coefficient.

S190では、CPU210は、トレーニングが完了したか否かを判断する。本実施例では、作業者からの完了指示が入力された場合にはトレーニングが完了したと判断し、トレーニングの継続指示が入力された場合にはトレーニングが完了していないと判断する。例えば、CPU210は、トレーニング用に用いられた入力データIDとは別の複数個のテスト用の入力データIDを、生成ネットワークGNに入力して、複数個の偽データODを生成する。CPU210は、生成された偽データODによって示される画像を表示部240に表示する。作業者は、表示された画像を確認して、事前処理の段階の画像として十分な画像(例えば、ある程度の文字が認識できる画像)が生成されているか否かを確認し、確認結果に応じて、操作部250を介して、トレーニングの完了指示または継続指示を入力する。変形例では、例えば、S120~S180の処理が所定回数だけ繰り返された場合に、トレーニングが完了されたと判断されても良い。 In S190, CPU 210 determines whether training has been completed. In this embodiment, if a completion instruction is input from the worker, it is determined that the training has been completed, and if an instruction to continue training is input, it is determined that the training is not completed. For example, the CPU 210 inputs a plurality of test input data IDs different from the input data ID used for training to the generation network GN, and generates a plurality of false data OD. The CPU 210 displays the image indicated by the generated fake data OD on the display unit 240. The worker checks the displayed image to see if a sufficient image has been generated for the pre-processing stage (for example, an image in which some characters can be recognized), and then , an instruction to complete or continue training is input via the operation unit 250. In a modified example, for example, it may be determined that training is completed when the processes of S120 to S180 are repeated a predetermined number of times.

トレーニングが完了していないと判断される場合には(S190:NO)、CPU210は、S120に処理を戻す。トレーニングが完了したと判断される場合には(S190:YES)、CPU210は、事前処理を終了する。 If it is determined that the training has not been completed (S190: NO), the CPU 210 returns the process to S120. If it is determined that the training has been completed (S190: YES), the CPU 210 ends the pre-processing.

A-4-3-2.メイン処理
図13は、メイン処理のフローチャートである。S205では、図12のS120と同様に、CPU210は、不揮発性記憶装置230に格納された複数個の実データペアPrから、バッチサイズ分の実データペアPr、例えば、V個の実データペアPrを選択する。なお、メイン処理のバッチサイズ、すなわち、本ステップで選択される実データペアPrの個数は、事前処理のバッチサイズとは異なっていても良い。
A-4-3-2. Main Processing FIG. 13 is a flowchart of the main processing. In S205, similar to S120 in FIG. 12, the CPU 210 extracts real data pairs Pr for the batch size, for example, V real data pairs Pr from the plurality of real data pairs Pr stored in the nonvolatile storage device 230. Select. Note that the batch size of the main process, that is, the number of real data pairs Pr selected in this step, may be different from the batch size of the pre-process.

S210では、図12のS130と同様に、CPU210は、選択されたV個の実データペアPrに含まれるV個の入力データIDをそれぞれ、生成ネットワークGNのエンコーダECに入力して、V個の入力データIDの特徴データCDを生成する。 In S210, similarly to S130 in FIG. 12, the CPU 210 inputs each of the V input data IDs included in the selected V real data pairs Pr to the encoder EC of the generation network GN. Generate feature data CD of input data ID.

S215では、図12のS140と同様に、CPU210は、V個の特徴データCDをそれぞれ、生成ネットワークGNのデコーダDCに入力して、V個の実データRDおよび入力データIDに対応するV個の偽データODを生成する。 In S215, similarly to S140 in FIG. 12, the CPU 210 inputs the V feature data CD to the decoder DC of the generation network GN, and inputs the V feature data CD corresponding to the V real data RD and the input data ID. Generate fake data OD.

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

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

S230では、CPU210は、S220にて実データペアPrについて生成されたV個の識別データDDと、S225にて偽データペアPfについて生成されたV個の識別データDDと、のそれぞれについて、識別データDDと教師データLDとの間の誤差値Eganを算出する。 In S230, the CPU 210 generates identification data for each of the V identification data DD generated for the real data pair Pr in S220 and the V identification data DD generated for the fake data pair Pf in S225. An error value Egan between DD and teacher data LD is calculated.

S235では、CPU210は、算出された(2×V)個の誤差値Eganを用いて、識別ネットワークDNの複数個の演算パラメータPdnを調整する。具体的には、CPU210は、以下の式(5)に示す損失関数Lganを用いて指標値を算出する。CPU210は、損失関数Lganを用いて算出される指標値が大きくなるように、所定のアルゴリズムに従って演算パラメータPdnを調整する。所定のアルゴリズムには、例えば、誤差逆伝播法と勾配降下法とを用いたアルゴリズムが用いられる。 In S235, the CPU 210 uses the calculated (2×V) error values Egan to adjust the plurality of calculation parameters Pdn of the identification network DN. Specifically, the CPU 210 calculates the index value using a loss function Lgan shown in equation (5) below. The CPU 210 adjusts the calculation parameter Pdn according to a predetermined algorithm so that the index value calculated using the loss function Lgan becomes large. As the predetermined algorithm, for example, an algorithm using error backpropagation and gradient descent is used.

Figure 0007423905000005
Figure 0007423905000005

式(5)に示すように、損失関数Lganは、(2×V)個の誤差値Eganの平均値を示す関数である。 As shown in equation (5), the loss function Lgan is a function that indicates the average value of (2×V) error values Egan.

S240では、図12のS150と同様に、CPU210は、V個の実データRDのそれぞれについて、実データRDと、該実データRDに対応する偽データODと、の間の誤差値E2を算出する。 In S240, similarly to S150 in FIG. 12, the CPU 210 calculates, for each of the V pieces of real data RD, an error value E2 between the real data RD and the false data OD corresponding to the real data RD. .

S245では、図12のS160と同様に、CPU210は、V個の偽データODのそれぞれを、生成ネットワークGNのエンコーダECに入力して、V個の偽データODの特徴データCDfを生成する。 In S245, similarly to S160 in FIG. 12, the CPU 210 inputs each of the V pieces of fake data OD to the encoder EC of the generation network GN to generate feature data CDf of the V pieces of fake data OD.

S250では、図12のS170と同様に、CPU210は、V個の入力データIDの特徴データCDのそれぞれについて、特徴データCDと、対応する特徴データCDfと、の間の誤差値E1を算出する。 In S250, similarly to S170 in FIG. 12, the CPU 210 calculates the error value E1 between the feature data CD and the corresponding feature data CDf for each of the feature data CD of the V input data IDs.

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

Figure 0007423905000006
Figure 0007423905000006

ここで、上述したように、Lganは(2×V)個の誤差値Eganの平均値であり、L1はV個の誤差値E1の平均値であり、L2はV個の誤差値E2の平均値である。β、γは、所定の係数である。 Here, as described above, Lgan is the average value of (2×V) error values Egan, L1 is the average value of V error values E1, and L2 is the average value of V error values E2. It is a value. β and γ are predetermined coefficients.

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

トレーニングが完了していないと判断される場合には(S260:NO)、CPU210は、S205に処理を戻す。トレーニングが完了したと判断される場合には(S260:YES)、CPU210は、トレーニング処理を終了する。以上説明したトレーニング処理が終了した時点で、生成ネットワークGNは、演算パラメータPe、Pdが調整された学習済みモデルになっている。したがって、トレーニング処理は、学習済みモデルを生成(製造)する処理である、と言うことができる。 If it is determined that the training has not been completed (S260: NO), the CPU 210 returns the process to S205. If it is determined that the training has been completed (S260: YES), the CPU 210 ends the training process. At the time when the training process described above is completed, the generation network GN has become a learned 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)のメイン処理(図13)は、入力データIDを生成ネットワークGNに入力することによって入力データIDに対応する偽データODを出力させる第1工程(図13のS210、S215)と、実データペアPrと偽データペアPfとを含む複数個のデータペアを識別ネットワークDNに入力して、複数個のデータペアに対応する複数個の識別データDDを出力させる第2工程(図13のS220、S225)と、識別データDDと教師データLDとを用いて、識別データDDと教師データLDとの差分が小さくなるように(本実施例では、誤差値Eganが大きくなるように)、識別ネットワークDNの複数個の演算パラメータPdnを調整する第3工程(図13のS230、S235)と、を備える。 According to the present embodiment described above, the main process (FIG. 13) of the training process (FIG. 11) is to output the fake data OD corresponding to the input data ID by inputting the input data ID to the generation network GN. 1 step (S210, S215 in FIG. 13), a plurality of data pairs including a real data pair Pr and a fake data pair Pf are input to the identification network DN, and a plurality of identifications corresponding to the plurality of data pairs are The second step of outputting the data DD (S220, S225 in FIG. 13) and the identification data DD and the teacher data LD are used to reduce the difference between the identification data DD and the teacher data LD (in this embodiment, , a third step (S230, S235 in FIG. 13) of adjusting a plurality of calculation parameters Pdn of the identification network DN (so that the error value Egan becomes large).

さらに、メイン処理は、偽データODに対して、エンコーダECによる次元削減処理を実行して特徴データCDfを生成する第4工程(図13のS245)と、識別データDDと教師データLDと特徴データCDと特徴データCDfとを用いて、識別データDDと教師データLDとの差分が大きくなり(本実施例では、誤差値Eganが小さくなり)、かつ、特徴データCDと特徴データCDfとの差分が小さくなるように(本実施例では誤差値E1が小さくなるように)、生成ネットワークGNの複数個の演算パラメータPe、Pdを調整する第5工程(図13のS250、S255)と、を備える。 Furthermore, the main process includes a fourth step (S245 in FIG. 13) of performing dimension reduction processing using the encoder EC on the fake data OD to generate feature data CDf, and identifying data DD, teacher data LD, and feature data. By using CD and the feature data CDf, the difference between the identification data DD and the teacher data LD becomes large (in this example, the error value Egan becomes small), and the difference between the feature data CD and the feature data CDf becomes large. A fifth step (S250, S255 in FIG. 13) of adjusting a plurality of calculation parameters Pe, Pd of the generation network GN so that the error value E1 becomes smaller (in this embodiment, the error value E1 becomes smaller) is provided.

メイン処理では、第1工程~第5工程を複数回繰り返す(図13のS260)ことによって、生成ネットワークGNと識別ネットワークDNとを並行してトレーニングする。このメイン処理によれば、生成ネットワークGNの複数個の演算パラメータPe、Pdは、識別データDDと教師データLDとの差分が大きくなるように調整されるだけでなく、特徴データCD、CDfとを用いて、これらの特徴データCD、CDf間の差分が小さくなるように調整される。この結果、入力データIDの特徴が特徴データCDに適切に反映されるように、演算パラメータPe、Pdを調整できる。従って、上記トレーニング処理を用いてトレーニングされた生成ネットワークGNを用いれば、入力データIDの特徴が反映された適切な偽データODを生成できる。 In the main process, the generation network GN and the discrimination network DN are trained in parallel by repeating the first to fifth steps multiple times (S260 in FIG. 13). According to this main processing, the plurality of calculation parameters Pe and Pd of the generation network GN are not only adjusted so that the difference between the identification data DD and the teacher data LD becomes large, but also are adjusted to increase the difference between the identification data DD and the teacher data LD. is used to adjust the difference between these feature data CD and CDf to be small. As a result, the calculation parameters Pe and Pd can be adjusted so that the characteristics of the input data ID are appropriately reflected in the characteristic data CD. Therefore, by using the generation network GN trained using the above training process, it is possible to generate appropriate fake data OD that reflects the characteristics of the input data ID.

例えば、エンコーダECが入力データIDの特徴(例えば、入力画像IIに示される文字の書体に依存しない本質的な特徴)を、特徴データの空間(潜在空間(latent space)とも呼ぶ)に適切にマッピングできており、デコーダDCによって、その特徴が適切に偽データODに再現されているとする。この場合には、特徴データCDと特徴データCDfとの差分は十分に小さくなると考えられる。このために、特徴データCDと特徴データCDfとの差分が小さくなるように、生成ネットワークGNをトレーニングすることで、エンコーダECが潜在空間に入力データIDの特徴をマッピングする精度を向上できるとともに、デコーダDCがその特徴を偽データODに再現する精度を向上することができる。換言すれば、例えば、入力データIDの特定の属性(例えば、表現すべき文字の種類)を保持しつつ、変換すべき別の属性(例えば、書体)を変換できるように、生成ネットワークGNをトレーニングすることができる。また、限られた入力データIDだけでなく、多様な入力データID(例えば、様々な文字を示す入力データID)に対応して、変換すべき属性(例えば、書体)を変換した偽データODを生成できるように、生成ネットワークGNをトレーニングできる(多様性の確保)。さらには、エンコーダECが潜在空間に誤ったマッピングを行う方向にトレーニングが進むことを抑制できるので、生成ネットワークGNのトレーニングを安定させることができる。 For example, the encoder EC appropriately maps the features of the input data ID (for example, the essential features independent of the font of the characters shown in the input image II) into the space of feature data (also called latent space). It is assumed that the characteristics are appropriately reproduced in the fake data OD by the decoder DC. In this case, the difference between the feature data CD and the feature data CDf is considered to be sufficiently small. For this purpose, by training the generation network GN so that the difference between the feature data CD and the feature data CDf becomes small, the accuracy with which the encoder EC maps the features of the input data ID in the latent space can be improved, and the decoder The accuracy with which the DC reproduces its features in the fake data OD can be improved. In other words, for example, the generation network GN is trained so that a specific attribute of the input data ID (for example, the type of character to be expressed) can be maintained while converting another attribute to be converted (for example, the typeface). can do. In addition, we can create fake data OD with converted attributes (for example, font) in response to not only limited input data IDs but also various input data IDs (for example, input data IDs indicating various characters). The generation network GN can be trained to generate (ensure diversity). Furthermore, since it is possible to prevent the training from progressing in a direction in which the encoder EC performs incorrect mapping in the latent space, it is possible to stabilize the training of the generation network GN.

さらに、本実施例のメイン処理では、上述した第5工程において、さらに、一の入力データに対応する実データRDおよび偽データODを用いて、実データRDと偽データODとの差分が小さくなるように(本実施例では、誤差値E2が小さくなるように)、生成ネットワークGNの複数個の演算パラメータPe、Pdを調整する(図13のS240、S255)。この結果、所望の偽データODが生成されるように、生成ネットワークGNをトレーニングできる。換言すれば、実データRDと偽データODとの差分が小さくなるように生成ネットワークGNをトレーニングすることで、生成ネットワークGNは、単に識別ネットワークDNが真偽の識別を誤るような偽データODを生成するだけでなく、実データRDに近い偽データODを生成するようにトレーニングされる。例えば、本実施例では、偽データODにおいて、実データRDで表現された書体が適切に再現されるように、生成ネットワークGNをトレーニングできる。 Furthermore, in the main processing of this embodiment, in the fifth step mentioned above, the difference between the real data RD and the fake data OD is further reduced by using the real data RD and the fake data OD corresponding to one input data. (in this embodiment, the plurality of calculation parameters Pe and Pd of the generation network GN are adjusted so that the error value E2 becomes small) (S240 and S255 in FIG. 13). As a result, the generation network GN can be trained to generate the desired false data OD. In other words, by training the generation network GN so that the difference between the real data RD and the false data OD becomes small, the generation network GN simply generates false data OD that would cause the identification network DN to misidentify the truth. It is trained not only to generate, but also to generate false data OD that is close to the real data RD. For example, in this embodiment, the generation network GN can be trained so that the typeface expressed in the real data RD is appropriately reproduced in the fake data OD.

また、本実施例の事前処理(図12)は、メイン処理(図13)と同様に、入力データIDを生成ネットワークGNに入力することによって入力データIDに対応する偽データODを出力させる第1工程(図12のS130、S140)と、偽データODに対して、エンコーダECによる次元削減処理を実行して特徴データCDfを生成する第4工程(図12のS160)と、を備える。事前処理は、さらに、特徴データCDと特徴データCDfとを用いて、識別データDDと教師データLDとを用いずに、特徴データCDと特徴データCDfとの差分が小さくなるように(本実施例では誤差値E1が小さくなるように)、生成ネットワークGNの複数個の演算パラメータPe、Pdを調整する第6工程(図12のS180)を備える。そして、事前処理では、第1工程と第4工程と第6工程とを複数回繰り返す(図12のS190)ことによって、生成ネットワークGNをトレーニングする。事前処理の後に、上述したメイン処理が実行される(図11)。このように、特徴データCD、CDfの差分が小さくなるように、生成ネットワークGNをトレーニングした後に、生成ネットワークGNと識別ネットワークDNとを並行してトレーニングする。この結果、事前処理において、エンコーダECが潜在空間に入力データIDの特徴をマッピングする精度をある程度保証することができる。したがって、入力データIDの特徴が第1の特徴データに適切に反映されるように、生成ネットワークGNを効果的にトレーニングできるので、上記トレーニング処理を用いてトレーニングされた生成ネットワークGNを用いれば、入力データIDの特徴が反映された適切な偽データODを生成できる。 Further, in the pre-processing (FIG. 12) of this embodiment, similarly to the main processing (FIG. 13), the first process outputs the fake data OD corresponding to the input data ID by inputting the input data ID to the generation network GN. (S130, S140 in FIG. 12), and a fourth step (S160 in FIG. 12) of performing dimension reduction processing by the encoder EC on the fake data OD to generate feature data CDf. The preprocessing is further performed using the feature data CD and the feature data CDf, without using the identification data DD and the teacher data LD, so that the difference between the feature data CD and the feature data CDf becomes small (this embodiment A sixth step (S180 in FIG. 12) of adjusting a plurality of calculation parameters Pe and Pd of the generation network GN so that the error value E1 becomes smaller) is provided. In the pre-processing, the first step, the fourth step, and the sixth step are repeated multiple times (S190 in FIG. 12) to train the generation network GN. After the pre-processing, the main processing described above is executed (FIG. 11). In this way, after training the generation network GN so that the difference between the feature data CD and CDf becomes small, the generation network GN and the discrimination network DN are trained in parallel. As a result, in the pre-processing, the accuracy with which the encoder EC maps the features of the input data ID onto the latent space can be guaranteed to some extent. Therefore, the generation network GN can be effectively trained so that the features of the input data ID are appropriately reflected in the first feature data, so if the generation network GN trained using the above training process is used, the input Appropriate fake data OD that reflects the characteristics of data ID can be generated.

ここで、上述したように、GANsでは、生成ネットワークGNのタスク(画像データの生成)が識別ネットワークDNのタスク(画像データの識別)よりも重い。メイン処理において、生成ネットワークGNのトレーニングは、識別ネットワークDNのトレーニングに対して遅れがちである。仮に、事前処理を実行しない場合には、メイン処理において、生成ネットワークGNのトレーニングが識別ネットワークDNのトレーニングに対して過度に遅れる可能性がある。この場合には、生成ネットワークGNの複数個の演算パラメータPe、Pdを調整する際に、勾配の消失が発生して生成ネットワークGNのトレーニングが進まなくなる場合がある。本実施例によれば、事前処理において、特徴データCDと特徴データCDfとの差分が小さくなるように、生成ネットワークGNの複数個の演算パラメータPe、Pdが調整されるので、このような不都合の発生を抑制できる。したがって、本実施例によれば、トレーニングの安定化およびトレーニング時間の短縮を実現できる。 Here, as described above, in GANs, the task of the generation network GN (generation of image data) is heavier than the task of the identification network DN (identification of image data). In the main process, the training of the generation network GN tends to lag behind the training of the discrimination network DN. If pre-processing is not performed, there is a possibility that training of the generation network GN will be excessively delayed with respect to training of the identification network DN in the main processing. In this case, when adjusting the plurality of calculation parameters Pe and Pd of the generation network GN, the gradient may disappear and the training of the generation network GN may not progress. According to this embodiment, in the pre-processing, a plurality of calculation parameters Pe and Pd of the generation network GN are adjusted so that the difference between the feature data CD and the feature data CDf becomes small, so that such inconveniences can be avoided. The occurrence can be suppressed. Therefore, according to this embodiment, it is possible to stabilize training and shorten training time.

さらに、本実施例の事前処理では、第6工程において、さらに、一の入力データに対応する実データRDおよび偽データODを用いて、実データRDと偽データODとの差分が小さくなるように(本実施例では、誤差値E2が小さくなるように)、生成ネットワークGNの複数個の演算パラメータPe、Pdを調整する(図12のS150、S180)。この結果、メイン処理の前に、所望の偽データODが生成されるように、生成ネットワークGNの複数個の演算パラメータPe、Pdをできる。この結果、所望の偽データODが生成されるように、生成ネットワークGNを効率良くトレーニングできる。また、生成ネットワークGNのトレーニングの進み具合が識別ネットワークDNのトレーニングの進み具合よりも遅れる不都合を、さらに抑制できる。 Furthermore, in the pre-processing of this embodiment, in the sixth step, the real data RD and fake data OD corresponding to one input data are further used to reduce the difference between the real data RD and the fake data OD. A plurality of calculation parameters Pe and Pd of the generation network GN are adjusted (in this embodiment, so that the error value E2 is small) (S150 and S180 in FIG. 12). As a result, a plurality of calculation parameters Pe and Pd of the generation network GN can be adjusted before the main processing so that the desired false data OD is generated. As a result, the generation network GN can be efficiently trained to generate the desired false data OD. Further, it is possible to further suppress the inconvenience that the training progress of the generation network GN lags behind the training progress of the identification network DN.

さらに、本実施例では、入力データIDは、第1の属性(例えば、「A」の文字であるという属性)と第2の属性(例えば、第1の書体であるという属性)を有し、かつ、第3の属性(例えば、第2の書体であるという属性)を有しない画像データである。そして、出力データ(偽データ)ODは、第1の属性と第3の属性を有し、かつ、第2の属性を有しない画像データである。したがって、本実施例によれば、学習済みの生成ネットワークGNは、入力データIDの第1の属性を維持しつつ、入力データIDの第2の属性を第3の属性に変換することによって出力データ(偽データ)ODを生成することができる。 Furthermore, in this embodiment, the input data ID has a first attribute (for example, an attribute that is the character "A") and a second attribute (for example, an attribute that is a first font), In addition, it is image data that does not have the third attribute (for example, the attribute that it is the second font). The output data (false data) OD is image data that has the first attribute and the third attribute, but does not have the second attribute. Therefore, according to this embodiment, the trained generation network GN converts the second attribute of the input data ID into the third attribute while maintaining the first attribute of the input data ID, thereby generating the output data. (Fake data) OD can be generated.

さらに、本実施例のトレーニング装置100(図1)、および、学習済みの生成ネットワークGNによれば、生成ネットワークGNは、上述したトレーニング処理によってトレーニングされているので、入力データIDの特徴が反映された適切な偽データODを生成できる。また、限られた入力データIDだけでなく、多様な入力データID(例えば、様々な文字を示す入力データID)に対応して、変換すべき属性(例えば、書体)を変換した偽データODを生成できる。 Furthermore, according to the training device 100 (FIG. 1) of the present embodiment and the trained generation network GN, the generation network GN is trained by the training process described above, so that the characteristics of the input data ID are not reflected. Appropriate fake data OD can be generated. In addition, we can create fake data OD with converted attributes (for example, font) in response to not only limited input data IDs but also various input data IDs (for example, input data IDs indicating various characters). Can be generated.

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

B.変形例:
(1)上記実施例では、生成ネットワークGNをトレーニングする際に、事前処理とメイン処理との両方にて、特徴データCDと特徴データCDfとの間の誤差値E1が用いられている。これに限らず、事前処理とメイン処理との少なくとも一方だけで、誤差値E1が用いられても良い。例えば、上記実施例にて、メイン処理のS255では、誤差値E1を用いて、生成ネットワークGNの演算パラメータPe、Pdを調整し、事前処理のS180では、誤差値E1を用いずに、誤差値E2のみを用いて、生成ネットワークGNの演算パラメータPe、Pdを調整しても良い。あるいは、メイン処理のS255では、誤差値E1を用いずに、誤差値Egan、E2のみを用いて、生成ネットワークGNの演算パラメータPe、Pdを調整し、事前処理のS180では、誤差値E1を用いて、生成ネットワークGNの演算パラメータPe、Pdを調整しても良い。
B. Variant:
(1) In the above embodiment, when training the generation network GN, the error value E1 between the feature data CD and the feature data CDf is used in both the pre-processing and the main processing. The present invention is not limited to this, and the error value E1 may be used only in at least one of the pre-processing and the main processing. For example, in the above embodiment, in S255 of the main processing, the calculation parameters Pe and Pd of the generation network GN are adjusted using the error value E1, and in S180 of the pre-processing, the error value is adjusted without using the error value E1. The calculation parameters Pe and Pd of the generation network GN may be adjusted using only E2. Alternatively, in S255 of the main process, the calculation parameters Pe, Pd of the generation network GN are adjusted using only the error value Egan, E2 without using the error value E1, and in S180 of the pre-processing, the error value E1 is used. Then, the calculation parameters Pe and Pd of the generation network GN may be adjusted.

(2)上記実施例のメイン処理のS255では、誤差値Eganと、誤差値E1と、誤差値E2と、を用いて、生成ネットワークGNのトレーニング、すなわち、演算パラメータPe、Pdの調整が行われている。これに代えて、メイン処理のS255では、誤差値E2を用いることなく、誤差値Eganと誤差値E1とのみを用いて、演算パラメータPe、Pdの調整が行われても良い。 (2) In S255 of the main processing of the above embodiment, the training of the generation network GN, that is, the adjustment of the calculation parameters Pe and Pd, is performed using the error value Egan, the error value E1, and the error value E2. ing. Alternatively, in S255 of the main process, the calculation parameters Pe and Pd may be adjusted using only the error value Egan and the error value E1 without using the error value E2.

(3)上記実施例の事前処理のS180では、誤差値E1と誤差値E2とを用いて、生成ネットワークGNのトレーニング、すなわち、演算パラメータPe、Pdの調整が行われている。これに代えて、事前処理のS180では、誤差値E2を用いることなく、誤差値E1のみを用いて、演算パラメータPe、Pdの調整が行われても良い。 (3) In S180 of the pre-processing in the above embodiment, the error value E1 and the error value E2 are used to train the generation network GN, that is, adjust the calculation parameters Pe and Pd. Alternatively, in S180 of the pre-processing, the calculation parameters Pe and Pd may be adjusted using only the error value E1 without using the error value E2.

(4)上記実施例のトレーニング処理において、事前処理を省略して、メイン処理のみで、生成ネットワークGNのトレーニングが実行されても良い。 (4) In the training process of the above embodiment, the training of the generation network GN may be performed by omitting the pre-processing and only by the main process.

(5)上記実施例では、誤差値Eganには、シグモイドクロスエントロピー誤差が用いられ、誤差値E1には、平均二乗誤差が用いられ、誤差値E1には、平均絶対誤差が用いれている。これに代えて、誤差値Egan、E1、E2には、他の種類の誤差値が用いれても良い。例えば、誤差値Eganには、ソフトマックスクロスエントロピー誤差が用いられても良い。誤差値E1には、平均絶対誤差が用いられても良い。誤差値E2には、平均二乗誤差が用いられても良い。 (5) In the above embodiment, a sigmoid cross entropy error is used for the error value Egan, a mean square error is used for the error value E1, and a mean absolute error is used for the error value E1. Instead, other types of error values may be used for the error values Egan, E1, and E2. For example, a softmax cross entropy error may be used for the error value Egan. An average absolute error may be used as the error value E1. A mean square error may be used for the error value E2.

(6)上記実施例は、生成ネットワーク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の属性を有しない画像データに変換するモデルである、と言うことができる。 (6) In the above embodiment, the generation network GN generally has a first attribute (for example, the attribute that it is the letter "A") and a second attribute (for example, the first image data that has the first attribute and the third attribute and does not have the third attribute (for example, the attribute that it is the second font) and does not have the third attribute (for example, the attribute that it is the second font) , is a model for converting into image data that does not have the second attribute. Such conversion is also commonly referred to as "style transfer" or "image-to-image translation." As another specific example, the generation network GN may generate a line drawing (an image drawn only with lines) showing a predetermined object (a still life such as a building, shoes, or an animal such as a horse or dog). It may also be a model that converts into a color image as shown. Furthermore, the generation network GN may be, for example, a model that converts an aerial photograph showing a predetermined location into a map showing the predetermined location. In these cases as well, the generation network GN has a first attribute (an attribute indicating a predetermined object, an attribute indicating a predetermined location) and a second attribute (an attribute indicating a line drawing, an attribute indicating an aerial photograph). ) and does not have the third attribute (the attribute of being a color image, the attribute of being a map), the image data that has the first attribute and the third attribute and does not have the third attribute (the attribute of being a color image, the attribute of being a map) is It can be said that this is a model for converting image data to image data that does not have attributes.

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

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

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

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

(10)上記各実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部あるいは全部をハードウェアに置き換えるようにしてもよい。例えば、生成ネットワークGNや識別ネットワークDNは、プログラムモジュールに代えて、ASIC(Application Specific Integrated Circuit)等のハードウェア回路によって実現されてよい。 (10) In each of the above embodiments, part of the configuration realized by hardware may be replaced with software, or conversely, part or all of the configuration realized by software may be replaced by hardware. You can do it like this. 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.

以上、実施例、変形例に基づき本発明について説明してきたが、上記した発明の実施の形態は、本発明の理解を容易にするためのものであり、本発明を限定するものではない。本発明は、その趣旨並びに特許請求の範囲を逸脱することなく、変更、改良され得ると共に、本発明にはその等価物が含まれる。 Although the present invention has been described above based on examples and modifications, the embodiments of the invention described above are for facilitating understanding of the present invention, and are not intended to limit the present invention. The present invention may be modified and 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…特徴データ、LD…教師データ、GN…生成ネットワーク、DN…識別ネットワーク、Pd、Pe、Pdn…演算パラメータ、Pr…実データペア、PGg、PGt…コンピュータプログラム 100... Training device, 110... CPU, 120... Volatile storage device, 130... Non-volatile storage device, 140... Display section, 150... Operation section, 200... Data generation device, 210... CPU, 220... Volatile storage device, 230...Nonvolatile 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, LD...Teacher data, GN...Generation network, DN... Identification network, Pd, Pe, Pdn... calculation parameters, Pr... real data pair, PGg, PGt... computer program

Claims (4)

機械学習モデルのトレーニング方法であって、
入力データを第1の機械学習モデルに入力することによって前記入力データに対応する偽データを出力させる第1工程であって、前記第1の機械学習モデルは、前記入力データに対して、次元数を削減する次元削減処理を実行して第1の特徴データを生成するエンコーダと、前記第1の特徴データに対して、次元数を復元する次元復元処理を実行して前記偽データを生成するデコーダと、を含み、前記第1の機械学習モデルは、複数個の第1の演算パラメータを用いて前記次元削減処理および前記次元復元処理を実行する、前記第1工程と、
第1のペアと第2のペアとを含む複数個のデータペアを第2の機械学習モデルに入力して、前記複数個のデータペアに対応する複数個の識別データを出力させる第2工程であって、前記第1のペアは、前記入力データと、前記入力データに対応する実データと、から成る一対のデータであり、前記第2のペアは、前記入力データと、前記入力データに対応する前記偽データと、から成る一対のデータであり、前記識別データは、対応する前記データペアが前記第1のペアと前記第2のペアとのいずれであるかを識別した結果を示し、前記第2の機械学習モデルは、複数個の第2の演算パラメータを用いた演算を実行して前記識別データを生成し、前記第2の機械学習モデルのタスクは、前記第1の機械学習モデルのタスクよりも軽い、前記第2工程と、
前記識別データと前記識別データの目標値を示す教師データとを用いて、前記識別データと前記教師データとの差分が小さくなるように、前記複数個の第2の演算パラメータを調整する第3工程と、
前記偽データに対して、前記エンコーダによる前記次元削減処理を実行して第2の特徴データを生成する第4工程と、
前記識別データと前記教師データと前記第1の特徴データと前記第2の特徴データとを用いて、前記識別データと前記教師データとの差分が大きくなり、かつ、前記第1の特徴データと前記第2の特徴データとの差分が小さくなるように、前記複数個の第1の演算パラメータを調整する第5工程と、
前記第1の特徴データと前記第2の特徴データとを用いて、前記識別データと前記教師データとを用いずに、前記第1の特徴データと前記第2の特徴データとの差分が小さくなるように、前記複数個の第1の演算パラメータを調整する第6工程と、
を備え、
前記第2工程と前記第3工程と前記第5工程とを行うことなく、前記第1工程と前記第4工程と前記第6工程とを複数回繰り返すことによって、前記第1の機械学習モデルをトレーニングした後に、前記第1工程~前記第5工程を複数回繰り返すことによって、前記第1の機械学習モデルと前記第2の機械学習モデルとを並行してトレーニングする、方法。
A method for training a machine learning model, the method comprising:
A first step of outputting fake data corresponding to the input data by inputting the input data to a first machine learning model, the first machine learning model an encoder that performs dimension reduction processing to reduce the number of dimensions to generate first feature data; and a decoder that performs dimension restoration processing to restore the number of dimensions to the first feature data to generate the fake data. and the first step, wherein the first machine learning model executes the dimension reduction process and the dimension restoration process using a plurality of first calculation parameters;
A second step of inputting a plurality of data pairs including a first pair and a second pair into a second machine learning model and outputting a plurality of identification data corresponding to the plurality of data pairs. The first pair is a pair of data consisting of the input data and actual data corresponding to the input data, and the second pair is the input data and actual data corresponding to the input data. a pair of data consisting of the false data, the identification data indicating a result of identifying whether the corresponding data pair is the first pair or the second pair; The second machine learning model performs an operation using a plurality of second operation parameters to generate the identification data, and the task of the second machine learning model is to the second step, which is lighter than the task;
A third step of adjusting the plurality of second calculation parameters using the identification data and teacher data indicating a target value of the identification data so that the difference between the identification data and the teacher data becomes small. and,
a fourth step of performing the dimension reduction process by the encoder on the fake data to generate second feature data;
Using the identification data, the teaching data, the first feature data, and the second feature data, the difference between the identification data and the teaching data becomes large, and the first feature data and the a fifth step of adjusting the plurality of first calculation parameters so that the difference with the second feature data is small;
Using the first feature data and the second feature data, without using the identification data and the teacher data, the difference between the first feature data and the second feature data is reduced. a sixth step of adjusting the plurality of first calculation parameters,
Equipped with
The first machine learning model is created by repeating the first step, the fourth step, and the sixth step multiple times without performing the second step, the third step, and the fifth step. After training, the first machine learning model and the second machine learning model are trained in parallel by repeating the first to fifth steps multiple times.
機械学習モデルのトレーニング方法であって、
入力データを第1の機械学習モデルに入力することによって前記入力データに対応する偽データを出力させる第1工程であって、前記第1の機械学習モデルは、前記入力データに対して、次元数を削減する次元削減処理を実行して第1の特徴データを生成するエンコーダと、前記第1の特徴データに対して、次元数を復元する次元復元処理を実行して前記偽データを生成するデコーダと、を含み、前記第1の機械学習モデルは、複数個の第1の演算パラメータを用いて前記次元削減処理および前記次元復元処理を実行する、前記第1工程と、
第1のペアと第2のペアとを含む複数個のデータペアを第2の機械学習モデルに入力して、前記複数個のデータペアに対応する複数個の識別データを出力させる第2工程であって、前記第1のペアは、前記入力データと、前記入力データに対応する実データと、から成る一対のデータであり、前記第2のペアは、前記入力データと、前記入力データに対応する前記偽データと、から成る一対のデータであり、前記識別データは、対応する前記データペアが前記第1のペアと前記第2のペアとのいずれであるかを識別した結果を示し、前記第2の機械学習モデルは、複数個の第2の演算パラメータを用いた演算を実行して前記識別データを生成し、前記第2の機械学習モデルのタスクは、前記第1の機械学習モデルのタスクよりも軽い、前記第2工程と、
前記識別データと前記識別データの目標値を示す教師データとを用いて、前記識別データと前記教師データとの差分が小さくなるように、前記複数個の第2の演算パラメータを調整する第3工程と、
前記偽データに対して、前記エンコーダによる前記次元削減処理を実行して第2の特徴データを生成する第4工程と、
前記識別データと前記教師データとを用いて、前記識別データと前記教師データとの差分が大きくなるように、前記複数個の第1の演算パラメータを調整する第5工程と、
前記第1の特徴データと前記第2の特徴データとを用いて、前記識別データと前記教師データとを用いずに、前記第1の特徴データと前記第2の特徴データとの差分が小さくなるように、前記複数個の第1の演算パラメータを調整する第6工程と、
を備え、
前記第2工程と前記第3工程と前記第5工程とを行うことなく、前記第1工程と前記第4工程と前記第6工程とを複数回繰り返すことによって、前記第1の機械学習モデルをトレーニングした後に、前記第1工程~前記第5工程を複数回繰り返すことによって、前記第1の機械学習モデルと前記第2の機械学習モデルとを並行してトレーニングする、方法。
A method for training a machine learning model, the method comprising:
A first step of outputting fake data corresponding to the input data by inputting the input data to a first machine learning model, the first machine learning model an encoder that performs dimension reduction processing to reduce the number of dimensions to generate first feature data; and a decoder that performs dimension restoration processing to restore the number of dimensions to the first feature data to generate the false data. and the first step, wherein the first machine learning model executes the dimension reduction process and the dimension restoration process using a plurality of first calculation parameters;
A second step of inputting a plurality of data pairs including a first pair and a second pair into a second machine learning model and outputting a plurality of identification data corresponding to the plurality of data pairs. The first pair is a pair of data consisting of the input data and actual data corresponding to the input data, and the second pair is the input data and actual data corresponding to the input data. a pair of data consisting of the false data, the identification data indicating a result of identifying whether the corresponding data pair is the first pair or the second pair; The second machine learning model performs an operation using a plurality of second operation parameters to generate the identification data, and the task of the second machine learning model is to the second step, which is lighter than the task;
A third step of adjusting the plurality of second calculation parameters using the identification data and teacher data indicating a target value of the identification data so that the difference between the identification data and the teacher data becomes small. and,
a fourth step of performing the dimension reduction process by the encoder on the fake data to generate second feature data;
a fifth step of adjusting the plurality of first calculation parameters using the identification data and the teacher data so that the difference between the identification data and the teacher data becomes large;
Using the first feature data and the second feature data, without using the identification data and the teacher data, the difference between the first feature data and the second feature data is reduced. a sixth step of adjusting the plurality of first calculation parameters,
Equipped with
The first machine learning model is created by repeating the first step, the fourth step, and the sixth step multiple times without performing the second step, the third step, and the fifth step. After training, the first machine learning model and the second machine learning model are trained in parallel by repeating the first to fifth steps multiple times.
請求項1または2のいずれかに記載の方法であって、
前記第6工程において、さらに、特定の前記入力データに対応する前記実データおよび前記偽データを用いて、前記実データと前記偽データとの差分が小さくなるように、前記第1の演算パラメータを調整する、方法。
3. The method according to claim 1 or 2,
In the sixth step, the first calculation parameter is further adjusted using the real data and the fake data corresponding to the specific input data so that the difference between the real data and the fake data is small. How to adjust.
請求項1~3のいずれかに記載の方法であって、
前記第5工程において、さらに、特定の前記入力データに対応する前記実データおよび前記偽データを用いて、前記実データと前記偽データとの差分が小さくなるように、前記第1の演算パラメータを調整する、方法。
The method according to any one of claims 1 to 3,
In the fifth step, the first calculation parameter is further adjusted using the real data and the fake data corresponding to the specific input data so that the difference between the real data and the fake data is small. How to adjust.
JP2019092212A 2019-05-15 2019-05-15 Machine learning model training method, data generation device, and trained machine learning model Active JP7423905B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2019092212A JP7423905B2 (en) 2019-05-15 2019-05-15 Machine learning model training method, data generation device, and trained machine learning model
PCT/JP2020/018932 WO2020230777A1 (en) 2019-05-15 2020-05-12 Training method for machine learning model, data generation device, and trained machine learning model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019092212A JP7423905B2 (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
JP2020187583A JP2020187583A (en) 2020-11-19
JP7423905B2 true JP7423905B2 (en) 2024-01-30

Family

ID=73221754

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019092212A Active JP7423905B2 (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) JP7423905B2 (en)
WO (1) WO2020230777A1 (en)

Families Citing this family (2)

* 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
JP7311120B1 (en) 2022-03-16 2023-07-19 ソフトバンク株式会社 Information processing device, information processing method and information processing program

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018139071A (en) 2017-02-24 2018-09-06 株式会社リコー Generation model learning method, generation model learning apparatus and program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018139071A (en) 2017-02-24 2018-09-06 株式会社リコー Generation model learning method, generation model learning apparatus and program

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
PENG, Xue Bin et. al.,Variational Discriminator Bottleneck: Improving Imitation Learning, Inverse RL, and GANs by Constrai,米国,arXiv.org,2018年12月29日,pp.1-27,https://arxiv.org/pdf/1810.00821.pdf
TAIGMAN, Yaniv et. al.,Unsupervised Cross-Domain Image Generation,米国,arXiv.org,2016年11月07日,pp.1-14,https://arxiv.org/pdf/1611.02200.pdf
篠崎隆志,GAN-敵対的生成ネットワーク-の発展,人工知能,日本,一般社団法人人工知能学会,2018年03月01日,第33巻,第2号(通巻188号),pp.181-188,ISSN 2188-2266

Also Published As

Publication number Publication date
JP2020187583A (en) 2020-11-19
WO2020230777A1 (en) 2020-11-19

Similar Documents

Publication Publication Date Title
CN109190722B (en) Font style migration transformation method based on Manchu character picture
US9619749B2 (en) Neural network and method of neural network training
US9390373B2 (en) Neural network and method of neural network training
JP7423905B2 (en) Machine learning model training method, data generation device, and trained machine learning model
AU2019202063A1 (en) Synthesizing new font glyphs from partial observations
US20200026416A1 (en) System and method for generating photorealistic synthetic images based on semantic information
US11449734B2 (en) Neural network reduction device, neural network reduction method, and storage medium
JP7207846B2 (en) Information processing device, information processing method and program
US11325398B2 (en) Image processing device generating dot data using machine learning model and method for training machine learning model
JP7055769B2 (en) Data generator, data generation method and program
US11615292B2 (en) Projecting images to a generative model based on gradient-free latent vector determination
CN113763268B (en) Blind restoration method and system for face image
JP2021026191A (en) Learned machine learning model, image data generation apparatus, and method
WO2020230776A1 (en) Training method for machine learning model, data generation device, and prelearned machine learning model
US20210374916A1 (en) Storage medium storing program, image processing apparatus, and training method of machine learning model
KR102537207B1 (en) Method for processing image based on machine learning and apparatus therefof
CN114881879A (en) Underwater image enhancement method based on brightness compensation residual error network
JP7148078B2 (en) Attribute estimation device, attribute estimation method, attribute estimator learning device, and program
JP7372591B2 (en) Image processing device and trained machine learning model
CN111402121A (en) Image style conversion method and device, computer equipment and storage medium
JP7254621B2 (en) Image processing device, learning device, image processing method, learning method, and program
JP7453828B2 (en) Programs, neural network systems, information processing methods, and neural network model generation methods
KR102577361B1 (en) Method and apparatus for image dehazing via complementary adversarial learning
CN113936320B (en) Face image quality evaluation method, electronic device and storage medium
WO2024043109A1 (en) Image processing method, image processing device, and program

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

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230529

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20230906

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20231121

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20231130

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240101

R150 Certificate of patent or registration of utility model

Ref document number: 7423905

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150