A national clothing design method based on deep learning
Through the ethnic clothing design method based on deep learning, using style transfer and confrontation network training, a clothing design that conforms to national characteristics is generated, which solves the inefficiency and resource waste in the process of combining ethnic clothing styles with modern clothing content, and achieves efficient design and resource utilization.
Patent Information
- Application Number
- CN202211006799.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-22
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-08-22
AI Technical Summary
The existing ethnic clothing styles and modern clothing content have problems of inefficiency and waste of resources, and the design process is lengthy and time-consuming.
Using a deep learning method, we use the style picture training and processing model of national characteristics styles, conduct style transfer and adversarial network training to generate pattern materials and clothing design pictures that conform to national characteristics styles.
It greatly reduces the length of the design process, simplifies the design process, and can easily generate a variety of modern clothing with national characteristics, meet the needs of the masses, and achieve efficient utilization of resources.
Smart Images

Figure CN115205424B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of computer vision and fashion design, and particularly to a method for designing ethnic clothing based on deep learning. Background Art
[0002] Technological innovation has profoundly changed people's lifestyles. Clothing, which ranks first among "clothing, food, housing, and transportation", must also adapt to the changes brought about by technological development and even guide the direction of technological development. As an important carrier of social, economic, and cultural development, clothing is also the main manifestation of fashion innovation elements. Currently, the role of technological innovation in the development of the clothing industry is even more prominent, and the future development blueprint of the clothing industry will be deeply influenced by technological innovation. Clothing style refers to the value orientation, inner character, and artistic features shown in the form and content of clothing in an era, a nation, a school, or a person. Ultimately, the realm pursued by fashion design is style positioning and design. Clothing style demonstrates the unique creative thinking and artistic pursuit of designers, and also reflects distinct characteristics of the times. Nowadays, clothing styles are ever-changing, forming many different styles, some with historical origins, some with regional origins, and some with cultural origins, to suit different wearing occasions, different wearing groups, and different wearing styles, showing different individual charms.
[0003] China is a multi-ethnic country. With different living environments for each ethnic group, a unique clothing culture has been formed. The ethnic traditional clothing culture has become an important part of traditional culture and plays a boosting role in the development of the times. Ethnic traditional clothing design has its own merits in aspects such as color matching, pattern design, and pattern drawing. Modern fashion design can draw on the design experience of ethnic traditional clothing, extract the essence from ethnic traditional clothing, and let more people feel the charm of ethnic culture.
[0004] However, in actual design, since Chinese ethnic clothing has a large number of clothing styles, if the clothing styles are paired one by one with the content of modern-designed clothing for on-site design, it will take a lot of time. And after the design, it is necessary to extract excellent designs from a vast number of designs for on-site production, resulting in a long and inefficient process and causing waste of resources such as time and energy. Summary of the Invention
[0005] This application provides a method for designing ethnic clothing based on deep learning, which can solve the problems of inefficiency and resource waste existing in the process of combining ethnic clothing styles with modern clothing content.
[0006] The technical solution of this application is a method for designing ethnic clothing based on deep learning, including:
[0007] S1: Determine the style pictures based on the ethnic characteristic style, and train the style pictures according to the ethnic characteristic style to obtain a processing model corresponding to the ethnic characteristic style;
[0008] S2: Determine the content pictures that can match the ethnic characteristic style, and perform style transfer on the content pictures that can match the ethnic characteristic style through the processing model corresponding to the ethnic characteristic style to obtain pattern material pictures corresponding to the ethnic characteristic style;
[0009] S3: Determine the clothing base plate, and perform adversarial network training on the pattern material pictures based on the clothing base plate to obtain clothing design pictures that can be applied to clothing production.
[0010] Optionally, the content pictures that can match the ethnic characteristic style are the content pictures selected based on the ethnic characteristic style for the purpose of obtaining clothing design pictures.
[0011] Optionally, the step S1 includes:
[0012] S11: Obtain several style pictures based on the ethnic characteristic style, determine the style of each style picture, and classify the several style pictures according to the ethnic characteristic style to obtain style classification pictures based on the ethnic characteristic style;
[0013] S12: Train the style classification pictures based on the ethnic characteristic style to obtain a processing model corresponding to the ethnic characteristic style.
[0014] Optionally, the step S2 includes:
[0015] S21: Establish a loss function based on content loss and style loss. The loss function is as follows:
[0016]
[0017] In the formula, Loss total represents the total loss value; Loss style represents the content loss; represents the network weights corresponding to the content loss; Loss content represents the style loss; represents the network weights corresponding to the content loss;
[0018] S22: Determine the network structure based on fast style transfer. The network structure includes: the network structure of the picture conversion network stage and the network structure of the loss network stage;
[0019] Determine the content pictures that can match the ethnic characteristic style, and perform style transfer on the content pictures that can match the ethnic characteristic style through the processing model corresponding to the ethnic characteristic style to obtain initial pattern material pictures corresponding to the ethnic characteristic style;
[0020] S23: Convert the initial picture of the pattern material into a converted picture of the pattern material according to the network stage structure of the picture conversion.
[0021] S24: Construct a loss network through VGG19, and input the content picture that can match the ethnic style, the style picture based on the ethnic style, and the initial picture of the pattern material corresponding to the ethnic style into the loss network to obtain the distribution of loss feature maps.
[0022] S25: Calculate the content loss and style loss of the initial picture of the pattern material according to the loss network stage structure through the distribution of loss feature maps.
[0023] And calculate the total loss value corresponding to the pattern material picture according to the loss function, content loss, and style loss.
[0024] S26: Based on the principle of minimizing the total loss value, adjust and 's proportion to obtain and 's optimal ratio.
[0025] S27: Based on and 's optimal ratio, obtain the pattern material picture corresponding to the ethnic style.
[0026] Optionally, in step S23, the number of feature maps in the distribution of loss feature maps is 10 layers, including: relu1_1, relu1_2, relu2_1, relu2_2, relu3_1, relu3_2, relu3_3, relu4_1, relu4_2, and relu4_3.
[0027] And, in step S24, calculate the content loss of the initial picture of the pattern material based on relu4_3, and calculate the style loss of the initial picture of the pattern material based on relu1_2, relu2_2, relu3_3, and relu4_3.
[0028] Optionally, in step S24, obtain the content loss by calculating the difference in the Euclidean distance of the pixels between the content picture that can match the ethnic style in relu4_3 and the initial picture of the pattern material corresponding to the ethnic style.
[0029] Moreover, calculate the Gram matrix of the style pictures based on the ethnic style and the initial material pictures corresponding to the ethnic style in relu1_2, relu2_2, relu3_3, and relu4_3 respectively. Based on the Gram matrix, calculate the differences in the Euclidean distances of the pixels in relu1_2, relu2_2, relu3_3, and relu4_3 respectively to obtain the style loss.
[0030] Optionally, step S3 includes:
[0031] S31: Establish a conditional generative adversarial network (CGAN) model for generating clothing design pictures, where the conditional variable is a position label that can control the generation position of the clothing design picture on the clothing base;
[0032] S32: Determine the clothing base, and perform adversarial network training on the pattern material pictures through the CGAN model with the conditional variable as the position label and based on the clothing base to obtain clothing design pictures applicable to clothing manufacturing.
[0033] Optionally, the CGAN model includes: a generative model G and a discriminative model D both introducing the conditional variable;
[0034] Moreover, step S31 includes:
[0035] S311: Classify several pattern material pictures according to a preset classification to obtain pattern material classification pictures based on the preset classification and label the pattern material classification pictures with category labels corresponding to the preset classification to obtain a classification data set;
[0036] S312: Input the classification data set into a convolutional neural network for training to obtain a generative model G corresponding to the preset classification;
[0037] S313: Obtain a real pattern material set and input the real pattern material set into a convolutional neural network for training to obtain a discriminative model D;
[0038] Moreover, step S32 includes:
[0039] S321: Determine the clothing base, and through the generative model G and based on the clothing base, obtain the output of the generative model G;
[0040] S322: Input the position label and the output of the generative model G into the discriminative model D. The discriminative model D is used to judge the gap between the output of the generative model G and the real pattern material set both referring to the position label, and obtain the output loss values of the generative model G and the discriminative model D respectively;
[0041] S323: Optimize the output loss values of the generation model G and the discriminant model D respectively based on the optimization principle of minimizing the output loss value of the generation model G and maximizing the output loss value of the discriminant model, and repeat steps S321 - S322 to obtain design pictures of clothing that can be applied to clothing production.
[0042] Beneficial effects:
[0043] In this application, by combining artificial intelligence deep learning with clothing design, extracting the silhouettes, colors, and detailed elements of ethnic traditional clothing, and using style transfer and generative adversarial networks to create new art forms, modern clothing that conforms to the public's aesthetic is innovated, organically combining art and technology and achieving good results.
[0044] In addition, during the actual use of the above steps, the long process of manual design is greatly reduced, and a variety of ethnic - characteristic clothing options can be designed conveniently and simply, meeting the public's demand for modern clothing with ethnic characteristics. Therefore, this application can solve the problems of inefficiency and resource waste existing in the process of combining ethnic clothing styles with modern clothing content. Brief description of the drawings
[0045] To more clearly illustrate the technical solutions of this application, the following will briefly introduce the drawings required for the embodiments. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0046] Figure 1 It is a schematic flowchart of a method for ethnic clothing design based on deep learning in an embodiment of this application;
[0047] Figure 2 It is an example diagram of style transfer in an embodiment of this application;
[0048] Figure 3 It is a schematic structural diagram of a network structure based on fast style transfer in an embodiment of this application;
[0049] Figure 4 It is a schematic diagram of the principle of the generative adversarial network algorithm in an embodiment of this application;
[0050] Figure 5 It is a schematic diagram of the principle of the conditional - constrained generative adversarial network algorithm in an embodiment of this application;
[0051] Figure 6 It is a schematic diagram of ethnic - characteristic texture in an embodiment of this application;
[0052] Figure 7 It is a transfer schematic of style transfer in an embodiment of this application Figure 1 ;
[0053] Figure 8 Schematic diagram of style transfer in the embodiments of the present application Figure 2 ;
[0054] Figure 9 Schematic diagram of the results of multi-ethnic characteristic styles after the transfer in the embodiments of the present application;
[0055] Figure 10 Schematic diagram of the clothing base plate in the embodiments of the present application;
[0056] Figure 11 Schematic diagram of the results after rendering in the embodiments of the present application;
[0057] Figure 12 Schematic diagram of the results after the completion of constraint confrontation in the embodiments of the present application. Detailed implementation manners
[0058] The embodiments will be described in detail below, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following embodiments do not represent all implementation manners consistent with the present application. They are only examples of the systems and methods consistent with some aspects of the present application detailed in the claims.
[0059] Artificial Intelligence (AI for short) is a new technical science that studies, develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence, and is regarded as one of the world's three most advanced technologies. Among them, artificial neural network is a current highly regarded artificial intelligence algorithm, which realizes simulating human thinking ability by simulating the structure of the neural network of the human cerebral cortex.
[0060] In 2014, the theory of generative adversarial network emerged, officially introducing artificial intelligence into the creation field. This network mainly generates outputs through the mutual game learning of the generator and the discriminator to achieve dynamic equilibrium, that is, the generator generates new images that do not exist in the original training dataset, which are both close to the real image distribution, and the discriminator cannot distinguish between true and false images. This process can be regarded as a creation process. Generative Adversarial Networks (GAN) is a deep learning model and one of the most promising methods for unsupervised learning on complex distributions in recent years.
[0061] Style transfer design is a process of imitating the style of an image. Transferring and synthesizing a style image onto a target content image so that the resulting image not only retains the shape and structural information of the target content clothing picture but also has the color, texture, etc. information of the style image, forming a new style.
[0062] Now, through the technical solution of the embodiments of the present application, artificial intelligence deep learning can be combined with clothing design to extract the silhouette, color, and detail elements of ethnic traditional clothing, and use style transfer and generative adversarial networks to create new art forms and innovate modern clothing that meets the public's aesthetic.
[0063] The present application provides a method for ethnic clothing design based on deep learning, as Figure 1 shown Figure 1 is a schematic flowchart of a method for ethnic clothing design based on deep learning in the embodiments of the present application. The method includes the following steps:
[0064] S1: Determine a style picture based on an ethnic characteristic style, and train the style picture according to the ethnic characteristic style to obtain a processing model corresponding to the ethnic characteristic style.
[0065] Among them, step S1 includes:
[0066] S11: Obtain several style pictures based on the ethnic characteristic style, determine the style of each style picture, and classify the several style pictures according to the ethnic characteristic style to obtain style classification pictures based on the ethnic characteristic style.
[0067] Specifically, traditional clothing pictures contain the style and content of the clothing pictures. The style of a clothing picture can be understood as information such as the brushstrokes and colors of the clothing picture, and the content of the clothing picture refers to the semantic information of the clothing picture, which can be understood as what objects are included in the picture. As Figure 2 shown Figure 2 is an example diagram of style transfer in the embodiments of the present application. The horses in the ink painting and the horses seen with the naked eye have the same content, which is the horse itself, but the display effects are very different. The ink texture in the ink painting is the style of the clothing picture, which can clearly illustrate the difference between style and content. And from a statistical or mathematical perspective, the content and style of a clothing picture can be separated. From this perspective, trying to separate the content and style of a clothing picture, extract the model containing the image style and apply it to the content of the target image so that it shows the original image style is the design idea of style transfer in this project.
[0068] First, classify the style pictures according to requirements, and the degree of classification is determined according to requirements. After classification, style classification pictures based on the ethnic characteristic style can be obtained.
[0069] S12: Train the style classification images based on the ethnic characteristic style to obtain a processing model corresponding to the ethnic characteristic style.
[0070] The content images that can be matched with the ethnic characteristic style are the content images selected based on the ethnic characteristic style for the purpose of obtaining clothing design images.
[0071] S2: Determine the content images that can be matched with the ethnic characteristic style, and perform style transfer on the content images that can be matched with the ethnic characteristic style through the processing model corresponding to the ethnic characteristic style to obtain pattern material images corresponding to the ethnic characteristic style.
[0072] Specifically, the convolutional neural network has powerful image processing capabilities and is widely used in the field of image processing. The convolutional neural network can hierarchically extract and combine image features through many local and lightweight convolutional kernels. In the convolutional neural network, a series of convolutional kernels in each convolutional layer can be regarded as a set of image filters of the network. This set of filters will extract specific features, and the responses obtained by the filters can be regarded as a set of feature expressions of the image. Only by classifying the activation values of the convolutional layer through a linear classifier, the final output is the feature parameters containing the content or style of the image.
[0073] At the same time, using a convolutional neural network to extract feature parameters can greatly reduce the difficulty of calculation. In an artificial fully connected neural network, there are connections between each neuron in two adjacent layers.
[0074] When the feature dimension of the input layer becomes very high, the number of parameters that need to be trained in the fully connected network will increase a lot, and the calculation speed will become very slow. For example, for a black and white 28×28 handwritten digit image, there are 784 (28×28) neurons in the input layer. If only one hidden layer is used in the middle, there are more than 784×15 = 11,760 parameters; if the input is a 28×28 color RGB format handwritten digit image, there are 28×28×3 = 2,352 (RGB has 3 color channels) input neurons. It is easy to find the problem of too many parameters to be trained when using a fully connected neural network to process images. In the convolutional neural network, the neurons in the convolutional layer are only connected to some neuron nodes in the previous layer, that is, the connections between its neurons are not fully connected, and the weights and offsets of the connections between some neurons in the same layer are shared, thus greatly reducing the number of parameters that need to be trained.
[0075] Among them, step S2 includes:
[0076] S21: Establish a loss function based on content loss and style loss. The loss function is as follows:
[0077]
[0078] In the formula, Loss total represents the total loss value; Loss style represents the content loss; represents the network weights corresponding to the content loss; Loss content represents the style loss; represents the network weights corresponding to the content loss.
[0079] S22: Determine the network structure based on fast style transfer, and the network structure includes: the structure of the picture conversion network stage and the structure of the loss network stage.
[0080] Determine the content pictures that can match the ethnic style, and perform style transfer on the content pictures that can match the ethnic style through the processing model corresponding to the ethnic style to obtain the initial picture of the pattern material corresponding to the ethnic style.
[0081] Specifically, as Figure 3 shown, Figure 3 is the schematic diagram of the network structure based on fast style transfer in the embodiment of the present application.
[0082] S23: According to the picture conversion network stage structure of fast neural style transfer, convert the initial picture of the pattern material into a converted picture of the pattern material.
[0083] Specifically, as Figure 3 shown, x (Input image) represents the converted picture of the pattern material.
[0084] y t represents the converted picture of the pattern material.
[0085] ImageTransformnet is a tool for converting the initial picture of the pattern material into a converted picture of the pattern material.
[0086] S24: Construct a loss network through VGG19, and input the content pictures that can match the ethnic style, the style pictures based on the ethnic style, and the initial pictures of the pattern materials corresponding to the ethnic style into the loss network to obtain the distribution of loss feature maps.
[0087] Specifically, the distribution of loss feature maps is as Figure 3 shown on the right side.
[0088] The number of feature maps in the loss feature map distribution is 10 layers, including: relu1_1, relu1_2, relu2_1, relu2_2, relu3_1, relu3_2, relu3_3, relu4_1, relu4_2, and relu4_3.
[0089] S25: According to the loss network stage structure, through the loss feature map distribution, calculate the content loss and style loss of the initial picture of the pattern material. Also, according to the loss function, content loss, and style loss, calculate the total loss value corresponding to the pattern material picture.
[0090] Specifically, by using the VGG19 pre-trained model in the convolutional neural network for image content loss (Contentloss) calculation, each layer in the network defines a set of non-linear filter banks (this set of filters extracts specific features, and the response obtained by the filters can be regarded as a set of feature expressions of the image). Its complexity increases with the position of the layer in the network. When the image is input into the network, each layer will encode it.
[0091] Content loss calculation: When the processing level of the network gradually deepens, the higher layers in the network capture high-level content according to the arrangement of the input image, but do not pay much attention to the exact pixel values. In contrast, the reconstruction of the lower layers simply reproduces the exact pixel values of the original image and is not sensitive to content. If a too shallow layer is selected when calculating the content loss, more texture color information will be retained, while in style transfer, only semantic information needs to be retained. Therefore, the feature response in the higher layer of the network is used as the content feature for loss calculation.
[0092] Therefore, in Figure 3 the content loss is obtained by calculating the difference in the Euclidean distance between the pixels of the content picture that can match the ethnic style in relu4_3 and the initial picture of the pattern material corresponding to the ethnic style.
[0093] Style loss calculation: For the calculation of the style loss (Styleloss), it is mentioned that after the image is input into the convolutional neural network, the covariance matrix of the feature maps obtained after passing through the convolutional layer. The covariance matrix can be the GramMatrix matrix.
[0094] The GramMatrix matrix can be regarded as the eccentric covariance matrix between Features. Each number in the Featuremap comes from the convolution of a specific filter at a specific position, so each number represents the intensity of a feature.
[0095] The GramMatrix is a matrix obtained by multiplying the feature map matrix by its own inverse matrix. The diagonal elements of the matrix obtained after the inner product reflect the amount of each feature appearing in the image, while the other elements contain the correlation information between different features. Therefore, the GramMatrix can reflect the style of the entire image. To measure the difference between the styles of two images, it is only necessary to compare the GramMatrix matrices of the styles of the two images.
[0096] Therefore, in Figure 3 calculate the Grammatrix matrices of the style images based on the ethnic style and the initial material images corresponding to the ethnic style in relu1_2, relu2_2, relu3_3, and relu4_3 respectively. Based on the Grammatrix matrices, calculate the differences in the Euclidean distances of the pixels in relu1_2, relu2_2, relu3_3, and relu4_3 respectively to obtain the style loss.
[0097] Finally, calculate the total loss value corresponding to the pattern material image according to the loss function, content loss, and style loss.
[0098] S26: Based on the principle of minimizing the total loss value, adjust the and proportions to obtain the and optimal ratios;
[0099] S27: Based on the and optimal ratios, obtain the pattern material image corresponding to the ethnic style.
[0100] S3: Determine the clothing base plate, and perform adversarial network training on the pattern material image based on the clothing base plate to obtain the clothing design image.
[0101] Among them, step S3 includes:
[0102] S31: Establish a conditional variable-based CGAN model for generating clothing design images, where the conditional variable is a part label that can control the generation position of the clothing design image on the clothing base plate.
[0103] Specifically, although the clothing pattern material after style transfer has been generated, directly using the image after style transfer for pasting on the clothing will result in a single clothing style, and the aesthetic degree has not reached the height envisioned before. Therefore, here the CGAN is selected to design the patterns of each part of the clothing.
[0104] Among them, the CGAN model includes: a generation model G and a discriminant model D that both introduce conditional variables.
[0105] Due to its sophisticated design of mutual confrontation, generative adversarial networks have become a research hotspot in the academic community in recent years with their applications in various scenarios, and many variants have emerged, such as conditional generative adversarial networks that control the generation prior conditions, infoGAN optimized from the perspective of information theory, and W-GAN that improves the optimization objective of generative adversarial networks. Due to the amazing effects brought by generative adversarial networks, research has begun on how to use GAN as a general framework for image translation tasks.
[0106] The GAN model framework consists of two modules: the generative model (GenerativeModel) and the discriminative model (DiscriminativeModel) that learn through mutual game to produce a compromise output. The adversarial network formula of GAN is as follows:
[0107]
[0108] Here, the formula is illustrated by taking the generation of pictures as an example. Suppose there are two networks, G (Generator) and D (Discriminator), with the following functions:
[0109] G is a network that generates pictures. It receives a random noise z and generates pictures through this noise, denoted as G(z).
[0110] D is a discriminative network that discriminates whether a picture is "real". Its input parameter is x, where x represents a picture, and the output D(x) represents the probability that x is a real picture. If it is 1, it means the picture is 100% real, and if the output is 0, it means the picture cannot be real.
[0111] As Figure 4 shown, Figure 4 This is a schematic diagram of the principle of the adversarial network algorithm in the embodiments of this application. During the training process, the goal of the generative network G is to generate as real pictures as possible to deceive the discriminative network D, while the goal of D is to distinguish the pictures generated by G from the real pictures as much as possible. G and D constitute a dynamic "game process".
[0112] Finally, in the most ideal state of the game result, G can generate pictures G(z) that are "indistinguishable from real ones". For D, it is difficult to determine whether the pictures generated by G are real, that is, a Nash equilibrium is reached, so D(G(z)) = 0.5. At this time, the convergence goal of the model is that the generator can generate real data from random noise.
[0113] The goal of GAN is to enable the generator to generate real data from random noise. However, the disadvantage of this method that does not require pre-modeling is that it is too free. For large images with a large number of pixels, the method based on simple GAN is less controllable. And if there is a little mistake during the training of GAN, it will cause the program to crash and increase the difficulty of training. To solve this problem, constraints need to be added during the game process, so it is necessary to apply CGAN, that is, conditional generative adversarial network.
[0114] As Figure 5 shown, Figure 5 This is a schematic diagram of the principle of the adversarial network algorithm with conditional constraints in the embodiments of this application. CGAN is a GAN with conditional constraints. A conditional variable y (conditional variable y) is introduced in the modeling of both the generative model (D) and the discriminative model (G). Using the conditional variable y to add conditions to the model can guide the data generation process.
[0115] The conditional variable y can be based on various information, such as class labels, partial data for image restoration, and data from different modalities.
[0116] If the conditional variable y is a class label, it can be considered that CGAN is an improvement that turns a pure unsupervised GAN into a supervised model. This simple and direct improvement has been proven to be very effective and is widely used in subsequent related work.
[0117] The conditional adversarial network formula of CGAN is as follows:
[0118]
[0119] Step S31 includes:
[0120] S311: Classify several pattern material pictures according to a preset classification to obtain pattern material classification pictures based on the preset classification and label the pattern material classification pictures with class labels corresponding to the preset classification to obtain a classification data set.
[0121] Specifically, the class refers to clothing categories, such as dresses or T-shirts, etc.
[0122] S312: Input the classification data set into a convolutional neural network for training to obtain a generative model G corresponding to the preset classification.
[0123] Specifically, at this time, the formula of CGAN mentioned above is used. For the generative model G, the images after style transfer are classified, different types of style images are labeled with class labels, a data set is established, and the data set is input into the convolutional neural network generator to be used as the generative model G.
[0124] S313: Obtain a real pattern material set and input the real pattern material set into a convolutional neural network for training to obtain a discriminant model D (which can distinguish clothing categories).
[0125] Specifically, for the discriminant model D, first build a clothing data set by oneself, and then input the clothing data set into a convolutional neural network for model training to generate a discriminant model that can judge clothing categories as the discriminant model D.
[0126] The conditional variable y is manually input with part labels by designers to control the part of the image generation on the clothing, thereby further restricting the adversarial process. After completing a series of tasks, the network will output a clothing style that conforms to our public aesthetic.
[0127] S32: Determine a clothing base plate, and perform adversarial network training on the pattern material picture based on the clothing base plate using a CGAN model with the part label as the conditional variable to obtain a clothing design picture applicable to clothing manufacturing.
[0128] Among them, step S32 includes:
[0129] S321: Determine a clothing base plate, and obtain the output of the generation model G based on the clothing base plate through the generation model G.
[0130] S322: Input the part label and the output of the generation model G into the discriminant model D. The discriminant model D is used to judge the gap between the output of the generation model G and the real pattern material set both referring to the part label, and respectively obtain the output loss values of the generation model G and the discriminant model D.
[0131] S323: Based on the optimization principle of minimizing the output loss value of the generation model G and maximizing the output loss value of the discriminant model, respectively optimize the output loss values of the generation model G and the discriminant model D, and repeat steps S321 - S322 to obtain a clothing design picture applicable to clothing production.
[0132] Embodiment 1
[0133] (1) Model training:
[0134] Select the 2014 training data in the Microsoft COCO dataset as the dataset. The MSCOCO2014 training set has a total of 82,783 images. Use VGG19 as the training model. An improvement of VGG19 compared to AlexNet is that it uses several consecutive 3x3 convolutional kernels instead of the larger convolutional kernels (11x11, 7x7, 5x5) in AlexNet. For a given receptive field (the local size of the input image related to the output), using stacked small convolutional kernels is better than using large convolutional kernels because multiple non-linear layers can increase the network depth to ensure learning more complex patterns at a relatively low cost (fewer parameters).
[0135] Train the collected style images based on ethnic characteristics to generate corresponding models respectively to prepare for subsequent work.
[0136] Use the generated processing model to transfer the target image. The target image selected for testing is the one with more prominent content in terms of content and style, such as images containing only objects, such as pictures of animals like horses, musical instruments like guitars, pet dogs, etc. The generated images are more distinguishable and more vivid. Thus, the clothing pattern materials after style transfer have been generated.
[0137] (2) Style transfer:
[0138] There are various ethnic characteristic texture patterns, such as Figure 6 shown Figure 6 is the schematic diagram of the ethnic characteristic texture in the embodiment of the present application.
[0139] 1) Select the Taichingzhuoerqiwen embroidery backstrap cover of the Dong ethnic group as the original style image, select the peacock as the target image, and train for 20 epochs (one epoch is equal to traversing all the images in the dataset once). Here, the transfer effects of three epochs are intercepted.
[0140] As Figure 7 shown Figure 7 is the transfer schematic of the style transfer in the embodiment of the present application Figure 1 , Figure 7 in which ContentImage on the left represents the content image, Figure 7 in which StyleImage on the left represents the style image, Figure 7 on the right are three GeneratedImage representing the iterated images.
[0141] 2) Select the sun banyan flower embroidery cover pattern of the Dong ethnic group as the original style image for the second transfer experiment. The effect is shown in the figure.
[0142] As Figure 8 shownFigure 8 Schematic diagram of style transfer in the embodiments of the present application Figure 2 , Figure 8 In the left side of, ContentImage represents the content image Figure 8 In the left side of, StyleImage represents the style image Figure 8 On the right side of, three GeneratedImages represent the iterated images
[0143] From Figure 8 (Actual color version), the following conclusions can be clearly drawn: The colors of the first and second iterated images are darker, and the overall effect is more inclined to the original style image. After the third iteration, the colors are more vivid, and it is more similar to the situation where the content image and the style image each account for 50%, achieving image style transfer and obtaining the pattern material image
[0144] Such as Figure 9 shown Figure 9 Schematic diagram of the results after the transfer of multi-ethnic characteristic styles in the embodiments of the present application
[0145] (III) Clothing design:
[0146] After the transfer is realized, the image needs to be applied to the clothing. Clothing has six basic attributes: type, raw material, style, specification, color, and pattern. In the embodiments of the present application, only standard men's pure white short sleeves and women's long dresses are selected for the clothing type, and the pattern (i.e., the content) is selected as the research focus, and the other four basic attributes are not involved
[0147] In the preliminary experiment, the generated pattern material image needs to be rendered onto the selected blank clothing baseboard, such as Figure 10 and Figure 11 shown Figure 10 Schematic diagram of the clothing baseboard in the embodiments of the present application Figure 11 Schematic diagram of the results after rendering in the embodiments of the present application
[0148] (IV) Constraint confrontation:
[0149] After completing the transfer training, start the adversarial network training on the generated pattern material image to further generate clothing that meets the public aesthetic
[0150] First, the output is generated by the generation model G. With the participation of professional designers, the part label controlling the pattern generation part and the output of the generation model G are input into the discriminant model D together to judge the gap between the discriminant output and the real data, and calculate the respective output loss values of the generator G and the discriminator D. Finally, the weight parameters trained are optimized through an algorithm, and then multiple loops are carried out. The generated images are output every 10 epochs, such as Figure 12As shown Figure 12 It is a schematic diagram of the result after the constraint confrontation is completed in the embodiment of the present application.
[0151] In summary, the embodiment of the present application combines style transfer and generative adversarial network in artificial intelligence with fashion design by using open source technologies such as TensorFlow. Extract the silhouette, color and detail elements of ethnic traditional costumes, integrate and recreate them with modern fashion design, which not only inherits and promotes ethnic traditions, but also meets people's high-quality clothing needs. The integration of traditional art forms with new technologies and new techniques is exactly the future trend of the development of clothing and has broad application prospects.
[0152] The above has described the embodiments of the present application in detail, but the content is only the preferred embodiment of the present application and cannot be considered as limiting the scope of implementation of the present application. All equivalent changes and improvements made according to the scope of the present application should still fall within the scope covered by the patent of the present application.
Claims
1. A national clothing design method based on deep learning, characterized in that, Including: S1: Determine style pictures based on ethnic characteristic styles, and train the style pictures according to the ethnic characteristic styles to obtain a processing model corresponding to the ethnic characteristic styles; S2: Determine content pictures that can match the ethnic characteristic styles, and perform style transfer on the content pictures that can match the ethnic characteristic styles through the processing model corresponding to the ethnic characteristic styles to obtain pattern material pictures corresponding to the ethnic characteristic styles; S3: Determine the clothing base plate, and perform adversarial network training on the pattern material pictures based on the clothing base plate to obtain clothing design pictures that can be applied to clothing production; The content pictures that can match the ethnic characteristic styles are content pictures selected based on the ethnic characteristic styles for the purpose of obtaining clothing design pictures; The step S2 includes: S21: Establish a loss function based on content loss and style loss. The loss function is as follows: where Loss total represents the total loss value; Loss style represents the content loss; represents the network weights corresponding to the content loss; Loss content represents the style loss; represents the network weights corresponding to the content loss; S22: Determine the network structure based on fast style transfer. The network structure includes: a picture conversion network stage structure and a loss network stage structure; Determine content pictures that can match the ethnic characteristic styles, and perform style transfer on the content pictures that can match the ethnic characteristic styles through the processing model corresponding to the ethnic characteristic styles to obtain initial pattern material pictures corresponding to the ethnic characteristic styles; S23: According to the picture conversion network stage structure, convert the initial pattern material pictures into pattern material conversion pictures; S24: Construct a loss network through VGG19, and input the content pictures that can match the ethnic characteristic styles, the style pictures based on the ethnic characteristic styles, and the initial pattern material pictures corresponding to the ethnic characteristic styles into the loss network to obtain the loss feature map distribution; S25: According to the loss network stage structure, calculate the content loss and style loss of the initial pattern material pictures through the loss feature map distribution; And, calculate the total loss value corresponding to the pattern material pictures according to the loss function, content loss and style loss; S26: Adjust and proportion according to the principle of minimizing the total loss value, and obtain and optimal ratio; S27: Based on and the optimal ratio, obtain the pattern material pictures corresponding to the ethnic characteristic style.
2. The national clothing design method based on deep learning according to claim 1, wherein, The step S1 includes: S11: Obtain several style pictures based on ethnic characteristic styles, determine the styles of each style picture, and classify the several style pictures according to the ethnic characteristic styles to obtain style classification pictures based on the ethnic characteristic styles; S12: Train the style classification pictures based on the ethnic characteristic styles to obtain a processing model corresponding to the ethnic characteristic styles.
3. The ethnic clothing design method based on deep learning according to claim 1, wherein, In step S23, the number of feature maps in the loss feature map distribution is 10 layers, including: relu1_1, relu1_2, relu2_1, relu2_2, relu3_1, relu3_2, relu3_3, relu4_1, relu4_2, and relu4_3; And, in step S24, calculate the content loss of the initial pattern material pictures based on relu4_3, and calculate the style loss of the initial pattern material pictures based on relu1_2, relu2_2, relu3_3, and relu4_3.
4. A national clothing design method based on deep learning according to claim 3, characterized in that In step S24, a content loss is obtained by calculating the difference in the Euclidean distances of the pixels of the content image that can match the ethnic style in relu4_3 and the initial pattern material image corresponding to the ethnic style. Moreover, the Gram matrices of the style images based on the ethnic style and the initial material images corresponding to the ethnic style in relu1_2, relu2_2, relu3_3, and relu4_3 are calculated respectively. Based on the Gram matrices, the differences in the Euclidean distances of the pixels in relu1_2, relu2_2, relu3_3, and relu4_3 are calculated respectively to obtain a style loss.
5. A national clothing design method based on deep learning according to claim 2, characterized in that, Step S3 includes: S31: Establish a conditional variable-based CGAN model for generating fashion design images, where the conditional variable is a part label that can control the generation position of the fashion design image on the clothing bottom plate. S32: Determine the clothing bottom plate, and perform adversarial network training on the pattern material image through the CGAN model with the conditional variable as the part label and based on the clothing bottom plate to obtain a fashion design image applicable to clothing manufacturing.
6. The national clothing design method based on deep learning according to claim 5, characterized in that The CGAN model includes: a generator model G and a discriminator model D that both introduce the conditional variable. Moreover, step S31 includes: S311: Classify several pattern material images according to a preset classification to obtain pattern material classification images based on the preset classification and label the pattern material classification images with category labels corresponding to the preset classification to obtain a classification data set. S312: Input the classification data set into a convolutional neural network for training to obtain a generator model G corresponding to the preset classification. S313: Obtain a real pattern material set and input the real pattern material set into a convolutional neural network for training to obtain a discriminator model D. Moreover, step S32 includes: S321: Determine the clothing bottom plate, and obtain the output of the generator model G through the generator model G and based on the clothing bottom plate. S322: Input the part label and the output of the generator model G into the discriminator model D. The discriminator model D is used to judge the gap between the output of the generator model G and the real pattern material set both referring to the part label, and obtain the output loss values of the generator model G and the discriminator model D respectively. S323: Based on the optimization principle of minimizing the output loss value of the generator model G and maximizing the output loss value of the discriminator model, optimize the output loss values of the generator model G and the discriminator model D respectively, and repeat steps S321 - S322 to obtain a fashion design image applicable to clothing production.
Citation Information
Patent Citations
Super-realistic drawing image style migration method based on deep learning
CN111724299A
Style migration model and method for specific relevant region of garment image
CN112017301A