Clothing generation method and system based on generative adversarial network
By applying adversarial generation network technology in clothing design, using user body shape data to generate personalized clothing design images, the problem of difficult traditional designs to combine body shape data is solved, and design efficiency and personalization are improved.
Patent Information
- Application Number
- CN202411580784.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-25
AI Technical Summary
Traditional clothing designs are difficult to combine user body shape data, making it difficult to achieve personalized designs and reduce production efficiency.
Using an adversarial generation network (GAN)-based method, by obtaining user body size data, matching multiple types of clothing, building a clothing image data set, and training convolutions on this data set to generate an adversarial network model to generate a user-matched clothing design image.
It achieves better matching and generating suitable clothing according to the user's body shape, improves work efficiency and enhances the personalization of clothing design.
Smart Images

Figure CN119514356A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of clothing design, and in particular to a clothing generation method and system based on a generative adversarial network. Background Art
[0002] Garment generation generally refers to the process of designing and creating garments using digital technology. This can include using computer-aided design (CAD) software to create the pattern, color palette, and overall design of a garment.
[0003] In traditional clothing design, designers draw sketches by hand, and then use CAD software to convert these sketches into digital format to make detail adjustments and color selections. Once the design is completed, physical samples are made to check the actual effect of the design and modify it as needed. The finalized design is then used for cutting and sewing in the production process.
[0004] However, the above method cannot well combine the user's body data, which makes it inconvenient to carry out personalized design and reduces production efficiency. Summary of the invention
[0005] The purpose of the present invention is to provide a clothing generation method and system based on a generative adversarial network, which aims to better match and generate suitable clothing according to the user's body shape and improve work efficiency.
[0006] To achieve the above-mentioned object, the present invention provides a clothing generation method and system based on a generative adversarial network, comprising obtaining body shape data of a user;
[0007] Match various types of clothing based on body shape data to obtain clothing image datasets;
[0008] Training a convolutional generative adversarial network model on the clothing image dataset;
[0009] The trained convolutional generative adversarial network model is used to generate user-matched clothing design images.
[0010] The specific steps of obtaining the user's body shape data include:
[0011] Get the body shape data filled in by the user;
[0012] Convert all collected body shape data into a unified format;
[0013] The processed body shape data is encrypted and stored.
[0014] The body shape data includes height, weight, chest circumference, waist circumference and hip circumference.
[0015] The specific steps of matching various types of clothing based on body shape data to obtain a clothing image dataset include:
[0016] Match the corresponding clothing images in the clothing database based on the body shape data to obtain a clothing set;
[0017] Remove clothing images with resolution lower than the preset value and duplicate clothing images from the clothing collection;
[0018] Resize all clothing images in the clothing collection to the same resolution;
[0019] Crop the garment image and center the garment.
[0020] The specific steps of training the convolutional generative adversarial network model on the clothing image dataset include:
[0021] Construct a convolutional generative adversarial network model;
[0022] In each training iteration, the discriminator is first updated, and it is trained to correctly classify real and generated images. Then the generator is updated, and the generator is trained to produce more realistic images by maximizing the discriminator’s error rate.
[0023] Use the validation set to periodically evaluate the performance of the generator.
[0024] Among them, the specific steps of constructing the convolutional generative adversarial network model are:
[0025] The input of the generator contains the user's body shape data. The hidden layer uses the deconvolution layer to gradually enlarge the size of the feature map. The output layer uses the sigmoid activation function, and the pixel value range of the generated image is between [-1, 1].
[0026] The discriminator network receives an image as input, uses convolutional and pooling layers to extract image features, and outputs a scalar representing the probability that the discriminator believes the input is a real image.
[0027] The specific steps of using the trained generator network to generate a clothing design image matching the user include:
[0028] Encode the user's body shape information into a conditional vector;
[0029] Combine the conditional vector with other inputs required by the generator model;
[0030] Using the integrated conditional vector as input, the trained convolutional generative adversarial network model is called to generate clothing design images;
[0031] Denormalize and color adjust clothing design images;
[0032] The generated clothing design images are displayed to the user for viewing.
[0033] After displaying the generated clothing design image to the user for viewing, the step further includes: collecting user feedback on the generated image.
[0034] In a second aspect, the present invention also provides a clothing generation system based on a generative adversarial network, comprising a body data acquisition module, a clothing image acquisition module, a model generation module and a clothing generation module; the body data acquisition module is used to acquire the body data of the user; the clothing image acquisition module is used to match various types of clothing based on the body data to obtain a clothing image data set; the model generation module is used to train a convolutional generative adversarial network model on the clothing image data set; the clothing generation module is used to generate a clothing design image that matches the user using the trained convolutional generative adversarial network model.
[0035] A clothing generation method and system based on a generative adversarial network of the present invention comprises: obtaining the user's body data; matching multiple types of clothing based on the body data to obtain a clothing image data set; training a convolutional generative adversarial network model on the clothing image data set; and using the trained convolutional generative adversarial network model to generate a clothing design image matching the user. First, the user's body data needs to be collected, which generally includes but is not limited to key body size information such as the user's height, weight, chest circumference, waist circumference and hip circumference. These data can be directly input by the user, upload measurement reports, or automatically collected by smart devices (such as somatosensory scanners). The purpose of obtaining this information is to provide a basic size basis for subsequent clothing design. The system will use the collected body data to screen and match in the existing clothing database to find multiple types of clothing suitable for the body type. Through such a matching process, the system can establish a clothing image data set specifically for the user's body type. The CGAN model consists of a generator and a discriminator, the generator is responsible for generating new images from random noise and conditional vectors, and the discriminator attempts to distinguish the difference between the generated image and the real image. Through continuous iterative training, the generator gradually learns how to generate realistic clothing images that meet specific conditions. When the model training is completed, the CGAN model that has learned how to generate personalized clothing images can be used to provide users with customized clothing design services. Users only need to enter or confirm their body shape data, and the system can use the trained model to generate a series of clothing design images that meet the user's body characteristics. This can better match and generate suitable clothing according to the user's body shape, improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 It is a flowchart of a clothing generation method based on a generative adversarial network according to the first embodiment of the present invention.
[0038] Figure 2 FIG. 1 is a flowchart of obtaining the body shape data of a user according to the first embodiment of the present invention.
[0039] Figure 3 This is a flowchart of the first embodiment of the present invention for matching various types of clothing based on body shape data to obtain a clothing image data set.
[0040] Figure 4 It is a flowchart of training a convolutional generative adversarial network model on the clothing image dataset according to the first embodiment of the present invention.
[0041] Figure 5 It is a flowchart of constructing a convolutional generative adversarial network model according to the first embodiment of the present invention.
[0042] Figure 6 This is a flowchart of the first embodiment of the present invention for generating a user-matched clothing design image using a trained convolutional generative adversarial network model. DETAILED DESCRIPTION
[0043] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0044] First embodiment
[0045] See also Figure 1 to Figure 6 The present invention provides a clothing generation method based on a generative adversarial network, comprising:
[0046] S101 obtains the user's body shape data;
[0047] The user's body shape data mainly includes but is not limited to the following five key indicators: height, which is the vertical distance from the soles of the feet to the top of the head; weight, which refers to the total mass of the human body; chest circumference, which refers to the horizontal circumference through the fullest part of the chest; waist circumference, which is the horizontal circumference of the thinnest part of the waist; hip circumference, which refers to the horizontal circumference through the widest part of the hips. These five data together constitute the basic information set that describes a person's body shape characteristics. The specific steps include:
[0048] S201 obtains the body shape data filled in by the user;
[0049] In this sub-step, the system will prompt the user to enter the above-mentioned body data through a graphical user interface (GUI) or other input methods. In order to ensure the accuracy of the data, the system will also provide some instructions, such as how to measure these dimensions correctly, or allow the user to upload photos to assist manual or automatic size recognition.
[0050] S202 converts all collected body shape data into a unified format;
[0051] Once this data is collected, the next step is to standardize this information. This means that all the data needs to be converted into a consistent and easy-to-process format. For example, if the user provides height data in imperial units (such as feet and inches), the system should convert it to the international system of units (meters and centimeters). In addition, it is necessary to ensure that all values are in the same level of precision to facilitate subsequent data processing and analysis.
[0052] S203 encrypts and stores the processed body shape data.
[0053] Finally, after ensuring that the data format is unified, this sensitive information needs to be encrypted. This is to protect the privacy of users and prevent unauthorized access or data leakage. Usually, modern encryption standards such as AES (Advanced Encryption Standard) are used to ensure that even if the data is intercepted, it cannot be easily interpreted. The encrypted data will be stored in a secure database, and only authenticated system components can access the data. At the same time, encryption keys need to be updated regularly to enhance security and comply with relevant data protection laws and regulations.
[0054] S102 matches various types of clothing based on the body shape data to obtain a clothing image dataset;
[0055] The specific steps include:
[0056] S301 matches corresponding clothing images in a clothing database based on the body shape data to obtain a clothing set;
[0057] In this step, the system compares the height, weight, chest, waist and hip data provided by the user with the size specifications of each garment in the clothing database. Machine learning models or rule-based matching algorithms are used here to find clothing styles that can adapt to the user's body shape. In this way, the system can initially screen a collection of clothing images containing a variety of styles and types.
[0058] S302 removes clothing images with a resolution lower than a preset value and duplicate clothing images in the clothing set;
[0059] In order to ensure that the clothing images presented to users have good visual effects and clarity, any images with resolutions below the preset minimum standard will be removed. In addition, in order to prevent users from seeing repeated clothing styles, the system will also check and delete the same or very similar images in the clothing collection, so as to improve the novelty and diversity of the recommendation results.
[0060] S303 adjusts all clothing images in the clothing set to the same resolution;
[0061] After cleaning up the images that do not meet the requirements, the next step is to adjust the remaining clothing images to a uniform resolution. This is done to ensure that all clothing images have a consistent visual experience when displayed, whether on a mobile phone or a computer screen. The uniform resolution also helps with subsequent image processing and analysis.
[0062] S304 crops the clothing image and places the clothing in the center.
[0063] The final step is to further optimize the clothing image, including cutting out unnecessary background parts and ensuring that the clothing is in the center of the image. The purpose of this is to make the clothing the focus, so that users can more intuitively evaluate the style and details of the clothing. At the same time, this processing method is also conducive to the subsequent image analysis or virtual fitting functions.
[0064] S103 training a convolutional generative adversarial network model on the clothing image dataset;
[0065] The specific steps include:
[0066] S401 constructs a convolutional generative adversarial network model;
[0067] Specific steps:
[0068] The input of the S501 generator contains the user's body shape data. The hidden layer uses a deconvolution layer to gradually enlarge the size of the feature map. The output layer uses a sigmoid activation function, and the pixel value range of the generated image is between [-1, 1].
[0069] The generator is responsible for generating new clothing images based on the input user body shape data. It usually adopts an encoding-decoding structure. In the encoding stage, the model converts the input data into a compact feature vector; in the decoding stage, the deconvolution layer is used to gradually restore the size of the feature map until the resolution of the original image is reached. The output layer uses the sigmoid activation function to convert the generated feature map into image pixel values, and these pixel values are constrained to a fixed range, such as [-1,1], to facilitate subsequent training and comparison.
[0070] S502 The discriminator network receives an image as input, uses convolutional layers and pooling layers to extract image features, and outputs a scalar representing the probability that the discriminator believes the input is a real image.
[0071] The role of the discriminator is to distinguish between the images generated by the generator and the real images in the actual clothing image dataset. It extracts the features of the image through a series of convolutional layers and pooling layers, and finally outputs a probability value between 0 and 1 to represent the authenticity score of the input image.
[0072] S402, in each training iteration, first update the discriminator, and train it with real images and generated images to correctly classify; then update the generator, and train the generator to produce more realistic images by maximizing the discriminator error rate;
[0073] During the training process, in each iteration, a batch of real images and a batch of images generated by the generator are first used to update the discriminator, so that it can better distinguish between real and fake images. Subsequently, the generator is updated by minimizing the probability that the images generated by the generator are judged as fake (that is, maximizing the error rate of the discriminator), so that the generator learns to generate more realistic images.
[0074] S403 uses the validation set to regularly evaluate the performance of the generator.
[0075] In order to monitor the effectiveness of the training process, an independent validation set is used to test the performance of the generator at a specific time point. The data in the validation set will not be used to train the model, but to objectively evaluate the quality of the images generated by the generator to ensure that the model can generalize to unseen data. In this way, potential problems can be discovered in a timely manner and necessary adjustments can be made to the model to improve the realism and quality of the final generated images.
[0076] S104 generates clothing design images matching the user using the trained convolutional generative adversarial network model.
[0077] The specific steps include:
[0078] S601 encodes the user's body shape information into a conditional vector;
[0079] First, the body data provided by the user, such as height, weight, chest circumference, waist circumference and hip circumference, needs to be converted into a form that can be understood by the computer - a conditional vector. This vector contains the user's body shape characteristics and serves as one of the inputs of the generator to help the generator understand what size and style the generated clothing should have.
[0080] S602 integrates the conditional vector with other inputs required by the generator model;
[0081] In addition to the user's body shape data, the generator also requires other inputs to generate high-quality images, such as random noise vectors, etc. These additional inputs will be merged with the conditional vector to form complete input data so that the generator can generate clothing images based on this information.
[0082] S603 uses the integrated conditional vector as input and calls the trained convolutional generative adversarial network model to generate a clothing design image;
[0083] When all the inputs are ready, they can be passed as input to the generator part of the trained CGAN model. The generator will use the knowledge learned based on these input information to generate one or more clothing design images.
[0084] S604 performs denormalization and color adjustment on the clothing design image;
[0085] Since the images are normalized during training so that the pixel values fall within a certain range (e.g. [-1, 1]), they need to be denormalized after being generated to restore them to the normal pixel value range (usually [0, 255]). In addition, the color of the image needs to be adjusted to ensure that the generated clothing images look natural and colorful.
[0086] S605 displays the generated clothing design image to the user for viewing;
[0087] After the above processing is completed, the generated clothing design images will be displayed to the user. The user can browse these images through a friendly interface and understand the clothing styles generated according to his or her body shape data.
[0088] S606 collects user feedback on the generated image.
[0089] Finally, the system will collect users’ opinions and suggestions on the generated images. This step is very important for the continuous improvement of the generation model, because user feedback can help us understand what is done well and what needs to be improved, so as to continuously optimize the algorithm and improve the quality of generated images and user satisfaction.
[0090] Second embodiment
[0091] The present invention also provides a clothing generation system based on a generative adversarial network, comprising a body data acquisition module, a clothing image acquisition module, a model generation module and a clothing generation module; the body data acquisition module is used to acquire the body data of the user; the clothing image acquisition module is used to match various types of clothing based on the body data to obtain a clothing image data set; the model generation module is used to train a convolutional generative adversarial network model on the clothing image data set; the clothing generation module is used to generate a clothing design image that matches the user using the trained convolutional generative adversarial network model.
[0092] The body shape data acquisition module collects the user's body measurement data, such as height, weight, shoulder width, chest circumference, waist circumference, hip circumference, etc., which are the basis for the subsequent generation of personalized clothing design. The user can provide this information to the system by uploading body measurement data or automatically collecting it through smart devices.
[0093] The clothing image acquisition module is used to match various types of clothing based on body shape data to obtain clothing image datasets. The work of this module is to select styles suitable for corresponding body shapes from a large number of clothing samples based on the existing body shape data, and to construct a clothing image dataset containing multiple styles and types. These datasets include not only the appearance images of clothing, but also the effect pictures of models wearing different body shapes, so as to facilitate the learning and training of subsequent models.
[0094] The task of the model generation module is to use the previously prepared clothing image dataset to train a convolutional generative adversarial network (CGAN). CGAN consists of two parts: the generator and the discriminator. The generator learns how to synthesize realistic clothing images from random noise and conditional vectors, while the discriminator learns to distinguish between real clothing images and images generated by the generator. Through the adversarial training of the two, the generator can eventually learn how to generate high-quality clothing images that meet specific conditions.
[0095] The clothing generation module receives the user's body shape data as input, and uses the trained CGAN model to generate clothing design images that meet the user's personal characteristics. These images can be used directly for user reference, or further fine-tuned by the designer to become real clothing design solutions. In this way, the system not only improves the efficiency of clothing design, but also increases the degree of personalization of design, meeting the diverse needs of users.
[0096] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A clothing generation method based on a generative adversarial network, characterized in that: include: Get the user's body shape data; Match various types of clothing based on body shape data to obtain clothing image datasets; Training a convolutional generative adversarial network model on the clothing image dataset; The trained convolutional generative adversarial network model is used to generate user-matched clothing design images.
2. A clothing generation method based on a generative adversarial network as claimed in claim 1, characterized in that: The specific steps of obtaining the user's body shape data include: Get the body shape data filled in by the user; Convert all collected body shape data into a unified format; The processed body shape data is encrypted and stored.
3. A clothing generation method based on a generative adversarial network as claimed in claim 2, characterized in that: The body shape data includes height, weight, chest circumference, waist circumference and hip circumference.
4. A clothing generation method based on a generative adversarial network as claimed in claim 3, characterized in that: The specific steps of matching various types of clothing based on body shape data to obtain a clothing image dataset include: Match the corresponding clothing images in the clothing database based on the body shape data to obtain a clothing set; Remove clothing images with resolution lower than the preset value and duplicate clothing images from the clothing collection; Resize all clothing images in the clothing collection to the same resolution; Crop the garment image and center the garment.
5. A clothing generation method based on a generative adversarial network as claimed in claim 4, characterized in that: The specific steps of training the convolutional generative adversarial network model on the clothing image dataset include: Construct a convolutional generative adversarial network model; In each training iteration, the discriminator is first updated, and it is trained to correctly classify real and generated images. Then the generator is updated, and the generator is trained to produce more realistic images by maximizing the discriminator’s error rate. Use the validation set to periodically evaluate the performance of the generator.
6. A clothing generation method based on a generative adversarial network as claimed in claim 5, characterized in that: The specific steps of constructing the convolutional generative adversarial network model are: The input of the generator contains the user's body shape data. The hidden layer uses the deconvolution layer to gradually enlarge the size of the feature map. The output layer uses the sigmoid activation function, and the pixel value range of the generated image is between [-1, 1]. The discriminator network receives an image as input, uses convolutional and pooling layers to extract image features, and outputs a scalar representing the probability that the discriminator believes the input is a real image.
7. A clothing generation method based on a generative adversarial network as claimed in claim 6, characterized in that: The specific steps of using the trained generator network to generate a clothing design image matching the user include: Encode the user's body shape information into a conditional vector; Combine the conditional vector with other inputs required by the generator model; Using the integrated conditional vector as input, the trained convolutional generative adversarial network model is called to generate clothing design images; Denormalize and color adjust clothing design images; The generated clothing design images are displayed to the user for viewing.
8. The clothing generation method based on a generative adversarial network as claimed in claim 7, characterized in that: After displaying the generated clothing design image to the user for viewing, the step further includes: collecting user feedback on the generated image.
9. A clothing generation system based on a generative adversarial network, applied to a clothing generation method based on a generative adversarial network as claimed in any one of claims 1 to 8, characterized in that: It includes a body shape data acquisition module, a clothing image acquisition module, a model generation module and a clothing generation module; The body shape data acquisition module is used to acquire the body shape data of the user; The clothing image acquisition module is used to match various types of clothing based on body shape data to obtain a clothing image data set; The model generation module is used to train a convolutional generative adversarial network model on the clothing image dataset; The clothing generation module is used to generate clothing design images matching the user using a trained convolutional generative adversarial network model.