A sketch-to-picture cross-domain synthesis method, system and device
Through a method based on a recurrent generative adversarial network, combined with a local area suppression attention mechanism and a multi-category end-to-end model, the problem of missing geometric deformation and category information in sketch-to-picture synthesis is solved, and high-quality sketch conversion and multi-category are achieved. Sketch composition.
Patent Information
- Application Number
- CN202311186044.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-14
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2043-09-14
AI Technical Summary
The existing technology is difficult to effectively convert sketches into pictures, especially when dealing with the semantic gap between the sketch domain and the picture domain. It cannot correct the geometric deformation of the sketch and simulate the sparse strokes of novice users, and lacks category information, resulting in sketches to pictures. The synthesis quality is not high.
Using a method based on recurrent generative adversarial networks, we build an attention mechanism module with local area suppression and a multi-category end-to-end sketch-to-picture synthesis model. Through geometric transformation and color filling, we combine the discriminant network and the improved residual module with the above Sampling structure for high-quality conversion of sketches.
It improves the quality of sketch-to-picture synthesis and can better correct the geometric deformation of sketches and simulate multi-category sketches. The generated pictures are more in line with human visual perception and have better generalization ability and robustness.
Smart Images

Figure CN117292017B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cross-domain image synthesis, and in particular to a sketch-to-image cross-domain synthesis method, system and device. Background Art
[0002] For a long time, vision and language are the two main media for humans to understand the real world, and sketches are another convenient and efficient information carrier. The increasing popularity of electronic touch-screen devices and smart terminals has provided users with smooth and convenient hand-drawing and handwriting conditions. When people want to describe an object, a quick and intuitive way is to draw it, and reduce the uncertainty of verbal description by describing the spatial position, placement, and significant texture information of the object. However, it is very challenging for machines to synthesize hand-drawn sketches into pictures. In order to overcome the semantic gap between the sketch domain and the picture domain, it is urgent to study the cross-domain synthesis task from sketch to picture.
[0003] Due to the diversity, randomness and high abstraction of sketches, most existing studies use edge maps instead of sketches to complete the cross-domain conversion process of images. However, there are significant differences between edge maps and sketches. Edge maps cannot meet the shape correction caused by spatial deformation, cannot simulate the sparse strokes drawn by novice users, and the model trained on the input edge map cannot be generalized to hand-drawn sketches to a large extent. The problems of existing technologies are: (1) there is a large difference between the sketch domain and the image domain, (2) the existing model cannot correct the geometric deformation of the sketch, and (3) there is a lack of category information for the task of synthesizing multi-category sketches.
[0004] At present, the research on hand-drawn sketches has become a major branch in the field of computer vision perception, and has achieved good results to a certain extent. However, there are only a few studies on sketch-to-image synthesis, and there is little verifiable information. In addition, there is no clear measurement standard for evaluating the quality of image synthesis, and the evaluation of synthesized images is mainly based on human subjective evaluation and visual perception. Summary of the invention
[0005] The purpose of the present invention is to provide a sketch-to-picture cross-domain synthesis method, system and device, which can improve the quality of picture synthesis in the field of single-category and multi-category sketches.
[0006] To achieve the above object, the present invention provides the following solutions:
[0007] A sketch-to-image cross-domain synthesis method, comprising:
[0008] Obtain a sketch-picture dataset; and preprocess the sketch-picture dataset; the picture pairs in the sketch-picture dataset are hand-drawn sketches and corresponding pictures; the preprocessing includes data enhancement;
[0009] Construct a synthetic picture model based on a recurrent generative adversarial network; the synthetic picture model based on the recurrent generative adversarial network includes: an attention mechanism module with local region suppression, a single-category sketch-to-picture synthesis model, a multi-category end-to-end sketch-to-picture synthesis model, and a discriminant network; the attention mechanism module with local region suppression is used to divide the sketch into a single-category sketch and a multi-category sketch according to the stroke-dense area in the sketch; the single-category sketch-to-picture synthesis model is used to perform geometric transformation and color filling on the single-category sketch to obtain a synthetic picture; the multi-category end-to-end sketch-to-picture synthesis model will improve the residual module and upsampling structure, add the category labels of the sketch and the picture to the network, and add a picture classifier in the discriminant network, and then synthesize the multi-category sketches to obtain a synthetic picture; the discriminant network is used to discriminate the synthetic picture;
[0010] Use the sketch-image dataset to train a synthetic image model based on a recurrent generative adversarial network;
[0011] Use the trained synthetic image model based on the cyclic generative adversarial network to synthesize the sketch to be converted.
[0012] Optionally, the single-category sketch-to-image synthesis model utilizes a geometric discriminator D when performing geometric transformation. g Identify the geometric features of the sketch; use cycle-consistent loss and joint perceptual loss to work together on the input sketch and the corresponding image;
[0013] The single-category sketch-to-picture synthesis model performs color filling according to the discriminator D I The color intensity loss is used to determine the consistency of the synthesized image and the original real image in the brightness channel of the color space; and the AdaIN style transfer module is regarded as a generator, D I It is a discriminator that improves the quality of rendered images through mutual competition.
[0014] Optionally, the specific process of the multi-category end-to-end sketch-to-picture synthesis model is as follows:
[0015] In the sketch-to-picture conversion phase, the multi-category generator G P The image is synthesized using the category information of the sketch and attention mechanism denoising, downsampling encoding, AdaIN residual module, and sub-pixel convolution upsampling operations.
[0016] In the image-to-sketch conversion stage, the single-category generator G S The encoding module encodes the features of the real image, converts it through multiple layers of residual modules, and performs upsampling operations on the decoder, and finally outputs the converted sketch;
[0017] In the multi-category generator, the normalization layer of the residual module is improved, and the AdaIN layer is used to replace the original IN layer; in the encoder part, the sub-pixel convolution PixShuffle is used, and the pixel reorganization operation replaces the original transposed convolution;
[0018] Optionally, the image classifier uses a HRNet classification network as a feature extraction part.
[0019] Optionally, a geometric discriminator is combined with a texture-based PatchGAN discriminator to train a synthetic image model based on a cyclic generative adversarial network.
[0020] A sketch-to-image cross-domain synthesis system, comprising:
[0021] A data set processing module, used to obtain a sketch-picture data set; and preprocess the sketch-picture data set; the picture pairs in the sketch-picture data set are hand-drawn sketches and corresponding pictures; the preprocessing includes data enhancement;
[0022] A model building module is used to build a synthetic picture model based on a recurrent generative adversarial network; the synthetic picture model based on the recurrent generative adversarial network includes: an attention mechanism module with local region suppression, a single-category sketch-to-picture synthesis model, a multi-category end-to-end sketch-to-picture synthesis model, and a discriminant network; the attention mechanism module with local region suppression is used to divide the sketch into a single-category sketch and a multi-category sketch according to the stroke-dense area in the sketch; the single-category sketch-to-picture synthesis model is used to perform geometric transformation and color filling on the single-category sketch to obtain a synthetic picture; the multi-category end-to-end sketch-to-picture synthesis model will improve the residual module and upsampling structure, add the category labels of the sketch and the picture to the network, and add a picture classifier in the discriminant network, and then synthesize the sketches of multiple categories to obtain a synthetic picture; the discriminant network is used to discriminate the synthetic picture;
[0023] A model training module, which is used to train a synthetic image model based on a cyclic generative adversarial network using a sketch-image dataset;
[0024] The image synthesis module is used to synthesize the sketch to be converted using the trained synthetic image model based on the cyclic generative adversarial network.
[0025] A sketch-to-picture cross-domain synthesis device comprises: at least one processor, at least one memory and computer program instructions stored in the memory, and when the computer program instructions are executed by the processor, a sketch-to-picture cross-domain synthesis method is implemented.
[0026] Optionally, the memory is a computer-readable storage medium.
[0027] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0028] The present invention provides a sketch-to-picture cross-domain synthesis method, system and device, which realizes the recognition of sketches of different categories by using a synthetic picture model based on a cyclic generative adversarial network, designs picture cross-domain synthesis models for single-category sketches and multi-category sketches respectively, enhances the sketch data, and adds an attention mechanism with local area suppression to the network, thereby exploring the rich semantic information of sketches in cross-domain synthesis tasks. The present invention performs a preprocessing operation on the data set, and secondly, the single-category sketch picture synthesis model (single-category sketch-to-picture synthesis model) adopts a two-stage method, wherein the geometric transformation stage is to correct the geometric deformation of the sketch, and the color filling stage is to supplement the texture details and color rendering, and finally outputs a variety of real pictures that conform to human visual perception; the multi-category sketch picture synthesis model (multi-category end-to-end sketch-to-picture synthesis model) adopts an end-to-end network design, and the category labels of the sketches and pictures are input into the network by improving the generator and upsampling structure, and the picture classifier is added to ensure that the category output is subject to the category input, and the overall shape and texture details of the final synthetic image have more outstanding performance. The present invention not only mines the effective features of sketch data in cross-domain tasks, but also makes full use of multi-category label information, ultimately obtaining high-quality and realistic synthetic images. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 A sketch-to-picture cross-domain synthesis method, system and device provided by the present invention;
[0031] Figure 2 Network diagram for the geometric transformation phase of the single-category two-stage sketch-to-image synthesis model;
[0032] Figure 3 This is a diagram of the single-category generator network structure;
[0033] Figure 4 This is the structure diagram of the discriminator network;
[0034] Figure 5 This is a network diagram for the color filling phase of the single-category two-stage sketch-to-picture synthesis model;
[0035] Figure 6 The network structure diagram of the multi-category end-to-end sketch-to-image synthesis model;
[0036] Figure 7 This is the network structure diagram of the multi-category generator. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] The purpose of the present invention is to provide a sketch-to-picture cross-domain synthesis method, system and device, which can improve the quality of picture synthesis in the field of single-category and multi-category sketches.
[0039] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0040] like Figure 1 As shown, the present invention provides a sketch-to-picture cross-domain synthesis method, comprising:
[0041] S101, obtaining a sketch-picture dataset; and preprocessing the sketch-picture dataset; the picture pairs in the sketch-picture dataset are hand-drawn sketches and corresponding pictures; the preprocessing includes data enhancement.
[0042] Sketch-image datasets are pixel-level datasets of one or several categories.
[0043] Sketch data enhancement: ①Add random lines; ②Add random noise blocks.
[0044] 100 pictures containing redundant lines were created and combined with sketches for training with a probability of 0.2 during training. In addition, 50×50 sketch noise blocks were randomly cropped from the original sketch dataset and combined with the original sketches for training with a random probability of 0.3. The purpose of this is to enrich the diversity of sketches and construct a sketch set with redundant lines, thereby enhancing the robustness of the network model in processing complex sketch data.
[0045] Image data enhancement: The image is processed using the unified center cropping method, and the size of the cropped image is 256 × 256. The background color of the images in the data set is white, so horizontal flipping and translation operations are used to preprocess the data. Specifically, during the training process, the data is translated up and down and left and right by 2 pixels with a random probability of 0.1. This data enhancement method can not only increase the number of data sets, but also make the model more stable to changes in input data and improve the generalization ability of the model.
[0046] S102, constructing a synthetic image model based on a recurrent generative adversarial network; the synthetic image model based on a recurrent generative adversarial network includes: an attention mechanism module with local area suppression, a single-category sketch-to-image synthesis model, a multi-category end-to-end sketch-to-image synthesis model and a discriminant network; the attention mechanism module with local area suppression is used to divide the sketch into a single-category sketch and a multi-category sketch according to the stroke-dense area in the sketch; the single-category sketch-to-image synthesis model is used to perform geometric transformation and color filling on the single-category sketch to obtain a synthetic image; the multi-category end-to-end sketch-to-image synthesis model will improve the residual module and upsampling structure, add the category labels of the sketch and the image to the network, and add an image classifier in the discriminant network, and then synthesize the multi-category sketches to obtain a synthetic image; the discriminant network is used to discriminate the synthetic image.
[0047] like Figure 2 As shown in the figure, in the geometric transformation stage, the framework consists of the following parts: two generators: sketch to grayscale image generator G A and grayscale to sketch generator G B , two discriminators D A and D B Acting on each generator separately, it is used to encourage the generator to synthesize outputs that are difficult to distinguish from the corresponding real pictures. The framework uses an unpaired sketch picture dataset for training, defines two picture domains A and B, and there is a pair of mappings G and F. G learns the mapping from sketch s (s∈A) to real picture p (p∈B). On the contrary, F learns the mapping from real picture p to sketch s. On this basis, this study designed a pair of novel geometric discriminators and Used to identify the geometric features of the image. Experimental results show that the proposed geometric discriminator combined with the texture-based PatchGAN discriminator can effectively learn the prior information of the sketch, enabling the network to remove geometric artifacts in the synthesized image, thereby optimizing the generated network.
[0048] Figure 3 A structural diagram of a generator of a network diagram in a geometric transformation phase provided by an embodiment of the present invention, the method comprising:
[0049] The single-category generator mainly consists of three parts: encoder, conversion network, and decoder. For convenience, Figure 3 The network is described in a symbolic abbreviation, where the encoder C7S1-64 represents 64 7×7 convolution kernels with a stride of 1. After the ReLU activation function and instance normalization operation, a convolution operation is completed. The input image of the network has a resolution of 256×256 and is a single-channel image. For black-and-white images such as hand-drawn sketches, the weighted average is used as the grayscale value before entering the network to facilitate the network to output grayscale images. The intermediate conversion network is actually composed of 9 residual blocks, each of which consists of two convolution layers, with a convolution kernel size of 3×3, a stride of 1, and 64 filters.
[0050] The present invention adds an ASA (Area Suppression Attention) module with regional suppression effect, which aims to locally denoise the image in the input network, so that the generation network will pay more attention to the stroke features of the sketch style unchanged; first, the hand-drawn image is passed through the encoder part to obtain a 256-dimensional feature map, and the data size is 64×64 at this time. After passing through the convolution layer with a convolution kernel size of 1, a 2-dimensional feature map is obtained. Secondly, after feature dimension transformation and Softmax normalization operation, the number of channels is adjusted, the attention map is inverted and then subtracted from 1, and then dot multiplication is performed with the spatial pixel points represented by the original feature, and the weights are redistributed to obtain the final feature map, which is used as the input of the subsequent network to complete the task of generating a sketch to a grayscale image.
[0051] The loss is calculated using the L1 norm. The preprocessed sketch data is converted into a sketch without noise after network conversion. This loss is applied to the input image and the reconstructed image. The result reflects the denoising effect of the ASA attention module. The self-supervised denoising loss is shown in formula (1), where S represents the original sketch data and S noise This is the picture after adding noise block.
[0052] L ss (G,F)=||SF(G(S noise ))||1 (1)
[0053] Figure 4 A discriminator structure diagram of a network diagram in a geometric transformation phase provided by an embodiment of the present invention, the method comprising:
[0054] The geometric discriminator proposed in the present invention is combined with the texture-based PatchGAN discriminator to train the network, resulting in significant improvements in the quality of synthesized photos and human visual perception.
[0055] The geometric discriminator D provided by the present invention g, which is used to identify the geometric features of the image. It uses cycle-consistent loss and joint perceptual loss to work together on the input image and the reconstructed image, while paying attention to the pixel-level information, it retains the high-level features of the image that conform to human visual perception.
[0056] The present invention defines the Euclidean distance in the high-level feature space as the perceptual loss, which is used to measure the difference between the high-level features of the image. The perceptual loss of the jth layer of the input image x and the reconstructed image y is defined as shown in formula (2):
[0057]
[0058] Among them, φ represents the loss network, φ j (.) represents the feature map of the input loss network, N j is the number of perceptrons in the jth layer. This patent uses the same layers as the geometric discriminator, namely the 7th, 10th and 13th layers, and defines the joint perceptual loss of the loss network as shown in formula (3); where represents the reconstructed image.
[0059]
[0060] The cycle consistency loss can capture the low-frequency information of the image and ensure the accuracy of the low-level features, while the joint perceptual loss focuses on the semantic differences and high-level features of the image. By combining these two losses, the synthesized images can be made more realistic.
[0061] Figure 5 A network diagram of a color filling phase in a single-category two-stage sketch-to-picture synthesis model provided by an embodiment of the present invention, the method comprising:
[0062] In the color filling stage, the n grayscale images {B1…B n} to perform color rendering, fill in the lost texture detail features, and finally synthesize realistic and diverse real color pictures {C1…C n During the training process, the network introduces the AdaIN style transfer module, which can selectively inject the reference image style information. Since the perceived brightness of the synthesized real image and the input grayscale image in the CIE Lab color space should be the same, a discriminator D is added. I , introduces color intensity loss to judge the consistency of the synthetic image and the original real image in the brightness channel of the color space; the network regards the style transfer module as a generator, D I The discriminator improves the quality of the rendered image as much as possible through mutual competition. The color intensity loss is shown in formula (4), where the grayscale method means converting the RGB image into a grayscale image.
[0063]
[0064] Figure 6 A multi-category end-to-end sketch-to-picture synthesis model network diagram provided by an embodiment of the present invention, the method includes:
[0065] First, a picture is randomly selected from the sketch domain and the picture domain, respectively, and input into the generative network. In the sketch-to-picture conversion stage, the multi-category generator G P The class information corresponding to the sketch is used as input, and multi-class image synthesis is completed through attention mechanism denoising, downsampling encoding, AdaIN residual module and sub-pixel convolution upsampling operation. In the image-to-sketch conversion stage, the single-class generator G S The encoding module encodes the features of the real image, converts it through multiple layers of residual modules, and performs upsampling operations on the decoder, and finally outputs the converted sketch image; in the discriminant network part, the input of the discriminator is the generated image and the real image, and after extracting features through multiple layers of convolution, the output result in the range of 0 to 1 is obtained. Because the focus of this patent is on the synthesis from sketch to image, the category constraint is only performed in the image domain with the help of the image classifier, the current loss is calculated according to the loss function, and the network is optimized by updating the gradient parameters to reach the global optimal point.
[0066] Figure 7 A multi-category generator network structure diagram of a multi-category end-to-end sketch-to-picture synthesis model provided by an embodiment of the present invention, the method comprising:
[0067] In the multi-class generator G P In , the normalization layer of the residual module is improved, and the AdaIN layer is used instead of the original IN layer. Since the network input image size is 256×256, a 9-layer AdaIN residual module is used, and the rest of the structure remains unchanged. If you want to achieve a style transfer effect during training, you can use the AdaIN layer to match the channel mean and standard deviation of the content input x to the channel mean and standard deviation of the style input y, and change the reflection parameters γ and β to achieve it. Based on this theory, this patent uses the category label as the style input, replaces the γ and β parameters in the IN layer with a one-hot encoding vector, and uses the sketch feature map as the content input. The image content information is combined with the category label through AdaIN. The advantage of this processing is that the category semantic information of the sketch guides the feature expression of the synthesized image.
[0068] The encoder in the image generation network can construct images from low resolution to high resolution, which is also called the upsampling process. Transposed convolution is a more common upsampling method. Convolution operations will produce smaller and smaller feature maps. For tasks that require consistent input and output sizes, it is necessary to use transposed convolution to gradually enlarge the feature map. However, for some special scenarios, a checkerboard effect will appear in the generated image, such as the transposed convolution with a convolution kernel size of 3×3 and a stride of 2. The main reason is that the convolution kernel size and stride cannot be divided evenly. To address this problem, the present invention uses sub-pixel convolution PixShuffle in the encoder part, and the pixel reorganization operation replaces the original transposed convolution. This method can effectively enlarge the feature map and achieve upsampling of the corresponding multiple.
[0069] S103, using the sketch-picture dataset to train a synthetic picture model based on a cyclic generative adversarial network;
[0070] S104, using the trained synthetic image model based on the cyclic generative adversarial network to perform image synthesis on the sketch to be converted.
[0071] Corresponding to the above method, the present invention also provides a sketch-to-picture cross-domain synthesis system, comprising:
[0072] A data set processing module, used to obtain a sketch-picture data set; and preprocess the sketch-picture data set; the picture pairs in the sketch-picture data set are hand-drawn sketches and corresponding pictures; the preprocessing includes data enhancement;
[0073] A model building module is used to build a synthetic picture model based on a recurrent generative adversarial network; the synthetic picture model based on the recurrent generative adversarial network includes: an attention mechanism module with local region suppression, a single-category sketch-to-picture synthesis model, a multi-category end-to-end sketch-to-picture synthesis model, and a discriminant network; the attention mechanism module with local region suppression is used to divide the sketch into a single-category sketch and a multi-category sketch according to the stroke-dense area in the sketch; the single-category sketch-to-picture synthesis model is used to perform geometric transformation and color filling on the single-category sketch to obtain a synthetic picture; the multi-category end-to-end sketch-to-picture synthesis model will improve the residual module and upsampling structure, add the category labels of the sketch and the picture to the network, and add a picture classifier in the discriminant network, and then synthesize the sketches of multiple categories to obtain a synthetic picture; the discriminant network is used to discriminate the synthetic picture;
[0074] A model training module, which is used to train a synthetic image model based on a cyclic generative adversarial network using a sketch-image dataset;
[0075] The image synthesis module is used to synthesize the sketch to be converted using the trained synthetic image model based on the cyclic generative adversarial network.
[0076] In order to execute the methods corresponding to the above embodiments to achieve corresponding functions and technical effects, the present invention also provides a sketch-to-picture cross-domain synthesis device, including: at least one processor, at least one memory, and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the sketch-to-picture cross-domain synthesis method is implemented.
[0077] The memory is a computer-readable storage medium.
[0078] Based on the above description, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned computer storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
[0079] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0080] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A sketch-to-picture cross-domain synthesis method, characterized in that: include: Get the sketch-image dataset; and preprocessing the sketch-picture dataset; the picture pairs in the sketch-picture dataset are hand-drawn sketches and corresponding pictures; The preprocessing includes data enhancement; Build a synthetic image model based on a recurrent generative adversarial network; The synthetic picture model based on the recurrent generative adversarial network includes: an attention mechanism module with local area suppression, a single-category sketch-to-picture synthesis model, a multi-category end-to-end sketch-to-picture synthesis model, and a discriminant network; the attention mechanism module with local area suppression is used to divide the sketch into single-category sketches and multi-category sketches according to the stroke-dense areas in the sketch; the single-category sketch-to-picture synthesis model is used to perform geometric transformation and color filling on the single-category sketch to obtain a synthetic picture; the multi-category end-to-end sketch-to-picture synthesis model will improve the residual module and upsampling structure, add the category labels of the sketch and the picture to the network, and add a picture classifier in the discriminant network, thereby synthesizing the multi-category sketches to obtain a synthetic picture; the discriminant network is used to discriminate the synthetic picture; Use the sketch-image dataset to train a synthetic image model based on a recurrent generative adversarial network; Use the trained synthetic image model based on the cyclic generative adversarial network to synthesize the sketch to be converted; The specific process of the multi-category end-to-end sketch-to-image synthesis model is as follows: In the sketch-to-picture conversion phase, the multi-category generator G P The image is synthesized using the category information of the sketch and attention mechanism denoising, downsampling encoding, AdaIN residual module, and sub-pixel convolution upsampling operations. In the image-to-sketch conversion stage, the single-category generator G S The encoding module encodes the features of the real image, converts it through multiple layers of residual modules, and performs upsampling operations on the decoder, and finally outputs the converted sketch; In the multi-category generator, the normalization layer of the residual module is improved, and the AdaIN layer is used instead of the original IN layer; in the encoder part, the sub-pixel convolution PixShuffle is used, and the pixel reorganization operation replaces the original transposed convolution.
2. The sketch-to-picture cross-domain synthesis method according to claim 1, characterized in that: The single-category sketch-to-image synthesis model uses a geometric discriminator D when performing geometric transformation. g Identify geometric features of sketches; Cycle-consistent loss and joint perceptual loss are used together on the input sketch and the corresponding image; The single-category sketch-to-picture synthesis model performs color filling according to the discriminator D I and color intensity loss to judge the consistency between the synthesized image and the original real image in the brightness channel of the color space; And regard the AdaIN style transfer module as a generator, D I It is a discriminator that improves the quality of rendered images through mutual competition.
3. The sketch-to-picture cross-domain synthesis method according to claim 2, characterized in that: The image classifier uses the HRNet classification network as the feature extraction part.
4. The sketch-to-picture cross-domain synthesis method according to claim 1, characterized in that: The geometric discriminator is combined with the texture-based PatchGAN discriminator to train a synthetic image model based on a cyclic generative adversarial network.
5. A sketch-to-picture cross-domain synthesis system, characterized in that: include: The dataset processing module is used to obtain the sketch-image dataset; and preprocessing the sketch-picture dataset; the picture pairs in the sketch-picture dataset are hand-drawn sketches and corresponding pictures; The preprocessing includes data enhancement; Model building module, used to build a synthetic image model based on a recurrent generative adversarial network; The synthetic picture model based on the recurrent generative adversarial network includes: an attention mechanism module with local area suppression, a single-category sketch-to-picture synthesis model, a multi-category end-to-end sketch-to-picture synthesis model, and a discriminant network; the attention mechanism module with local area suppression is used to divide the sketch into single-category sketches and multi-category sketches according to the stroke-dense areas in the sketch; the single-category sketch-to-picture synthesis model is used to perform geometric transformation and color filling on the single-category sketch to obtain a synthetic picture; the multi-category end-to-end sketch-to-picture synthesis model will improve the residual module and upsampling structure, add the category labels of the sketch and the picture to the network, and add a picture classifier in the discriminant network, thereby synthesizing the multi-category sketches to obtain a synthetic picture; the discriminant network is used to discriminate the synthetic picture; A model training module, which is used to train a synthetic image model based on a cyclic generative adversarial network using a sketch-image dataset; An image synthesis module is used to synthesize images of the sketch to be converted using a trained synthetic image model based on a cyclic generative adversarial network; The specific process of the multi-category end-to-end sketch-to-image synthesis model is as follows: In the sketch-to-picture conversion phase, the multi-category generator G P The image is synthesized using the category information of the sketch and attention mechanism denoising, downsampling encoding, AdaIN residual module, and sub-pixel convolution upsampling operations. In the image-to-sketch conversion stage, the single-category generator G S The encoding module encodes the features of the real image, converts it through multiple layers of residual modules, and performs upsampling operations on the decoder, and finally outputs the converted sketch; In the multi-category generator, the normalization layer of the residual module is improved, and the AdaIN layer is used instead of the original IN layer; in the encoder part, the sub-pixel convolution PixShuffle is used, and the pixel reorganization operation replaces the original transposed convolution.
6. A sketch-to-picture cross-domain synthesis device, characterized in that: include: At least one processor, at least one memory, and computer program instructions stored in the memory, when the computer program instructions are executed by the processor, implement a sketch-to-picture cross-domain synthesis method as described in any one of claims 1-4.
7. The sketch-to-picture cross-domain synthesis device according to claim 6, characterized in that: The memory is a computer-readable storage medium.
Citation Information
Patent Citations
Method for generating sketch to bas relief model based on generative adversarial network
CN110766786A
Fashionable garment image generation method based on garment category and texture pattern control
CN113393546A
Sketch generative adversarial network, rendering generative adversarial network and costume design method thereof
CN116266251A
Method and Apparatus for Construction of Controllable Image Dataset in Generative Adversarial Networks
KR102288759B1
Method and system for auto-generation of sketch notes-based visual summary of multimedia content
US20180130496A1
