Training method and migration method for overall garment style migration based on improved CyclGan
Through the improved CycleGan network model, the problem of local area control difficulties and boundary artifacts in the migration of complex background clothing image styles is solved by using the global connection of residual network and perceived loss function, and the problem of local area control difficulties and boundary artifacts is realized. More stable and realistic style transfer effect.
Patent Information
- Application Number
- CN202411356925.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-14
AI Technical Summary
CycleGAN is difficult to control local areas in the style transfer of complex background clothing images, and boundary artifacts are easily generated after style transfer.
Adopting the improved CycleGan network model, including the generation module and the discriminative module, enhance feature extraction and image generation by globally connecting the residual network and the perceived loss function, combined with the adversarial training of the WGAN-GP loss function optimization generation module and the discriminative module, solve the training Imbalance problem.
It realizes effective and clear migration of complex patterns, patterns or textures, generates more realistic style transfer images, and improves the stability and generation effect of the network.
Smart Images

Figure CN119313761A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of intelligent clothing, and in particular relates to a training method and a migration method for overall clothing style migration based on an improved CycleGan. Background Art
[0002] With the widespread application of computer vision technology in the fashion field, the creation and display of clothing images have ushered in unprecedented diversity and personalization. As a key driving force in the field of fashion clothing design, this is being achieved through style transfer technology. This technology can cleverly integrate different artistic styles into clothing images, greatly promoting the individual expression and style innovation of clothing design, and has become a very dynamic research direction in the field of image style transfer.
[0003] With the rise of deep learning technology, Luan et al. added regularization to CycleGAN to prevent overfitting and improve the quality of image generation. Although CycleGAN has achieved good results in global image style transfer, it is difficult to control local areas in the style transfer of clothing images with complex backgrounds. The network transfers the same style to every part of the clothing in the original clothing image, and boundary artifacts will occur after style transfer. Summary of the invention
[0004] The present invention provides a training method and a migration method for overall clothing style migration based on an improved CycleGan, aiming to solve the problem in the prior art that local areas of CycleGAN are difficult to control in the style migration of clothing images with complex backgrounds.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] In a first aspect, the present invention provides a training method for overall clothing style transfer based on improved CycleGan, comprising the following steps:
[0007] S100, creating a CycleGan network model; the CycleGan network model includes a generation module and a discrimination module;
[0008] S200, receiving original clothing images and clothing style images to train the CycleGan network model;
[0009] S300, the generating module receives the clothing original image and the clothing style image; the generating module generates a virtual clothing style image according to the clothing original image, and the generating module generates a virtual clothing original image according to the clothing style image;
[0010] The generating module then restores the virtual clothing style image into a secondary virtual clothing original image, and the generating module then restores the virtual clothing original image into a secondary virtual clothing style image;
[0011] The generating module sends the generated virtual clothing style image and the virtual clothing original image to the distinguishing module;
[0012] S400, the discrimination module receives the clothing original image, clothing style image, virtual clothing style image and virtual clothing original image; the discrimination module compares the clothing original image with the virtual clothing original image, and compares the clothing style image with the virtual clothing style image, and feeds back the discrimination result to the generation module to form a confrontation, until the discrimination module and the generation module reach a confrontation balance, the discrimination module determines that the probability of the image generated by the generation module being true reaches a set threshold, and the training of the CycleGan network model is completed.
[0013] A further solution: the generation module includes a generator A and a generator B, and the generator A and the generator B both include a globally connectable residual network;
[0014] For the generator A, the generator A receives the original clothing image and generates the virtual clothing style image through the globally connectable residual network; the generator A receives the original virtual clothing image and restores the original virtual clothing image into the secondary virtual clothing style image through the globally connectable residual network;
[0015] For the generator B, the generator B receives the clothing style image and generates the virtual clothing original image after passing through the globally connectable residual network; the generator B receives the virtual clothing style image and restores the virtual clothing style image to the secondary virtual clothing original image after passing through the globally connectable residual network.
[0016] Based on the above scheme, the globally connectable residual network not only increases the global field of view of feature extraction of the original clothing image or the clothing style image, but also can increase the multi-scale invariant characteristics, thereby more completely migrating the complex patterns, designs and textures on the clothing style image to the original clothing image.
[0017] A further solution: the globally connectable residual network includes a self-attention layer and two convolutional layers;
[0018] The formula for the globally connectable residual network is:
[0019] F=X+Conv(SEAT(E))+Conv(Conv(E));
[0020] Among them, the F represents the output of the globally connected residual network; the E represents the input of the globally connected residual network; the Conv() represents the convolutional layer; and the SEAT() represents the self-attention layer.
[0021] A further solution: In the process of the generator A restoring the virtual clothing original image to the secondary virtual clothing style image, and in the process of the generator B restoring the virtual clothing style image to the secondary virtual clothing original image, the generator A and the generator B both include a perceptual loss function.
[0022] Based on the above scheme, the perceptual loss function can make the secondary virtual clothing style image restored by the generator A infinitely close to the clothing style image, and the secondary virtual clothing original image restored by the generator B infinitely close to the clothing original image, which is helpful to learn meaningful mapping in the absence of paired data (the clothing original image and the clothing style image).
[0023] A further solution: the discriminator module includes a discriminator A and a discriminator B;
[0024] The discriminator A receives the clothing style image and the virtual clothing style image and compares them, and feeds back the discrimination result to the generator A, and the generator A and the discriminator A form a confrontation until the probability that the discriminator A judges that the virtual clothing style image is true reaches a set threshold;
[0025] The discriminator B receives the original image of the clothing and the original image of the virtual clothing and compares them, and feeds back the discrimination result to the generator B. The generator B and the discriminator B form a confrontation until the probability that the discriminator B judges that the original image of the virtual clothing is true reaches a set threshold.
[0026] Based on the above scheme, the generator A and the discriminator A form an adversary, and the generator B and the discriminator B form an adversary, and the parameter settings of the generation module can be continuously optimized, so that the CycleGan network model is more stable and the conversion effect is better.
[0027] Further solution: the structures of the discriminator A and the discriminator B both adopt the Auto-Encoder network structure;
[0028] The Auto-Encoder network structure includes an input layer, a downsampling layer, a fully connected layer, an upsampling layer and an output layer in sequence.
[0029] Based on the above scheme, the Auto-Encoder network structure makes the training of the discrimination module no longer constrained by the generation module. The discrimination module can be trained first, and the training of the generation module can be stimulated by optimizing the discrimination module, thereby solving the training imbalance problem caused by the CycleGan network model.
[0030] A further solution: the generation module and the discrimination module adopt the WGAN-GP loss function in the process of forming the confrontation.
[0031] Based on the above scheme, the WGAN-GP loss function can optimize the Wasserstein distance and introduce a gradient penalty term, which can not only generate more diverse style-transferred images, but also constrain the gradient norm of the discriminant module, effectively avoid the problems of gradient explosion and gradient vanishing, and further improve the stability of the CycleGan network model.
[0032] A further solution: before performing step S100, first obtain a clothing original image training set and a clothing style image training set of different styles; and pre-process the clothing original clothing images in the clothing original image training set and the clothing style images in the clothing style image training set.
[0033] A further solution: the preprocessing includes: reading the clothing original image training set and the clothing style image training set; adjusting the resolution of the clothing original images in the clothing original image training set and the resolution of the clothing style images in the clothing style image training set to 256×256, and filtering the clothing original images or clothing style images whose resolution cannot be adjusted to 256×256.
[0034] Based on the above scheme, by adjusting the resolution of the original clothing image and the clothing style image, the computational burden of the CycleGan network model can be reduced and the reasoning speed and efficiency can be improved.
[0035] In a second aspect, the present invention provides a method for transferring the overall style of clothing based on an improved CycleGan, using a trained CycleGan network model in any of the training methods for transferring the overall style of clothing based on an improved CycleGan as described in the first aspect; comprising the following steps:
[0036] The first step: obtaining a real clothing original image and a real clothing style image, preprocessing the real clothing original image and the real clothing style image; and inputting the preprocessed real clothing original image and the real clothing style image into the trained CycleGan network model;
[0037] Step 2: The trained CycleGan network model receives the real clothing original image and the real clothing style image, and the generation module transfers the clothing style on the real clothing style image to the real clothing original image, and outputs a clothing style conversion image.
[0038] The beneficial effects of the present invention are:
[0039] The present invention improves the structure of the CycleGan network model, enhances the training of the CycleGan network model, solves the problem of unbalanced initial training of the CycleGan network model in the prior art, makes the trained CycleGan network model more stable, and further completes the effective and clear migration of complex patterns, patterns or textures.
[0040] In the present invention, the virtual clothing style image and the virtual clothing original image generated by the generation module are discriminated by the discrimination module, and the judgment result of the discrimination module is fed back to the generation module, so that a confrontation is formed between the discrimination module and the generation module, thereby enabling the generation module to optimize parameters, the CycleGan network model to be more stable, and the generation module to generate a more realistic style-transferred image.
[0041] In the present invention, the generation module can restore the virtual clothing style image into a secondary virtual clothing original image (that is, the secondary virtual clothing original image is the same as the clothing original image), and the generation module can restore the virtual clothing style image into a secondary virtual clothing style image (that is, the secondary virtual clothing style image is the same as the clothing style image) according to the virtual clothing original image, so that the generation module can be further trained, which helps the generation module to learn meaningful mapping in the absence of paired data (the clothing original image and the clothing style image are a pair of data), thereby enabling the generation module to generate an image that is closer to the real style transfer. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 It is a flow chart of the training method of clothing overall style transfer based on improved CycleGan in the present invention;
[0044] Figure 2It is a structural schematic diagram of a training method for overall clothing style transfer based on improved CycleGan in the present invention;
[0045] Figure 3 Schematic diagram of the process of the self-attention layer (SEAT) in the present invention;
[0046] Figure 4 It is a flow chart of the Auto-Encoder network structure in the present invention;
[0047] Figure 5 It is a flow chart of the overall clothing style transfer method based on improved CycleGan in the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work belong to the protection scope of the present invention.
[0049] Embodiment 1:
[0050] like Figure 1 As shown, this embodiment provides a training method for overall clothing style transfer based on improved CycleGan, comprising the following steps:
[0051] Step 1: Obtain clothing original image training set and clothing style image training set of different styles; pre-process the clothing original image in the clothing original image training set and the clothing style image in the clothing style image training set. The clothing original image training set and clothing style image training set can be obtained by web crawler and other technologies.
[0052] A more specific example of the above steps is: the preprocessing operation mainly includes: reading the clothing original image training set and the clothing style image training set; adjusting the resolution of the clothing original images in the clothing original image training set and the resolution of the clothing style images in the clothing style image training set to 256×256, and filtering the clothing original images or clothing style images whose resolution cannot be adjusted to 256×256. The preprocessed clothing original images and clothing style images are input into the CycleGan network model and the CycleGan network model is trained.
[0053] Step 2: Create a CycleGan network model; the CycleGan network model includes a generation module and a discrimination module; the CycleGan network model receives original clothing images and clothing style images to train the CycleGan network model.
[0054] Step 3: the generation module receives the clothing original image and the clothing style image; the generation module generates a virtual clothing style image according to the clothing original image, and the generation module generates a virtual clothing original image according to the clothing style image;
[0055] The generating module then restores the virtual clothing style image into a secondary virtual clothing original image, and the generating module then restores the virtual clothing original image into a secondary virtual clothing style image;
[0056] The generating module sends the generated virtual clothing style image and the virtual clothing original image to the distinguishing module.
[0057] A more specific example of the above steps is: the generation module includes a generator A and a generator B, and the generator A and the generator B both include a globally connectable residual network;
[0058] like Figure 2 As shown, for the generator A, the generator A receives the original clothing image and generates the virtual clothing style image through the globally connectable residual network; the generator A receives the original virtual clothing image and restores the original virtual clothing image into the secondary virtual clothing style image through the globally connectable residual network;
[0059] For the generator B, the generator B receives the clothing style image and generates the virtual clothing original image after passing through the globally connectable residual network; the generator B receives the virtual clothing style image and restores the virtual clothing style image to the secondary virtual clothing original image after passing through the globally connectable residual network.
[0060] The globally connectable residual network (SA Blocks) includes a self-attention layer (SEAT) and two convolutional layers; it should be noted that: the two convolutional layers are both 3×3 convolutional layers;
[0061] The formula for the globally connectable residual network is:
[0062] F=X+Conv(SEAT(E))+Conv(Conv(E));
[0063] Among them, the F represents the output of the globally connected residual network; the E represents the input of the globally connected residual network; the Conv() represents the convolutional layer; and the SEAT() represents the self-attention layer.
[0064] like Figure 3 As shown, the original clothing image or the clothing style image needs to be feature transformed in the generation module. The following is an input E, and the hth in the globally connected residual network i-1 Taking the self-attention layer as an example, the working principle of the self-attention layer (SEAT) is as follows:
[0065] The input E of the globally connected residual network passes through three 1×1 convolutional layers to obtain the feature matrix W Q , feature matrix W K and the feature matrix W V ; The feature matrix W K After the transpose operation (Transpose), the transposed matrix K is obtained T ; The feature matrix W Q With the transposed matrix K T After multiplication, normalization operation (Softmax) is performed to obtain the feature matrix W KQ , the feature matrix W KQ With the feature matrix W V After multiplication, it passes through a 3×3 convolutional layer and enters the hth layer of the globally connected residual network. i layer.
[0066] In addition, in the process of the generator A restoring the virtual clothing original image to the secondary virtual clothing style image, and in the process of the generator B restoring the virtual clothing style image to the secondary virtual clothing original image, the generator A and the generator B both include a perceptual loss function (LPIPS).
[0067] The perceptual loss function (LPIPS) includes a cycle consistency loss, which is used to ensure that when the original clothing image is transformed into the virtual clothing style image and then restored back to the secondary virtual clothing original image, the secondary virtual clothing original image is the same as the original clothing image, and to ensure that when the clothing style image is transformed into the virtual clothing original image and then restored back to the secondary virtual clothing style image, the secondary virtual clothing style image is the same as the clothing style image.
[0068] The perceptual loss function is used to measure the difference between two images (for example, the secondary virtual clothing original image and the clothing original image, or the secondary virtual clothing style image and the clothing style image). The working principle is: the real image x (for example, the clothing original image or the clothing style image) and the image to be tested x0 (the secondary virtual clothing original image or the secondary virtual clothing style image) are respectively substituted into the feature extraction network for feature extraction, and feature stacks are extracted in different convolutional layers (here, the L layer is taken as an example), and the feature stacks in different channels are normalized, and the activation channel is scaled by vector w1, and the distance is calculated using the L2 norm, and the average is calculated in space, and the distance between the features of the real image x and the image to be tested x0 is calculated by summing over the channel; the formula is as follows:
[0069]
[0070] Wherein, d(x, x0) represents the distance between the features of the real image x and the image to be tested x0; L Represents the height of the feature map of the training convolutional neural network at layer L; the W L Represents the width of the feature map of the training convolutional neural network at layer L; represents normalizing the spatial dimension of the feature map; wl represents the weight of the feature difference at the Lth layer; ⊙ represents multiplication; Represents the mapping of the real image x; represents the mapping of the image to be tested x0; the ||||2 represents the calculation of the L2 norm.
[0071] Step 4: The discrimination module receives the original clothing image, clothing style image, virtual clothing style image and virtual clothing original image; the discrimination module compares the original clothing image with the virtual clothing original image, and compares the clothing style image with the virtual clothing style image, and feeds back the discrimination result to the generation module to form a confrontation, until the discrimination module and the generation module reach a confrontation balance, and the discrimination module determines that the probability of the image generated by the generation module being true reaches a set threshold to complete the training of the CycleGan network model.
[0072] It should be noted that the threshold is a value close to 1.
[0073] A more specific example of the above steps is: the discrimination module includes a discriminator A and a discriminator B;
[0074] like Figure 2As shown, the discriminator A receives the clothing style image and the virtual clothing style image and compares them, and feeds back the discrimination result to the generator A. The generator A and the discriminator A form a confrontation until the probability that the discriminator A judges that the virtual clothing style image is true reaches a set threshold;
[0075] The discriminator B receives the original image of the clothing and the original image of the virtual clothing and compares them, and feeds back the discrimination result to the generator B. The generator B and the discriminator B form a confrontation until the probability that the discriminator B judges that the original image of the virtual clothing is true reaches a set threshold.
[0076] Wherein, the structures of the discriminator A and the discriminator B both adopt the Auto-Encoder network structure;
[0077] like Figure 4 As shown, the Auto-Encoder network structure includes an input layer, a downsampling layer, a fully connected layer, an upsampling layer and an output layer in sequence.
[0078] Specifically, for the discriminator A, the input layer (input, receiving the virtual clothing style image) of the Auto-Encoder network has a size of 256×256 and a channel number of 3. After convolution, a feature image with a size of 256×256 and a channel number of n (n can be freely set) is obtained. Then, after the first downsampling, a feature image with a size of 128×128 and a channel number of 2n is obtained. After the second downsampling, a feature image with a size of 64×64 and a channel number of 3n is obtained. After the third downsampling, a feature image with a size of 32×32 and a channel number of 4n is obtained. After the fourth downsampling, a feature image with a size of 16×16 and a channel number of 5n is obtained. Then, a full connection is performed. The first upsampling is performed to obtain a feature image with a size of 32×32 and a number of channels of 4n, the second upsampling is performed to obtain a feature image with a size of 64×64 and a number of channels of 3n, the third upsampling is performed to obtain a feature image with a size of 128×128 and a number of channels of 2n, the fourth upsampling is performed to obtain a feature image with a size of 256×256 and a number of channels of n, and finally the output image (output, output clothing style image) is obtained through convolution, and the size of the output layer is 256×256 and the number of channels is 3. The discriminator A determines whether the clothing style image output by the output layer is consistent with the clothing style image received by the discriminator A.
[0079] For the discriminator B, the input layer (input, receiving the original image of the virtual clothing) of the Auto-Encoder network has a size of 256×256 and a channel number of 3. After convolution, a feature image with a size of 256×256 and a channel number of n (n can be freely set) is obtained. Then, after the first downsampling, a feature image with a size of 128×128 and a channel number of 2n is obtained. After the second downsampling, a feature image with a size of 64×64 and a channel number of 3n is obtained. After the third downsampling, a feature image with a size of 32×32 and a channel number of 4n is obtained. After the fourth downsampling, a feature image with a size of 16×16 and a channel number of 5n is obtained. Then, a full connection is performed. The first upsampling is performed to obtain a feature image with a size of 32×32 and a number of channels of 4n, the second upsampling is performed to obtain a feature image with a size of 64×64 and a number of channels of 3n, the third upsampling is performed to obtain a feature image with a size of 128×128 and a number of channels of 2n, and the fourth upsampling is performed to obtain a feature image with a size of 256×256 and a number of channels of n. Finally, the output image (output, output clothing original image) is obtained through convolution. At this time, the size of the output layer is 256×256 and the number of channels is 3. The discriminator B determines whether the clothing original image output by the output layer is consistent with the clothing original image received by the discriminator B.
[0080] Based on the above solution, the generation module and the discrimination module adopt the WGAN-GP loss function in the process of forming confrontation.
[0081] During the training of the CycleGan network model, the CycleGan network model includes two generative adversarial losses;
[0082] The first adversarial loss is achieved through G (generator A) to convert the X domain (original clothing image) to the Y domain (clothing style image) loss formula is:
[0083]
[0084] Among them, the E y~Pdata(y) [D Y (y)] represents the real data distribution P data (y) below, the discriminator D Y The expected value of the output for input y; the E x~Pdata(x)[DY(G(x))] represents the distribution of the real data P data The sample x sampled in (x) passes through G (generator A) and the sample G (x) generated by the discriminator D Y The expected value of the output after Indicates the calculation of gradient penalty in the WGAN-GP loss function. Specifically, λ represents the weight coefficient of the gradient penalty term; the E y~Y represents the expected value of the random variable y; Represents the discriminator D Y The gradient of the input y; represents the L2 norm of the gradient; Represents the square of the difference between the gradient strength and 1.
[0085] The second adversarial loss is achieved through F (generator B) to convert the Y domain (clothing style image) to the X domain (clothing original image) loss formula is:
[0086]
[0087] Among them, the E x~Pdata(x) [D X (x)] represents the real data distribution P data The sample x in (x) passes through the discriminator D X The expected value of the output after y~Pdata(y) [D X (F(y))] represents the distribution of the real data from P data The sample y sampled in (y) is converted by F (generator B) and then passed through the discriminator D X The expected value of the output after Indicates the calculation of gradient penalty in the WGAN-GP loss function. Specifically, λ represents the weight coefficient of the gradient penalty term; Ex~X represents the expected value of the random variable x; Represents the discriminator D X The gradient of the input x; represents the L2 norm of the gradient; Represents the square of the difference between the L2 norm of the gradient and 1.
[0088] Embodiment 2:
[0089] This embodiment provides a method for transferring the overall style of clothing based on an improved CycleGan, using the trained CycleGan network model in the training method for transferring the overall style of clothing based on an improved CycleGan as described in the first embodiment; Figure 5 As shown, the following steps are included:
[0090] The first step: obtaining a real clothing original image and a real clothing style image, preprocessing the real clothing original image and the real clothing style image; and inputting the preprocessed real clothing original image and the real clothing style image into the trained CycleGan network model;
[0091] Step 2: The trained CycleGan network model receives the real clothing original image and the real clothing style image, and the generation module transfers the clothing style on the real clothing style image to the real clothing original image, and outputs a clothing style conversion image.
[0092] The following example further illustrates a method for transferring the overall clothing style based on an improved CycleGan:
[0093] Requirements: Transfer the retro style of clothing retro style images to clothing street style images, where style features include color, fabric, cut or pattern, etc.
[0094] The style transfer steps include:
[0095] The first step: obtaining clothing retro style images (in clothing retro style images, the clothing is brightly colored, the fabric is knitted, the cut is bell-bottom pants, and the pattern is printed) and clothing street style images (in clothing street style images, the clothing is black and white, the fabric is denim, the cut is slim, and the pattern is splicing); adjusting the resolution of the clothing retro style images and the clothing street style images to 256×256, and inputting the clothing retro style images and the clothing street style images into the CycleGan network model.
[0096] Step 2: The trained CycleGan network model receives the clothing retro style image and the clothing street style image; the generation module transfers the retro style (including color, fabric, cut or pattern) of the clothing retro style image to the clothing street style image, and outputs a clothing style conversion image.
[0097] The clothing style conversion image may be a modern street style clothing with bell-bottom pants cut, the fabric is sports material, the middle of the clothing is printed, and the bottom is a splicing design to increase the sense of layering. The clothing style conversion image has both retro style and street style.
[0098] The present invention is not limited to the above-mentioned optional implementation modes. Anyone can derive other various forms of products under the inspiration of the present invention. However, no matter what changes are made in the shape or structure, all technical solutions that fall within the scope defined by the claims of the present invention fall within the protection scope of the present invention.
Claims
1. A training method for overall clothing style transfer based on improved CycleGan, characterized in that: The following steps are involved: S100, creating a CycleGan network model; the CycleGan network model includes a generation module and a discrimination module; S200, receiving original clothing images and clothing style images to train the CycleGan network model; S300, the generating module receives the clothing original image and the clothing style image; the generating module generates a virtual clothing style image according to the clothing original image, and the generating module generates a virtual clothing original image according to the clothing style image; The generating module then restores the virtual clothing style image into a secondary virtual clothing original image, and the generating module then restores the virtual clothing original image into a secondary virtual clothing style image; The generating module sends the generated virtual clothing style image and the virtual clothing original image to the distinguishing module; S400, the discrimination module receives the clothing original image, clothing style image, virtual clothing style image and virtual clothing original image; the discrimination module compares the clothing original image with the virtual clothing original image, and compares the clothing style image with the virtual clothing style image, and feeds back the discrimination result to the generation module to form a confrontation, until the discrimination module and the generation module reach a confrontation balance, the discrimination module determines that the probability of the image generated by the generation module being true reaches a set threshold, and the training of the CycleGan network model is completed.
2. According to claim 1, a training method for overall clothing style transfer based on improved CycleGan is characterized in that: The generation module includes a generator A and a generator B, and both the generator A and the generator B include a globally connectable residual network; For the generator A, the generator A receives the original clothing image and generates the virtual clothing style image through the globally connectable residual network; the generator A receives the original virtual clothing image and restores the original virtual clothing image into the secondary virtual clothing style image through the globally connectable residual network; For the generator B, the generator B receives the clothing style image and generates the virtual clothing original image after passing through the globally connectable residual network; the generator B receives the virtual clothing style image and restores the virtual clothing style image to the secondary virtual clothing original image after passing through the globally connectable residual network.
3. According to claim 2, a training method for overall clothing style transfer based on improved CycleGan is characterized in that: The globally connectable residual network includes a self-attention layer and two convolutional layers; The formula for the globally connectable residual network is: F=X+Conv(SEAT(E))+Conv(Conv(E)); Among them, the F represents the output of the globally connected residual network; the E represents the input of the globally connected residual network; the Conv() represents the convolutional layer; and the SEAT() represents the self-attention layer.
4. According to claim 2, a training method for overall clothing style transfer based on improved CycleGan is characterized in that: In the process of the generator A restoring the virtual clothing original image to the secondary virtual clothing style image, and in the process of the generator B restoring the virtual clothing style image to the secondary virtual clothing original image, the generator A and the generator B both include a perceptual loss function.
5. The training method for overall clothing style transfer based on improved CycleGan according to claim 1, characterized in that: The discriminator module includes a discriminator A and a discriminator B; The discriminator A receives the clothing style image and the virtual clothing style image and compares them, and feeds back the discrimination result to the generator A, and the generator A and the discriminator A form a confrontation until the probability that the discriminator A judges that the virtual clothing style image is true reaches a set threshold; The discriminator B receives the original image of the clothing and the original image of the virtual clothing and compares them, and feeds back the discrimination result to the generator B. The generator B and the discriminator B form a confrontation until the probability that the discriminator B judges that the original image of the virtual clothing is true reaches a set threshold.
6. The training method for overall clothing style transfer based on improved CycleGan according to claim 5, characterized in that: The structures of the discriminator A and the discriminator B both adopt the Auto-Encoder network structure; The Auto-Encoder network structure includes an input layer, a downsampling layer, a fully connected layer, an upsampling layer and an output layer in sequence.
7. The training method for overall clothing style transfer based on improved CycleGan according to claim 1, characterized in that: The generation module and the discrimination module use the WGAN-GP loss function in the process of forming confrontation.
8. The method for training overall clothing style transfer based on improved CycleGan according to claim 1, characterized in that: Before performing step S100, a clothing original image training set and a clothing style image training set of different styles are first obtained; and the clothing original images in the clothing original image training set and the clothing style images in the clothing style image training set are preprocessed.
9. The training method for overall clothing style transfer based on improved CycleGan according to claim 8, characterized in that: The preprocessing includes: reading the clothing original image training set and the clothing style image training set; adjusting the resolution of the clothing original images in the clothing original image training set and the resolution of the clothing style images in the clothing style image training set to 256×256, and filtering the clothing original images or clothing style images whose resolution cannot be adjusted to 256×256.
10. A method for transferring the overall clothing style based on improved CycleGan, characterized in that: Using the trained CycleGan network model in the training method for overall clothing style transfer based on improved CycleGan as described in any of claims 1 to 9; comprising the following steps: The first step: obtaining a real clothing original image and a real clothing style image, preprocessing the real clothing original image and the real clothing style image; and inputting the preprocessed real clothing original image and the real clothing style image into the trained CycleGan network model; Step 2: The trained CycleGan network model receives the real clothing original image and the real clothing style image, and the generation module transfers the clothing style on the real clothing style image to the real clothing original image, and outputs a clothing style conversion image.