Image generation method based on hand-drawn grey-scale map
Through an image generation method based on hand-drawn grayscale images, using generative adversarial networks and hybrid attention mechanism modules, the problems of high resource consumption and low applicability in the existing technology are solved, and high-quality color images can be generated on low-configuration devices. ability.
Patent Information
- Application Number
- CN202410854374.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-20
AI Technical Summary
Existing color image generation methods based on line drawings or sketches have complex algorithms, high resource consumption, and low applicability, and cannot be applied to various types of image generation tasks.
An image generation method based on hand-drawn grayscale images is adopted. The hand-drawn grayscale images are converted into hand-drawn color images through a generative adversarial network. The hybrid attention mechanism module in the generator is used to extract pattern features and texture features, and multi-dimensional features are used in the discriminator. Scale discriminator module and perceptual similarity loss function to improve generator performance and robustness.
It reduces the consumption of computing resources, improves the quality and applicability of image generation, can generate more realistic, clear, and accurate color images, and is suitable for various types of image generation tasks.
Smart Images

Figure CN118674807A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing and relates to an image generation method based on a hand-painted grayscale image. Background Art
[0002] The research on color image generation based on hand-drawn sketches can not only save designers the coloring step, but also generate different color images based on the original image. While reducing the workload, it also provides designers with certain inspiration, allowing them to focus on quickly exploring different ideas and concepts, improving design efficiency and reducing repetitive work.
[0003] Current color image generation methods use hand-drawn sketches, which are usually line drawings or sketches.
[0004] Patent application CN115984400A discloses a method and system for automatic image generation based on hand-drawn sketches. The patent first obtains hand-drawn sketches and color images corresponding to the sketches, constructs training sets and test sets, then constructs an automatic image generation model, uses the training set data to conduct adversarial training on the automatic image generation model, and then inputs the test set into the trained automatic image generation model to generate the corresponding color image. The method of the patent improves the generation quality of color images to a certain extent.
[0005] However, the method of generating color images based on line drawings or sketches has a complex algorithm and high requirements for device configuration, resulting in high resource consumption. In addition, this method needs to rely on specific data sets and cannot be applied to various types of image generation tasks, so its applicability is low. Summary of the invention
[0006] The purpose of the present invention is to solve the problems existing in the prior art and provide an image generation method based on a hand-drawn grayscale image.
[0007] To achieve the above object, the technical solution adopted by the present invention is as follows:
[0008] A method for generating an image based on a hand-drawn grayscale image, wherein the hand-drawn grayscale image is input into a hand-drawn color image generation model, which outputs a hand-drawn color image;
[0009] The hand-drawn color image generation model is a trained generative adversarial network;
[0010] Generative adversarial networks consist of a generator and a discriminator;
[0011] In the generator, a convolution layer for extracting pattern features and texture features of a hand-drawn grayscale image is provided in the downsampling module, and a transposed convolution layer for converting the hand-drawn grayscale image into a hand-drawn color image is provided in the upsampling module;
[0012] In the discriminator, the discriminator module contains convolutional layers for processing additional channels of grayscale images.
[0013] As the preferred technical solution:
[0014] As described above, an image generation method based on a hand-drawn grayscale image, the hand-drawn grayscale image is a hand-drawn clothing grayscale image.
[0015] As described above, in the image generation method based on hand-drawn grayscale images, a hybrid attention mechanism module is provided between two adjacent residual block modules in the generator, and a hybrid attention mechanism module is provided between the residual block module and the upsampling module. The hybrid attention mechanism module adds a spatial attention mechanism on the basis of the channel attention mechanism.
[0016] The present invention adds a hybrid attention mechanism module to the generator because:
[0017] Grayscale images only contain brightness information and lack color information. This makes it more challenging to extract meaningful features from grayscale images. The hybrid attention mechanism can make up for this deficiency by focusing on important regions and features in grayscale images.
[0018] Grayscale images are susceptible to noise and artifacts, which can reduce the quality of generated images. The hybrid attention mechanism can suppress noise and artifacts, thereby generating cleaner and clearer images.
[0019] The hybrid attention mechanism module combines the advantages of the spatial attention mechanism and the channel attention mechanism. While improving the performance of the generator, it also enhances the modeling ability of different types of information and the robustness of the generator, making the generator have better generation capabilities.
[0020] The traditional attention mechanism based on convolutional neural networks focuses more on the analysis of the channel domain and is limited to considering the interaction between feature map channels. The hybrid attention mechanism module adds a spatial attention mechanism on the basis of the channel attention mechanism. Starting from the two domains of channel and space, the sequential attention structure from channel to space is realized through the two analysis dimensions of spatial attention and channel attention.
[0021] As described above, the image generation method based on hand-drawn grayscale images, the generator is mainly composed of a feature extraction module, a downsampling module, a residual block module, a hybrid attention mechanism module, an upsampling module, and a feature restoration module.
[0022] The generator works as follows:
[0023] First, the feature extraction module in the generator performs preliminary feature extraction on the grayscale image and downsamples the grayscale image. The above operation is then repeated until the grayscale image size becomes 16×16. The grayscale image is then input into the residual block module. Each residual block contains a Batch Normalization layer and a ReLU activation function. The ReLU activation function has a very low gradient calculation cost, is simple and constant, and helps speed up the training of deep neural networks. In addition, the ReLU activation function can also set negative inputs to zero, thereby producing sparse activations, which helps prevent overfitting and promote the generalization ability of deep neural networks. The Batch Normalization layer can make deep neural networks more robust to different input data. The residual block can learn the identity mapping, which means that the input and output are the same, which is very useful for maintaining the constancy of certain features in deep neural networks. At the same time, the residual block can also learn the residual, which is the difference between the input and output. This allows deep neural networks to focus on learning new features instead of relearning the identity mapping. In addition, residual blocks allow features to be passed from early layers of deep neural networks to subsequent layers, which helps promote feature reuse and enables deep neural networks to learn more complex representations. Specifically, the effects of residual blocks on features include: retaining useful features, shortcut connections allow useful features to be passed from early layers of deep neural networks to subsequent layers, which helps prevent valuable information from being lost; suppressing gradient vanishing, shortcut connections also allow gradients to jump directly from input to output, which helps alleviate the gradient vanishing problem that may occur in deep neural networks. And residual blocks have been shown to improve the robustness of deep neural networks to noise and perturbations. At the same time, each residual block is combined with a hybrid attention mechanism module to strengthen the weights of important features, suppress unnecessary features, and further improve the feature map. The feature map output by the residual block will be globally averaged and globally max-pooled by the channel attention module in the hybrid attention module, and then input into the fully connected layer for addition, and then input into the activation function layer (sigmoid) to generate weights, and finally multiply the weights with the feature map. The input feature map will be averaged and maximized from the channel dimension by the spatial attention module, and then merged to obtain a convolution layer with 2 channels. Then, it passes through a convolution layer and inputs the activation function layer (sigmoid) to obtain a spatial attention with 1 channel. The feature map and the spatial attention are then multiplied. Finally, the result is input into the residual block for iterative processing to obtain the final feature map. Next, the feature map is processed by the upsampling module to gradually restore the image and finally generate a hand-painted color image.
[0024] As described above, in the image generation method based on a hand-drawn grayscale image, in the discriminator, the discriminator module is a multi-scale discriminator module, which is composed of three sub-discriminator modules, and each sub-discriminator module includes a batch normalization layer (BatchNormalization layer), a LeakyReLU activation function, and a convolution layer for processing additional channels of grayscale images.
[0025] The discriminator of the present invention adopts a multi-scale discriminator module, which is composed of three sub-discriminator modules, each of which contains a batch normalization layer and a LeakyReLU activation function. The LeakyReLU activation function can prevent the gradient from disappearing and make the network easier to train, while the batch normalization layer can make the network more robust to different input data. The real image and the synthetic image are distinguished by three sub-discriminator modules, and the real image and the synthetic image are downsampled by 2 times and 4 times respectively, so as to obtain three images of different scales. The image is discriminated by each discriminator module at different image scales, which enables the fine details and global structure of the image to be captured. After the image is discriminated by the three sub-discriminator modules at different scales, the results output by the sub-discriminator modules are fused to obtain the final discrimination result. The fused discrimination result contains the global features and local details of the image, so that the multi-scale discriminator module can simultaneously obtain the result according to the global and local features of the image. Therefore, with the help of the multi-scale discriminator module, the generator network can generate images that are more realistic, clearer, and more in line with the style of the target training image.
[0026] The working process of the discriminator is as follows:
[0027] The real image and the synthetic image are distinguished by three sub-discriminator modules. The real image and the synthetic image are downsampled by 2 and 4 times respectively, so as to obtain images of three different scales. The image is discriminated by each sub-discriminator module at different image scales, which enables the fine details and global structure of the image to be captured. Although the structures of the three sub-discriminators are the same, the sub-discriminators that discriminate images at different scales have different receptive fields. Different receptive fields will make the sub-discriminators focus on different images. The global features are obtained by the sub-discriminators at the coarsest scale, while the detailed features of the image are captured by the sub-discriminators at the finest scale. After the image is discriminated by the three sub-discriminators, the results output by the sub-discriminators are fused to obtain the final discrimination result. The fused discrimination result contains the global features and local details of the image, so that the multi-scale discriminator module can simultaneously obtain results based on the global and local features of the image.
[0028] As described above, a method for generating images based on hand-drawn grayscale images generates a loss function for the adversarial network. as follows:
[0029] ;
[0030] in, represents the perceptual loss function, represents the perceptual similarity loss function (Lpips loss function), is the loss function of the discriminator in the generative adversarial network, is an adaptive weight parameter used to balance the importance of perceptual loss and perceptual similarity loss (value range is 0-1);
[0031] The formula is as follows:
[0032] ;
[0033] In the formula, represents the input image, r represents the target image, N represents the number of feature layers, represents the pre-trained Vgg network, , They are and r in the pre-trained Vgg network The feature representation of the layer, the generator is fed into the input image Get the generated image , and the generated image It should be as close to the target image as possible , Represents the Euclidean distance between the generated image feature map and the target image feature map;
[0034] The formula is as follows:
[0035] ;
[0036] In the formula, , Respectively represent the image feature maps in The height and width of the layer, Represents the number of layers of the pre-trained Vgg network, and Respectively represent the generated image and the target image in the The activation value of the layer, Indicates The weight of the layer, Represents element-wise product.
[0037] The present invention adds a perceptual similarity loss function and a perceptual loss function based on the loss function of the discriminator in the generative adversarial network. The perceptual similarity loss function can reduce the pooling operation affected by noise and illumination changes in the image to aggregate image features, and is robust to image noise, illumination changes and geometric transformations. The perceptual loss function can consider the overall structure and content of the image, rather than focusing only on pixel-level differences.
[0038] As described above, the image generation method based on the hand-drawn grayscale image, the steps of constructing the hand-drawn color image generation model are as follows:
[0039] (a) Collect hand-drawn grayscale images and construct training sets and validation sets;
[0040] (b) The training set is used to train the generative adversarial network until the generator cannot generate more realistic hand-painted color images for more than 90% of the training samples. The training process is the process of iteratively optimizing the parameters of the generator through the back-propagation algorithm.
[0041] (c) The generative adversarial network is verified using the validation set, and the parameters of the generator are optimized based on the verification results. The purpose is to improve the generalization ability of the generator on unseen samples. The final generative adversarial network is the hand-drawn color image generation model.
[0042] In the above-mentioned image generation method based on hand-drawn grayscale images, step (a) is specifically as follows:
[0043] (a1) Collect color sketches from different designers and perform manual screening;
[0044] (a2) The background of the filtered images is uniformly processed to white and cropped into a single image;
[0045] (a3) Processing the cropped image to obtain the corresponding hand-drawn grayscale image;
[0046] (a4) Using data enhancement technology to expand the hand-drawn grayscale image;
[0047] (a5) Divide the expanded hand-drawn grayscale image into a training set and a validation set.
[0048] Beneficial effects:
[0049] The present invention can output the hand-drawn grayscale image as a hand-drawn color image after the generative adversarial network is trained by setting a convolution layer for extracting pattern features and texture features of the hand-drawn grayscale image in the downsampling module of the generative adversarial network, setting a transposed convolution layer for converting the hand-drawn grayscale image into a hand-drawn color image in the upsampling module, and setting a convolution layer containing an additional channel for processing the grayscale image in the discriminator module;
[0050] Line drawings usually do not contain texture and detail information, which makes it difficult to generate realistic-looking color images based on line drawings. Sketches contain a large number of lines. If the lines are too rough or incomplete, the generated image will be blurry or inaccurate. In addition, if there are messy fine lines in the lines, the generated image may contain additional details or parts that do not match the main body of the image.
[0051] Compared with sketches and line drawings, the algorithm for grayscale images is simple, and the computing resources required to extract grayscale or color blocks from grayscale images to generate hand-drawn color images are less, and it can run on devices with lower configurations, so the resource consumption is relatively low; at the same time, extracting grayscale or color blocks from grayscale images to generate hand-drawn color images does not depend on a specific data set, and can be applied to various types of image generation tasks, such as artistic creation, image enhancement, etc., so it has a wider range of applicability; in addition, grayscale images do not contain messy lines, but contain texture and detail information, which can provide more complete and clear feature information, so that the generator will not be affected by irrelevant feature information in the image, and can generate more realistic, clear and accurate images. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A structural diagram of a generative adversarial network of the present invention;
[0053] Figure 2 The hand-drawn clothing grayscale image inputted in Example 1;
[0054] Figure 3 The hand-painted color image outputted by Example 1;
[0055] Figure 4 The hand-painted color image outputted by Example 2;
[0056] Figure 5 The hand-painted color image outputted by Example 3;
[0057] Figure 6 This is the hand-drawn color image output by Example 4. DETAILED DESCRIPTION
[0058] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.
[0059] Example 1
[0060] A method for generating an image based on a hand-drawn grayscale image, the specific steps are as follows:
[0061] S1. Design a generative adversarial network and its loss function;
[0062] Generate adversarial networks such as Figure 1 As shown, it consists of a generator and a discriminator;
[0063] The generator is mainly composed of a feature extraction module, a downsampling module, a residual block module, a hybrid attention mechanism module, an upsampling module, and a feature restoration module; the downsampling module is provided with a convolution layer for extracting pattern features and texture features of hand-painted clothing grayscale images, and the upsampling module is provided with a transposed convolution layer for converting hand-painted clothing grayscale images into hand-painted color images; a hybrid attention mechanism module is provided between each of two adjacent residual block modules, and a hybrid attention mechanism module is provided between the residual block module and the upsampling module, and the hybrid attention mechanism module adds a spatial attention mechanism on the basis of the channel attention mechanism;
[0064] In the discriminator, the discriminator module is a multi-scale discriminator module, which consists of three sub-discriminator modules. Each sub-discriminator module contains a batch normalization layer, a LeakyReLU activation function, and a convolution layer for processing an extra channel of the hand-painted clothing grayscale image;
[0065] Loss function for generative adversarial networks as follows:
[0066] ;
[0067] in, represents the perceptual loss function, represents the perceptual similarity loss function, is the loss function of the discriminator in the generative adversarial network, is an adaptive weight parameter used to balance the importance of perceptual loss and perceptual similarity loss (value range is 0-1);
[0068] The formula is as follows:
[0069] ;
[0070] In the formula, represents the input image, r represents the target image, N represents the number of feature layers, represents the pre-trained Vgg network, , They are and r in the pre-trained Vgg network The feature representation of the layer, the generator is fed into the input image Get the generated image , and the generated image It should be as close to the target image as possible , Represents the Euclidean distance between the generated image feature map and the target image feature map;
[0071] The formula is as follows:
[0072] ;
[0073] In the formula, , Respectively represent the image feature maps in The height and width of the layer, Represents the number of layers of the pre-trained Vgg network, and Respectively represent the generated image and the target image in the The activation value of the layer, Indicates The weight of the layer, represents element-wise product;
[0074] S2. Construct a hand-drawn color image generation model;
[0075] S2-1. Collect hand-drawn grayscale images and build training sets and validation sets. The specific steps are as follows:
[0076] S2-1-1. Collect color sketches from different designers and perform manual screening;
[0077] S2-1-2. The background of the filtered images is uniformly processed to white and cut into a single image;
[0078] S2-1-3. Process the cropped image to obtain a corresponding hand-painted clothing grayscale image;
[0079] S2-1-4. Use data enhancement technology to expand the hand-painted clothing grayscale image;
[0080] S2-1-5. Divide the expanded hand-drawn clothing grayscale image into a training set and a validation set in a ratio of 8:2;
[0081] S2-2. Use the training set to train the generative adversarial network until the generator cannot generate more realistic hand-painted color images for more than 90% of the training samples. The training process is the process of iteratively optimizing the parameters of the generator through the back-propagation algorithm;
[0082] S2-3. Use the validation set to validate the generative adversarial network, optimize the parameters of the generator based on the validation results, and the resulting generative adversarial network is the hand-painted color image generation model;
[0083] S3. Generate a variety of hand-drawn color images of different styles using the hand-drawn color image generation model;
[0084] S3-1. Image input: Use a randomly selected hand-drawn clothing grayscale image (such as Figure 2 As shown) as input, as the basis for generating hand-drawn color images;
[0085] S3-2. Feature extraction: Extract features from the input hand-drawn clothing grayscale image to obtain its feature map;
[0086] S3-3. Real-time output: Output the hand-drawn color image generated based on the hand-drawn clothing grayscale image.
[0087] The final output hand-painted color image is as follows Figure 3 shown.
[0088] Example 2
[0089] A method for generating an image based on a hand-drawn grayscale image is basically the same as that in Example 1, except that: there is no hybrid attention mechanism module in the generator in the generative adversarial network in step S1.
[0090] The final output hand-painted color image is as follows Figure 4 shown.
[0091] Will Figure 3 and Figure 4 By comparison, it can be seen that the hand-painted color image output by Example 2 has obvious confusion in the color of the character's clothing and inconsistent tones. The upper body clothes of the character span nearly three colors from the left cuff to the right cuff: light yellow, reddish brown, and light red. At the same time, light blue is also mixed in various parts of the character's clothing, making the overall look not clear and clean enough. The color of the skirt hem also has the problem of uneven color and messy color. However, Example 1 successfully avoids these defects. This is because Example 1 sets a hybrid attention mechanism module between two adjacent residual block modules of the generator, and sets a hybrid attention mechanism module between the residual block module and the upsampling module. The hybrid attention mechanism can suppress noise and artifacts, thereby generating cleaner and clearer images; at the same time, the hybrid attention mechanism module combines the advantages of the spatial attention mechanism and the channel attention mechanism. While improving the performance of the generator, it also enhances the modeling ability of different types of information and the robustness of the generator, so that the generator has better generation capabilities.
[0092] Example 3
[0093] A method for generating an image based on a hand-drawn grayscale image is basically the same as in Example 1, except that: the discriminator module in the discriminator in the generative adversarial network in step S1 is a single-scale discriminator module, and the single-scale discriminator module consists of only one sub-discriminator module (the same as in Example 1).
[0094] The final output hand-painted color image is as follows Figure 5 shown.
[0095] Will Figure 3 and Figure 5 By comparison, it can be seen that the color of the character's clothing in the hand-painted color image output by Example 3 is relatively messy, the character's legs are unnatural light blue, the bottom of the handbag is also light blue similar to the hem of the skirt, the color boundary is blurred, and there is a big difference from the original image. Example 1 successfully avoids these defects. This is because the discriminator module in the discriminator of the generative adversarial network of Example 1 is a multi-scale discriminator module, which consists of three sub-discriminator modules, each of which contains a batch normalization layer and a LeakyReLU activation function. The LeakyReLU activation function can prevent the gradient from disappearing and make the network easier to train, while the batch normalization layer can make the network more robust to different input data. The real image and the synthetic image are distinguished by three sub-discriminator modules, and the real image and the synthetic image are downsampled by 2 times and 4 times respectively, so as to obtain three images of different scales. The image is discriminated by each discriminator module at different image scales, which enables the fine details and global structure of the image to be captured. After the image is discriminated by the three sub-discriminator modules at different scales, the output results of the sub-discriminator modules are fused to obtain the final discrimination result. The fused discrimination result contains the global features and local details of the image, so that the multi-scale discriminator module can simultaneously obtain results based on the global and local features of the image. Therefore, with the help of the multi-scale discriminator module, the generator network can generate images that are more realistic, clearer, and more in line with the style of the target training image.
[0096] Example 4
[0097] A method for generating an image based on a hand-drawn grayscale image is basically the same as in Example 1, except that the loss function of the generative adversarial network in step S1 is as follows:
[0098] ;
[0099] in LosscGAN(G,D) = Er[ log D(r)] + Eg,z[ log ( 1 -D(G(g,z))] , LossL 1 (G) = Eg,r,z[ ‖ y − G(g,z) ‖ 1 ] , represents the input image, represents the target image, represents a random noise vector, G represents the generator, D represents the discriminator, Table generation sample, represents the Manhattan distance between the generated sample and the target image, Er[ log D(r)] represents the discriminator loss, Eg,z[ log ( 1 -D(G(g,z))] represents the generator loss, The discriminator transforms the target image The probability of being classified as a true sample, is the probability that the discriminator classifies the generated sample as a real sample, represents the GAN loss function in the generative adversarial network, represents the L1 loss of the generator network G, Represents the weight of L1 loss in the generator network loss function.
[0100] The final output hand-painted color image is as follows Figure 6 shown.
[0101] Will Figure 3 and Figure 6 By comparison, it can be seen that the hand-painted color image output by Example 4 has distorted facial features, lacks local details, the colors of clothing and human body are dark red, and the overall content quality of the image is poor. Example 1 successfully avoids these defects. This is because Example 1 adds a perceptual similarity loss function and a perceptual loss function on the basis of the loss function of the discriminator in the generative adversarial network. The perceptual similarity loss function can reduce the pooling operation affected by noise and illumination changes in the image to aggregate image features, and it is robust to image noise, illumination changes and geometric transformations. The perceptual loss function can take into account the overall structure and content of the image, rather than focusing only on pixel-level differences.
Claims
1. A method for generating an image based on a hand-drawn grayscale image, characterized in that: The hand-drawn grayscale image is input into the hand-drawn color image generation model, which outputs the hand-drawn color image; The hand-drawn color image generation model is a trained generative adversarial network; Generative adversarial networks consist of a generator and a discriminator; In the generator, a convolution layer for extracting pattern features and texture features of a hand-drawn grayscale image is provided in the downsampling module, and a transposed convolution layer for converting the hand-drawn grayscale image into a hand-drawn color image is provided in the upsampling module; In the discriminator, the discriminator module contains convolutional layers for processing additional channels of grayscale images.
2. The image generation method based on hand-drawn grayscale image according to claim 1, characterized in that: The hand-drawn grayscale image is a hand-drawn grayscale image of clothing.
3. The image generation method based on hand-drawn grayscale image according to claim 1, characterized in that: In the generator, there is a hybrid attention mechanism module between two adjacent residual block modules, and there is a hybrid attention mechanism module between the residual block module and the upsampling module. The hybrid attention mechanism module adds a spatial attention mechanism on the basis of the channel attention mechanism.
4. The image generation method based on hand-drawn grayscale image according to claim 3 is characterized in that: The generator is mainly composed of a feature extraction module, a downsampling module, a residual block module, a hybrid attention mechanism module, an upsampling module, and a feature restoration module.
5. The image generation method based on hand-drawn grayscale image according to claim 1, characterized in that: In the discriminator, the discriminator module is a multi-scale discriminator module, which consists of three sub-discriminator modules. Each sub-discriminator module contains a batch normalization layer, a LeakyReLU activation function, and a convolution layer for processing additional channels of grayscale images.
6. The image generation method based on hand-drawn grayscale image according to claim 1, characterized in that: Loss function for generative adversarial networks as follows: ; in, represents the perceptual loss function, represents the perceptual similarity loss function, is the loss function of the discriminator in the generative adversarial network, is an adaptive weight parameter.
7. The image generation method based on hand-drawn grayscale image according to claim 1, characterized in that: The steps to build the hand-drawn color image generation model are as follows: (a) Collect hand-drawn grayscale images and construct training sets and validation sets; (b) The training set is used to train the generative adversarial network until the generator cannot generate more realistic hand-painted color images for more than 90% of the training samples. The training process is the process of iteratively optimizing the parameters of the generator through the back-propagation algorithm. (c) The generative adversarial network is verified using the verification set, and the parameters of the generator are optimized based on the verification results. The final generative adversarial network is the hand-drawn color image generation model.
8. The image generation method based on hand-drawn grayscale image according to claim 7, characterized in that: Step (a) is as follows: (a1) Collect color sketches from different designers and perform manual screening; (a2) The background of the filtered images is uniformly processed to white and cropped into a single image; (a3) Processing the cropped image to obtain the corresponding hand-drawn grayscale image; (a4) Using data enhancement technology to expand the hand-drawn grayscale image; (a5) Divide the expanded hand-drawn grayscale image into a training set and a validation set.
Citation Information
Cited By
Micro-nano photoetching grey-scale map generation method based on AI model and LoRA fine tuning
CN120912716A
