A color dithering method for images based on color transfer model

Through the neural network method based on the color transfer model, the color parameters are directly read and converted, which solves the problem of insufficient layering and texture preservation in the existing color transfer technology and achieves an efficient and automated color dithering effect.

CN118967536BActive Publication Date: 2025-10-03HEILONGJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410922405.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2025-10-03
Estimated Expiration
2044-07-10

AI Technical Summary

Technical Problem

Existing color migration technologies fail to maintain layering and texture when processing images with complex structures, and deep learning-based methods face problems of detail information loss and color distortion.

Method used

A color dithering method based on a color transfer model is adopted. The color is directly read and identified through a neural network model and converted into substantial color parameters. The color feature extraction network, color feature fusion network and fully connected network are used to generate dithered images, which lowers the color adjustment threshold and improves efficiency.

Benefits of technology

It realizes efficient and automatic generation of dithered images, improves the accuracy and naturalness of color migration, reduces the difficulty of color adjustment, and is suitable for different dithering needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967536B_ABST
    Figure CN118967536B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for image color dithering based on a color transfer model, belonging to the field of color transfer. The color transfer model employs supervised learning technology and is composed of an image color transfer module based on an encoder-decoder structure and a color adjustment parameter prediction module based on feature extraction. The model accepts an original image with natural colors and a reference image with stylized tones as input. After calculation by a neural network, the model can apply the color features of the reference image to the source image while maintaining the texture structural features of the source image. The present invention utilizes the above method to analyze the color changes of the image during the dithering process into intuitive and clear parameter information. This intuitive parameter information effectively addresses the need for image color dithering. The method can also be encapsulated into a corresponding color adjustment program to achieve rapid color dithering, thereby adjusting the color of the original image to be similar to that of the reference image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of color migration, and in particular to a picture color dithering method based on a color migration model. Background Art

[0002] Color transfer is an image enhancement technique. Its core research objective is to impart the color style of the reference image to the source image by fusing the color information of the source image with that of the reference image, without changing the source image's content or structure. Research on image color transfer has demonstrated its application value in various fields.

[0003] From the perspective of color migration implementation strategies, current research can be mainly divided into global color migration methods, local color migration methods, and color migration methods based on deep learning technology.

[0004] Global color migration methods apply a uniform mapping to every pixel in the source image, thereby making the color distribution of the source image similar to that of the reference image. This method mainly uses various statistical analysis methods such as global statistical transformation, histogram matching, and optimal transfer.

[0005] Local color migration methods, developed based on global color migration techniques, aim to transfer color between corresponding local regions within an image. These methods, based on preprocessing techniques such as image segmentation and color clustering, divide the source and reference images into independently calculable subregions during the color migration process. Correlations between these subregions are then calculated, and color migration is performed between these correlated regions. Current local color migration techniques can be divided into two categories based on the interaction method: interactive local color migration methods and automatic local color migration methods, each suitable for different application scenarios.

[0006] Despite significant progress in color transfer technology, traditional methods fail to fully consider the spatial relationships between pixels, resulting in inadequate layering and texture preservation in transferred images, particularly when processing structurally complex images. While recent deep learning-based methods can leverage image semantic information to guide color transfer, improving accuracy and naturalness, they still suffer from loss of detail and color distortion when working with detailed, real-world photographic images. Summary of the Invention

[0007] The purpose of the present invention is to provide a method for image dithering based on a color migration model. The method directly reads and identifies colors through a neural network model and converts them into substantial color parameters. The method can automatically generate dithered images in batches, thereby improving efficiency and effectively lowering the threshold for color adjustment.

[0008] To achieve the above object, the present invention provides a method for image color dithering based on a color migration model, comprising the following steps:

[0009] Step 1: Establish a color transfer model, including a color transfer module and a color adjustment parameter prediction module, and train the color transfer model;

[0010] The color migration module includes a color feature extraction network and a color feature fusion network, wherein the color feature extraction network is provided with an encoder network, and the color feature fusion network is provided with a decoder network;

[0011] The color adjustment parameter prediction module is provided with a fully connected layer network;

[0012] Step 2: Build a large-scale ground-truth labeled image dataset. This dataset includes a set of natural color source images, a set of color editing files containing color adjustment parameters, and a set of stylized reference images obtained by adjusting the natural color source images according to the color editing files. From the labeled image dataset, select the natural color source images and the stylized reference images, dimensionally concatenate the source and reference images, and then input them into the trained color transfer model.

[0013] Step 3: Use the color feature extraction network to extract the texture structure and color style features of the source image and the reference image, and extract high-dimensional features including color features and structural features Figure 1 ;

[0014] Use the color feature extraction network to extract the color style features of the reference image and extract high-dimensional features including color features Figure 2 ;

[0015] Step 4: High-dimensional features Figure 1 and high-dimensional features Figure 2 The fused feature map is obtained by splicing in the corresponding dimension, and the size and dimension of the fused feature map are restored through the decoder network in the color feature fusion network to obtain the color migration result picture 1

[0016] In the color adjustment parameter prediction module, a fully connected network is used to transform high-dimensional features Figure 2 Map the color adjustment parameters to represent the tone style of the reference image, generate a color editing file, and then apply the color editing file to the source image to obtain the color migration result image 2

[0017] Preferably, in step 1, the specific structure of the color feature extraction network is as follows:

[0018] The color feature extraction network includes an encoder S and an encoder C. The encoder S takes the concatenated data of the source image and the reference image as input and extracts the color and structural features of the reference image to the source image. The encoder C takes the source image data as input and extracts the structural feature information of the source image.

[0019] Both encoder S and encoder C have a five-layer structure. Each layer extracts the feature information of the image through two consecutive convolutions. The last four layers are downsampling layers constructed by combining low-pass filtering technology and maximum pooling technology. Before the third maximum pooling in encoder S and encoder C, the obtained feature map is input into the convolution attention module CBAM for processing. For the input feature map of size H×W×32, the size will become H / 16×W / 16×256 after encoder processing. The feature map data calculated by the two encoders at the same layer will be spliced, and the spliced ​​feature map will be passed to the color feature fusion network. EvoNorm-S0 combined with normalization technology is used as the activation function of the two encoders. The formula is as follows:

[0020]

[0021] Where x represents the input feature map, σ(v1x) is the Swish activation function, and v1 is a trainable hyperparameter. Used to calculate the standard deviation of the feature map x in the group g, where w represents the width of the feature map, h represents the height of the feature map, c represents the number of channels of the feature map, and γ and β are scaling parameters and translation parameters respectively.

[0022] Preferably, in step 1, the specific structure of the color feature fusion network is as follows:

[0023] The color feature fusion network consists of a decoder D and a final convolutional layer with a tanh activation function. The decoder D has a total of five layers. The first four layers of the decoder D are set as upsampling layers. The fifth layer removes the upsampling operation compared to the first four layers and retains two consecutive convolutions. The upsampling layer is implemented by transposed convolution and a custom low-pass filter. Its weights are set as follows, where p and q are the position indexes of the filter kernel in two dimensions:

[0024]

[0025] The decoder D restores the size of the image through the upsampling layer to improve the resolution of the image. In the upsampling process, the jump connection is used to combine the feature map data G = {G1, G2, G3, G4, G5}, where G1 to G5 are the feature maps obtained by the encoder C and encoder S in the 1st to 5th layers. These feature maps contain different levels of image color information and image structure information. After passing through the final convolution layer following the decoder D, Tanh is used to restore the number of channels of the feature map to 3, generating the color migration result image 1

[0026] Preferably, in step 1, the structure of the color adjustment parameter prediction module is as follows:

[0027] The color adjustment parameter prediction module is composed of a fully connected linear layer L. The input data of the fully connected linear layer L is the high-dimensional feature data extracted by the encoder S. The last fully connected layer of the linear layer L uses Tanh as the activation function to map the feature data into a vector with 55 dimensions.

[0028] Preferably, the training process in step 1 is as follows:

[0029] For a set of color migration tasks, while ensuring that the source image S natural Under the same conditions, different pictures with the same stylized tones are selected as reference picture inputs. The formula is as follows:

[0030]

[0031] By constructing a loss function to constrain the differences between color feature data, the network parameters are adjusted by backpropagation during the iteration process to increase the stability of color extraction for reference images with similar color styles. The calculation method of the loss function is as follows:

[0032]

[0033] Where N represents the total number of source image batch samples, D represents the size of the reference image set, represents the vector extracted by the fully connected layer when the i-th source image sample uses image j as the reference image, represents the L1 loss of two feature vectors.

[0034] Therefore, the present invention adopts the above-mentioned image dithering method based on the color migration model, which has the following advantages:

[0035] A color transfer model-based image dithering method is employed. The resulting system can be used to transfer the color style of a reference image to the original photographic work. The color changes during the dithering process can be analyzed as easily understood parameter information, lowering the barrier to entry for color grading. Two methods are used to generate corresponding dithering files, meeting different dithering requirements. The method of the present invention effectively addresses these requirements. Furthermore, the reference image input is changed from a single image to a collection of images. Feature data is calculated for each item in the reference image collection when compared to the same source image as the model input. By fitting the differences between the different color feature data in a linear layer, network parameters are optimized using backpropagation, effectively improving the encoder's stability during color feature extraction.

[0036] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a network structure diagram of a color dithering method for an image based on a color migration model according to the present invention;

[0038] Figure 2 This is a diagram showing the actual effect of a color dithering method for an image based on a color migration model according to the present invention;

[0039] Figure 3 A schematic diagram of the effect of different reference picture set sizes input to a model on the color migration performance of the model in a color dithering method based on a color migration model of the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. The specific model specifications need to be selected and determined based on the actual specifications of the device, etc. The specific selection calculation method adopts the existing technology in this field, so it will not be described in detail.

[0041] Example

[0042] like Figure 1 As shown, the present invention provides a method for image dithering based on a color migration model, comprising the following steps:

[0043] Step 1: Establish a color migration model, including a color migration module and a color adjustment parameter prediction module, and train the color migration model. The training process is as follows:

[0044] For a set of color migration tasks, while ensuring that the source image S natural Under the condition that the same stylized tones are used as reference images, the color styles of the color transfer results generated by the model should be as close as possible, and the color adjustment parameters predicted by the model should also be as similar as possible. To achieve this goal, different images with the same stylized tones are used as reference images. The formula is as follows:

[0045]

[0046] During one iteration of the network, the set Each item in S is used as a reference image natural The color migration feature data between the two images is constrained by the constructed loss function. The network parameters are adjusted through backpropagation during the iteration process to increase the stability of color extraction for reference images with similar color styles. The calculation method of the loss function is as follows:

[0047]

[0048] Where N represents the total number of source image batch samples, and D represents the size of the reference image set, which is specifically set to 3. represents the vector extracted by the fully connected layer when the i-th source image sample uses image j as the reference image, represents the L1 loss of two feature vectors.

[0049] The color migration module includes a color feature extraction network and a color feature fusion network. The color feature extraction network is provided with an encoder network. The specific structure of the color feature extraction network is as follows:

[0050] The color feature extraction network includes an encoder S and an encoder C. The encoder S takes the concatenated data of the source image and the reference image as input and extracts the color and structural features of the reference image to the source image. The encoder C takes the source image data as input and extracts the structural feature information of the source image.

[0051] Both encoder S and encoder C have a five-layer structure. Each layer extracts the feature information of the image through two consecutive convolutions. The last four layers are downsampling layers constructed by combining low-pass filtering technology and maximum pooling technology. Before the third maximum pooling in encoder S and encoder C, the obtained feature map is input into the convolution attention module CBAM for processing. For the input feature map of size H×W×32, the size will become H / 16×W / 16×256 after encoder processing. The feature map data calculated by the two encoders at the same layer will be spliced, and the spliced ​​feature map will be passed to the color feature fusion network. EvoNorm-S0 combined with normalization technology is used as the activation function of the two encoders. The formula is as follows:

[0052]

[0053] Where x represents the input feature map, σ(v1x) is the Swish activation function, and v1 is a trainable hyperparameter. Used to calculate the standard deviation of the feature map x in the group g, where w represents the width of the feature map, h represents the height of the feature map, c represents the number of channels of the feature map, and γ and β are scaling parameters and translation parameters respectively.

[0054] A decoder network is set in the color feature fusion network, and the specific structure is as follows:

[0055] The color feature fusion network consists of a five-layer decoder D and a final convolutional layer with a tanh activation function. The first four layers of decoder D are set as upsampling layers. Compared with the first four layers, the fifth layer removes the upsampling operation and only retains two consecutive convolutions. The upsampling strategy is implemented through transposed convolution and a custom low-pass filter. The weight formula is set as follows, where p and q are the position indices of the filter kernel in two dimensions:

[0056]

[0057] Decoder D restores the image size by upsampling and improves the image resolution. During the upsampling process, it uses skip connections to combine feature map data G = {G1, G2, G3, G4, G5}, where G1 to G5 are the feature maps obtained by encoder C and encoder S in layers 1 to 5. These feature maps contain image color information and image structure information at different levels. The final convolutional layer after decoder D uses Tanh to restore the number of channels of the feature map to 3, generating a color migration result image.

[0058] A fully connected layer network is set in the color adjustment parameter prediction module, which is composed of a fully connected linear layer L. The input data of the fully connected linear layer L is the high-dimensional feature data extracted by the encoder S. The last fully connected layer of the linear layer L uses Tanh as the activation function to map the feature data into a vector with 55 dimensions.

[0059] Alternatively, an encoder network S can be set separately before the fully connected network to form two independent modules with the color migration module.

[0060] The color adjustment parameter prediction module can be used to predict the color adjustment parameters that represent the stylized tones of the reference image. After setting, there are 55 types of predicted parameters. These parameters correspond to the 55 parameters that only control the color effects of the image among the more than 150 color adjustment parameters supported by Adobe Lightroom. They are all numerical data types and consist of floating-point and integer type parameters.

[0061] Step 2: Build a large-scale ground-truth labeled image dataset. This dataset includes a set of natural color source images, a set of color editing files containing color adjustment parameters, and a set of stylized reference images obtained by adjusting the natural color source images according to the color editing files. From the labeled image dataset, select the natural color source images and the stylized reference images, dimensionally concatenate the source and reference images, and then input them into the trained color transfer model.

[0062] Step 3: Use the color feature extraction network to extract the texture structure and color style features of the source image and the reference image, and extract high-dimensional features including color features and structural features Figure 1 ;

[0063] Use the color feature extraction network to extract the color style features of the reference image and extract high-dimensional features including color features Figure 2 ;

[0064] Step 4: High-dimensional features Figure 1 and high-dimensional features Figure 2 The fused feature map is obtained by splicing in the corresponding dimension, and the size and dimension of the fused feature map are restored through the decoder network in the color feature fusion network to obtain the color migration result picture 1

[0065] In the color adjustment parameter prediction module, a fully connected network is used to transform high-dimensional features Figure 2 Map the color adjustment parameters to represent the tone style of the reference image, generate a color editing file, and then apply the color editing file to the source image to obtain the color migration result image 2

[0066] Among them, different color migration result images correspond to different generation strategies. Color migration result image 1 corresponds to generation method D using direct color migration strategy, and color migration result image 2 corresponds to generation method P using indirect color migration strategy.

[0067] The difference between the two types of generation lies in whether or not they are generated using a color editing file. A color editing file is a file structured around multiple color adjustment parameters that can be used to store metadata about color presets. The parameters defined in the preset file can be parsed and applied directly to the image, enabling rapid color style transfer. This allows users to quickly achieve complex color grading effects without having to manually adjust each color parameter.

[0068] Perform specific generation, some of the generation results are as follows Figure 2 The specific implementation process is as follows:

[0069] The dataset used in this paper consists of a natural color image set, a color editing file set, and a reference image set obtained by stylizing the natural color image set using the color editing file set. The selection and construction of the dataset will affect the performance of the deep learning model.

[0070] To construct the color editing file dataset required for this invention, we selected 60 official Lightroom color preset files and 240 publicly released color preset files from renowned photographers and artists. All preset files were originally in XMP format. However, given the limited compatibility and storage performance of the XMP file format, we extracted the color adjustment parameters from the original XMP preset files, removed all metadata, and converted the files to JSON format for storage through batch processing.

[0071] The focus is on adjusting the image's color style. Therefore, each color editing file is filtered to retain only 55 basic numerical color adjustment parameters. Each parameter represents the specific degree of adjustment to the corresponding color or effect. All parameter values ​​are then normalized to a range of -1 to 1.

[0072] The present invention selects the open source data set Flickr2K to construct a natural color picture set. Flickr2K is a public image data set that is widely used in computer vision tasks such as image super-resolution, color migration, and image enhancement. The data set consists of more than 2,000 high-definition pictures from the Flickr website, covering a variety of shooting scenes, providing rich visual information and diverse color distribution to support the research and development of various image processing tasks. When constructing a natural color picture set, it is necessary to ensure that the color style of the picture is as natural as possible. After screening, the present invention finally adopted 700 high-definition pictures with natural colors from the Flickr2K data set. In order to make up for the lack of specific seasonal scene pictures and Asian portrait pictures in the open source data set, the present invention supplemented the data set with 100 original natural color photos to meet the diversity of scenes contained in the image data set.

[0073] The reference picture set constructed by the present invention is composed of a natural color picture set stylized according to a color editing file data set. n The natural color picture set in this invention is a picture with natural color style. p Edit the file for a color that represents a specific color style p. By replacing F p Applied to I n , a stylized reference image I with color style p can be generated p During model training, if you use pictures with natural colors I n As the source image input, and also use F p The other stylized images processed are input as reference images, then I p This can be used as a comparison between the ground-truth image and the color migration result predicted by the model. This method calculates the loss function value in each iteration of the supervised learning process and strives to minimize and stabilize the loss value. It then optimizes the neural network parameters through backpropagation, ultimately effectively guiding the model to converge in the right direction.

[0074] The present invention combines the selected 300 stylized color editing files with 800 natural color images, and finally constructs 240,000 image data with stylized colors;

[0075] Parameter settings: The model was trained using the Adam optimizer, with a convolutional layer activation function with a learning rate of 0.0001, β1 = 0.9, and β2 = 0.999. Based on training experience, a batch size of 8 was used. To increase the diversity of training samples, random cropping with a height and width of 512 pixels was applied, and the input data was randomly rotated at angles of 90, 180, and 270 degrees, as well as randomly flipped horizontally and vertically. All values ​​in the images were normalized to the range [-1, 1].

[0076] This paper uses histogram correlation, histogram Bhattacharyya distance, peak signal-to-noise ratio, and perceptual loss, which are commonly used in color migration research, as the main evaluation indicators. The results are as follows: Figure 3

[0077] Baseline Model

[0078] In order to verify the effectiveness of the method proposed in the present invention, the inventors selected representative methods of species for performance comparison, including two traditional color migration methods and three deep learning-based color migration methods.

[0079] Traditional color migration methods

[0080] The full-color gamut color migration method proposed by Nguyen et al. is based on light perception and color gamut limitation technology, which can complete color migration of images under different lighting scenes.

[0081] The global color transfer method proposed by Reinhard et al. completes color transfer based on the Lαβ color space based on the second-order statistical information of the image. It is often selected as a classic color transfer method for reference and comparison.

[0082] Color transfer method based on deep learning

[0083] PhotoWCT 2 Based on a lightweight autoencoder, a block training method and high-frequency residual skip connections are introduced, focusing on processing color conversion of photo-level images.

[0084] WCT 2 Based on wavelet transform technology, it achieves end-to-end illumination perception and realistic color transfer, which can preserve the image's structural details while authentically conveying the image's color style.

[0085] WCT is a general style transfer model based on feature transformation, which achieves color transfer by matching the statistical distribution and correlation of content and style features during the forward propagation process.

[0086] The color migration model included in this invention consists of two functional modules, each of which implements color migration between images using different strategies. The color migration module, based on the U-Net network structure, can directly generate the resulting image after color migration using its decoder structure. This method is referred to as Method-D in this invention. In addition, the model also includes a color adjustment parameter prediction module based on feature extraction. This module indirectly generates the resulting color migration image by embedding a predicted color editing file into the source image. This method is referred to as Method-P in this invention.

[0087] The inventors compared and analyzed the color migration effects of the present invention's method-D and method-P with several representative related works in different application scenarios. The color migration model of the present invention was evaluated using multiple evaluation indicators, and the average score for each indicator was taken. Detailed example results are listed in Table 1:

[0088] Table 1

[0089]

[0090] Experimental results demonstrate that the two color transfer methods implemented by the color transfer model proposed in this invention outperform other control methods. The color transfer results from the two methods have higher histogram correlations and lower histogram Bhattacharyya distances compared to the ground-truth images, demonstrating that the color transfer results from the methods of this invention have a more accurate overall color style. Furthermore, the two methods of this invention achieve higher PSNR and lower LPIPS, indicating that the color transfer results from the methods of this invention are more similar to the ground-truth images at the pixel level and have an image similarity closer to human visual perception. Furthermore, Method-D and Method-P achieve similar objective evaluation results, demonstrating that the two dithering methods of the model of this invention can effectively achieve color transfer.

[0091] Therefore, the present invention adopts a color dithering method for images based on a color migration model. It directly reads and identifies colors through a neural network model and converts them into substantial color parameters. It can automatically generate dithered images in batches, improve efficiency, and effectively lower the threshold for color adjustment.

[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solutions of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A color dithering method for an image based on a color migration model, characterized in that: The following steps are involved: Step 1: Establish a color migration model, including a color migration module and a color adjustment parameter prediction module, and train the color migration model. The training process is as follows: For a set of color migration tasks, while ensuring that the source image S natural Under the same conditions, different pictures with the same stylized tones are selected as reference picture inputs. The formula is as follows: By constructing a loss function to constrain the differences between color feature data, the network parameters are adjusted by backpropagation during the iteration process to increase the stability of color extraction for reference images with similar color styles. The calculation method of the loss function is as follows: Where N represents the total number of source image batch samples, D represents the size of the reference image set, represents the vector extracted by the fully connected layer when the i-th source image sample uses image j as the reference image, represents the L1 loss of two feature vectors; The color migration module includes a color feature extraction network and a color feature fusion network, wherein the color feature extraction network is provided with an encoder network, and the color feature fusion network is provided with a decoder network; The color feature extraction network includes an encoder S and an encoder C. The encoder S takes the concatenated data of the source image and the reference image as input and extracts the color and structural features of the reference image to the source image. The encoder C takes the source image data as input and extracts the structural feature information of the source image. Both encoder S and encoder C have a five-layer structure. Each layer extracts the feature information of the image through two consecutive convolutions. The last four layers are downsampling layers constructed by combining low-pass filtering technology and maximum pooling technology. Before the third maximum pooling in encoder S and encoder C, the obtained feature map is input into the convolution attention module CBAM for processing. For the input feature map of size H×W×32, the size will become H / 16×W / 16×256 after encoder processing. The feature map data calculated by the two encoders at the same layer will be spliced, and the spliced ​​feature map will be passed to the color feature fusion network. EvoNorm-S0 combined with normalization technology is used as the activation function of the two encoders. The formula is as follows: Where x represents the input feature map, σ(v1x) is the Swish activation function, and v1 is a trainable hyperparameter. Used to calculate the standard deviation of the feature map x in group g, where w represents the width of the feature map, h represents the height of the feature map, c represents the number of channels of the feature map, γ and β are scaling parameters and translation parameters respectively; The color feature fusion network consists of a decoder D and a final convolutional layer with a tanh activation function. The decoder D has a total of five layers. The first four layers of the decoder D are set as upsampling layers. The fifth layer removes the upsampling operation compared to the first four layers and retains two consecutive convolutions. The upsampling layer is implemented by transposed convolution and a custom low-pass filter. Its weights are set as follows, where p and q are the position indexes of the filter kernel in two dimensions: The decoder D restores the size of the image through the upsampling layer to improve the resolution of the image. In the upsampling process, the jump connection is used to combine the feature map data G = {G1, G2, G3, G4, G5}, where G1 to G5 are the feature maps obtained by the encoder C and encoder S in the 1st to 5th layers. These feature maps contain different levels of image color information and image structure information. After passing through the final convolution layer following the decoder D, Tanh is used to restore the number of channels of the feature map to 3, generating the color migration result image 1 The color adjustment parameter prediction module is provided with a fully connected layer network. The color adjustment parameter prediction module is composed of a fully connected linear layer L. The input data of the fully connected linear layer L is the high-dimensional feature data extracted by the encoder S. The last fully connected layer of the linear layer L uses Tanh as the activation function to map the feature data into a vector with 55 dimensions. Step 2: Build a large-scale ground-truth labeled image dataset. This dataset includes a set of natural color source images, a set of color editing files containing color adjustment parameters, and a set of stylized reference images obtained by adjusting the natural color source images according to the color editing files. From the labeled image dataset, select the natural color source images and the stylized reference images, dimensionally concatenate the source and reference images, and then input them into the trained color transfer model. Step 3: Use the color feature extraction network to extract the texture structure and color style features of the source image and the reference image, and extract a high-dimensional feature map 1 containing color features and structural features; Use the color feature extraction network to extract the color style features of the reference image and extract a high-dimensional feature map containing color features. Step 4: Concatenate the high-dimensional feature map 1 and the high-dimensional feature map 2 in the corresponding dimensions to obtain a fused feature map. Restore the size and dimension of the fused feature map through the decoder network in the color feature fusion network to obtain the color migration result image 1. In the color adjustment parameter prediction module, a fully connected network is used to map the high-dimensional feature map 2 into the color adjustment parameters representing the hue style of the reference image, generate a color editing file, and then apply the color editing file to the source image to obtain the color migration result image 2.

Citation Information

Patent Citations

  • Self-adaptive style migration method for historic building image based on visual encoder

    CN116309022A

  • Method for training skin color migration model, method for generating skin beautifying image and related device

    CN116703707A