WO2021139120A1 - 网络训练方法及装置、图像生成方法及装置 - Google Patents
网络训练方法及装置、图像生成方法及装置 Download PDFInfo
- Publication number
- WO2021139120A1 WO2021139120A1 PCT/CN2020/099953 CN2020099953W WO2021139120A1 WO 2021139120 A1 WO2021139120 A1 WO 2021139120A1 CN 2020099953 W CN2020099953 W CN 2020099953W WO 2021139120 A1 WO2021139120 A1 WO 2021139120A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- network
- training
- discriminant
- generation
- Prior art date
Links
- 238000012549 training Methods 0.000 title claims abstract description 157
- 238000000034 method Methods 0.000 title claims abstract description 109
- 239000013598 vector Substances 0.000 claims abstract description 220
- 238000012545 processing Methods 0.000 claims abstract description 87
- 238000006731 degradation reaction Methods 0.000 claims abstract description 15
- 230000015556 catabolic process Effects 0.000 claims abstract description 14
- 238000003860 storage Methods 0.000 claims description 26
- 230000036544 posture Effects 0.000 claims description 21
- 238000004590 computer program Methods 0.000 claims description 20
- 238000010586 diagram Methods 0.000 description 18
- 230000006870 function Effects 0.000 description 16
- 238000004891 communication Methods 0.000 description 10
- 230000000694 effects Effects 0.000 description 9
- 230000008569 process Effects 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 8
- 230000009471 action Effects 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 5
- 238000009826 distribution Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 238000005457 optimization Methods 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 230000007704 transition Effects 0.000 description 4
- 241001465754 Metazoa Species 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 208000037170 Delayed Emergence from Anesthesia Diseases 0.000 description 2
- 241000282326 Felis catus Species 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000013527 convolutional neural network Methods 0.000 description 2
- 230000007123 defense Effects 0.000 description 2
- 230000000593 degrading effect Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000750 progressive effect Effects 0.000 description 2
- 230000001902 propagating effect Effects 0.000 description 2
- 238000011524 similarity measure Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 1
- RYGMFSIKBFXOCR-UHFFFAOYSA-N Copper Chemical compound [Cu] RYGMFSIKBFXOCR-UHFFFAOYSA-N 0.000 description 1
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 229910052802 copper Inorganic materials 0.000 description 1
- 239000010949 copper Substances 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000011176 pooling Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/04—Context-preserving transformations, e.g. by using an importance map
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/088—Non-supervised learning, e.g. competitive learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/047—Probabilistic or stochastic networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4046—Scaling of whole images or parts thereof, e.g. expanding or contracting using neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/60—Image enhancement or restoration using machine learning, e.g. neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
Definitions
- the present disclosure relates to the field of computer technology, in particular to a network training method and device, and an image generation method and device.
- Deep Image Prior proposes that a randomly initialized convolutional neural network has low-level image priors, which can be used to achieve super-resolution and image completion.
- the present disclosure proposes a technical solution for network training and image generation.
- a network training method including: inputting latent vectors into a pre-trained generation network to obtain a first generated image, and the generation network is trained against the discrimination network through multiple natural images. Performing degradation processing on the first generated image to obtain a first degraded image of the first generated image; training the latent vector and the generated image according to the first degraded image and the second degraded image of the target image Network, wherein the trained generation network and the trained latent vector are used to generate the reconstructed image of the target image.
- training the latent vector and the generation network according to the first degraded image and the second degraded image of the target image includes: combining the first degraded image and the second degraded image of the target image The two degraded images are respectively input into the pre-trained discriminant network for processing to obtain the first discriminant feature of the first degraded image and the second discriminant feature of the second degraded image; according to the first discriminant feature and the second discriminant feature Discriminating features, training the hidden vector and the generating network.
- the discriminant network includes a multi-level discriminant network block
- the first degraded image and the second degraded image of the target image are respectively input into a pre-trained discriminant network for processing to obtain the first degraded image and the second degraded image of the target image.
- the first discriminant feature of the degraded image and the second discriminant feature of the second degraded image include: inputting the first degraded image into the discriminant network for processing to obtain the output of the multi-level discriminant network block of the discriminant network A plurality of first discriminant features; input the second degraded image into the discriminant network for processing to obtain a plurality of second discriminant features output by the multi-level discriminant network block of the discriminant network.
- training the latent vector and the generating network according to the first discriminant feature and the second discriminant feature includes: according to the first discriminant feature and the second discriminant feature The distance between the features determines the network loss of the generation network; according to the network loss of the generation network, the hidden vector and the generation network are trained.
- the generation network includes N-level generation network blocks
- training the latent vector and the generation network according to the network loss of the generation network includes: training the latent vector and the generation network according to the n-1th round of training The network loss of the generating network, training the first n-level generating network blocks of the generating network, and obtaining the generating network after the nth round of training, 1 ⁇ n ⁇ N, n and N are integers.
- the method further includes: inputting a plurality of initial latent vectors into a pre-trained generation network to obtain a plurality of second generated images; according to the target image and the plurality of second generated images The difference information between, the hidden vector is determined from the plurality of initial hidden vectors.
- the method further includes: inputting the target image into a pre-trained coding network, and outputting the hidden vector.
- the method further includes: inputting the trained latent vector into the trained generation network to obtain a reconstructed image of the target image, wherein the reconstructed image includes a color image, and the target The second degraded image of the image includes a grayscale image; or the reconstructed image includes a complete image, and the second degraded image includes a missing image; or the resolution of the reconstructed image is greater than the resolution of the second degraded image.
- an image generation method including: performing perturbation processing on a first latent vector by random jitter information to obtain a perturbed first latent vector; and inputting the perturbed first latent vector Process in the first generation network to obtain a reconstructed image of the target image.
- the position of the object in the reconstructed image is different from the position of the object in the target image, wherein the first latent vector and the first generation network are based on The above network training method is trained.
- an image generation method including: inputting a second latent vector and category features of a preset category into a second generation network for processing to obtain a reconstructed image of a target image, the second generation network It includes a conditional generation network, the category of the object in the reconstructed image includes the preset category, and the category of the object in the target image is different from the preset category, wherein the second latent vector and the second generation The network is trained according to the above-mentioned network training method.
- an image generation method including: performing interpolation processing on a third hidden vector, a fourth hidden vector, a parameter of a third generation network, and a parameter of a fourth generation network, respectively, to obtain at least one interpolation value Latent vectors and at least one parameter of the interpolation generating network, the third generating network is used to generate the reconstructed image of the first target image according to the third latent vector, and the fourth generating network is used to generate the reconstructed image of the second target image according to the fourth latent vector ;
- Each interpolation hidden vector is input into the corresponding interpolation generation network to obtain at least one deformed image, the posture of the object in the at least one deformed image is in the posture of the object in the first target image and the object in the second target image.
- a network training device including: a first generation module, configured to input latent vectors into a pre-trained generation network to obtain a first generated image, and the generation network is connected to the discriminant network.
- a natural image confrontation training ; a degradation module, used to perform degradation processing on the first generated image to obtain a first degraded image of the first generated image; a training module, used to perform a degradation process based on the first degraded image and For the second degraded image of the target image, the latent vector and the generating network are trained, wherein the trained generating network and the trained latent vector are used to generate the reconstructed image of the target image.
- the training module includes: a feature acquisition sub-module, configured to input the first degraded image and the second degraded image of the target image into a pre-trained discriminant network for processing, to obtain the The first discriminant feature of the first degraded image and the second discriminant feature of the second degraded image; a first training sub-module for training the hidden vector according to the first discriminant feature and the second discriminant feature And the generating network.
- the discriminant network includes a multi-level discriminant network block
- the feature acquisition submodule includes: a first acquisition submodule, configured to input the first degraded image into the discrimination network for processing To obtain a plurality of first discriminant features output by the multi-level discriminant network block of the discriminant network; the second acquisition sub-module is used to input the second degraded image into the discriminant network for processing to obtain the discriminant network Multiple second discriminant features output by the multi-level discriminant network block.
- the first training sub-module includes: a loss determination sub-module, configured to determine the distance between the first discriminant feature and the second discriminant feature Network loss; a second training sub-module for training the latent vector and the generation network according to the network loss of the generation network.
- the generative network includes N-level generative network blocks
- the second training sub-module is used to train the generative network according to the network loss of the generative network after the n-1th round of training
- the first n levels of the generated network block are obtained, and the generated network after the nth round of training is obtained, 1 ⁇ n ⁇ N, and n and N are integers.
- the device further includes: a second generation module, configured to input a plurality of initial latent vectors into the pre-trained generation network to obtain a plurality of second generated images; and a first vector determination module, using According to the difference information between the target image and the plurality of second generated images, the hidden vector is determined from the plurality of initial hidden vectors.
- a second generation module configured to input a plurality of initial latent vectors into the pre-trained generation network to obtain a plurality of second generated images
- a first vector determination module using According to the difference information between the target image and the plurality of second generated images, the hidden vector is determined from the plurality of initial hidden vectors.
- the device further includes: a second vector determining module, configured to input the target image into a pre-trained coding network, and output the hidden vector.
- the device further includes: a first reconstruction module, configured to input the trained latent vector into the trained generation network to obtain a reconstructed image of the target image, wherein the reconstructed image Including a color image, the second degraded image of the target image includes a grayscale image; or the reconstructed image includes a complete image, and the second degraded image includes a missing image; or the resolution of the reconstructed image is greater than that of the second The resolution of the degraded image.
- a first reconstruction module configured to input the trained latent vector into the trained generation network to obtain a reconstructed image of the target image, wherein the reconstructed image Including a color image, the second degraded image of the target image includes a grayscale image; or the reconstructed image includes a complete image, and the second degraded image includes a missing image; or the resolution of the reconstructed image is greater than that of the second The resolution of the degraded image.
- an image generation device including: a disturbance module, configured to perform disturbance processing on a first latent vector by random jitter information to obtain a disturbed first latent vector; and a second reconstruction module, using The first latent vector after the disturbance is input into the first generation network for processing to obtain a reconstructed image of the target image.
- the position of the object in the reconstructed image is different from the position of the object in the target image.
- a latent vector and the first generation network are obtained by training according to the above-mentioned network training device.
- an image generation device including: a third reconstruction module, configured to input the second latent vector and the category features of the preset category into the second generation network for processing to obtain a reconstructed image of the target image
- the second generation network includes a conditional generation network, the category of the object in the reconstructed image includes the preset category, the category of the object in the target image is different from the preset category, and the second hidden
- the vector and the second generation network are obtained by training according to the above-mentioned network training device.
- an image generation device including: an interpolation module for performing interpolation processing on the third hidden vector and the fourth hidden vector, the parameters of the third generation network and the parameters of the fourth generation network, respectively , Obtain at least one interpolation hidden vector and at least one parameter of the interpolation generation network, the third generation network is used to generate the reconstructed image of the first target image according to the third hidden vector, and the fourth generation network is used to generate the second image according to the fourth hidden vector A reconstructed image of the target image; a deformed image acquisition module for inputting each interpolation hidden vector into a corresponding interpolation generation network to obtain at least one deformed image, and the posture of the object in the at least one deformed image is in the first target image Between the posture of the object and the posture of the object in the second target image, wherein the third hidden vector and the third generation network, the fourth hidden vector and the fourth generation network are based on the above Trained by a network training device.
- an electronic device including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to call the instructions stored in the memory to execute the foregoing method.
- a computer-readable storage medium having computer program instructions stored thereon, and the computer program instructions implement the above-mentioned method when executed by a processor.
- a computer program including computer readable code, and when the computer readable code runs in an electronic device, a processor in the electronic device executes the above-mentioned image processing method.
- the generated image can be obtained through the pre-trained generation network, and the latent vector and the generation network are trained at the same time according to the difference between the degraded image of the generated image and the degraded image of the original image, thereby improving the training effect of the generated network , To achieve more accurate image reconstruction.
- Fig. 1 shows a flowchart of a network training method according to an embodiment of the present disclosure.
- Fig. 2 shows a schematic diagram of a training process of a generative network according to an embodiment of the present disclosure.
- Fig. 3 shows a block diagram of a network training device according to an embodiment of the present disclosure.
- Fig. 4 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
- Fig. 5 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
- image restoration and image editing applications or software it is usually necessary to reconstruct the target image to achieve image restoration and/or image manipulation tasks such as colorization, image completion, super-resolution, confrontation defense, and image deformation.
- image reconstruction the generative network in Generative Adversarial Networks (GAN for short) learned from large-scale natural images can be used as a general image prior, and the hidden vectors and generator parameters can be optimized for image reconstruction.
- GAN Generative Adversarial Networks
- Fig. 1 shows a flowchart of a network training method according to an embodiment of the present disclosure. As shown in Fig. 1, the network training method includes:
- step S11 the latent vector is input to the pre-trained generation network to obtain the first generated image, and the generation network is obtained by training against the discriminant network through multiple natural images;
- step S12 performing degradation processing on the first generated image to obtain a first degraded image of the first generated image
- step S13 the latent vector and the generating network are trained according to the first degraded image and the second degraded image of the target image, wherein the trained generating network and the trained latent vector are used to generate the The reconstructed image of the target image.
- the network training method can be executed by electronic equipment such as a terminal device or a server, and the terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, or a cordless
- UE user equipment
- PDAs personal digital assistants
- the method can be implemented by a processor invoking computer-readable instructions stored in a memory.
- the method can be executed by a server.
- the adversarial generative network is a widely used generative model, which includes a generative network G (Generator) and a discriminant network D (Discriminator).
- the generative network G is responsible for mapping the latent vector to the generated image
- the discriminating network D is responsible for distinguishing Generate images and real images.
- the hidden vector can be sampled from a multivariate Gaussian distribution, for example.
- the generation network G and the discriminant network D are trained through adversarial learning. After the training is completed, the generated network G can be used to sample the synthesized image.
- a plurality of natural images can be used to counter-train the generation network and the discrimination network, and the natural image can be an image that objectively reflects a natural scene. Taking a large number of natural images as samples can make the generation network and the discriminant network learn more general image prior information. After confrontation training, a pre-trained generation network and a discriminant network can be obtained.
- the present disclosure does not limit the selection of natural images and the specific training methods of confrontation training.
- x is the original natural image (which can be called the target image)
- a degraded image an image that has lost some information (for example: loss of color, loss of image blocks, loss of resolution, etc., this type of image is referred to as a degraded image below).
- the type of loss information which can be regarded as the result of degrading the target image (that is, through Obtained), where ⁇ is the corresponding degenerate transformation (for example, ⁇ can be a grayscale transformation such that a color image becomes a grayscale image).
- the degraded image can be Perform image reconstruction in the degraded space.
- the latent vector may be input into the pre-trained generation network in step S11 to obtain the first generated image.
- the hidden vector may be, for example, a hidden vector initialized randomly, which is not limited in the present disclosure.
- the first generated image may be degraded in step S12 to obtain the first degraded image of the first generated image.
- the manner of the degradation processing is the same as the manner of degrading the target image, for example, gray-scale processing.
- step S13 based on the difference (such as similarity or distance) between the first degraded image of the first generated image and the second degraded image of the target image, the latent vector and the generated network Conduct training.
- the training goal of the generative network can be expressed as:
- ⁇ can represent the parameters of the generating network G
- z can represent the hidden vector to be trained
- G(z, ⁇ ) represents the first generated image
- ⁇ (G(z, ⁇ )) represents the first generated image
- the degraded image of the image may be called the first degraded image
- Represents the degraded image of the target image may be referred to as the second degraded image
- L represents the similarity measure between the first degraded image and the second degraded image.
- z* can represent the hidden vector after training
- ⁇ * can represent the parameters of the generated network after training
- x* can represent the reconstructed image of the target image.
- the network loss can be determined according to the similarity between the first degraded image and the second degraded image, and the hidden vector and the parameters of the generated network can be iterated to optimize the hidden vector and generate the parameters of the network according to the network loss to make the network loss converge and obtain the hidden hidden after training.
- Vector sum generative network The latent vector after the training and the generation network are used to generate a reconstructed image of the target image and restore the image information in the target image. Since the generation network G has learned the distribution of natural images, the reconstructed x* will recover The missing natural image information. For example, if It is a grayscale image, and x* is the matching color image.
- the parameters of the hidden vector and the generation network can be adjusted through the backpropagation algorithm and the ADAM (adaptive moment estimation) optimization algorithm. There are no restrictions on training methods.
- the generated image can be obtained through the pre-trained generation network, and the latent vector and the generation network can be trained at the same time according to the difference between the degraded image of the generated image and the degraded image of the original image, thereby improving the training effect of the generated network , To achieve more accurate image reconstruction.
- the hidden vector to be trained may be determined first.
- the hidden vector can be obtained directly, for example, by random sampling from a multivariate Gaussian distribution, or can be obtained in other ways.
- the method further includes: inputting a plurality of initial latent vectors into a pre-trained generation network to obtain a plurality of second generated images; according to the target image and the plurality of second generated images The difference information between, the hidden vector is determined from the plurality of initial hidden vectors.
- multiple initial latent vectors can be randomly sampled, and each initial latent vector is input into the pre-trained generation network G to obtain multiple second generated images.
- the difference information between the original target image and each second generated image can be obtained, for example, the similarity (such as L1 distance) between the target image and each second generated image can be calculated, and the one with the smallest difference (that is, the largest similarity) can be determined
- the second generated image, and the initial hidden vector corresponding to the second generated image may be determined as the hidden vector to be trained. In this way, the determined hidden vector can be made closer to the image information of the target image, thereby improving the training efficiency.
- the method further includes: inputting the target image into a pre-trained coding network, and outputting the hidden vector.
- a coding network for example, a convolutional neural network
- the coding network can be pre-trained through sample images to obtain a pre-trained coding network.
- the sample image is input into the coding network to obtain the hidden vector, and then the hidden vector is input into the pre-trained generation network to obtain the generated image; the coding network is trained according to the difference between the generated image and the sample image, and the present disclosure does not limit the specific training method .
- the target image can be input to the pre-trained coding network, and the hidden vector to be trained is output. In this way, the determined hidden vector can be made closer to the image information of the target image, thereby improving the training efficiency.
- step S13 may include:
- the generation network can be trained according to the discriminant network corresponding to the generation network.
- the first degraded image and the second degraded image of the target image can be separately input into the pre-trained discriminant network for processing, and the first discriminant feature of the first degraded image and the second discriminative feature of the second degraded image are output; according to the first The discriminant feature and the second discriminant feature are used to train the hidden vector and the generating network.
- the L1 distance between the first discriminant feature and the second discriminant feature is used to determine the network loss of the generated network, and then the hidden vector and the parameters of the generated network are adjusted according to the network loss. In this way, the authenticity of the reconstructed image can be better preserved.
- the discriminant network includes a multi-level discriminant network block
- the first degraded image and the second degraded image of the target image are respectively input into a pre-trained discriminant network for processing to obtain the first discriminant feature of the first degraded image and the second discriminative feature of the second degraded image, include:
- the second degraded image is input into the discriminant network for processing, and multiple second discriminant features output by the multi-level discriminant network block of the discriminant network are obtained.
- the discriminant network may include multi-level discriminant network blocks.
- Each discriminant network block may be, for example, a residual block.
- Each residual block includes, for example, at least one residual layer, a fully connected layer, and a pooling layer.
- the present disclosure does not limit the specific structure of each discriminating network block.
- the first degraded image can be input into the discriminant network for processing, and the first discriminant features output by the discriminant network blocks at all levels can be obtained; similarly, the second degraded image can be input into the discriminant network for processing. Obtain the second discriminant feature output by the discriminant network block at all levels. In this way, the characteristics of different depths of the discriminating network can be obtained, so that the subsequent similarity measurement is more accurate.
- the step of training the latent vector and the generating network may include:
- the network loss of the generation network is determined; and the hidden vector and the generation network are trained according to the network loss of the generation network.
- the L1 distance between multiple first discriminant features and multiple second discriminant features can be determined:
- x 1 can represent the first degraded image
- x 2 can represent the second degraded image
- D(x 1 ,i) and D(x 2 ,i) can respectively represent the output of the i-th discriminant network block
- the first discriminant feature and the second discriminant feature, I represents the number of stages of the discriminant network block, 1 ⁇ i ⁇ I, i, I are integers.
- the L1 distance can be directly used as the network loss of the generating network; the L1 distance can also be combined with other loss functions to jointly use the network loss of the generating network. And then train and generate the network according to the network loss.
- the present disclosure does not limit the selection and combination of loss functions.
- this method can better preserve the authenticity of the reconstructed picture and improve the training effect of the generated network.
- the generating network includes N-level generating network blocks
- the step of training the hidden vector and the generating network includes:
- train the first n levels of generation network blocks of the generation network to obtain the generation network after the nth round of training, 1 ⁇ n ⁇ N, and n and N are integers.
- the generation network may include N levels of generation network blocks, and each level of generation network block may include, for example, at least one convolutional layer.
- the present disclosure does not limit the specific structure of each level of generation network block.
- a progressive parameter optimization method can be used for network training.
- the first level generation network block of the generation network can be trained to obtain the generation network after the first round of training; according to the network loss of the generation network after the first round of training, training Generate network blocks of the first and second levels of the generative network to obtain the generative network after the second round of training; and so on, train the first level of the generative network according to the network loss of the generated network after the N-1 round of training Go to the Nth level to generate network blocks, and obtain the generated network after the Nth round of training, as the final generated network.
- Fig. 2 shows a schematic diagram of a training process of a generative network according to an embodiment of the present disclosure.
- the generation network 21 may, for example, include a 4-level generation network block
- the discriminant network 22 may, for example, include a 4-level discriminative network block.
- the hidden vector (not shown) is input into the generating network 21 to obtain the generated image 23; the generated image 23 is input to the discriminant network 22 to obtain the output characteristics of the 4-level discriminant network block of the discriminant network 22, and the output characteristics of the 4-level discriminant network block As the network loss of the generation network 21.
- the training process of the generative network 21 can be divided into four rounds. The first round trains the first level to generate network blocks; the second round trains the first and second levels to generate network blocks; ...; the fourth round of training from level 1 to level 2 Generate the network block at level 4, and get the generated network after training.
- the method further includes:
- the reconstructed image includes a complete image, and the second degraded image includes a missing image;
- the resolution of the reconstructed image is greater than the resolution of the second degraded image.
- the hidden vector and the generating network after training can be obtained.
- the image restoration (image restoration) task can be realized through the trained latent vector and the generation network, that is, the trained latent vector is input into the trained generation network to obtain a reconstructed image of the target image.
- the present disclosure does not limit the types of tasks included in the image restoration task.
- the second degraded image of the target image is a grayscale image (the corresponding degradation function includes grayscale), and the reconstructed image generated by the generation network is a color image.
- the second degraded image of the target image is a missing image, that is, there is a partial loss in the second degraded image
- m represents the binary mask corresponding to the image completion task
- ⁇ represents dot multiplication
- the reconstructed image generated by the generation network is a complete image.
- the second degraded image of the target image is a blurred image (the corresponding degradation function includes downsampling), and the reconstructed image generated by the generation network is a clear image, that is, reconstruction
- the resolution of the image is greater than the resolution of the second degraded image.
- the generation network can restore the information not contained in the target image, and the restoration effect of the image restoration task is significantly improved.
- an image manipulation (image manipulation) task (also referred to as an image editing task) can also be implemented through the trained latent vector and the generation network.
- image manipulation image manipulation
- the present disclosure does not limit the types of tasks included in the image manipulation task. The following describes the processing procedures of several image manipulation tasks.
- an image generation method which includes:
- the first latent vector and the first generation network are obtained by training according to the above-mentioned network training method.
- the trained latent vector and the generation network (herein referred to as the first latent vector and the first generation network) can be obtained by training, and randomization can be achieved through the first latent vector and the first generation network.
- Random jittering can be set, and the random jitter information can be, for example, a random vector or a random number, which is not limited in the present disclosure.
- perturbation processing can be performed on the first latent vector by using the random jitter information, for example, the random jitter information and the first latent vector are superimposed to obtain the disturbed first latent vector. Then input the disturbed first latent vector into the first generation network for processing to obtain a reconstructed image of the target image.
- the position of the object in the reconstructed image is different from the position of the object in the target image, thereby realizing random shaking of the object in the image. In this way, the processing effect of image manipulation tasks can be improved.
- an image generation method which includes:
- the second latent vector and the category features of the preset category are input into a second generation network for processing to obtain a reconstructed image of the target image.
- the second generation network includes a conditional generation network, and the category of the object in the reconstructed image includes the predetermined Assuming a category, the category of the object in the target image is different from the preset category, wherein the second latent vector and the second generation network are obtained by training according to the above-mentioned network training method.
- the trained latent vector and the generating network (herein referred to as the second latent vector and the second generating network) can be obtained by training, and the object can be realized through the second latent vector and the second generating network.
- the category transfer (category transfer).
- the second generation network may be a generation network in a conditional GAN, and its input includes latent vectors and category features.
- multiple categories may be preset, and each preset category has a corresponding category feature.
- Input the second hidden vector and the category features of the preset category into the second generation network for processing, and a reconstructed image of the target image can be obtained.
- the category of the object in the reconstructed image is the preset category, and the category of the object in the original target image is compared with the preset category.
- Set the categories to be different For example, when the object is an animal, the animal in the target image is a dog, and the animal in the reconstructed image is a cat; when the object is a vehicle, the vehicle in the target image is a bus, and the vehicle in the reconstructed image is a truck.
- an image generation method which includes:
- Each interpolation hidden vector is input into the corresponding interpolation generation network to obtain at least one deformed image.
- the posture of the object in the at least one deformed image is between the posture of the object in the first target image and that of the object in the second target image. Between postures,
- the third hidden vector and the third generation network, the fourth hidden vector and the fourth generation network are obtained by training according to the above-mentioned network training method.
- two or more hidden vectors and generating networks can be trained to achieve continuous transition between two images through these hidden vectors and generating networks, that is, image morphing (image morphing). ).
- the third latent vector and the third generation network, the fourth latent vector and the fourth generation network can be trained, and the third generation network is used to generate the reconstruction of the first target image according to the third latent vector Image, the fourth generation network is used to generate a reconstructed image of the second target image according to the fourth latent vector.
- the third hidden vector and the fourth hidden vector, the parameters of the third generation network and the parameters of the fourth generation network can be interpolated respectively to obtain at least one interpolated hidden vector and at least one interpolated generator
- the parameters of the network, that is, the corresponding sets of interpolated hidden vectors and the interpolated generation network are obtained.
- the present disclosure does not limit the specific difference method.
- each interpolation hidden vector may be input into a corresponding interpolation generation network to obtain at least one deformed image.
- the posture of the object in the at least one deformed image is between the posture of the object in the first target image and the posture of the object in the second target image. In this way, the obtained one or more deformed images can realize the transition between the two images.
- the reconstructed image of the first target image, multiple deformed images, and the reconstructed image of the second target image can also be used as video frames to form a video, from discrete images to continuous videos Transformation between.
- the generative network in the Generative Adversarial Networks (GAN for short) learned from large-scale natural images is used as a general image prior, and the hidden vectors and generator parameters are optimized for image processing.
- Reconstruction can restore information outside the target image, such as the color of grayscale images; it can learn the manifold of the image, and realize the manipulation of the high-level semantics of the image.
- the L1 distance against the characteristics of the discriminant network in the generation network is used as the similarity metric for image reconstruction, and the optimization of the parameters of the generation network can be performed in a progressive manner.
- the training effect of the network is further improved, and more accurate image reconstruction can be achieved.
- the method according to the embodiments of the present disclosure can be applied to image restoration, image editing applications or software, effectively realizing the reconstruction of various target images, and realizing a series of image restoration tasks and image manipulation (image manipulation).
- Tasks including but not limited to: colorization (colorization), image completion (inpainting), super-resolution (super-resolution), adversarial defense, random jittering, image morphing , Category transfer, etc.
- the user can use this method to restore the color of grayscale pictures, convert low-resolution images into high-resolution images, and restore image blocks lost in the picture; they can also manipulate the content of the picture, such as turning the dog in the picture into a cat , Change the posture of the dog in the picture, realize the continuous transition of two pictures, etc.
- the present disclosure also provides network training devices, image generation devices, electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any of the network training methods and image generation methods provided in the present disclosure, and the corresponding technical solutions and Description and refer to the corresponding records in the method section, and will not repeat them.
- Fig. 3 shows a block diagram of a network training device according to an embodiment of the present disclosure. As shown in Fig. 3, the device includes:
- the first generation module 31 is configured to input the latent vector into a pre-trained generation network to obtain a first generated image, and the generation network is obtained by training against the discrimination network through a plurality of natural images;
- the degradation module 32 is configured to perform degradation processing on the first generated image to obtain a first degraded image of the first generated image
- the training module 33 is configured to train the latent vector and the generation network according to the first degraded image and the second degraded image of the target image, wherein the trained generation network and the trained latent vector are used to generate the The reconstructed image of the target image.
- the training module includes: a feature acquisition sub-module, configured to input the first degraded image and the second degraded image of the target image into a pre-trained discriminant network for processing, to obtain the The first discriminant feature of the first degraded image and the second discriminant feature of the second degraded image; a first training sub-module for training the hidden vector according to the first discriminant feature and the second discriminant feature And the generating network.
- the discriminant network includes a multi-level discriminant network block
- the feature acquisition submodule includes: a first acquisition submodule, configured to input the first degraded image into the discrimination network for processing To obtain a plurality of first discriminant features output by the multi-level discriminant network block of the discriminant network; the second acquisition sub-module is used to input the second degraded image into the discriminant network for processing to obtain the discriminant network Multiple second discriminant features output by the multi-level discriminant network block.
- the first training sub-module includes: a loss determination sub-module, configured to determine the distance between the first discriminant feature and the second discriminant feature Network loss; a second training sub-module for training the latent vector and the generation network according to the network loss of the generation network.
- the generative network includes N-level generative network blocks
- the second training sub-module is used to train the generative network according to the network loss of the generative network after the n-1th round of training
- the first n levels of the generated network block are obtained, and the generated network after the nth round of training is obtained, 1 ⁇ n ⁇ N, and n and N are integers.
- the device further includes: a second generation module, configured to input a plurality of initial latent vectors into the pre-trained generation network to obtain a plurality of second generated images; and a first vector determination module, using According to the difference information between the target image and the plurality of second generated images, the hidden vector is determined from the plurality of initial hidden vectors.
- a second generation module configured to input a plurality of initial latent vectors into the pre-trained generation network to obtain a plurality of second generated images
- a first vector determination module using According to the difference information between the target image and the plurality of second generated images, the hidden vector is determined from the plurality of initial hidden vectors.
- the device further includes: a second vector determining module, configured to input the target image into a pre-trained coding network, and output the hidden vector.
- the device further includes: a first reconstruction module, configured to input the trained latent vector into the trained generation network to obtain a reconstructed image of the target image, wherein the reconstructed image Including a color image, the second degraded image of the target image includes a grayscale image; or the reconstructed image includes a complete image, and the second degraded image includes a missing image; or the resolution of the reconstructed image is greater than that of the second The resolution of the degraded image.
- a first reconstruction module configured to input the trained latent vector into the trained generation network to obtain a reconstructed image of the target image, wherein the reconstructed image Including a color image, the second degraded image of the target image includes a grayscale image; or the reconstructed image includes a complete image, and the second degraded image includes a missing image; or the resolution of the reconstructed image is greater than that of the second The resolution of the degraded image.
- an image generation device including: a disturbance module, configured to perform disturbance processing on a first latent vector by random jitter information to obtain a disturbed first latent vector; and a second reconstruction module, using The first latent vector after the disturbance is input into the first generation network for processing to obtain a reconstructed image of the target image.
- the position of the object in the reconstructed image is different from the position of the object in the target image.
- a latent vector and the first generation network are obtained by training according to the above-mentioned network training device.
- an image generation device including: a third reconstruction module, configured to input the second latent vector and the category features of the preset category into the second generation network for processing to obtain a reconstructed image of the target image
- the second generation network includes a conditional generation network, the category of the object in the reconstructed image includes the preset category, the category of the object in the target image is different from the preset category, and the second hidden
- the vector and the second generation network are obtained by training according to the above-mentioned network training device.
- an image generation device including: an interpolation module for performing interpolation processing on the third and fourth hidden vectors, the parameters of the third generation network and the parameters of the fourth generation network, respectively , Obtain at least one interpolation hidden vector and at least one parameter of the interpolation generation network, the third generation network is used to generate the reconstructed image of the first target image according to the third hidden vector, and the fourth generation network is used to generate the second image according to the fourth hidden vector A reconstructed image of the target image; a deformed image acquisition module for inputting each interpolation hidden vector into a corresponding interpolation generation network to obtain at least one deformed image, and the posture of the object in the at least one deformed image is in the first target image Between the posture of the object and the posture of the object in the second target image, wherein the third hidden vector and the third generation network, the fourth hidden vector and the fourth generation network are in accordance with the claims
- the network training device described in any one of 12-18 is trained.
- the functions or modules contained in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments.
- the functions or modules contained in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments.
- the embodiments of the present disclosure also provide a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above-mentioned method when executed by a processor.
- the computer-readable storage medium may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium.
- An embodiment of the present disclosure also proposes an electronic device, including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
- the embodiments of the present disclosure also provide a computer program product, which includes computer-readable code.
- the processor in the device executes the network training method and the network training method provided in any of the above embodiments. Instructions for the image generation method.
- the embodiments of the present disclosure also provide another computer program product for storing computer-readable instructions, which when executed, cause the computer to perform the operations of the network training method and the image generation method provided by any of the foregoing embodiments.
- the electronic device can be provided as a terminal, server or other form of device.
- FIG. 4 shows a block diagram of an electronic device 800 according to an embodiment of the present disclosure.
- the electronic device 800 may be a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and other terminals.
- the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, and a sensor component 814 , And communication component 816.
- the processing component 802 generally controls the overall operations of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
- the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the foregoing method.
- the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components.
- the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
- the memory 804 is configured to store various types of data to support operations in the electronic device 800. Examples of these data include instructions for any application or method to operate on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc.
- the memory 804 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic Disk or Optical Disk.
- SRAM static random access memory
- EEPROM electrically erasable programmable read-only memory
- EPROM erasable Programmable Read Only Memory
- PROM Programmable Read Only Memory
- ROM Read Only Memory
- Magnetic Memory Flash Memory
- Magnetic Disk Magnetic Disk or Optical Disk.
- the power supply component 806 provides power for various components of the electronic device 800.
- the power supply component 806 may include a power management system, one or more power supplies, and other components associated with the generation, management, and distribution of power for the electronic device 800.
- the multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user.
- the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from users.
- the touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure related to the touch or slide operation.
- the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
- the audio component 810 is configured to output and/or input audio signals.
- the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal.
- the received audio signal may be further stored in the memory 804 or transmitted via the communication component 816.
- the audio component 810 further includes a speaker for outputting audio signals.
- the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module.
- the above-mentioned peripheral interface module may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: home button, volume button, start button, and lock button.
- the sensor component 814 includes one or more sensors for providing the electronic device 800 with various aspects of state evaluation.
- the sensor component 814 can detect the on/off status of the electronic device 800 and the relative positioning of the components.
- the component is the display and the keypad of the electronic device 800.
- the sensor component 814 can also detect the electronic device 800 or the electronic device 800.
- the position of the component changes, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration/deceleration of the electronic device 800, and the temperature change of the electronic device 800.
- the sensor component 814 may include a proximity sensor configured to detect the presence of nearby objects when there is no physical contact.
- the sensor component 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
- the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
- the communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices.
- the electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof.
- the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
- the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication.
- the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
- RFID radio frequency identification
- IrDA infrared data association
- UWB ultra-wideband
- Bluetooth Bluetooth
- the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field-available A programmable gate array (FPGA), controller, microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
- ASIC application-specific integrated circuits
- DSP digital signal processors
- DSPD digital signal processing devices
- PLD programmable logic devices
- FPGA field-available A programmable gate array
- controller microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
- a non-volatile computer-readable storage medium such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to complete the foregoing method.
- FIG. 5 shows a block diagram of an electronic device 1900 according to an embodiment of the present disclosure.
- the electronic device 1900 may be provided as a server. 5
- the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932, for storing instructions executable by the processing component 1922, such as application programs.
- the application program stored in the memory 1932 may include one or more modules each corresponding to a set of instructions.
- the processing component 1922 is configured to execute instructions to perform the above-described methods.
- the electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to the network, and an input output (I/O) interface 1958 .
- the electronic device 1900 can operate based on an operating system stored in the memory 1932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
- a non-volatile computer-readable storage medium is also provided, such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to complete the foregoing method.
- the present disclosure may be a system, method and/or computer program product.
- the computer program product may include a computer-readable storage medium loaded with computer-readable program instructions for enabling a processor to implement various aspects of the present disclosure.
- the computer-readable storage medium may be a tangible device that can hold and store instructions used by the instruction execution device.
- the computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
- Non-exhaustive list of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a printer with instructions stored thereon
- RAM random access memory
- ROM read-only memory
- EPROM erasable programmable read-only memory
- flash memory flash memory
- SRAM static random access memory
- CD-ROM compact disk read-only memory
- DVD digital versatile disk
- memory stick floppy disk
- mechanical encoding device such as a printer with instructions stored thereon
- the computer-readable storage medium used here is not interpreted as the instantaneous signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (for example, light pulses through fiber optic cables), or through wires Transmission of electrical signals.
- the computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing/processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
- the network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
- the network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network, and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device .
- the computer program instructions used to perform the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or in one or more programming languages.
- Source code or object code written in any combination, the programming language includes object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages.
- Computer-readable program instructions can be executed entirely on the user's computer, partly on the user's computer, executed as a stand-alone software package, partly on the user's computer and partly executed on a remote computer, or entirely on the remote computer or server carried out.
- the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to access the Internet connection).
- LAN local area network
- WAN wide area network
- an electronic circuit such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by using the status information of the computer-readable program instructions.
- the computer-readable program instructions are executed to realize various aspects of the present disclosure.
- These computer-readable program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine that makes these instructions when executed by the processor of the computer or other programmable data processing device , A device that implements the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams is produced. It is also possible to store these computer-readable program instructions in a computer-readable storage medium. These instructions make computers, programmable data processing apparatuses, and/or other devices work in a specific manner. Thus, the computer-readable medium storing the instructions includes An article of manufacture, which includes instructions for implementing various aspects of the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
- each block in the flowchart or block diagram may represent a module, program segment, or part of an instruction, and the module, program segment, or part of an instruction contains one or more components for realizing the specified logical function.
- Executable instructions may also occur in a different order from the order marked in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
- each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or actions Or it can be realized by a combination of dedicated hardware and computer instructions.
- the computer program product can be specifically implemented by hardware, software, or a combination thereof.
- the computer program product is specifically embodied as a computer storage medium.
- the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc. Wait.
- SDK software development kit
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Probability & Statistics with Applications (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
Description
Claims (25)
- 一种网络训练方法,包括:将隐向量输入预训练的生成网络,得到第一生成图像,所述生成网络是与判别网络通过多个自然图像对抗训练得到的;对所述第一生成图像进行退化处理,得到所述第一生成图像的第一退化图像;根据所述第一退化图像及目标图像的第二退化图像,训练所述隐向量及所述生成网络,其中,训练后的生成网络和训练后的隐向量用于生成所述目标图像的重建图像。
- 根据权利要求1所述的方法,其特征在于,根据所述第一退化图像及目标图像的第二退化图像,训练所述隐向量及所述生成网络,包括:将所述第一退化图像及目标图像的第二退化图像分别输入预训练的判别网络中处理,得到所述第一退化图像的第一判别特征及所述第二退化图像的第二判别特征;根据所述第一判别特征及所述第二判别特征,训练所述隐向量及所述生成网络。
- 根据权利要求2所述的方法,其特征在于,所述判别网络包括多级判别网络块,将所述第一退化图像及目标图像的第二退化图像分别输入预训练的判别网络中处理,得到所述第一退化图像的第一判别特征及所述第二退化图像的第二判别特征,包括:将所述第一退化图像输入所述判别网络中处理,得到所述判别网络的多级判别网络块输出的多个第一判别特征;将所述第二退化图像输入所述判别网络中处理,得到所述判别网络的多级判别网络块输出的多个第二判别特征。
- 根据权利要求2或3所述的方法,其特征在于,根据所述第一判别特征及所述第二判别特征,训练所述隐向量及所述生成网络,包括:根据所述第一判别特征及所述第二判别特征之间的距离,确定所述生成网络的网络损失;根据所述生成网络的网络损失,训练所述隐向量及所述生成网络。
- 根据权利要求4所述的方法,其特征在于,所述生成网络包括N级生成网络块,根据所述生成网络的网络损失,训练所述隐向量及所述生成网络,包括:根据第n-1轮训练后的生成网络的网络损失,训练所述生成网络的前n级生成网络块,得到第n轮训练后的生成网络,1≤n≤N,n、N为整数。
- 根据权利要求1-5中任意一项所述的方法,其特征在于,所述方法还包括:将多个初始隐向量输入预训练的生成网络,得到多个第二生成图像;根据所述目标图像与所述多个第二生成图像之间的差异信息,从所述多个初始隐向量中确定出所述隐向量。
- 根据权利要求1-5中任意一项所述的方法,其特征在于,所述方法还包括:将所述目标图像输入预训练的编码网络,输出所述隐向量。
- 根据权利要求1-7中任意一项所述的方法,其特征在于,所述方法还包括:将训练后的隐向量输入训练后的生成网络,得到所述目标图像的重建图像,其中,所述重建图像包括彩色图像,所述目标图像的第二退化图像包括灰度图像;或所述重建图像包括完整图像,所述第二退化图像包括缺失图像;或所述重建图像的分辨率大于所述第二退化图像的分辨率。
- 一种图像生成方法,所述方法包括:通过随机抖动信息对第一隐向量进行扰动处理,得到扰动后的第一隐向量;将所述扰动后的第一隐向量输入第一生成网络中处理,得到目标图像的重建图像,所述重建图像中对象的位置与所述目标图像中对象的位置不同,其中,所述第一隐向量及所述第一生成网络是根据权利要求1-7中任意一项所述的网络训练方法训练得到的。
- 一种图像生成方法,所述方法包括:将第二隐向量及预设类别的类别特征输入第二生成网络中处理,得到目标图像的重建图像,所述第二生成网络包括条件生成网络,所述重建图像中对象的类别包括所述预设类别,所述目标图像中对象的类别与所述预设类别不同,其中,所述第二隐向量及所述第二生成网络是根据权利要求1-7中任意一项所述的网络训练方法训练得到的。
- 一种图像生成方法,所述方法包括:对第三隐向量与第四隐向量、第三生成网络的参数与第四生成网络的参数分别进行插值处理,得到至少一个插值隐向量以及至少一个插值生成网络的参数,第三生成网络用于根据第三隐向量生成第一目标图像的重建图像,第四生成网络用于根据第四隐向量生成第二目标图像的重建图像;将各个插值隐向量分别输入相应的插值生成网络,得到至少一个变形图像,所述至少一个变形图像中对象的姿态处于所述第一目标图像中对象的姿态与所述第二目标图像中对象的姿态之间,其中,所述第三隐向量及所述第三生成网络、所述第四隐向量及所述第四生成网络是根据权利要求1-7中任意一项所述的网络训练方法训练得到的。
- 一种网络训练装置,包括:第一生成模块,用于将隐向量输入预训练的生成网络,得到第一生成图像,所述生成网络是与判别网络通过多个自然图像对抗训练得到的;退化模块,用于对所述第一生成图像进行退化处理,得到所述第一生成图像的第一退化图像;训练模块,用于根据所述第一退化图像及目标图像的第二退化图像,训练所述隐向量及所述生成网络,其中,训练后的生成网络和训练后的隐向量用于生成所述目标图像的重建图像。
- 根据权利要求12所述的装置,其特征在于,所述训练模块包括:特征获取子模块,用于将所述第一退化图像及目标图像的第二退化图像分别输入预训练的判别网络中处理,得到所述第一退化图像的第一判别特征及所述第二退化图像的第二判别特征;第一训练子模块,用于根据所述第一判别特征及所述第二判别特征,训练所述隐向量及所述生成网络。
- 根据权利要求13所述的装置,其特征在于,所述判别网络包括多级判别网络块,所述特征获取子模块包括:第一获取子模块,用于将所述第一退化图像输入所述判别网络中处理,得到所述判别网络的多级判别网络块输出的多个第一判别特征;第二获取子模块,用于将所述第二退化图像输入所述判别网络中处理,得到所述判别网络的多级判别网络块输出的多个第二判别特征。
- 根据权利要求13或14所述的装置,其特征在于,所述第一训练子模块包括:损失确定子模块,用于根据所述第一判别特征及所述第二判别特征之间的距离,确定所述生成网络的网络损失;第二训练子模块,用于根据所述生成网络的网络损失,训练所述隐向量及所述生成网络。
- 根据权利要求15所述的装置,其特征在于,所述生成网络包括N级生成网络块,所述第二训练子模块用于:根据第n-1轮训练后的生成网络的网络损失,训练所述生成网络的前n级生成网络块,得到第n轮训练后的生成网络,1≤n≤N,n、N为整数。
- 根据权利要求12-16中任意一项所述的装置,其特征在于,所述装置还包括:第二生成模块,用于将多个初始隐向量输入预训练的生成网络,得到多个第二生成图像;第一向量确定模块,用于根据所述目标图像与所述多个第二生成图像之间的差异信息,从所述多个初始隐向量中确定出所述隐向量。
- 根据权利要求12-16中任意一项所述的装置,其特征在于,所述装置还包括:第二向量确定模块,用于将所述目标图像输入预训练的编码网络,输出所述隐向量。
- 根据权利要求12-18中任意一项所述的装置,其特征在于,所述装置还包括:第一重建模块,用于将训练后的隐向量输入训练后的生成网络,得到所述目标图像的重建图像, 其中,所述重建图像包括彩色图像,所述目标图像的第二退化图像包括灰度图像;或所述重建图像包括完整图像,所述第二退化图像包括缺失图像;或所述重建图像的分辨率大于所述第二退化图像的分辨率。
- 一种图像生成装置,包括:扰动模块,用于通过随机抖动信息对第一隐向量进行扰动处理,得到扰动后的第一隐向量;第二重建模块,用于将所述扰动后的第一隐向量输入第一生成网络中处理,得到目标图像的重建图像,所述重建图像中对象的位置与所述目标图像中对象的位置不同,其中,所述第一隐向量及所述第一生成网络是根据权利要求12-18中任意一项所述的网络训练装置训练得到的。
- 一种图像生成装置,包括:第三重建模块,用于将第二隐向量及预设类别的类别特征输入第二生成网络中处理,得到目标图像的重建图像,所述第二生成网络包括条件生成网络,所述重建图像中对象的类别包括所述预设类别,所述目标图像中对象的类别与所述预设类别不同,其中,所述第二隐向量及所述第二生成网络是根据权利要求12-18中任意一项所述的网络训练装置训练得到的。
- 一种图像生成装置,包括:插值模块,用于对第三隐向量与第四隐向量、第三生成网络的参数与第四生成网络的参数分别进行插值处理,得到至少一个插值隐向量以及至少一个插值生成网络的参数,第三生成网络用于根据第三隐向量生成第一目标图像的重建图像,第四生成网络用于根据第四隐向量生成第二目标图像的重建图像;变形图像获取模块,用于将各个插值隐向量分别输入相应的插值生成网络,得到至少一个变形图像,所述至少一个变形图像中对象的姿态处于所述第一目标图像中对象的姿态与所述第二目标图像中对象的姿态之间,其中,所述第三隐向量及所述第三生成网络、所述第四隐向量及所述第四生成网络是根据权利要求12-18中任意一项所述的网络训练装置训练得到的。
- 一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行权利要求1至11中任意一项所述的方法。
- 一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行 时实现权利要求1至11中任意一项所述的方法。
- 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现权利要求1至11中任意一项所述的方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020227024492A KR20220116015A (ko) | 2020-01-09 | 2020-07-02 | 네트워크 트레이닝 방법 및 장치, 이미지 생성 방법 및 장치 |
US17/853,816 US20220327385A1 (en) | 2020-01-09 | 2022-06-29 | Network training method, electronic device and storage medium |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010023029.7 | 2020-01-09 | ||
CN202010023029.7A CN111223040B (zh) | 2020-01-09 | 2020-01-09 | 网络训练方法及装置、图像生成方法及装置 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/853,816 Continuation US20220327385A1 (en) | 2020-01-09 | 2022-06-29 | Network training method, electronic device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021139120A1 true WO2021139120A1 (zh) | 2021-07-15 |
Family
ID=70832269
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/099953 WO2021139120A1 (zh) | 2020-01-09 | 2020-07-02 | 网络训练方法及装置、图像生成方法及装置 |
Country Status (5)
Country | Link |
---|---|
US (1) | US20220327385A1 (zh) |
KR (1) | KR20220116015A (zh) |
CN (1) | CN111223040B (zh) |
TW (1) | TWI759830B (zh) |
WO (1) | WO2021139120A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114140603A (zh) * | 2021-12-08 | 2022-03-04 | 北京百度网讯科技有限公司 | 虚拟形象生成模型的训练方法和虚拟形象生成方法 |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111223040B (zh) * | 2020-01-09 | 2023-04-25 | 北京市商汤科技开发有限公司 | 网络训练方法及装置、图像生成方法及装置 |
CN111767679B (zh) * | 2020-07-14 | 2023-11-07 | 中国科学院计算机网络信息中心 | 时变矢量场数据的处理方法及装置 |
CN112003834B (zh) * | 2020-07-30 | 2022-09-23 | 瑞数信息技术(上海)有限公司 | 异常行为检测方法和装置 |
CN114007099A (zh) * | 2021-11-04 | 2022-02-01 | 北京搜狗科技发展有限公司 | 一种视频处理方法、装置和用于视频处理的装置 |
CN113822798B (zh) * | 2021-11-25 | 2022-02-18 | 北京市商汤科技开发有限公司 | 生成对抗网络训练方法及装置、电子设备和存储介质 |
CN114299588B (zh) * | 2021-12-30 | 2024-05-10 | 杭州电子科技大学 | 一种基于局部空间转换网络的实时目标编辑方法 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20190040586A (ko) * | 2017-10-11 | 2019-04-19 | 인하대학교 산학협력단 | 인공신경망을 이용한 단일 영상 고해상도 복원 방법 및 시스템 |
CN109816620A (zh) * | 2019-01-31 | 2019-05-28 | 深圳市商汤科技有限公司 | 图像处理方法及装置、电子设备和存储介质 |
CN109840890A (zh) * | 2019-01-31 | 2019-06-04 | 深圳市商汤科技有限公司 | 图像处理方法及装置、电子设备和存储介质 |
CN111223040A (zh) * | 2020-01-09 | 2020-06-02 | 北京市商汤科技开发有限公司 | 网络训练方法及装置、图像生成方法及装置 |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11449759B2 (en) * | 2018-01-03 | 2022-09-20 | Siemens Heathcare Gmbh | Medical imaging diffeomorphic registration based on machine learning |
CN110633755A (zh) * | 2019-09-19 | 2019-12-31 | 北京市商汤科技开发有限公司 | 网络训练方法、图像处理方法及装置、电子设备 |
-
2020
- 2020-01-09 CN CN202010023029.7A patent/CN111223040B/zh active Active
- 2020-07-02 KR KR1020227024492A patent/KR20220116015A/ko not_active Application Discontinuation
- 2020-07-02 WO PCT/CN2020/099953 patent/WO2021139120A1/zh active Application Filing
- 2020-08-24 TW TW109128779A patent/TWI759830B/zh active
-
2022
- 2022-06-29 US US17/853,816 patent/US20220327385A1/en not_active Abandoned
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20190040586A (ko) * | 2017-10-11 | 2019-04-19 | 인하대학교 산학협력단 | 인공신경망을 이용한 단일 영상 고해상도 복원 방법 및 시스템 |
CN109816620A (zh) * | 2019-01-31 | 2019-05-28 | 深圳市商汤科技有限公司 | 图像处理方法及装置、电子设备和存储介质 |
CN109840890A (zh) * | 2019-01-31 | 2019-06-04 | 深圳市商汤科技有限公司 | 图像处理方法及装置、电子设备和存储介质 |
CN111223040A (zh) * | 2020-01-09 | 2020-06-02 | 北京市商汤科技开发有限公司 | 网络训练方法及装置、图像生成方法及装置 |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114140603A (zh) * | 2021-12-08 | 2022-03-04 | 北京百度网讯科技有限公司 | 虚拟形象生成模型的训练方法和虚拟形象生成方法 |
JP2022177218A (ja) * | 2021-12-08 | 2022-11-30 | ベイジン バイドゥ ネットコム サイエンス テクノロジー カンパニー リミテッド | 虚像生成モデルのトレーニング方法および虚像生成方法 |
JP7374274B2 (ja) | 2021-12-08 | 2023-11-06 | ベイジン バイドゥ ネットコム サイエンス テクノロジー カンパニー リミテッド | 虚像生成モデルのトレーニング方法および虚像生成方法 |
Also Published As
Publication number | Publication date |
---|---|
TWI759830B (zh) | 2022-04-01 |
CN111223040B (zh) | 2023-04-25 |
CN111223040A (zh) | 2020-06-02 |
TW202127369A (zh) | 2021-07-16 |
US20220327385A1 (en) | 2022-10-13 |
KR20220116015A (ko) | 2022-08-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021139120A1 (zh) | 网络训练方法及装置、图像生成方法及装置 | |
WO2020224457A1 (zh) | 图像处理方法及装置、电子设备和存储介质 | |
WO2021155632A1 (zh) | 图像处理方法及装置、电子设备和存储介质 | |
WO2021196401A1 (zh) | 图像重建方法及装置、电子设备和存储介质 | |
WO2021056621A1 (zh) | 文本序列的识别方法及装置、电子设备和存储介质 | |
WO2021208667A1 (zh) | 图像处理方法及装置、电子设备和存储介质 | |
WO2020199704A1 (zh) | 文本识别 | |
WO2021012564A1 (zh) | 视频处理方法及装置、电子设备和存储介质 | |
CN111612070B (zh) | 基于场景图的图像描述生成方法及装置 | |
CN110245757B (zh) | 一种图像样本的处理方法及装置、电子设备和存储介质 | |
WO2023050723A1 (zh) | 视频插帧方法、装置、电子设备、存储介质、程序及程序产品 | |
WO2021208666A1 (zh) | 字符识别方法及装置、电子设备和存储介质 | |
CN111242303B (zh) | 网络训练方法及装置、图像处理方法及装置 | |
WO2020172979A1 (zh) | 数据处理方法和装置、电子设备和存储介质 | |
TWI778313B (zh) | 圖像處理方法、電子設備和儲存介質 | |
WO2020220807A1 (zh) | 图像生成方法及装置、电子设备及存储介质 | |
CN110633470A (zh) | 命名实体识别方法、装置及存储介质 | |
WO2021056770A1 (zh) | 图像重建方法及装置、电子设备和存储介质 | |
CN113139484B (zh) | 人群定位方法及装置、电子设备和存储介质 | |
CN111988622B (zh) | 视频预测方法及装置、电子设备和存储介质 | |
CN111311588B (zh) | 重定位方法及装置、电子设备和存储介质 | |
WO2021082381A1 (zh) | 人脸识别方法及装置、电子设备和存储介质 | |
CN114842404A (zh) | 时序动作提名的生成方法及装置、电子设备和存储介质 | |
CN110443363B (zh) | 图像特征学习方法及装置 | |
CN107992893B (zh) | 压缩图像特征空间的方法及装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20911364 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2022540701 Country of ref document: JP Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 20227024492 Country of ref document: KR Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20911364 Country of ref document: EP Kind code of ref document: A1 |