A method and system for generating surface images based on generative adversarial networks
By training the texture generation adversarial network and embedding it into the complete sample generation adversarial network, the problem of insufficient texture clarity and types when generating exoplanet samples is solved, and the effect of stably generating surface sample features and increasing sample types is achieved. .
Patent Information
- Application Number
- CN202210249374.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-14
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-03-14
AI Technical Summary
Existing GAN networks are difficult to generate sufficiently clear textures or produce fewer texture types when generating exoterrestrial planetary samples, especially when facing data skews, which are difficult to generate samples with a small proportion in the training data.
By first training the texture generation adversarial network to learn texture features, and then embed them into the complete sample generation adversarial network, using multi-scale embedding and resolution enhancement layers, the complete surface sample generation adversarial network is gradually trained to generate extraterrestrial planetary samples.
In the case of data skew, the surface image sample features are generated stably, which increases the types of surface samples that can be generated by the adversarial generation network, avoids the problem of network difficulty in training caused by directly learning all sample features, and reduces generation by phased training. The difficulty of better samples.
Smart Images

Figure CN114758021B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computer vision and deep learning technology, and specifically involves a method of first training a texture generation generative adversarial network (GAN), and then embedding the network into a complete image generation GAN to complete planetary landform generation. Background Art
[0002] PGGAN achieves good results in tasks such as face generation by training in stages with gradually increasing output resolution. PGGAN training starts with low-resolution images and then gradually increases the resolution by adding layers to the network. This network growth training process can first discover a small number of features at a larger scale, and then gradually move on to learning more refined features, gradually learning features at each scale. In addition, the step-by-step training process can also avoid the problem of gradient vanishing when all layers are trained together, where the front layers are difficult to train. In actual operation, the progressively growing adversarial generative network introduces techniques including smooth transitions in resolution, balanced learning rates, and small batch standard deviations to improve training results. Its training process is as follows: Figure 1 shown.
[0003] StyleGAN is inspired by style transfer and designs a new generator network structure based on PGGAN. The new network structure can decouple and separate the high-level semantic attributes of the image through unsupervised automatic learning, such as the posture and identity of the face image, the random changes of the generated image such as freckles and hair, and can also achieve a certain degree of control synthesis. Its generator network structure is as follows Figure 2 As shown, compared with the traditional structure, it is changed to consist of two parts: a mapping network and a generation network.
[0004] "Multi-Scale Terrain Texturing using Generative Adversarial Networks" This work proposes a novel automatic generation process of detail maps that can reduce tiling artifacts in real-time terrain rendering. This is achieved by training a generative adversarial network (GAN) with a single input texture and then using it to synthesize a huge texture that spans the entire terrain. During the rendering process, the low-frequency components of the GAN output are extracted, downscaled, and combined with the high-frequency components of the input texture. This produces highly detailed and non-repetitive terrain textures, eliminating tiling artifacts without reducing the overall image quality. Rendering is efficient in terms of memory consumption and computational cost.
[0005] However, PGGAN has difficulty in synthesizing images with clear textures that conform to real-world features, and the types of terrain samples that can be generated are limited; StyleGAN and StyleGANv2 can generate images with clear enough textures, but it is still difficult to generate samples that account for a small proportion of the training data when faced with data skew; Multi-Scale Terrain Texturing using Generative Adversarial Networks uses a texture stitching method, and generating images with textures through stitching may be difficult to avoid tiling artifacts during the stitching process. Summary of the invention
[0006] In view of the above problems, the present invention proposes a surface image generation method based on a generative adversarial network, including: obtaining an original surface image, generating an original data set, a texture data set and a framework data set; constructing a texture generative adversarial network, and training the texture generative adversarial network with the texture data set; constructing a framework generative adversarial network, and training the framework generative adversarial network with the framework data set; embedding the generator of the texture generative adversarial network into the generator of the framework generative adversarial network to obtain a surface image generative adversarial network, and training the surface image generative adversarial network with the original data set; and generating a surface image using the generator of the surface image generative adversarial network as a surface image generation model.
[0007] The surface image generation method described in the present invention, wherein the step of obtaining the surface image generation adversarial network specifically includes: embedding the generator g1' of the texture generation adversarial network GAN1 into the generator g2' of the framework generation adversarial network gan2, and connecting the multi-layer fusion and resolution increase layer g3 after g2' to obtain the generator G2 of the surface image generation adversarial network GAN2; adding the resolution reduction network d3 before the discriminator d2' of the framework generation adversarial network gan2 to obtain the discriminator D2 of GAN2; and training GAN2 with the original data set R for a specified number of iterations.
[0008] The surface image generation method of the present invention, wherein the surface image generates a discriminator of the adversarial network The loss function ;in, For History loss The proportion, For the previous iteration , is the Wasserstein-gp loss function.
[0009] The surface image generation method of the present invention, wherein the loss function of the discriminator D1 of the texture generation adversarial network is for: ; for Current losses and Historical Value The new weighted value, is the weight of label loss, is the scale label loss function, For History loss The proportion, For the previous iteration , is the Wasserstein-gp loss function.
[0010] The present invention also proposes a surface image generation system based on a generative adversarial network, comprising: an original data acquisition module, used to obtain the original surface image, generate an original data set, a texture data set and a framework data set; a first model training module, used to construct a texture generative adversarial network, and train the texture generative adversarial network with the texture data set; a second model training module, used to construct a framework generative adversarial network, and train the framework generative adversarial network with the framework data set; a third model training module, used to embed the generator of the texture generative adversarial network into the generator of the framework generative adversarial network to obtain a surface image generative adversarial network, and train the surface image generative adversarial network with the original data set; a surface image generation module, used to generate a surface image using the generator of the surface image generative adversarial network as a surface image generation model.
[0011] The surface image generation system described in the present invention, wherein the third model training module specifically includes: a network generation module, used to generate the surface image generation adversarial network; wherein the generator g1' of the texture generation adversarial network GAN1 is embedded in the generator g2' of the framework generation adversarial network gan2, and a multi-layer fusion and resolution increase layer g3 is connected after g2' to obtain the generator G2 of the surface image generation adversarial network GAN2; a resolution reduction network d3 is added before the discriminator d2' of the framework generation adversarial network gan2 to obtain the discriminator D2 of GAN2; a network training module, used to train GAN2 for a specified number of iterations with the original data set R.
[0012] The surface image generation system of the present invention, wherein the surface image generates a discriminator of the adversarial network The loss function ;in, For History loss The proportion, For the previous iteration , is the Wasserstein-gp loss function.
[0013] The surface image generation system of the present invention, wherein the loss function of the discriminator D1 of the texture generation adversarial network is for: ; for Current losses and Historical Value The new weighted value, is the weight of label loss, is the scale label loss function, For History loss The proportion, For the previous iteration , is the Wasserstein-gp loss function.
[0014] The present invention also proposes a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are executed, the surface image generation method based on the generative adversarial network as described above is implemented.
[0015] The present invention also proposes a data processing device, comprising the computer-readable storage medium as described above, and when the processor of the data processing device retrieves and executes the computer-executable instructions in the computer-readable storage medium, a surface image is generated. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a schematic diagram of the PGGAN adversarial network training process.
[0017] Figure 2 This is a schematic diagram of the StyleGAN generator network structure.
[0018] Figure 3 It is a flow chart of the method for generating a ground surface image of the present invention.
[0019] Figure 4A , 4B 4C is a schematic diagram of the surface image generation adversarial network structure of the present invention.
[0020] Figure 5 This is an example diagram of the embedding method of the texture generation adversarial network of the present invention and the complete network structure of GAN2.
[0021] Figure 6 This is a schematic diagram of the terrain sample in R and the R1 construction process of the present invention.
[0022] Figure 7 It is a schematic diagram of a data processing device of the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation method described herein is only used to explain the present invention and is not used to limit the present invention.
[0024] The purpose of the present invention is to solve the problem that the existing GAN network is difficult to generate sufficiently clear textures or generates fewer types of textures when facing skewed data in the task of generating exoplanet samples. A GAN-based exoplanet surface sample generation method is proposed. The method is characterized by first training a texture generative adversarial network to learn texture features, then embedding the texture generative adversarial network into a complete sample generative adversarial network at multiple scales, and finally training the complete surface sample generative adversarial network to generate exoplanet samples.
[0025] In the process of trying to use the Mars surface data set to complete the generation of Mars surface samples, the inventor found that it is difficult to use the existing GAN network structure (PGGAN) to synthesize images with clear textures that conform to real-world characteristics, and the types of terrain samples that can be generated are limited; StyleGAN and StyleGANv2 can generate images with clear textures, but it is still difficult to generate samples that account for a small proportion of the training data when facing data skew. The inventor believes that the reason for this problem is that the unevenness of the samples makes it difficult for specific textures to be fully learned in the process of directly generating a complete surface image.
[0026] The inventor studied the characteristics of Martian surface image samples and found that the surface images mainly contain several specific surface features, namely several specific textures. The texture of each texture can be cut out from the complete data set. These cut-out feature blocks have a smaller resolution and are therefore easily learned by the GAN network. The difficulty of generating a complete surface sample image can be reduced by first learning the texture and then learning the overall image.
[0027] Based on the above analysis, the inventors proposed that a texture generative adversarial network is first trained by intercepting terrain texture blocks; in the second step, the low-resolution partial layer of the complete generative adversarial network is preliminarily trained by using samples blurred by low-resolution samples; finally, the texture generative adversarial network is embedded in the complete framework network, and adversarial training is performed using real images to obtain a generative network that can generate clear texture features and a sufficient variety of terrains.
[0028] The surface image generation method of the present invention adopts a combined GAN structure, first training the texture generation adversarial network to learn texture features, and then embedding the trained texture generation adversarial network into the complete sample generation GAN network for training. In this way, when the surface samples have a certain degree of skewness, it can avoid directly learning all sample features, which makes it difficult to train the network to obtain a good generation effect, and staged training reduces the difficulty of generating better samples.
[0029] The texture generation adversarial network of the present invention uses input noise to be transformed by a fully connected network and then input into the rear resolution enhancement network. During independent training, the output of the fully connected layer is reduced according to the channel dimension, so that only a single sample is generated for easy training and the fully connected network can be trained at the same time; after being embedded in the complete generation adversarial network, the output of the fully connected layer is input into the rear network after being dispersed by multiple channels, so that the complete network can generate multiple samples in a single cycle. In this way, a single output of the texture generation adversarial network only contains a small number of texture information, and multiple embedding of multiple textures can generate more types of texture features for the generated samples.
[0030] In addition, the texture learning network is trained using scaling constraints, so that the output texture of the texture generation adversarial network can be controlled by the input scale constraint; accordingly, when embedding the complete sample generation adversarial network, multiple output feature maps are embedded in different resolution enhancement layers. Scale constraints and multi-resolution embedding enable the sample generation adversarial network to use texture information of different scales at different stages.
[0031] The overall process of the surface image generation method based on the generative adversarial network focusing on texture generation of the present invention is as follows: Figure 3 As shown, it contains 5 overall steps: Figure 3 The network structures introduced in Figure 4A , 4B , as shown in 4C, the specific steps are as follows:
[0032] Step S1: collect the original planetary surface data set R, construct a data set R1 containing texture scales from the data set R through selection, preprocessing, cropping, and scaling, and construct a low-resolution framework data set R2 from the data set R through fuzzy downsampling.
[0033] The dataset R can be constructed by following the steps below:
[0034] Step S11, the data set R is a surface image data set shot with a near-surface camera at a relatively fixed viewing angle and cropped into square blocks of a fixed size.
[0035] Dataset R1 can be constructed by following the steps below:
[0036] Step S12, uniformly selecting terrain samples from R and adding them to set R'.
[0037] Step S13: for each sample in R', use a background segmentation algorithm, such as GrabCut, to roughly segment the foreground and background to obtain a foreground partial mask.
[0038] Step S14, the foreground mask is expanded and contracted to connect the similar masks, and the mask area is used for filtering to delete the mask part with a smaller area.
[0039] Step S15, for each continuous mask area convex hull on a mask, the largest square is cut from the inside or the smallest square is obtained from the outside according to the area size to obtain a set of square mask areas, and each single square mask in the set is used to crop an image block from the original image as a texture sample block.
[0040] Step S16 , for each cropped sample block, a ratio is calculated as a scale factor compared to the target size, the sample block is scaled to the target size using the scale factor, and the obtained sample block and the corresponding scale factor are added to the data set R1 .
[0041] The data set R2 can be constructed by following the steps below:
[0042] Step S17: for each sample in R, firstly blur and filter out fine-grained noise, for example, using a Gaussian blur algorithm. Scaling the blurred sample to a lower target resolution, the obtained image is added to the sample set R2.
[0043] It should be understood that the collection of data set R and the construction of data sets R1 and R2 are not limited to the above steps. For example, data set R can be collected through drone perspective shooting and / or satellite image capture methods, data set R1 can be constructed through manual capture and / or deep learning foreground segmentation methods, and data set R2 can also be constructed through direct downsampling methods. The present invention is not limited to this.
[0044] Step S2: Construct a texture generative adversarial network GAN1 and use the dataset R1 to train GAN1 until it meets the preset requirements. Specifically, it includes:
[0045] Step S21, constructing a texture generation adversarial network GAN1 based on the GAN network, such as Figure 4A As shown, the GAN1 network details are as follows:
[0046] Step S211, GAN1 network generator The composition includes: multi-level fully connected network part , multi-level convolution + resolution enhancement network part , primary RGB conversion layer , among which, and The connected sub-network is used as the sub-generator to be provided by the GAN1 network .
[0047] Step S212, setting , , The input vector is , which is composed of the connected noise vector and the vector formed by connecting the scale coefficient S, set The length is Len( );set up The output vector is , the length is ;set up The network input feature map is a vector , the length is . for M times of , where M is an integer greater than 1.
[0048] Step S213: Folded into M channels, each channel length is A tensor of which M channels are averaged to obtain a single-channel vector input ; The output is a multi-channel feature map , through After conversion, the output is an RGB color image with the same size as the target texture block in the R1 set.
[0049] Step S214, the GAN1 network discriminator is , The output is a binary true or false discrimination and the predicted scale coefficient .
[0050] Step S215, The loss function It consists of two parts. The first part is the historical average Wasserstein-gp loss function. , the second part is the scale label loss function The loss function is specifically defined as follows:
[0051] (1)
[0052] (2)
[0053] (3)
[0054] In the above formula, is the weight of label loss, 1 for history loss The proportion, For the current and the new value weighted by the historical value, is the Wasserstein-gp loss function, Generate sample distribution for the generator, is the real sample distribution, is the distribution of all samples, Calculate for the discriminator, The last iteration saved , is the scale label loss function, is the true label value of the sample, Predict the value for the sample label.
[0055] Step S22, training the texture generation adversarial network GAN1, inputting control noise into the network generator G1 And the scale coefficient S generates a false sample P1; P1 and the real sample in R1 are input into the network discriminator D1 for prediction and , calculate the loss function And back propagate, iteratively train the generator G1 and the discriminator D1 until the end. The training ends when the preset number of iterations is reached or the score of the generated samples stably exceeds the threshold.
[0056] Step S3: Construct a low-resolution generative adversarial network gan2 and train gan2 using the dataset R2 until it meets the preset requirements. Specifically, it includes:
[0057] Step S31: construct the low-resolution part of the surface sample generation adversarial network GAN2 ,like Figure 4B As shown, The network details are as follows:
[0058] Step S311, Initial frame generator for the network Then connect the RGB conversion layer . It is composed of a single fully connected layer connected to a convolution layer + a resolution enhancement layer. The input is used to control the noise , the output is a multi-channel feature map , the feature map After conversion, the output is an RGB color image P2 with the same size as the target texture block of the data set R2.
[0059] Step S312, The network discriminator is , The output is a binary true or false discrimination .
[0060] Step S313, The loss function L d2' The loss function L of the network discriminator D2 of GAN2 D2 Consistent.
[0061] Step S32, training network: gan2 network generator input control noise Generate fake samples ;Will And compared with the real sample input discriminator prediction in R2 , calculate the loss function and back propagate, iteratively train the generator and discriminator until the end. The training ends when the preset number of iterations is reached or the score of the generated samples stably exceeds the threshold.
[0062] Step S4: Construct a complete sample generative adversarial network GAN2, and use the dataset R to train GAN2 until it meets the preset requirements. Specifically include:
[0063] Step S41, construct a complete surface sample generative adversarial network GAN2, the abstract network structure is as follows Figure 4C As shown, the example network structure is as follows Figure 5 As shown, the build details are as follows:
[0064] Step S411, in the generator of GAN2 In the example, a sub-generator of the trained texture generative adversarial network GAN1 is embedded. Part as Subgenerator (The corresponding output is ), trained In the network generator Part as (The corresponding output is ).
[0065] Step S412, generator Based on the existing network layer, Added multi-layer fusion & resolution-enhanced layer at the back , where the resolution enhancement network is denoted as , each layer The structure is convolution + upsampling resolution, Then connect a RGB conversion layer to convert the feature map into an RGB image.
[0066] Step S413: Embed in Resolution enhancement layer middle, Modifications and Embed The method will be described in detail below.
[0067] Step S414, in the discriminator of GAN2 In the network discriminator of gan2, As , and in On this basis, a resolution reduction network d3 is added, and the structure of each layer of d3 is realized by a convolutional layer. The network size of each layer in the medium resolution reduction layer is set according to the total number of parameters of the generator to balance the number of parameters of the generator G2 and the discriminator D2.
[0068] Step S415, The loss function is the historical average Wasserstein-gp loss function.
[0069] (4)
[0070] In formula (4), The last iteration saved , The definition is the same as that of formula (2). a2 is similar to a1 in formula (2) and is the historical 2 Loss The proportion.
[0071] Step S42: The network is embedded in the back of G2 as follows:
[0072] Step S421, Network input noise vector , set the length to ; The M layer in the G2 resolution enhancement layer is connected; the length of the G2 network input noise vector Z is , .
[0073] Step S422, Network part modification: part The input is originally Layer output The vector obtained by reducing the channel dimension is of shape [ ], the input is changed to Broadcast the M-channel tensor obtained by dividing by M and folding it , The shape is [M* ]. This process can make Each time M groups are generated Size feature map.
[0074] Step S423, split the input vector Z into corresponding Part and correspondence The two parts of the part are input into g1 and g2 respectively. The g1 part outputs the M channel feature map , part g2 outputs feature map f2.
[0075] Step S424, for a feature map of a channel in feature map F1 , add a convolutional splicing network layer to the back of the feature map , perform tiling and convolution operations, and output the output feature map of the previous layer of the target insertion position in G2 Feature maps of the same length and width .
[0076] Step S425: and Connect to form a new feature map ,Will Input the next resolution upscaling layer Output .
[0077] Step S426, for the feature map The insertion position of each channel From 1 to M, execute the above-mentioned steps S422 to S425 to complete the insertion.
[0078] Step S43, GAN2 network training method:
[0079] Step S431: The generator inputs the control noise Z to generate a false sample P; P and the real sample in R are input into the discriminator prediction , calculate the loss function And back propagate, iteratively train the generator and discriminator until the end.
[0080] Step S432: The training process is divided into two stages: initial training and overall training.
[0081] a) In the initial training, the parameters of the original network layers g1, g2, d2, etc. are fixed, only the newly added layers are trained, and a gradual transition strategy is adopted in the connection between the original network and the newly added network;
[0082] b) When the initial network training reaches the specified number of iterations, it enters the overall training stage. In the overall training stage, all network parameters are made trainable, but a smaller learning rate is set for the g1 network part.
[0083] Step S5: Extract the generator part G2 of the sample generation adversarial network GAN2, and input the control vector to generate surface samples.
[0084] Specific implementation examples:
[0085] Example parameter setting: The target resolution of the sample generation adversarial network is [512*512] in the data set R, [64*64] in the R1 data set, and [64*64] in the low-resolution frame image sample resolution in the R2 data set. The length is 255, The length is 256, The length of is 512 and M is 3.
[0086] Step 1: Construct data sets R, R1, R2.
[0087] The dataset R consists of 10,000 [512*512] Mars sample images. 500 samples of 20 types of terrains are captured from R and scaled to [64*64], and the scaling ratios are recorded and compared as sample set R1. For each image of R, the resolution is reduced by blurring to obtain sample set R2.
[0088] The terrain sample in example R and the R1 construction process are as follows Figure 6 As shown:
[0089] Step 2: Build the texture generative adversarial network GAN1 network and train it using the data set R1.
[0090] Generator in GAN1 Designed for: The layer is 3 layers, input The length is 255, S is 1, the output length is 768, the size is changed to [3,256] size tensor, and the 3-channel specification is reduced to
[256] length vector , then enter . In the network, it is first converted into a [128*4*4] feature map through a fully connected layer, and then the [128*4*4] feature map is gradually upgraded in resolution + convolution to finally obtain a [8*64*64] feature map, that is, The output feature maps of each layer of the network are [128*4*4, 64*8*8, 32*16*16, 16*32*32, 8*64*64] from front to back. Transformation Sutra The layer is converted to an RGB image of [3*64*64] .
[0091] Discriminator in GAN1 The design is: the input is a 3*64*64 image, and the output is two scalars. and . It consists of 5 convolutional resolution reduction layers and 3 fully connected layers at the back. The outputs of the convolutional resolution reduction layers are [8*64*64, 16*32*32, 32*16*16, 64*8*8, 128*4*4] from front to back. The back is connected to the fully connected layer, and the input is the output of the previous layer expanded into a 2048-length vector. The output lengths of each fully connected layer are 256, 256, and 2.
[0092] The training process is: the loss function is ; The optimizer is Adam optimizer; the ratio of discriminator and generator training times is 1:1; the termination condition is that the network converges and the number of iterations reaches 5000 times.
[0093] Step 3: Construct the low-resolution part of the surface sample generative adversarial network gan2 network and train it using the data set R2.
[0094] Generator in gan2 The design is as follows: the length of the input noise Z' is 256, which is converted into a [512*4*4] feature map through a fully connected layer. The subsequent resolution enhancement layer constructs a generator similar to GAN1. The resolution of each feature map is the same and the number of output channels is increased. The final output is a [64*64*64] feature map. Converted to a [3*64*64] sample image.
[0095] Discriminator in gan2 The design is as follows: the shape of the input feature map is [3*64*64], which is converted into a [64*64*64] feature map through a convolutional layer. The subsequent resolution reduction layer structure is similar to the discriminator D1 of GAN1. The difference is that the number of output channels of each layer of the network increases, and the final output is only the authenticity discrimination TorF, that is, the output length of the last fully connected layer is 1.
[0096] The training process is: the loss function is ; Other configurations are the same as training GAN1.
[0097] Step 4: Construct the surface sample generative adversarial network GAN2 and train it using the data set R.
[0098] Construct the complete GAN2 structure as follows Figure 3 As shown, it contains the existing network GAN1 and Part of the layer, that is, the g1 part corresponding to the GAN1 network (which contains , ) and the corresponding gan2 network , .
[0099] The modification of g1 is: the output of fc1 Each channel is divided by 3 and folded into a multi-channel tensor of shape [3*256] and input up1. Instead of reducing the multi-channel to a single channel vector of length
[256] as in step 2, Figure 3 As shown in part g1.
[0100] GAN2 adds a total of four new networks, including multi-layer fusion and resolution-enhancing layers in the generator part. There are 3 groups of networks:
[0101] 1) 3 levels of resolution enhancement . Each output The shapes are [32*128*128], [16*256*256], [16*512*512].
[0102] 2) 3-level convolutional concatenation layer . The respective inputs are The feature map of a channel in is of shape [8*64*64]. The layers are tiled + repeated + convolved, and each outputs The shapes are [32*128*128], [16*256*256], [16*512*512].
[0103] 3) The RGB conversion layer converts the last level feature map into an RGB image, and the output shape is [3*512*512].
[0104] Add a new network in the discriminator part:
[0105] 4) Multi-level reduced-resolution convolution layer d3. The structure of d3 is that the input is [3*512*512] feature map and the output is [8*64*64] feature map (consistent with the input of the latter d2).
[0106] Step 5: Extract samples Generate adversarial network generator input control vector output sample.
[0107] Extract the generator G2 in GAN2 and input the control noise vector Z with a length of 512 to generate samples.
[0108] Figure 7 Schematic diagram of the data processing device of the present invention. Figure 7As shown, an embodiment of the present invention further provides a computer-readable storage medium and a data processing device. The computer-readable storage medium of the present invention stores computer-executable instructions. When the computer-executable instructions are executed by the processor of the data processing device, the above-mentioned surface image generation method based on the generative adversarial network is implemented. A person of ordinary skill in the art can understand that all or part of the steps in the above-mentioned method can be completed by instructing related hardware (such as a processor, FPGA, ASIC, etc.) through a program, and the program can be stored in a readable storage medium, such as a read-only memory, a disk or an optical disk, etc. All or part of the steps in the above-mentioned embodiment can also be implemented using one or more integrated circuits. Accordingly, each module in the above-mentioned embodiment can be implemented in the form of hardware, such as implementing its corresponding functions through an integrated circuit, or can be implemented in the form of a software function module, such as implementing its corresponding functions through a processor executing a program / instruction stored in a memory. The embodiment of the present invention is not limited to any specific form of combination of hardware and software.
[0109] This method can stably generate surface image sample features when there is a certain degree of deviation in the surface samples, and increase the types of surface samples that can be generated by the adversarial generative network.
[0110] The above implementation modes are only used to illustrate the present invention, but not to limit the present invention. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the present invention. The scope of protection of the present invention should be defined by the claims.
Claims
1. A method for generating surface images based on a generative adversarial network, characterized in that: include: Step 1, obtain the original surface image, generate the original data set, texture data set and framework data set; Step 2, constructing a generator and a discriminator of a texture generation adversarial network, and training the texture generation adversarial network with the texture dataset; The loss function of the discriminator of the texture generation adversarial network is constructed using the Wasserstein-gp loss function and the scale label loss function; Step 3, construct the generator and discriminator of the framework generative adversarial network, train the framework generative adversarial network with the framework dataset; construct the loss function of the discriminator of the framework generative adversarial network with the Wasserstein-gp loss function; Step 4, embedding the generator of the texture generative adversarial network into the generator of the framework generative adversarial network, and connecting multiple layers of fusion and resolution enhancement layers after the generator of the framework generative adversarial network to obtain the generator of the surface image generative adversarial network; adding a resolution reduction network before the discriminator of the framework generative adversarial network to obtain the discriminator of the surface image generative adversarial network; training the surface image generative adversarial network with the original data set for a specified number of iterations; wherein the loss function of the discriminator of the framework generative adversarial network is constructed with the Wasserstein-gp loss function; Step 5: Generate a surface image using the generator of the surface image generative adversarial network as a surface image generation model.
2. The method for generating a ground surface image according to claim 1, wherein: The loss function of the discriminator of the surface image generation adversarial network ; in, For History loss The proportion, For the previous iteration , is the Wasserstein-gp loss function.
3. The method for generating a ground surface image according to claim 1, wherein: The loss function of the discriminator of the texture generation adversarial network for: ; for Current losses and Historical Value The new weighted value, is the weight of label loss, is the scale label loss function, For History loss The proportion, For the previous iteration , is the Wasserstein-gp loss function.
4. A surface image generation system based on a generative adversarial network, characterized in that: include: The original data acquisition module is used to obtain the original surface image and generate the original data set, texture data set and framework data set; The first model training module is used to construct a generator and a discriminator of a texture generation adversarial network, and train the texture generation adversarial network with the texture data set; wherein the loss function of the discriminator of the texture generation adversarial network is constructed with a Wasserstein-gp loss function and a scale label loss function; The second model training module is used to construct a generator and a discriminator of the framework generation adversarial network, and train the framework generation adversarial network with the framework data set; wherein the loss function of the discriminator of the framework generation adversarial network is constructed with the Wasserstein-gp loss function; The third model training module is used to generate the surface image generation adversarial network; wherein the generator of the texture generation adversarial network is embedded in the generator of the framework generation adversarial network, and multiple layers of fusion and resolution increase layers are connected after the generator of the framework generation adversarial network to obtain the generator of the surface image generation adversarial network; a resolution reduction network is added before the discriminator of the framework generation adversarial network to obtain the discriminator of the surface image generation adversarial network; the surface image generation adversarial network is trained for a specified number of iterations with the original data set; wherein the loss function of the discriminator of the framework generation adversarial network is constructed with the Wasserstein-gp loss function; The surface image generation module is used to generate a surface image using the generator of the surface image generation adversarial network as a surface image generation model.
5. The surface image generation system according to claim 4, characterized in that: The loss function of the discriminator of the surface image generation adversarial network ; in, For History loss The proportion, For the previous iteration , is the Wasserstein-gp loss function.
6. The surface image generation system according to claim 4, characterized in that: The loss function of the discriminator of the texture generation adversarial network for: ; for Current losses and Historical Value The new weighted value, is the weight of label loss, is the scale label loss function, For History loss The proportion, For the previous iteration , is the Wasserstein-gp loss function.
7. A computer-readable storage medium storing computer-executable instructions, which, when executed, implement the surface image generation method based on a generative adversarial network as described in any one of claims 1 to 3.
8. A data processing device, comprising the computer-readable storage medium as claimed in claim 7, wherein when a processor of the data processing device retrieves and executes the computer-executable instructions in the computer-readable storage medium, a surface image is generated.
Citation Information
Patent Citations
A method for 3D reconstruction and texture generation from single-view face based on multi-task learning
CN109255831A
Super-resolution reconstruction method based on conditional generative adversarial network
CN109978762A
Sea surface rainy day image sample augmentation method based on generative adversarial network
CN111145116A
Image tampering recognition model training method and device and image tampering recognition method and device
CN111368342A
Image synthesis with generative adversarial network
US20210012486A1
