Method, device, equipment and storage medium for rapid training of adversarial generative network

By alternately training generator G and discriminator D, and using singular value decomposition to optimize convolutional layer connection weights, the problem of low efficiency of existing adversarial generation network training algorithms is solved, and fast training and efficient learning are achieved.

CN114463599BActive Publication Date: 2025-03-25BEIJING NORMAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210131123.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-13
Publication Date
2025-03-25
Estimated Expiration
2042-02-13

AI Technical Summary

Technical Problem

Existing adversarial generation network training algorithms are inefficient, especially when processing large amounts of unlabeled data, requiring high labor and time costs.

Method used

By alternately training generator G and discriminator D, the optimized convolution layer connection weight is calculated using singular value decomposition and pseudo-inverse matrix, and the analytical solution of the objective function is directly calculated to avoid iterative optimization and hyperparameter adjustment.

Benefits of technology

It realizes rapid training of the adversarial generation network, improves learning efficiency, and reduces computing costs and human resources requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114463599B_ABST
    Figure CN114463599B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, device, electronic device and computer-readable storage medium for rapid training of a generative adversarial network. The method comprises: obtaining a training data set, the training data set comprising a plurality of image training samples; a discriminator D of a generative adversarial network, for a first synthetic image set generated by a generator G, judging whether each first synthetic image in the first synthetic image set is a real image; the generator G and the discriminator D of the generative adversarial network, two neural network models, are alternately trained and compete with each other, so that the objective function reaches the optimum.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a training method for a generative adversarial network. Background Art

[0002] At present, artificial intelligence technologies represented by deep learning usually use supervised learning methods, which often require a large amount of labeled data to train deep network models. However, most of the data obtained in practical applications are unlabeled data. If a large amount of unlabeled data is manually labeled, it will require a high manpower and time cost. Therefore, it is a trend in the development of artificial intelligence technology to use unsupervised learning technologies and methods to directly perform representation learning on unlabeled data and make full use of a large amount of unlabeled data.

[0003] The disadvantage of supervised learning is that it requires a large number of labeled samples, which is very time-consuming and labor-intensive. Although unsupervised learning does not have this problem, its accuracy is often lower. Generative Adversarial Networks (GANs) can be said to be an improvement on unsupervised learning. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings of the existing adversarial generative network training algorithm. The technical solution adopted by the present invention to solve its technical problems is as follows:

[0005] A method for quickly training a generative adversarial network, comprising:

[0006] Step S01: Obtain a training data set, where the training data set includes multiple image training samples for training the generator G and the discriminator D of the adversarial generative network;

[0007] Step S02: The generator G of the adversarial generative network generates a first synthetic image set for each image training sample;

[0008] Step S03: The discriminator D of the adversarial generation network determines whether each first synthetic image in the first synthetic image set generated by the generator G is a real image;

[0009] Step S04: The generator G and the discriminator D of the adversarial generative network are trained alternately and compete with each other to optimize the objective function; the neural network models of the generator G and the discriminator D are both composed of multiple layers, and the samples are forward propagated along the network; the generator G is composed of 2 deconvolution layers and 10 convolution layers; the discriminator D is composed of 4 convolution layers and one fully connected layer; the convolution layers of the two neural network models are optimized according to the following method:

[0010] Step S0401: Calculate the connection weight W from layer l to layer l+1 l; Where l is the layer number of the adversarial generation network;

[0011] Step S0402: The input data matrix of the lth layer is X l , for X l Perform singular value decomposition to obtain matrices U, Σ, V, so that X l =UΣV T ;

[0012] Step S0403: Calculate X l The pseudo-inverse matrix Y = VΣ'U T ; Where Σ' is a diagonal matrix consisting of the reciprocals of the singular values ​​in Σ;

[0013] Step S0404: truncate the matrix V, retain the first p rows of the matrix V, and obtain the truncated matrix V'. Calculate the approximate pseudo-inverse matrix X' expressed as X'=V'Σ'U T ;

[0014] Step S0405: Take X' as the connection weight W from the lth layer to the l+1th layer l The initial value of

[0015] Step S0406: Use the connection weight W from layer l to layer l+1 l , multiplied by the neuron output matrix Y of the lth layer l , and applying the activation function, we can get the output matrix Y of the l+1th layer l+1 ;

[0016] Step S0407: adjust the regularization parameter to control the size of the reconstruction error; end the training of the neural network model.

[0017] The present invention also provides a device for quickly training a generative adversarial network, comprising:

[0018] Dataset acquisition module: obtains the training data set, which includes multiple image training samples and is used to train the generator G and discriminator D of the adversarial generative network;

[0019] Generator module: The generator G of the adversarial generative network generates a first set of synthetic images for each image training sample;

[0020] Discriminator module: The discriminator D of the adversarial generation network determines whether each first synthetic image in the first synthetic image set generated by the generator G is a real image;

[0021] Optimization module: The generator G and discriminator D of the adversarial generative network are trained alternately and compete with each other to optimize the objective function; the neural network models of the generator G and the discriminator D are composed of multiple layers, and the samples are forward propagated along the network; the generator G consists of 2 deconvolution layers and 10 convolution layers; the discriminator D consists of 4 convolution layers and one fully connected layer; the convolution layers of the two neural network models are optimized according to the following method:

[0022] Step S0401: Calculate the connection weight W from layer l to layer l+1 l ; Where l is the layer number of the adversarial generation network;

[0023] Step S0402: The input data matrix of the lth layer is X l , for X l Perform singular value decomposition to obtain matrices U, Σ, V, so that X l =UΣV T ;

[0024] Step S0403: Calculate X l The pseudo-inverse matrix Y = VΣ'U T ; Where Σ' is a diagonal matrix consisting of the reciprocals of the singular values ​​in Σ;

[0025] Step S0404: truncate the matrix V, retain the first p rows of the matrix V, and obtain the truncated matrix V'. Calculate the approximate pseudo-inverse matrix X' expressed as X'=V'Σ'U T ;

[0026] Step S0405: Take X' as the connection weight W from the lth layer to the l+1th layer l The initial value of

[0027] Step S0406: Use the connection weight W from layer l to layer l+1 l , multiplied by the neuron output matrix Y of the lth layer l , and applying the activation function, we can get the output matrix Y of the l+1th layer l+1 ;

[0028] Step S0407: adjust the regularization parameter to control the size of the reconstruction error; end the training of the neural network model.

[0029] The present invention also provides an electronic device, comprising:

[0030] at least one processor; and

[0031] a memory communicatively connected to the at least one processor; wherein,

[0032] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described.

[0033] The present invention also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the method.

[0034] Specifically, in classification or prediction problems, the features output by the generative adversarial network can be selected as the input of the classifier or prediction model, and the classifier or prediction model can be fine-tuned using training samples with category labels to finally obtain a generative adversarial network for specific learning tasks.

[0035] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become easy to understand through the following description. Other features, objects and advantages of the present invention can be derived from the description, drawings and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Attached Figure 1 Schematic diagram of the adversarial generative network of the present invention. DETAILED DESCRIPTION

[0037] The present invention provides a method for quickly training a generative adversarial network in order to overcome the shortcomings of existing neural network training algorithms.

[0038] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the following is a detailed description of the present invention in conjunction with the specific embodiments and the appended drawings. Figure 1 The method is further described in detail. It should be understood that the description of the specific embodiments herein is only used to explain the present invention and is not used to limit the present invention.

[0039] Specifically, see Figure 1 , is a flow chart of a method for quickly training a generative adversarial network according to an embodiment of the present invention.

[0040] A fast training method for a generative adversarial network according to an embodiment of the present invention includes:

[0041] Step S01: Obtain a training data set, where the training data set includes multiple image training samples for training the generator G and the discriminator D of the adversarial generative network;

[0042] Step S02: The generator G of the adversarial generative network generates a first synthetic image set for each image training sample;

[0043] Specifically, for each image training sample, image features are extracted; the image features of multiple image training samples form an input matrix X; the input matrix is ​​input into the neural network model of the generator G to obtain an output matrix Y;

[0044] Step S03: The discriminator D of the adversarial generation network determines whether each first synthetic image in the first synthetic image set generated by the generator G is a real image;

[0045] Specifically, for each image training sample, image features are extracted; the image features of multiple image training samples form an input matrix X'; the input matrix is ​​input into the neural network model of the discriminator D to obtain an output matrix Y';

[0046] Step S04: The generator G and the discriminator D of the adversarial generative network are trained alternately and compete with each other to optimize the objective function; the neural network models of the generator G and the discriminator D are both composed of multiple layers, and the samples are forward propagated along the network; the generator G is composed of 2 deconvolution layers and 10 convolution layers; the discriminator D is composed of 4 convolution layers and one fully connected layer; the convolution layers of the two neural network models are optimized according to the following method:

[0047] Step S0401: Calculate the connection weight W from layer l to layer l+1 l ; Where l is the layer number of the adversarial generation network;

[0048] Step S0402: The input data matrix of the lth layer is X l , for X l Perform singular value decomposition to obtain matrices U, Σ, V, so that X l =UΣV T ;

[0049] Step S0403: Calculate X l The pseudo-inverse matrix Y = VΣ'U T ; Where Σ' is a diagonal matrix consisting of the reciprocals of the singular values ​​in Σ;

[0050] Step S0404: truncate the matrix V, retain the first p rows of the matrix V, and obtain the truncated matrix V'. Calculate the approximate pseudo-inverse matrix X' expressed as X'=V'Σ'U T ;

[0051] Step S0405: Take X' as the connection weight W from the lth layer to the l+1th layer l The initial value of

[0052] Due to the above steps, the present invention can directly calculate the analytical solution of the optimization target without the need for an iterative optimization process and a tedious hyperparameter adjustment process, so the learning efficiency is higher than that of other gradient descent algorithms such as error back propagation;

[0053] Step S0406: Use the connection weight W from layer l to layer l+1 l , multiplied by the neuron output matrix Y of the lth layer l , and applying the activation function, we can get the output matrix Y of the l+1th layer l+1 ;

[0054] Specifically, the activation function can adopt a step activation function, that is, if x>δ max ,f(x)=1,if x≤δ max ,f(x)=0;δ max It is a small positive number, which is related to the specific data;

[0055] Due to the above steps, the network optimization goal of the present invention can be converted into finding such a projection operator that minimizes the output error;

[0056] Step S0407: Adjust the regularization parameter to control the size of the reconstruction error; end the training of the neural network model

[0057] Due to the above steps, the training process of the present invention does not need to perform an iterative optimization process based on a gradient descent algorithm, and the connection weights are directly solved by basic linear algebra operations, so the calculation speed is faster. Features are learned from raw data, so it is not necessary to accurately reconstruct the data during training. There is no need to set too many control parameters, so the training method of the present invention is easy to use.

[0058] The above description of the disclosed embodiments enables professionals and technicians familiar with the art to implement or use the present invention. Modifications to the embodiments will be obvious to professionals and technicians in the art. The general principles defined in this patent can be implemented in other embodiments without departing from the basic idea or scope of application of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, and any solution that utilizes the design ideas of the present invention and makes some simple changes should be included in the scope of protection of the present invention.

Claims

1. A method for rapid training of a generative adversarial network, characterized in that: Step S01: Obtain a training data set, where the training data set includes multiple image training samples for training the generator G and the discriminator D of the adversarial generative network; Step S02: The generator G of the adversarial generative network generates a first synthetic image set for each image training sample; Step S03: The discriminator D of the adversarial generation network determines whether each first synthetic image in the first synthetic image set generated by the generator G is a real image; Step S04: The generator G and the discriminator D of the adversarial generative network are trained alternately and compete with each other to optimize the objective function; the neural network models of the generator G and the discriminator D are both composed of multiple layers, and the samples are forward propagated along the network; the generator G is composed of 2 deconvolution layers and 10 convolution layers; the discriminator D is composed of 4 convolution layers and one fully connected layer; the convolution layers of the two neural network models are optimized according to the following method: Step S0401: Calculate the connection weight W from layer l to layer l+1 l ; Where l is the layer number of the adversarial generation network; Step S0402: The input data matrix of the lth layer is X l , for X l Perform singular value decomposition to obtain matrices U, Σ, V, so that X l =UΣV T ; Step S0403: Calculate X l The pseudo-inverse matrix Y = VΣ'U T ; Where Σ' is a diagonal matrix consisting of the reciprocals of the singular values ​​in Σ; Step S0404: truncate the matrix V, retain the first p rows of the matrix V, and obtain the truncated matrix V'; calculate the approximate pseudo-inverse matrix X' expressed as X'=V'Σ'U T ; Step S0405: Take X' as the connection weight W from the lth layer to the l+1th layer l The initial value of Step S0406: Use the connection weight W from layer l to layer l+1 l , multiplied by the neuron output matrix Y of the lth layer l , and applying the activation function, we can get the output matrix Y of the l+1th layer l+1 ; Step S0407: adjust the regularization parameter to control the size of the reconstruction error; end the training of the neural network model.

2. A method for rapid training of a generative adversarial network according to claim 1, characterized in that: In step S02, specifically, for each image training sample, image features are extracted; an input matrix X is formed by the image features of multiple image training samples; and the input matrix is ​​input into the neural network model of the generator G to obtain an output matrix Y.

3. The method for rapid training of a generative adversarial network according to claim 1, characterized in that: In step S03, for each image training sample, image features are extracted; an input matrix X' is formed by the image features of multiple image training samples; the input matrix is ​​input into the neural network model of the discriminator D to obtain an output matrix Y'.

4. The method for rapid training of a generative adversarial network according to claim 1, characterized in that: Step S0406 includes, The activation function can use a step activation function, that is, if x>δ max ,f(x)=1,if x≤δ max ,f(x)=0;δmax is a small positive number, which is related to the specific data.

5. The method for rapid training of a generative adversarial network according to claim 1, characterized in that: The generative adversarial network is used to synthesize face images.

6. A device for rapidly training a deep neural network, comprising: Dataset acquisition module: obtains the training data set, which includes multiple image training samples and is used to train the generator G and discriminator D of the adversarial generative network; Generator module: The generator G of the adversarial generative network generates a first set of synthetic images for each image training sample; Discriminator module: The discriminator D of the adversarial generation network determines whether each first synthetic image in the first synthetic image set generated by the generator G is a real image; Optimization module: The generator G and discriminator D of the adversarial generative network are trained alternately and compete with each other to optimize the objective function; the neural network models of the generator G and the discriminator D are composed of multiple layers, and the samples are forward propagated along the network; the generator G consists of 2 deconvolution layers and 10 convolution layers; the discriminator D consists of 4 convolution layers and one fully connected layer; the convolution layers of the two neural network models are optimized according to the following method: Step S0401: Calculate the connection weight W from layer l to layer l+1 l ; Where l is the layer number of the adversarial generation network; Step S0402: The input data matrix of the lth layer is X l , for X l Perform singular value decomposition to obtain matrices U, Σ, V, so that X l =UΣV T ; Step S0403: Calculate X l The pseudo-inverse matrix Y = VΣ'U T ; Where Σ' is a diagonal matrix consisting of the reciprocals of the singular values ​​in Σ; Step S0404: truncate the matrix V, retain the first p rows of the matrix V, and obtain the truncated matrix V'; calculate the approximate pseudo-inverse matrix X' expressed as X'=V'Σ'U T ; Step S0405: Take X' as the connection weight W from the lth layer to the l+1th layer l The initial value of Step S0406: Use the connection weight W from layer l to layer l+1 l , multiplied by the neuron output matrix Y of the lth layer l , and applying the activation function, we can get the output matrix Y of the l+1th layer l+1 ; Step S0407: adjust the regularization parameter to control the size of the reconstruction error; end the training of the neural network model.

7. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Sparse self-encoder fast training method based on pseudo inverse learning

    CN107480777A

  • Data discriminator training method, data discriminator training device, program and training method

    WO2019004350A1