Chinese traditional pattern intelligent generation method based on artificial intelligence

By building a structure mapper and pre-training model, combined with dynamic upsampling and feature fusion technology, the problems of color distribution uncertainty and limited design freedom in traditional Chinese patterns are solved, and efficient and automated pattern generation is achieved. The generated pattern structure is accurate and highly diverse.

CN120707673APending Publication Date: 2025-09-26XI'AN POLYTECHNIC UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510754237.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing technologies have difficulty dealing with the uncertainty of color distribution and limited design freedom of traditional Chinese patterns, resulting in low design efficiency and easy generation failure.

Method used

An artificial intelligence-based method was adopted to collect and preprocess color images of traditional Chinese nest patterns, construct a structure mapper and a pre-trained StyleGAN model, and combine dynamic upsampling and feature fusion techniques to generate grayscale and color patterns. The contour images were extracted using the TEED method, and the improved MCConv module and ST-TR2 model were used to achieve fully automated design.

Benefits of technology

It achieves precise control of the color distribution of traditional Chinese patterns, avoids generation failure, ensures clear pattern details, improves design efficiency and freedom, and the accuracy and diversity of the generated pattern structure are significantly better than traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120707673A_ABST
    Figure CN120707673A_ABST
Patent Text Reader

Abstract

The invention discloses a Chinese traditional pattern intelligent generation method based on artificial intelligence, and the method comprises the following specific steps: collecting a Chinese traditional nest pattern color image, carrying out the preprocessing, obtaining a data set, and dividing the data set into a training set and a test set; constructing a structure mapper and processing the data set to obtain hidden variables; inputting the hidden variables into a pre-trained StyleGAN model, and generating a gray-scale pattern image; inputting the gray pattern image and the processed Chinese traditional nest pattern color image into a pre-trained ST-TR2 model to generate a color image; training a structure mapper and finely adjusting the pre-trained StyleGAN model to obtain a trained overall model; and inputting the test set into the trained overall model to generate a final color image. According to the method, the problems that the uncertainty of color distribution of traditional patterns in China is difficult to process and the degree of freedom of design is limited are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of pattern generation methods, and in particular relates to an intelligent generation method of traditional Chinese patterns based on artificial intelligence. Background Art

[0002] Traditional Chinese patterns are an integral part of China's cultural heritage, widely used in painting, clothing, architecture, and other fields. These patterns not only carry a wealth of historical and cultural information but also possess unique artistic value. However, the design process for traditional patterns is highly dependent on the designer's expertise, requiring considerable time and effort from conception to final design. Furthermore, the complex and varied color distribution of traditional patterns means that the same outline may correspond to multiple color combinations, further increasing the design complexity.

[0003] Although existing computer-aided design (CAD) technologies can improve design efficiency, they still require the full participation of designers and cannot achieve true automation. In recent years, artificial intelligence generated content (AIGC) technologies, such as text-to-image generation, image translation, and style transfer, have provided new possibilities for pattern design. However, these technologies have the following limitations: (1) they have difficulty handling the uncertainty of the color distribution of traditional Chinese patterns, which can easily lead to pattern collapse or generation failure; (2) they require color images as input, which limits the degree of design freedom. Summary of the Invention The purpose of the present invention is to provide an intelligent generation method of traditional Chinese patterns based on artificial intelligence, so as to solve the problems in existing methods of difficulty in dealing with the uncertainty of color distribution of traditional Chinese patterns and limiting the degree of freedom of design.

[0004] The technical solution adopted by the present invention is an intelligent generation method of traditional Chinese patterns based on artificial intelligence, and the specific steps are as follows: Step 1: collect and preprocess color images of traditional Chinese nest patterns to obtain a dataset, and divide the dataset into a training set and a test set; Step 2: Build a structure mapper and process the data set to obtain latent variables; Step 3: Input the latent variables into the pre-trained StyleGAN model to generate a grayscale pattern image; Step 4: Input the grayscale pattern image and the processed Chinese traditional nest pattern color image into the pre-trained ST-TR 2 In the model, a color image is generated; Step 5: Use the training set to train the structure mapper and fine-tune the pre-trained StyleGAN model to obtain the trained overall model; Step 6: Input the test set into the trained overall model to generate the final color image. The present invention is also characterized in that: The specific process of step 1 is: Step 1.1, collecting color images of traditional Chinese round nest patterns and cropping the collected images to the same size and converting them into PNG format to obtain processed color images of traditional Chinese round nest patterns; Step 1.2, performing data augmentation on the processed color image of the traditional Chinese round nest pattern by using the GPDM method to obtain an augmented color image of the traditional Chinese round nest pattern; Step 1.3: Convert each color image of the traditional Chinese nest pattern augmented in step 1.2 into a grayscale image. The conversion formula is: (1) In formula (1), Respectively represent the red, green, and blue channel components of the augmented traditional Chinese nest pattern color image; Step 1.4, using the TEED method to extract the contour image of each collected augmented traditional Chinese nest pattern color image; In step 1.5, the augmented color image, grayscale image, and contour image of traditional Chinese nest patterns are used as a data set, and the data set is divided into a training set and a test set.

[0005] In step 2, the structure mapper consists of a ResNet-101 network, a dynamic upsampling module, and an improved MCConv module.

[0006] The improved MCConv module includes a right branch and a left branch. The right branch extracts multi-dimensional features through conventional convolution, dilated convolution and deformable convolution. The size of conventional convolution is 3×3 and the stride is 2. The size of dilated convolution is 3×3 and the stride is 2. The dilation rate is 2. The size of deformable convolution is 3×3 and the stride is 3. The number is 1 / 3 of the input feature map. The left branch enhances feature interaction through the channel attention mechanism and uses 1×1 convolution instead of the fully connected layer in the channel attention mechanism.

[0007] In step 2, the structure mapper processes the data as follows: Step 2.1: Input the contour image into the ResNet-101 network to extract multi-scale feature maps, and obtain coarse feature maps, medium feature maps, and fine feature maps; In step 2.2, the obtained coarse feature map, medium feature map and fine feature map are fused through the dynamic upsampling module to generate hybrid features; The specific fusion process is: Generate pre-upsampled features through formula (2) , the expression is: (2) In formula (2), represents the fine feature map, is the dynamic upsampling kernel, CARAFE is the dynamic upsampling operator; Calculate the dynamic upsampling kernel, the expression is: (3) In formula (3), Conv represents the convolution operation, Up represents the upsampling operation, Softmax represents the normalized kernel weight, is the coarse feature map, is the middle feature map; Then the mixed feature is obtained by formula (4), which is expressed as: (4) In formula (4), G It is a gate map used to control the feature fusion ratio; in, (5) In formula (5), is the activation function; Step 2.3: Input the obtained mixed features into the improved MCConv module to capture the long-range context and geometric transformation features to obtain a 512-dimensional latent variable. .

[0008] In step 3, a grayscale pattern image is generated The expression is: (6) In formula (6), is the average latent vector of the pre-trained StyleGAN model, Indicates that the model weights are frozen.

[0009] In step 4, the expression for generating a color image is: (7) In formula (7), Indicates that the model weights are fixed.

[0010] In step 5, the loss function for training the structure mapper is the similarity loss function: (8) In formula (8), is the contour image, S It is a contour extraction operator (TEED method) used to maintain the structural consistency of the generated image and the input contour; The loss function for fine-tuning the pre-trained StyleGAN model is: Pixel-level L2 loss: (9) In formula (9), is the real grayscale image (the grayscale image in the training set), is the generated grayscale pattern image used to constrain pixel-level similarity.

[0011] Perceptual Loss (LPIPS): (10) In formula (10), It is a pre-trained VGG network used to extract high-level semantic features; Total loss function: (11) In formula (11), 、 、 is the weight coefficient.

[0012] The beneficial effects of the present invention are: (1) The present invention's intelligent generation method for traditional Chinese patterns based on artificial intelligence uses contour control structures and color images of traditional Chinese cluster patterns to control color, thus avoiding generation failures caused by the uncertainty of color distribution in traditional Chinese patterns and achieving pattern generation in an open color gamut. (2) The present invention uses an artificial intelligence-based intelligent generation method for traditional Chinese patterns, which ensures clear details of the generated patterns through dynamic upsampling and feature fusion technology; (3) The present invention is based on an artificial intelligence-based intelligent generation method for traditional Chinese patterns. By combining sketch generation with style transfer, it can achieve fully automated design from outline to color pattern, with high design freedom and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 This is a framework diagram of the overall model of the artificial intelligence-based intelligent generation method of traditional Chinese patterns in the present invention. DETAILED DESCRIPTION

[0014] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0015] Example 1 The present invention is based on the artificial intelligence method for intelligently generating traditional Chinese patterns, which is specifically implemented according to the following steps: Step 1: Collect color images of traditional Chinese nest patterns and preprocess the collected images to obtain a data set, and divide the data set into a training set and a test set; The dataset contains color images, grayscale images, and contour images of traditional Chinese nest patterns; Step 2: Build a structure mapper and process the contour images in the dataset to obtain latent variables. This process can train the mapping from contour images to latent space. Step 3: Input the latent variables obtained in step 2 into the pre-trained StyleGAN model to generate a grayscale pattern image; Step 4: Input the grayscale pattern image and the pre-processed Chinese traditional nest pattern color image into the pre-trained ST-TR 2 In the Transformer-based style transfer model, a color image is generated. Step 5: Use the training set to train the structure mapper constructed in step 2 of the overall model, fine-tune the pre-trained StyleGAN model in the overall model, fix the weights of the trained structure mapper and the fine-tuned pre-trained StyleGAN model, and obtain the trained overall model; The overall model consists of the structure mapper built in step 2, the pre-trained StyleGAN model in step 3, and the pre-trained ST-TR 2 Model composition; Pre-trained ST-TR 2 The model does not require further fine-tuning and can be used directly; Step 6: Input the test set into the trained overall model to generate the final color image.

[0016] Example 2 Based on Example 1, the specific process of step 1 is as follows: Step 1.1: Collect color images of traditional Chinese round-nest patterns and crop the collected images to the same size (256×256) and convert them into PNG format to obtain processed color images of traditional Chinese round-nest patterns. A total of 1,351 color images of traditional Chinese round-nest patterns were collected. Step 1.2, performing data augmentation on the processed color image of the traditional Chinese round nest pattern using the GPDM (Generative Patch Distribution Matching) method to obtain an augmented color image of the traditional Chinese round nest pattern; Step 1.3: Convert each color image of the traditional Chinese nest pattern augmented in step 1.2 into a grayscale image. The conversion formula is: (1) In formula (1), They represent the red, green, and blue channel components of the augmented traditional Chinese nest pattern color image, respectively. The weight coefficients are set according to the sensitivity of the human eye to different color channels. Step 1.4, using the TEED (lightweight convolutional neural network) method to extract the contour image of each collected augmented traditional Chinese nest pattern color image; In step 1.5, the augmented color, grayscale, and contour images of traditional Chinese round nest patterns are used as a dataset. The dataset is divided into a training set and a test set. The dataset contains a total of 30,000 images that meet aesthetic standards to ensure data diversity.

[0017] Example 3 Based on Example 2, in step 2, the structure mapper consists of a ResNet-101 network, a dynamic upsampling module (CARAFE), and an improved MCConv module; The ResNet-101 network and the dynamic upsampling module (CARAFE) form a feature pyramid, and the improved MCConv module is used for latent space mapping; The ResNet-101 network consists of 1 input layer, 98 residual blocks, 1 global pooling layer, and 1 fully connected layer, for a total of 101 parameter layers. The input layer is a 7×7 convolutional layer with 64 channels, a stride of 2, and padding=3, used to extract initial features. The 98 residual blocks are divided into four stages: 1 residual block in the first stage, 23 residual blocks in the second stage, 23 residual blocks in the third stage, and 1 residual block in the fourth stage. Each residual block consists of 1×1 convolution (for dimensionality reduction), 3×3 convolution (for feature extraction), and 1×1 convolution (for dimensionality increase), for a total of 3 parameter layers. The global average pooling layer is used to compress the feature map into a 1×1 vector. The fully connected layer is used to output the category book for classification tasks. The improved MCConv module includes a right branch and a left branch. The right branch extracts multi-dimensional features through conventional convolution, dilated convolution and deformable convolution. The size of conventional convolution is 3×3 and the stride is 2. The size of dilated convolution is 3×3 and the stride is 2. The dilation rate is 2. The size of deformable convolution is 3×3 and the stride is 3. The number is 1 / 3 of the input feature map. The left branch enhances feature interaction through the channel attention mechanism and uses 1×1 convolution instead of the fully connected layer in the channel attention mechanism.

[0018] Example 4 Based on Example 3, in step 3, the structure mapper processes the contour image as follows: Step 2.1: Input the contour image into the ResNet-101 network to extract multi-scale feature maps, and obtain a coarse feature map (global semantic feature map), a medium feature map (local structural feature map), and a fine feature map (detail information feature map); In step 2.2, the obtained coarse feature map, medium feature map and fine feature map are fused through the dynamic upsampling module to generate hybrid features; The specific fusion process is: Generate pre-upsampled features through formula (2) , the expression is: (2) In formula (2), represents the fine feature map, is the dynamic upsampling kernel, CARAFE is the dynamic upsampling operator; Calculate the dynamic upsampling kernel, the expression is: (3) In formula (3), Conv represents the convolution operation, Up represents the upsampling operation, Softmax represents the normalized kernel weight, is the coarse feature map, is the middle feature map; Then the mixed feature is obtained by formula (4), which is expressed as: (4) In formula (4), G It is a gate map used to control the feature fusion ratio; in, (5) In formula (5), is the activation function; Step 2.3: Input the obtained mixed features into the improved MCConv module to capture the long-range context and geometric transformation features to obtain a 512-dimensional latent variable. .

[0019] Example 5 Based on Example 4, in step 3, a grayscale pattern image is generated. The expression is: (6) In formula (6), is the average latent vector of the pre-trained StyleGAN model, Indicates that the model weights are frozen.

[0020] Example 6 Based on Example 5, in step 4, the expression for generating a color image is: (7) In formula (7), Indicates that the model weight is fixed; Users can adjust the style and color distribution of the generated pattern by replacing the processed color image of the traditional Chinese round nest pattern.

[0021] Example 7 Based on Example 6, in step 5, the loss function for training the structure mapper is a similarity loss function: (8) In formula (8), is the contour image, S It is a contour extraction operator (TEED method) used to maintain the structural consistency of the generated image and the input contour; The loss function for fine-tuning the pre-trained StyleGAN model is: Pixel-level L2 loss: (9) In formula (9), is the real grayscale image (the grayscale image in the training set), is the generated grayscale pattern image used to constrain pixel-level similarity.

[0022] Perceptual Loss (LPIPS): (10) In formula (10), It is a pre-trained VGG network used to extract high-level semantic features; Total loss function: (11) In formula (11), 、 、 is the weight coefficient, whose default values ​​are 1.0, 0.8, and 0.5, respectively, and is used to balance different loss items; Example 8 The comparative experiments of the method of the present invention with the existing Pix2Pix, CycleGAN, and Stable Diffusion methods show that the evaluation indicators use PSNR, SSIM, and LPIPS. The specific results are shown in Table 1; Table 1

[0023] As can be seen from Table 1, the method of the present invention improves the PSNR, SSIM and other indicators by more than 20%, and the color diversity and structural accuracy of the generated patterns are significantly better than those of the traditional method.

Claims

1. The intelligent generation method of traditional Chinese patterns based on artificial intelligence is characterized by: The specific steps are as follows: Step 1: collect and preprocess color images of traditional Chinese round nest patterns to obtain a dataset, and divide the dataset into a training set and a test set; Step 2: Build a structure mapper and process the data set to obtain latent variables; Step 3: Input the latent variables into the pre-trained StyleGAN model to generate a grayscale pattern image; Step 4: Input the grayscale pattern image and the processed Chinese traditional nest pattern color image into the pre-trained ST-TR 2 In the model, a color image is generated; Step 5: Use the training set to train the structure mapper and the pre-trained StyleGAN model to obtain the trained overall model; Step 6: Input the test set into the trained overall model to generate the final color image.

2. The method for intelligently generating traditional Chinese patterns based on artificial intelligence according to claim 1, characterized in that: The specific process of step 1 is: Step 1.1, collecting color images of traditional Chinese round nest patterns and cropping the collected images to the same size and converting them into PNG format to obtain processed color images of traditional Chinese round nest patterns; Step 1.2, performing data augmentation on the processed color image of the traditional Chinese round nest pattern by using the GPDM method to obtain an augmented color image of the traditional Chinese round nest pattern; Step 1.3: Convert each color image of the traditional Chinese nest pattern augmented in step 1.2 into a grayscale image. The conversion formula is: (1) In formula (1), Respectively represent the red, green, and blue channel components of the augmented traditional Chinese nest pattern color image; Step 1.4, using the TEED method to extract the contour image of each collected augmented traditional Chinese nest pattern color image; In step 1.5, the augmented color image, grayscale image, and contour image of traditional Chinese nest patterns are used as a data set, and the data set is divided into a training set and a test set.

3. The method for intelligently generating traditional Chinese patterns based on artificial intelligence according to claim 1, characterized in that: In step 2, the structure mapper consists of a ResNet-101 network, a dynamic upsampling module, and an improved MCConv module.

4. The method for intelligently generating traditional Chinese patterns based on artificial intelligence according to claim 3, characterized in that: The improved MCConv module includes a right branch and a left branch. The right branch extracts multi-dimensional features through conventional convolution, dilated convolution and deformable convolution. The size of conventional convolution is 3×3 and the step size is 2. The size of dilated convolution is 3×3, the step size is 2, and the dilation rate is 2. The size of deformable convolution is 3×3, the step size is 3, and the number is 1 / 3 of the input feature map. The left branch enhances feature interaction through the channel attention mechanism and uses 1×1 convolution to replace the fully connected layer in the channel attention mechanism.

5. The method for intelligently generating traditional Chinese patterns based on artificial intelligence according to claim 2, characterized in that: In step 2, the structure mapper processes the data as follows: Step 2.1: Input the contour image into the ResNet-101 network to extract multi-scale feature maps, and obtain coarse feature maps, medium feature maps, and fine feature maps; In step 2.2, the obtained coarse feature map, medium feature map and fine feature map are fused through the dynamic upsampling module to generate hybrid features; The specific fusion process is: Generate pre-upsampled features through formula (2) , the expression is: (2) In formula (2), represents the fine feature map, is the dynamic upsampling kernel, CARAFE is the dynamic upsampling operator; Calculate the dynamic upsampling kernel, the expression is: (3) In formula (3), Conv represents the convolution operation, Up represents the upsampling operation, Softmax represents the normalized kernel weight, is the coarse feature map, is the middle feature map; Then the mixed feature is obtained by formula (4), which is expressed as: (4) In formula (4), G It is a gate map used to control the feature fusion ratio; in, (5) In formula (5), is the activation function; Step 2.3: Input the obtained mixed features into the improved MCConv module to capture the long-range context and geometric transformation features to obtain a 512-dimensional latent variable. .

6. The method for intelligently generating traditional Chinese patterns based on artificial intelligence according to claim 1, characterized in that: In step 3, a grayscale pattern image is generated The expression is: (6) In formula (6), is the average latent vector of the pre-trained StyleGAN model, Indicates that the model weights are frozen.

7. The method for intelligently generating traditional Chinese patterns based on artificial intelligence according to claim 1, characterized in that: In step 4, the expression for generating a color image is: (7) In formula (7), Indicates that the model weights are fixed.

8. The method for intelligently generating traditional Chinese patterns based on artificial intelligence according to claim 1, characterized in that: In step 5, the loss function for training the structure mapper is the similarity loss function: (8) In formula (8), is the contour image, S It is a contour extraction operator used to maintain the structural consistency between the generated image and the input contour; The loss function for fine-tuning the pre-trained StyleGAN model is: Pixel-level L2 loss: (9) In formula (9), is a true grayscale image, is the generated grayscale pattern image, used to constrain pixel-level similarity; Perceptual Loss: (10) In formula (10), It is a pre-trained VGG network used to extract high-level semantic features; Total loss function: (11) In formula (11), 、 、 is the weight coefficient.