Deep learning-based elaborate style image style migration method and system
Through deep learning technology, combined with convolution processing, position normalization and pooling processing, the problems of inaccurate detail extraction and semantic changes in image style transfer are solved, more precise style transfer and semantic retention are achieved, and image style is improved. level of transformation.
Patent Information
- Application Number
- CN202411773839.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-01-03
AI Technical Summary
When the existing image style transfer method is used to process Chinese painting style, the image details are not accurate enough, the stroke boundary features are difficult to represent, and the generated image may undergo semantic changes, resulting in inconsistent content before and after the conversion, and the degree of style conversion is limited, so the target style cannot be fully captured. feature.
Using the fine brushstroke image style transfer method based on deep learning, cross-stacking with downsampling, combined with position normalization processing, multi-scale features are extracted, and structured position information is supplemented through torque shortcut processing, using global average pooling and maximum pooling process retains semantic expressions, introduces shared weights and attention mechanisms, and achieves more precise style transfers.
It improves the accuracy and semantic consistency of image style transfer, ensures that the image after the style is converted has clear boundaries and rich details, truly reflects the characteristics of Chinese fine brushwork, and enhances the quality and semantic rigor of stylized images.
Smart Images

Figure CN119251046A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a method and system for transferring the style of a fine brushwork image based on deep learning. Background Art
[0002] The goal of image style transfer is to establish a mapping, input a picture in one image domain, and output a picture in another image domain. Deep learning, as a research method in the field of image style transfer, mainly implements style transfer based on convolutional neural networks and style transfer based on generative adversarial networks.
[0003] However, current image style transfer methods still have limitations: 1) The extraction of image details is not accurate enough, especially when dealing with Chinese painting styles, fine stroke boundary features cannot be well represented. 2) The generated image may sometimes undergo semantic changes, resulting in inconsistent content expression before and after the conversion. And it may limit the extent of style transfer, resulting in the stylized image failing to fully capture all the features of the target style. Summary of the invention
[0004] The present invention provides a method and system for transferring the style of fine brushwork images based on deep learning.
[0005] The technical solution of the present invention is as follows: The present invention provides a method for transferring the style of a fine brushwork image based on deep learning, comprising the following steps: S1: Obtain an image in the first image domain, and obtain a generated image in the second image domain through the first style transfer; The style transfer is performed as follows: The image to be processed is sequentially subjected to the first two-dimensional convolution, layer normalization, the first convolution processing, the first downsampling, the first convolution processing, the second downsampling, the second convolution processing, the third downsampling, and the first convolution processing to obtain multi-scale features; After the multi-scale features are processed by the moment shortcut, they are processed by deconvolution, the first two-dimensional convolution, and the first activation function in sequence to obtain the processed image; The down sampling is specifically: The features after the first convolution processing or the second convolution processing are sequentially processed by the second two-dimensional convolution, position normalization processing, real column regularization, and the second activation function processing to obtain the down-sampled features; S2: The generated image is subjected to a second style transfer to obtain a reconstructed image in the first image domain, the loss between the reconstructed image and the image obtained in the first image domain is calculated, the reconstructed image that meets the first preset condition is marked, and the generated image corresponding to the marked reconstructed image is used as the target generated image; S3: The target generated image is convolved with the fourth two-dimensional convolution to obtain a feature map; The feature map is processed by global average pooling to obtain the first feature map; The feature map is processed by global maximum pooling to obtain the second feature map; After the first feature map and the second feature map are weighted, the first attention feature map and the second attention feature map are obtained respectively; The first attention feature map and the second attention feature map are respectively multiplied with the feature map, and concatenated to obtain the attention feature map; After the fifth two-dimensional convolution of the attention feature map, the image to be judged is obtained; S4: Obtain a real image in the second image domain, calculate the loss between the image to be identified and the real image, and use the image to be identified that meets the second preset condition as a style transfer image.
[0006] The position normalization process in step S1 is performed according to the formula: , calculate the mean of the feature space position; According to the formula: , calculate the standard deviation of the feature space position; Based on the mean and standard deviation of the feature space position, the formula is: , normalize the feature space position; In the formula, is the mean of the feature space position; is the total number of channels; is the feature after the second two-dimensional convolution; is the batch size; c is the number of channels, c=1,2,..., ; is the height; is the width; is the standard deviation of the feature space position; Used to prevent the denominator from being zero; It is the feature after position normalization.
[0007] The multi-scale features in step S1 are processed by moment shortcut, specifically: According to the formula: , supplement the location information to the multi-scale features; In the formula, It is the feature after moment shortcut processing; It is a multi-scale feature; is the mean of the feature space position; is the standard deviation of the feature space position.
[0008] The step S1 of the first convolution process or the second convolution process is specifically: The features to be convolved are sequentially subjected to depthwise separable two-dimensional convolution, layer normalization, the third two-dimensional convolution, the third activation function processing, and the third two-dimensional convolution, and then added element-by-element with the features to be convolved to obtain the features after one convolution processing, and the first convolution processing or the second convolution processing is completed according to the preset number of processing times of the first convolution processing or the second convolution processing.
[0009] In step S3, the target generated image is subjected to the fourth two-dimensional convolution to obtain a feature map, which is specifically: The target generated image is processed in sequence by convolution with a kernel size of 4, a step size of 2, and a stacking number of 64, spectrum normalization, activation function processing, convolution with a kernel size of 4, a step size of 2, and a stacking number of 128, spectrum normalization, activation function processing, convolution with a kernel size of 4, a step size of 2, and a stacking number of 256, spectrum normalization, activation function processing, and convolution with a kernel size of 4, a step size of 1, and a stacking number of 512 to obtain a feature map.
[0010] After the fifth two-dimensional convolution of the attention feature map in step S3, the image to be judged is obtained, which is specifically: The attention feature map is sequentially processed by convolution with a 1×1 kernel with a step size of 1, spectrum normalization, activation function processing, and convolution with a 4×4 kernel with a step size of 1 to obtain the image to be discriminated.
[0011] If the first image domain is a natural landscape image, then the second image domain is a Chinese fine brush painting image; If the first image domain is a Chinese brush painting image, the second image domain is a natural landscape image.
[0012] The present invention also provides a deep learning-based meticulous painting image style transfer system, comprising: An image generation module in the second image domain: used to obtain an image in the first image domain, and obtain a generated image in the second image domain through a first style transfer; The style transfer is performed as follows: The image to be processed is sequentially subjected to the first two-dimensional convolution, layer normalization, the first convolution processing, the first downsampling, the first convolution processing, the second downsampling, the second convolution processing, the third downsampling, and the first convolution processing to obtain multi-scale features; After the multi-scale features are processed by the moment shortcut, they are processed by deconvolution, the first two-dimensional convolution, and the first activation function in sequence to obtain the processed image; The down sampling is specifically: The features after the first convolution processing or the second convolution processing are sequentially processed by the second two-dimensional convolution, position normalization processing, real column regularization, and the second activation function processing to obtain the down-sampled features; A target generated image determination module is used to generate an image through a second style transfer to obtain a reconstructed image in the first image domain, calculate the loss between the reconstructed image and the image obtained in the first image domain, mark the reconstructed image that meets the first preset condition, and use the generated image corresponding to the marked reconstructed image as the target generated image; Image generation module to be judged: used to generate the target image through the fourth two-dimensional convolution to obtain the feature map; The feature map is processed by global average pooling to obtain the first feature map; The feature map is processed by global maximum pooling to obtain the second feature map; After the first feature map and the second feature map are weighted, the first attention feature map and the second attention feature map are obtained respectively; The first attention feature map and the second attention feature map are respectively multiplied with the feature map, and concatenated to obtain the attention feature map; After the fifth two-dimensional convolution of the attention feature map, the image to be judged is obtained; Style transfer image determination module: used to obtain a real image in the second image domain, calculate the loss between the image to be identified and the real image, and use the image to be identified that meets the second preset condition as the style transfer image.
[0013] Beneficial effect: The present invention cross-stacks convolution processing and downsampling to accurately extract stroke features, and combines position normalization processing to extract structured position information to obtain multi-scale features; the multi-scale features are processed by moment shortcuts to supplement the structured position information to the multi-scale features to alleviate the potential problem of structured loss during the downsampling process, thereby improving the level of image style transfer.
[0014] The present invention also better preserves the semantic expression of the original image and captures more details of the image stylization by sharing weights of feature maps processed by global average pooling and global maximum pooling, thereby further improving the stylization level of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A flowchart of a method for transferring the style of a fine brushwork image based on deep learning is provided in an embodiment. DETAILED DESCRIPTION
[0016] The following examples are intended to illustrate the present invention rather than to further limit the present invention.
[0017] The present invention provides a method for transferring the style of fine brushwork images based on deep learning. Figure 1 As shown, the following steps are included: S1: Obtain an image in the first image domain, and obtain a generated image in the second image domain through the first style transfer.
[0018] In order to meet the clearer boundary requirements of Chinese meticulous painting style and improve the quality of generated images, if the first image domain is a natural landscape image, the second image domain is a Chinese meticulous painting image; if the first image domain is a Chinese meticulous painting image, the second image domain is a natural landscape image. Thus, bidirectional style transfer between different domains, namely natural landscape images and Chinese meticulous painting images, is achieved.
[0019] The style transfer is performed as follows: The image to be processed is processed in sequence through the first two-dimensional convolution, layer normalization, the first convolution processing, the first downsampling, the first convolution processing, the second downsampling, the second convolution processing, the third downsampling, and the first convolution processing to obtain multi-scale features.
[0020] For the first style transfer, the image to be processed is an image obtained in the first image domain. For example, the first image domain is a natural landscape image, and the second image domain is a Chinese fine brushwork image. Then, the result of the first style transfer is the transfer of the natural landscape image style to the Chinese fine brushwork image style.
[0021] In order to make the extracted features more accurate, for example, first, the first two-dimensional convolution uses a convolution with a kernel size of 7 and a stride of 1 (denoted as Conv2d k7,s1) to roughly sample the 256*256 image.
[0022] Then, the first convolution process and the second convolution process are respectively used to extract accurate features at the current scale; and the first downsampling, the second downsampling, and the third downsampling are used to reduce the image scale in stages.
[0023] The present invention allows extracting clear stroke features from a style image by cross-stacking convolution processing and downsampling, thereby generating an image with clearer boundaries, truly reflecting the Chinese meticulous style of painting.
[0024] In the process of style migration, multiple convolution processes are involved, including a first convolution process and a second convolution process. Preferably, the first convolution process or the second convolution process is specifically: The features to be convolved are sequentially subjected to depthwise separable two-dimensional convolution, layer normalization, the third two-dimensional convolution, the third activation function processing, and the third two-dimensional convolution, and then added element-by-element with the features to be convolved to obtain the features after one convolution processing, and the first convolution processing or the second convolution processing is completed according to the preset number of processing times of the first convolution processing or the second convolution processing.
[0025] In the process of style migration, the features to be convolved may be features after layer normalization, features after the first downsampling, features after the second downsampling, and features after the third downsampling.
[0026] For example, if the feature to be convolved is the feature after the first downsampling, then the convolution process is: The features after the first downsampling are processed by depthwise separable two-dimensional convolution (depthwise separable two-dimensional convolution with a kernel size of 7, a stride of 1, and a pixel padding of 3, expressed as Depthwise Conv2d k7,s1,p3), layer normalization, the third two-dimensional convolution (two-dimensional convolution with a kernel size of 7 and a stride of 1, expressed as Conv2d k1,s1), the third activation function (GeLU activation function can be used), and the third two-dimensional convolution, and then added element-by-element with the features after the first downsampling to obtain the features after convolution processing.
[0027] Furthermore, for the first convolution processing, the same convolution processing operation is performed three times in sequence; and for the second convolution processing, the same convolution processing operation is performed nine times in sequence.
[0028] In the process of style migration, multiple downsampling is also involved. Preferably, the downsampling is specifically: The features after the first convolution processing or the second convolution processing are sequentially processed by the second two-dimensional convolution, position normalization, real column regularization, and the second activation function to obtain the downsampled features.
[0029] For example, if the feature after convolution processing is the feature after the second convolution processing, then the downsampling process (corresponding to the third downsampling) is: The features after the second convolution processing are processed by the second two-dimensional convolution (a two-dimensional convolution with a kernel size of 3, a step size of 2, and a pixel padding of 1, expressed as Conv2d k3,s2,p1), position normalization, instance normalization, and the second activation function (ReLU activation function can be used) to obtain the features after the third downsampling.
[0030] In the downsampling process, the present invention adopts position normalization processing to extract more position information from the original image, which plays a vital role in maintaining the same content before and after style conversion and improves the semantic rigor.
[0031] Preferably, the position normalization process is performed according to the formula: , calculate the mean of the feature space position; According to the formula: , calculate the standard deviation of the feature space position; Based on the mean and standard deviation of the feature space position, the formula is: , normalize the feature space position; In the formula, is the mean of the feature space position; is the total number of channels; is the feature after the second two-dimensional convolution; is the batch size; c is the number of channels, c=1,2,..., ; is the height; is the width; is the standard deviation of the feature space position; Used to prevent the denominator from being zero; It is the feature after position normalization.
[0032] The present invention normalizes each position of a feature through position normalization processing, wherein the calculated mean and standard deviation are related to the position information of the feature and can effectively represent the structural position information of the input image.
[0033] After a series of operations related to style transfer, including cross-stacking of convolution and downsampling to accurately extract stroke features, and combining position normalization to extract position information, multi-scale features are obtained. Multi-scale features not only have accurately extracted stroke features with clear boundaries, but also contain rich structured position information.
[0034] After obtaining the multi-scale features, the extracted content image information is used for transformation and image reconstruction. The operation is as follows: After the multi-scale features are processed by the moment shortcut, they are processed in sequence by deconvolution (a two-dimensional convolution with a kernel size of 3, a step size of 2, and a pixel padding of 1 can be used, expressed as ConvTrans2d k3,s2,p1), the first two-dimensional convolution (a convolution with a kernel size of 7 and a step size of 1, expressed as Conv2d k7,s1), and the first activation function (Tanh activation function can be used) to obtain the processed image.
[0035] For the first style transfer, the processed image is the generated image of the second image domain.
[0036] Preferably, the multi-scale features are processed by moment shortcut, specifically: According to the formula: , supplement the location information to the multi-scale features; In the formula, It is the feature after moment shortcut processing; It is a multi-scale feature; is the mean of the feature space position; is the standard deviation of the feature space position.
[0037] The present invention uses the mean and standard deviation obtained by position normalization processing to supplement the structured position information to the multi-scale features to alleviate the potential problem of structured loss in the downsampling process and enhance semantic understanding.
[0038] S2: The generated image undergoes a second style transfer to obtain a reconstructed image of the first image domain, and the loss between the reconstructed image and the image data obtained in the first image domain is calculated. The reconstructed image that meets the first preset condition is marked, and the generated image corresponding to the marked reconstructed image is used as the target generated image.
[0039] Regarding the second style transfer, the style transfer process is the same as step S1. The result of the second style transfer is that the style of the Chinese brushwork image is transferred to the style of the natural landscape image.
[0040] Furthermore, in order to ensure the consistency of the bidirectional style transfer, the loss of the image data between the reconstructed image and the image data obtained in the first image domain is calculated so that the reconstructed image is as close as possible to the image obtained in the first image domain. The first preset condition is a cycle consistency loss to ensure that the converted image retains the detail information of the original image.
[0041] S3: The target generated image is subjected to the fourth two-dimensional convolution to obtain a feature map.
[0042] Specifically: The target generated image is processed by convolution with a kernel size of 4, a step size of 2, and a stacking number of 64 (expressed as Conv2d k4,s2), spectral normalization, activation function (LeakyReLU activation function can be used), convolution with a kernel size of 4, a step size of 2, and a stacking number of 128, spectral normalization, activation function (LeakyReLU activation function can be used), convolution with a kernel size of 4, a step size of 2, and a stacking number of 256, spectral normalization, activation function (LeakyReLU activation function can be used), and convolution with a kernel size of 4, a step size of 1, and a stacking number of 512 (expressed as Conv2d k4,s2) to obtain the feature map.
[0043] The feature map is processed by global average pooling to obtain the first feature map; The feature map is processed by global maximum pooling to obtain the second feature map; After the first feature map and the second feature map are weighted, the first attention feature map and the second attention feature map are obtained respectively; The first attention feature map and the second attention feature map are multiplied with the feature map respectively and concatenated to obtain the attention feature map.
[0044] In addition, regarding shared weights, this can be achieved through a shared weight multilayer perceptron.
[0045] In order to include more global information structures, the present invention performs global average pooling and global maximum pooling on the feature maps respectively, and shares weights to obtain the attention feature map, thereby preserving the content of the entire image to a large extent and better preserving the semantic expression of the original image. In addition, more details of the image stylization can be captured, and the image stylization level can be improved to more clearly identify the foreground and background of the image.
[0046] After the fifth two-dimensional convolution, the attention feature map obtains the image to be judged, which is: The attention feature map is sequentially processed by convolution with a 1×1 kernel with a stride of 1 (which can be expressed as Conv2d k1, s1), spectral normalization, activation function (LeakyReLU activation function can be used), and convolution with a 4×4 kernel with a stride of 1 (which can be expressed as Conv2d k4, s1) to obtain the image to be judged.
[0047] A self-attention framework is introduced to improve the capture of more details in the target style, enhance the stylization level of the image, and achieve clearer recognition of the foreground and background of the image.
[0048] S4: Obtain a real image in the second image domain, calculate the loss between the image to be identified and the real image, and use the image to be identified that meets the second preset condition as a style transfer image.
[0049] The image to be judged, i.e., the image after style transfer, should have the same style as the image in the second image domain, and the same content as the image before transfer (the image in the first image domain). Preferably, the second preset condition is the generation of adversarial loss, i.e., the degree of style similarity between the image after style transfer and the image set in the second image domain is judged, and no calculation is made with the first image domain. For example, G(A) generated after style transfer of image A in the first image domain performs step S4, i.e., calculates the style difference between the two with image B in the second image domain, and determines the final style transfer image according to the generation of adversarial loss. This step only involves style difference, while the content difference is calculated by the cycle consistency loss in step S2.
[0050] In order to improve the style transfer level of the image, the loss between the image to be judged and the real image is calculated so that the style of the image to be judged is as close as possible to the real image obtained in the second image domain.
[0051] The present invention cross-stacks convolution processing and downsampling to accurately extract stroke features, and combines position normalization processing to extract structured position information to obtain multi-scale features. Multi-scale features are processed by moment shortcuts to supplement structured position information to multi-scale features to alleviate the potential problem of structured loss during downsampling, thereby improving the level of image style transfer.
[0052] In addition, by sharing the weights of feature maps processed by global average pooling and global maximum pooling, the semantic expression of the original image can be better preserved, and more details of the image stylization can be captured, further improving the image stylization level.
[0053] The present invention also provides a deep learning-based meticulous painting image style transfer system, comprising: An image generation module in the second image domain: used to obtain an image in the first image domain, and obtain a generated image in the second image domain through a first style transfer; The style transfer is performed as follows: The image to be processed is sequentially subjected to the first two-dimensional convolution, layer normalization, the first convolution processing, the first downsampling, the first convolution processing, the second downsampling, the second convolution processing, the third downsampling, and the first convolution processing to obtain multi-scale features; After the multi-scale features are processed by the moment shortcut, they are processed by deconvolution, the first two-dimensional convolution, and the first activation function in sequence to obtain the processed image; The down sampling is specifically: The features after the first convolution processing or the second convolution processing are sequentially processed by the second two-dimensional convolution, position normalization processing, real column regularization, and the second activation function processing to obtain the down-sampled features; A target generated image determination module is used to generate an image through a second style transfer to obtain a reconstructed image in the first image domain, calculate the loss between the reconstructed image and the image obtained in the first image domain, mark the reconstructed image that meets the first preset condition, and use the generated image corresponding to the marked reconstructed image as the target generated image; Image generation module to be judged: used to generate the target image through the fourth two-dimensional convolution to obtain the feature map; The feature map is processed by global average pooling to obtain the first feature map; The feature map is processed by global maximum pooling to obtain the second feature map; After the first feature map and the second feature map are weighted, the first attention feature map and the second attention feature map are obtained respectively; The first attention feature map and the second attention feature map are respectively multiplied with the feature map, and concatenated to obtain the attention feature map; After the fifth two-dimensional convolution of the attention feature map, the image to be judged is obtained; Style transfer image determination module: used to obtain a real image in the second image domain, calculate the loss between the image to be identified and the real image, and use the image to be identified that meets the second preset condition as the style transfer image.
Claims
1. A method for transferring the style of a fine brushwork image based on deep learning, characterized in that: The following steps are involved: S1: Obtain an image in the first image domain, and obtain a generated image in the second image domain through the first style transfer; The style transfer is performed as follows: The image to be processed is sequentially subjected to the first two-dimensional convolution, layer normalization, the first convolution processing, the first downsampling, the first convolution processing, the second downsampling, the second convolution processing, the third downsampling, and the first convolution processing to obtain multi-scale features; After the multi-scale features are processed by the moment shortcut, they are processed by deconvolution, the first two-dimensional convolution, and the first activation function in sequence to obtain the processed image; The down sampling is specifically: The features after the first convolution processing or the second convolution processing are sequentially processed by the second two-dimensional convolution, position normalization processing, real column regularization, and the second activation function processing to obtain the down-sampled features; S2: The generated image is subjected to a second style transfer to obtain a reconstructed image in the first image domain, the loss between the reconstructed image and the image obtained in the first image domain is calculated, the reconstructed image that meets the first preset condition is marked, and the generated image corresponding to the marked reconstructed image is used as the target generated image; S3: The target generated image is convolved with the fourth two-dimensional convolution to obtain a feature map; The feature map is processed by global average pooling to obtain the first feature map; The feature map is processed by global maximum pooling to obtain the second feature map; After the first feature map and the second feature map are weighted, the first attention feature map and the second attention feature map are obtained respectively; The first attention feature map and the second attention feature map are respectively multiplied with the feature map, and concatenated to obtain the attention feature map; After the fifth two-dimensional convolution of the attention feature map, the image to be judged is obtained; S4: Obtain a real image in the second image domain, calculate the loss between the image to be identified and the real image, and use the image to be identified that meets the second preset condition as a style transfer image.
2. According to the method for transferring the style of fine brushwork images based on deep learning in claim 1, it is characterized in that: The position normalization process in step S1 is performed according to the formula: , calculate the mean of the feature space position; According to the formula: , calculate the standard deviation of the feature space position; Based on the mean and standard deviation of the feature space position, the formula is: , normalize the feature space position; In the formula, is the mean of the feature space position; is the total number of channels; is the feature after the second two-dimensional convolution; is the batch size; c is the number of channels, c=1,2,..., ; is the height; is the width; is the standard deviation of the feature space position; Used to prevent the denominator from being zero; It is the feature after position normalization.
3. The method for transferring the style of a fine brushwork image based on deep learning according to claim 1, characterized in that: The multi-scale features in step S1 are processed by moment shortcut, specifically: According to the formula: , supplement the location information to the multi-scale features; In the formula, It is the feature after moment shortcut processing; It is a multi-scale feature; is the mean of the feature space position; is the standard deviation of the feature space position.
4. The method for transferring the style of a fine brushwork image based on deep learning according to claim 1, characterized in that: The step S1 of the first convolution process or the second convolution process is specifically: The features to be convolved are sequentially subjected to depthwise separable two-dimensional convolution, layer normalization, the third two-dimensional convolution, the third activation function processing, and the third two-dimensional convolution, and then added element-by-element with the features to be convolved to obtain the features after one convolution processing, and the first convolution processing or the second convolution processing is completed according to the preset number of processing times of the first convolution processing or the second convolution processing.
5. The method for transferring the style of a fine brushwork image based on deep learning according to claim 1, characterized in that: In step S3, the target generated image is subjected to the fourth two-dimensional convolution to obtain a feature map, which is specifically: The target generated image is processed in sequence by convolution with a kernel size of 4, a step size of 2, and a stacking number of 64, spectrum normalization, activation function processing, convolution with a kernel size of 4, a step size of 2, and a stacking number of 128, spectrum normalization, activation function processing, convolution with a kernel size of 4, a step size of 2, and a stacking number of 256, spectrum normalization, activation function processing, and convolution with a kernel size of 4, a step size of 1, and a stacking number of 512 to obtain a feature map.
6. The method for transferring the style of a fine brushwork image based on deep learning according to claim 1, characterized in that: After the fifth two-dimensional convolution of the attention feature map in step S3, the image to be judged is obtained, which is specifically: The attention feature map is sequentially processed by convolution with a 1×1 kernel with a step size of 1, spectrum normalization, activation function processing, and convolution with a 4×4 kernel with a step size of 1 to obtain the image to be discriminated.
7. The method for transferring the style of a fine brushwork image based on deep learning according to claim 1, characterized in that: If the first image domain is a natural landscape image, then the second image domain is a Chinese fine brush painting image; If the first image domain is a Chinese brush painting image, the second image domain is a natural landscape image.
8. A deep learning-based meticulous painting image style transfer system, characterized in that: include: An image generation module in the second image domain: used to obtain an image in the first image domain, and obtain a generated image in the second image domain through a first style transfer; The style transfer is performed as follows: The image to be processed is sequentially subjected to the first two-dimensional convolution, layer normalization, the first convolution processing, the first downsampling, the first convolution processing, the second downsampling, the second convolution processing, the third downsampling, and the first convolution processing to obtain multi-scale features; After the multi-scale features are processed by the moment shortcut, they are processed by deconvolution, the first two-dimensional convolution, and the first activation function in sequence to obtain the processed image; The down sampling is specifically: The features after the first convolution processing or the second convolution processing are sequentially processed by the second two-dimensional convolution, position normalization processing, real column regularization, and the second activation function processing to obtain the down-sampled features; A target generated image determination module is used to generate an image through a second style transfer to obtain a reconstructed image in the first image domain, calculate the loss between the reconstructed image and the image obtained in the first image domain, mark the reconstructed image that meets the first preset condition, and use the generated image corresponding to the marked reconstructed image as the target generated image; Image generation module to be judged: used to generate the target image through the fourth two-dimensional convolution to obtain the feature map; The feature map is processed by global average pooling to obtain the first feature map; The feature map is processed by global maximum pooling to obtain the second feature map; After the first feature map and the second feature map are weighted, the first attention feature map and the second attention feature map are obtained respectively; The first attention feature map and the second attention feature map are respectively multiplied with the feature map, and concatenated to obtain the attention feature map; After the fifth two-dimensional convolution of the attention feature map, the image to be judged is obtained; Style transfer image determination module: used to obtain a real image in the second image domain, calculate the loss between the image to be identified and the real image, and use the image to be identified that meets the second preset condition as the style transfer image.
Citation Information
Patent Citations
Image style migration method and system based on deep learning
CN114581341A
