Virtual fitting method based on global flow garment transformation

Through the clothing deformation module and U-Net network of global appearance flow and local attention, it solves the problem that virtual fitting technology cannot meet the large deformation and realistic experience of clothing, realizes efficient virtual trying on with low hardware requirements, and improves the User experience and shopping efficiency.

CN118735628APending Publication Date: 2024-10-01DONGHUA UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410737578.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing virtual fitting technology cannot meet the needs of large-scale deformation of clothing, has high hardware requirements, and cannot provide a realistic and personalized fitting experience, which limits the widespread promotion of virtual fitting of clothing.

Method used

The clothing deformation module based on global appearance flow and local attention and the virtual try-on module of the U-Net network are used to achieve multi-scale deformation and realistic try-on effects of clothing through the pyramid feature extraction network and ResUNet network, reducing hardware requirements.

Benefits of technology

It realizes various ranges of clothing deformation and posture adaptation, provides a realistic virtual try-on experience, improves user online shopping satisfaction and efficiency, and reduces the amount of calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735628A_ABST
    Figure CN118735628A_ABST
Patent Text Reader

Abstract

The invention relates to a virtual fitting method based on global flow garment transformation, which comprises the following steps of: inputting a garment to be fitted and a user image to a garment transformation module for distorting and deforming the garment to a human body posture; and inputting the deformed garment and the user image into a garment virtual fitting module for generating a final user fitting effect picture. The garment deformation module is used for distorting and deforming the to-be-tried garment to be consistent with the human body posture based on the global appearance flow and the local attention; and the garment virtual fitting module is used for fitting the deformed garment on the user based on the U-Net network. The problem that the virtual fitting technology has high hardware requirements and cannot meet the requirement for large-amplitude deformation of the clothes is solved, the full-process design of virtual fitting of the clothes with the user as the center is achieved, global information is perceived based on a global flow method, the sense of reality of a clothes deformation result is enhanced, the fitting experience of the user is greatly improved, and the user experience is improved. And the actual application efficiency of the virtual try-on platform is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of multimedia and computer vision, and in particular to a clothing deformation fitting method based on a global appearance flow. Background Art

[0002] The demand for online shopping of fashion products is growing rapidly. Virtual fitting technology enriches customers' shopping experience and has huge commercial advantages. In-depth research and development of virtual fitting technology is of great significance. In traditional clothing selection, customers need to go to offline clothing stores and try on one piece after another to find the right clothing for themselves. This process takes a lot of time and energy, and is also subject to the business hours of the store, which greatly reduces customers' willingness to shop. Although in recent years, with the rapid development of network technology, people's demand for buying fashion products online has exploded. Compared with traditional offline shopping, clothing selection on the network platform is faster and more efficient, and has huge commercial advantages. However, when customers buy online, they lack personalized experience and real-time interaction of clothing fitting, and the user's own experience and degree of suitability are important factors that promote the willingness to buy. However, the existing virtual fitting technology is not yet mature, and it cannot provide customers with realistic virtual fitting results. It is easy to have poor deformation effects of large-gesture clothing and distortion of clothing deformation results with rich textures. In addition, this technology also requires powerful computing power, resulting in very high requirements for hardware, which greatly limits the large-scale promotion of clothing virtual fitting. Summary of the invention

[0003] Aiming at the problem that virtual try-on technology has high hardware requirements and cannot meet the large deformation of clothing, a clothing deformation try-on method based on global appearance flow is proposed, which can realize clothing deformation of various magnitudes and adapt to various postures of users. A virtual try-on platform with low hardware requirements but at the same time providing customers with the most realistic clothing try-on renderings is built to meet the needs of users who cannot get timely feedback when purchasing fashion products online. A convenient online try-on tool is provided to users to solve the above problems and improve the satisfaction and efficiency of users purchasing fashion products online.

[0004] The technical solution of the present invention is:

[0005] A virtual fitting method based on global flow clothing transformation comprises the following steps:

[0006] Step 1: Input the garment to be tried on and the user image to the garment deformation module, which is used to distort the garment into the human body posture;

[0007] Step 2: Input the deformed clothing and user image into the clothing virtual try-on module to generate the final user try-on effect image;

[0008] Among them, the clothing deformation module is based on global appearance flow and local attention, which is used to distort the clothing to be tried on to be consistent with the human body posture; the clothing virtual try-on module is based on the U-Net network, which is used to try the deformed clothing on the user;

[0009] The specific steps are as follows:

[0010] Step 1.1: Collect image information of the clothing to be tried on and its mask and semantic information; collect user images and their human posture key points, human posture analysis graphs and dense posture estimation;

[0011] Step 1.2: Input the collected information of the clothing to be tried on and the user image into the pyramid feature extraction network to obtain multi-scale information;

[0012] The pyramid feature extraction network in step 1.2 is:

[0013] The clothing information is input into a pyramid feature extraction network and the human posture feature information is input into another pyramid feature extraction network to extract the feature information of clothing and human posture respectively; the convolution kernel size of each layer of the pyramid feature extraction network is different in order to extract the multi-scale feature information of clothing and human posture; the extracted clothing and human posture feature information is 1 / 2 of the size of the previous layer, wherein the number of layers of the pyramid network in the clothing deformation fitting method based on global flow is set to 4;

[0014] Step 1.3: The extracted multi-scale information of clothing and users is input layer by layer into the local enhancement information module and the global stripe information matching module to generate a multi-scale appearance flow; wherein, the pyramid feature information is input into the global enhancement information module and the appearance flow regressed by the global stripe information matching module, and is upsampled to the clothing feature of the next layer. Figure 1 The clothing feature map is used to deform the clothing feature map, and then the correlation between the deformed clothing feature map and the human body posture feature information at the same layer is calculated;

[0015] The local enhancement information module in step 1.3 is:

[0016] The multi-scale information extracted from the pyramid is firstly used for the convolution operation with a convolution kernel of 1×1 to activate the horizontal and vertical feature information of clothing and human posture respectively; for the activated feature information, the association between adjacent regions is established through the self-attention mechanism, that is, the weak semantic feature information of the adjacent regions of the features to be matched is enhanced, which makes a great contribution to the subsequent improvement of the global stripe information matching accuracy of the multi-scale feature information of clothing and human posture; wherein, the feature information does not change after being output to the local enhancement information module and before being input; the multi-scale human posture information output from the local enhancement information module is input to the global stripe information matching module;

[0017] The global stripe information matching module process in step 1.3 is as follows:

[0018] First, according to the size of the input feature map, a length and input feature Figure 1 The width of the pooling window is 1 horizontally, and then a width and feature Figure 1 The length of the pooling window in the vertical direction is 1; the feature map information of the human body posture in the horizontal and vertical directions of the local enhanced feature information is input into the pooling windows in the horizontal and vertical directions respectively, and the human body posture feature map focusing on the global feature information in the horizontal and vertical directions is obtained respectively; in the horizontal direction, the global matching degree is calculated by combining the horizontal feature map of the clothing through the local enhanced information module with the human body posture feature map focusing on the global information in the horizontal direction; in the vertical direction, the global matching degree in the vertical direction can be obtained in the same way; the global matching degree in the horizontal direction and the global matching degree in the vertical direction are superimposed, and then the global appearance flow is obtained by regression through multi-layer convolution operation;

[0019] Step 1.4: Generate the final clothing appearance flow to distort the deformed clothing, and obtain the final distorted deformed clothing;

[0020] In step 1.4, in order to ensure that the final distorted clothing has a realistic feel, the following loss function is designed:

[0021] The first-order smooth loss is used to minimize the difference between the deformed clothing and the matching clothing label. The formula is as follows:

[0022] L 1 =||S p -S label || 1

[0023] Where, L 1 is the first-order smoothing loss in the clothing deformation stage, S p It is a transformed costume, S label It’s a clothing label;

[0024] Use perceptual loss to enhance the realism of the generated clothing deformation results. The formula is as follows:

[0025]

[0026] Where L per is the perceptual loss in the clothing deformation stage, φ m VGG19 represents the feature map of the mth layer in the pre-trained VGG19 network;

[0027] The appearance flow of deformed clothing has a large number of degrees of freedom, which may have an adverse effect when there is a significant difference in the appearance flow between adjacent pixels; such a difference may cause unrealistic artifacts in the deformed clothing. This difficulty is addressed by imposing a regularization constraint on the final appearance flow using a smoothness loss:

[0028]

[0029] Among them, L smt is the clothing appearance flow smoothing loss in the clothing deformation stage, F s_i is the appearance flow, i represents the i-th iteration of the appearance flow, i = 1, 2, 3, 4;

[0030] The learning objectives of the clothing deformation stage can be stated as:

[0031] L warp_loss =λ 1 ·L 1 +λ per ·L per +λ smt ·L smt

[0032] Among them, L warp_loss is the total loss in the clothing deformation stage, λ 1 , per , smt Hyperparameters corresponding to first-order smooth loss, perceptual loss, and smooth loss respectively;

[0033] The U-Net-based clothing virtual try-on process in step 2 is:

[0034] Step 2.1: Input the deformed clothing and information containing human body posture features into the virtual fitting module;

[0035] Step 2.2: The virtual try-on module uses the ResUNet network to ensure the authenticity of the virtual try-on results. The ResUNet main framework consists of upsampling layers and downsampling layers to encode and decode the input image. In addition, each module of the encoder and decoder contains residual connections to effectively alleviate the problem of small gradients in the deep learning network. This can fully extract low-frequency information. In addition, this can also enable the fusion of contextual information, thereby effectively alleviating the problem of missing semantic information. The final result of the user trying on clothing is obtained by continuously encoding and decoding through the ResUNet network;

[0036] In step 2.2, in order to achieve the final result of the user trying on the clothes, that is, the user's virtual trying on image has a realistic feeling, the following loss function is designed:

[0037] The first-order smoothing loss is used to ensure that the difference between the generated user's try-on image and the corresponding user's try-on result label value is minimized. The formula is as follows:

[0038] L′ 1 =||P s -P label || 1

[0039] Among them, L′ 1 represents the first-order smooth loss in the clothing fitting stage, P s is a picture of the user trying on the deformed clothing, P label It is the label picture of the clothes that the user tries on;

[0040] Use perceptual loss to enhance the realism of the generated user try-on results. The formula is as follows:

[0041]

[0042] Among them, L′ per is the perceptual loss during the clothing fitting phase, φ m VGG19 represents the feature map of the mth layer in the pre-trained VGG19 network;

[0043] The learning objectives for the clothing fitting phase can be stated as follows:

[0044] L try_on =λ′ 1 ·L′ 1 +λ′ per ·L′ per

[0045] Among them, L try_on is the total loss in the clothing fitting stage, λ′ 1 ,λ′ per They correspond to the hyperparameters of the first-order smooth loss and perceptual loss respectively.

[0046] Furthermore, the specific implementation process of step 1 is as follows:

[0047] Construct a clothing deformation module to distort the clothing to be tried on input by the user to be consistent with the user's image posture;

[0048] First, input the clothing to be tried on and the user image. For the clothing image, extract its mask and semantic information; for the input user image, collect its human posture key points, human posture analysis diagram and dense posture estimation information;

[0049] The obtained clothing information is input into the pyramid feature extraction network to obtain the multi-scale information of clothing; the obtained human posture information is input into the pyramid feature extraction network to obtain the multi-scale information of human posture; the size of the collected multi-scale information is 1 / 2 of the previous layer, and the expression formula is as follows:

[0050] {P 1 ,P 2 ,...,P n =FPN_P(P)

[0051] {S 1 ,S 2 ,...,S n}=FPN_S(S)

[0052] Among them, FPN_P and FPN_S represent the feature extraction networks of posture and clothing respectively, P and S represent human posture and clothing respectively, and n=4;

[0053] In step 1.3, the multi-scale clothing and human posture feature information obtained in step 1.2 is respectively activated in the horizontal and vertical directions through a convolution layer with a convolution kernel size of 1×1:

[0054] S i_v =E 1 (S 4 / S i_warped );

[0055] S i_h =E 1 (S 4 / S i_warped );

[0056] P i_v =E 1 (P i );

[0057] P i_h =E 1 (P i );

[0058] Among them, E 1 is a convolutional layer with a convolution kernel size of 1×1, S i_v , S i_h are the vertical and horizontal feature information of the clothing, P i_v , P i_h are the vertical and horizontal feature information of human posture, S 4 represents the top-level feature map extracted by the pyramid feature extraction network, S i_warped represents the clothing feature map after being distorted by the appearance flow, i represents the feature map of the first layer, Si_warped where i = 3, 2, 1, P i Pyramid feature extraction network extracts multi-layer feature maps of human posture. i i=4, 3, 2, 1;

[0059] In step 1.3, the horizontal and vertical feature information S of clothing and human posture is obtained through a 1×1 convolution kernel i_h , S i_v , P i_h , P i_v Input to the local enhancement information module, and enhance the weak semantic feature information to improve the ability of clothing to find matching human posture feature information. The calculation formula is as follows:

[0060]

[0061]

[0062] in, The query and keyword keys represent the attention weights respectively. represents the attention feature vector, represents the matrix multiplication, and d h,w Represents the range of enhanced information of the local enhanced information module, Indicates that after aggregation, M i The feature point at position (h,w), W i Q , W i K , W i V is the weight of the learned attention matrix; it is worth noting that the sizes of the horizontal and vertical information feature maps of clothing and human posture do not change after the aggregation operation, respectively, where S i_v , S i_h After the local enhancement information module, the output φ after the clothing horizontal and vertical information enhancement is obtained v ,φ h ,φ v ,φ h It is the vertical and horizontal feature information enhanced by the local information of clothing; P i_v , P i_h After the local enhancement information module, the output θ after the horizontal and vertical information enhancement of the human body posture is obtained v ,θ h ,θ v ,θ h It is the vertical and horizontal feature information enhanced by the local information of human posture; their sizes are R C×H×W , where C is the number of channels of the feature map, H is the height of the feature map, and W is the width of the feature map;

[0063] The multi-scale information of human posture output from the local enhancement information module is input into the global stripe information matching module; first, a length and input feature map are established according to the size of the input feature map; Figure 1 The width of the pooling window is 1 horizontally, and then a width and feature Figure 1 The length of the pooling window in the vertical direction is 1; the feature map information of the human body posture in the horizontal and vertical directions of the local enhanced feature information is input into the pooling windows in the horizontal and vertical directions respectively, and the human body posture feature maps focusing on the global feature information in the horizontal and vertical directions are obtained respectively;

[0064]

[0065] in and is the global feature map of the horizontal and vertical directions of the human body posture, θ h (m,k,n) and θ v (m,n,k) is the feature information enhanced in the horizontal and vertical directions of human posture; m, k, n represent the number of channels, height and width of the feature map respectively; θ h (m,k,n),θ v The size of (m,n,k) is R C×H×W , The size is R C×H , The size is R C×W ;

[0066] φ h and φ v The size is from R C×H×W Transpose to R H×W×C ,Then the global correlation between clothing and human posture feature map is calculated, and the calculation formula is as follows:

[0067]

[0068] φ h ' and φ v 'Then superimpose them to obtain a global correlation calculation matrix F cost ∈R H ×W×(H+W) , and then through continuous convolution operations, the global appearance flow F is obtained s_i ∈R H×W×2 ;

[0069] By getting the appearance flow of this layer upsampled to the features of the next layer of clothing Figure 1 After that, the clothing feature map of the next layer is distorted first, and then the appearance flow of the next layer is obtained by calculation. The calculation formula is as follows:

[0070] F s_i =U i (G i (Warp(S i ,F s_(i+1) ),P i ),F s_(i+1) )

[0071] Warp means that the feature map of clothing is distorted by the appearance flow, G i (x,y) is used to calculate the global feature correlation between x and y, U i is the upsampling operation, S i is the i-th layer feature map extracted by the pyramid feature extraction network, F s_(i+1) represents the appearance flow of the i+1th layer, P i is the i-th layer feature map extracted by the pyramid feature extraction network;

[0072] The clothing is deformed for the final appearance flow, and the deformed clothing S is obtained. p .

[0073] The beneficial effects of the present invention are:

[0074] The present invention discloses a clothing deformation module based on global appearance flow and local attention, which provides users with a clothing deformation rendering with low hardware requirements but capable of generating large-scale clothing deformation renderings; the present invention discloses a clothing virtual try-on module based on a U-Net network, which provides users with the final virtual try-on renderings and has good application prospects.

[0075] The present invention utilizes artificial intelligence technology to realize the full-process design of user-centered virtual clothing try-on, and perceives global information based on the global flow method without greatly increasing the amount of calculation, thereby enhancing the realism of clothing deformation results, greatly improving the user's try-on experience, and greatly improving the efficiency of the practical application of the virtual try-on platform. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 This is a framework diagram of a clothing deformation fitting method based on a global appearance flow disclosed by the present invention;

[0077] Figure 2 It is a structural diagram of a local enhancement information module and a global information matching module in a clothing deformation stage disclosed by the present invention acting together on clothing deformation;

[0078] Figure 3 It is a structural diagram of a local enhancement information module in a clothing deformation stage disclosed by the present invention;

[0079] Figure 4It is a structural diagram of a global information matching module in a clothing deformation stage disclosed by the present invention;

[0080] Figure 5 The present invention discloses a flow chart of a clothing deformation fitting method based on a global appearance flow. DETAILED DESCRIPTION

[0081] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0082] like Figure 1 As shown, it is a framework diagram of a method for clothing deformation fitting based on global appearance flow disclosed by the present invention. The model framework process of the method is divided into clothing deformation module construction and clothing virtual fitting module construction.

[0083] 1. A clothing deformation module based on global appearance flow and local attention, which is used to distort the clothing to be tried on to be consistent with the human body posture;

[0084] Second: A clothing virtual try-on module based on the U-Net network, which is used to try on the deformed clothing on the user;

[0085] like Figure 5 The specific steps are described as follows:

[0086] S1: Construct a clothing deformation module to distort the clothing to be tried on input by the user to be consistent with the user's image posture.

[0087] S11, first input the clothing to be tried on and the user image, and for the clothing image, extract its mask and semantic information; for the input user image, collect its human body posture key points, human body posture analysis diagram and dense posture estimation information;

[0088] S12, input the obtained clothing information into the pyramid feature extraction network to obtain multi-scale information of the clothing; input the obtained human posture information into the pyramid feature extraction network to obtain multi-scale information of the human posture; wherein the size of the collected multi-scale information is 1 / 2 of the previous layer, and the expression formula is as follows:

[0089] {P 1 ,P 2 ,...,P n =FPN_P(P)

[0090] {S 1 ,S 2 ,...,S n}=FPN_S(S)

[0091] Among them, FEN_P and FEN_S represent the feature extraction networks of posture and clothing respectively, P and S represent human posture and clothing respectively, and n=4.

[0092] S13, the obtained multi-scale clothing and human posture feature information is subjected to a convolution operation with a convolution kernel size of 1×1 to activate the feature information in the vertical and horizontal directions respectively:

[0093] S i_v =E 1 (S 4 / S i_warped );

[0094] S i_h =E 1 (S 4 / S i_warped );

[0095] P i_v =E 1 (P i );

[0096] P i_h =E 1 (P i );

[0097] Among them, E 1 is a convolutional layer with a convolution kernel size of 1×1, S i_v , S i_h are the vertical and horizontal feature information of the clothing, P i_v , P i_h are the vertical and horizontal feature information of human posture, S 4 represents the top-level feature map extracted by the pyramid feature extraction network, S i_warped represents the clothing feature map after being distorted by the appearance flow, i represents the feature map of the first layer, S i_warped where i = 3, 2, 1, P i Pyramid feature extraction network extracts multi-layer feature maps of human posture. i i=4, 3, 2, 1;

[0098] S14, after the convolution layer with 1×1 convolution kernel size, the horizontal direction S of the clothing is obtained i_h With vertical direction S i_v The horizontal P with human body posture i_h and vertical direction P i_v The feature information is input into the local enhancement information module, and the ability of clothing to find matching human posture feature information is improved by enhancing weak semantic feature information. The calculation formula is as follows:

[0099]

[0100] in, The query and keyword keys represent the attention weights respectively. represents the attention feature vector, represents the matrix multiplication, and d h,w Represents the range of enhanced information of the local enhanced information module, Indicates that after aggregation, M i The feature point at position (h,w), W i Q , W i K , W i V is the weight of the learned attention matrix; it is worth noting that the sizes of the horizontal and vertical information feature maps of clothing and human posture do not change after the aggregation operation, respectively, where S i_v , S i_h After the local enhancement information module, the output φ after the clothing horizontal and vertical information enhancement is obtained v ,φ h ,φ v ,φ h It is the vertical and horizontal feature information enhanced by the local information of clothing; P i_v , P i_h After the local enhancement information module, the output θ after the horizontal and vertical information enhancement of the human body posture is obtained v ,θ h ,θ v ,θ h It is the vertical and horizontal feature information enhanced by the local information of human posture; their sizes are R C×H×W , where C is the number of channels of the feature map, H is the height of the feature map, and W is the width of the feature map.

[0101] S15, the multi-scale information of human posture output from the local enhancement information module is input to the global stripe information matching module. First, a length and input feature map are established according to the size of the input feature map. Figure 1 The width of the pooling window is 1 horizontally, and then a width and feature Figure 1 The length of the vertical pooling window is 1. The feature map information of the human body posture in the horizontal and vertical directions of the local enhanced feature information is input into the pooling windows in the horizontal and vertical directions respectively, and the human body posture feature maps focusing on the global feature information in the horizontal and vertical directions are obtained respectively;

[0102]

[0103] in and is the global feature map of the horizontal and vertical directions of the human body posture, θ h (m,k,n) and θ v (m,n,k) is the feature information enhanced in the horizontal and vertical directions of human posture; m, k, n represent the number of channels, height and width of the feature map respectively; θ h (m,k,n),θ v The size of (m,n,k) is R C×H×W , The size is R C×H , The size is R C×W ;

[0104] S16, φ h and φ v The size is from R C×H×W Transpose to R H×W×C ,Then the global correlation between clothing and human posture feature map is calculated, and the calculation formula is as follows:

[0105]

[0106] φ′ h and φ′ v Then add them together to get a global correlation calculation matrix F cost ∈R H ×W×(H+W) , and then through continuous convolution operations, the global appearance flow F is obtained s_i ∈R H×W×2 .

[0107] S17, by getting the appearance flow of this layer upsampled to the features of the next layer of clothing Figure 1 After that, the clothing feature map of the next layer is distorted first, and then the appearance flow of the next layer is obtained by calculation. The calculation formula is as follows:

[0108] F s_i =U i (G i (Warp(S i ,F s_(i+1) ),P i ),F s_(i+1) )

[0109] Warp means that the feature map of clothing is distorted by the appearance flow, G i (x,y) is used to calculate the global feature correlation between x and y, U i is the upsampling operation, S i is the i-th layer feature map of clothing extracted by the pyramid feature extraction network, F s_(i+1)represents the appearance flow of the i+1th layer, P i It is the i-th layer feature map of human posture extracted by the pyramid feature extraction network.

[0110] S18, deforming the clothing according to the final appearance flow, and obtaining the deformed clothing S p .

[0111] In order to ensure that the final distorted clothing has a realistic feel, the following loss function is designed:

[0112] The first-order smooth loss is used to minimize the difference between the deformed clothing and the matching clothing label. The formula is as follows:

[0113] L 1 =||S p -S label || 1

[0114] Where, L 1 is the first-order smoothing loss in the clothing deformation stage, S p It is a transformed costume, S label It's a clothing label.

[0115] Use perceptual loss to enhance the realism of the generated clothing deformation results. The formula is as follows:

[0116]

[0117] Among them, L per is the perceptual loss in the clothing deformation stage, φ m VGG19 represents the feature map of the mth layer in the pre-trained VGG19 network.

[0118] The appearance flow of deformed clothing has a large number of degrees of freedom, which may have an adverse effect when there is a significant difference in the appearance flow between adjacent pixels. This difference may cause unrealistic artifacts in the deformed clothing. This difficulty is addressed by applying a regularization constraint on the final appearance flow using a smoothness loss:

[0119]

[0120] Among them, L smt is the smoothness loss of clothing appearance flow in clothing deformation stage, F s_i is the calculated clothing appearance flow of the i-th layer, where i is the i-th layer feature map (i = 1, 2, 3, 4);

[0121] The learning objectives of the clothing deformation stage can be stated as:

[0122] L warp_loss =λ 1 ·L1 +λ per ·L per +λ smt ·L smt

[0123] Among them, L warp_loss is the total loss in the clothing deformation stage, λ 1 , per , smt They are the hyperparameters of the first-order smoothness loss, perceptual loss, and smoothness loss in the clothing deformation stage.

[0124] S2: Build a clothing virtual try-on module to generate the final user try-on results.

[0125] The virtual try-on module uses the ResUNet network to ensure the authenticity of the virtual try-on results. The ResUNet main framework consists of upsampling layers and downsampling layers, which encode and decode the input images. In addition, each module of the encoder and decoder contains residual connections, which effectively alleviates the problem of small gradients in the deep learning network. This can fully extract low-frequency information. In addition, this can also fuse contextual information, thereby effectively alleviating the problem of missing semantic information. The final result of the user trying on clothing is obtained by continuously encoding and decoding through the ResUNet network.

[0126] In order to achieve the final result of the user trying on the clothes, that is, the user's virtual trying on image has a realistic feeling, the following loss function is designed:

[0127] The first-order smoothing loss is used to ensure that the difference between the generated user's try-on image and the corresponding user's try-on result label value is minimized. The formula is as follows:

[0128] L' 1 =||P s -P label || 1

[0129] Among them, L′ 1 represents the first-order smooth loss in the clothing fitting stage, P s is a picture of the user trying on the deformed clothing, P label It is the label picture of the clothes that the user tries on;

[0130] Use perceptual loss to enhance the realism of the generated user try-on results. The formula is as follows:

[0131]

[0132] Among them, L p ' er is the perceptual loss during the clothing fitting phase, φ mVGG19 represents the feature map of the mth layer in the pre-trained VGG19 network;

[0133] The learning objectives for the clothing fitting phase can be stated as follows:

[0134] L try_on =λ' 1 ·L' 1 +λ' per ·L' per

[0135] Among them, L try_on is the total loss in the clothing fitting stage, λ′ 1 ,λ′ per They correspond to the hyperparameters of the first-order smooth loss and perceptual loss respectively.

[0136] Figure 1 In, P e P is a semantic perception graph, P p It is a picture of the model without the clothing area to be matched.

[0137] The above-mentioned embodiment only expresses one implementation mode of the present invention, and its description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.

Claims

1. A virtual fitting method based on global flow clothing transformation, characterized in that: The following steps are involved: Step 1: Input the garment to be tried on and the user image to the garment deformation module, which is used to distort the garment into the human body posture; Step 2: Input the deformed clothing and user image into the clothing virtual try-on module to generate the final user try-on effect image; Among them, the clothing deformation module is based on global appearance flow and local attention, which is used to distort the clothing to be tried on to be consistent with the human body posture; the clothing virtual try-on module is based on the U-Net network, which is used to try the deformed clothing on the user; The specific steps are as follows: Step 1.1: Collect image information of the clothing to be tried on and its mask and semantic information; collect user images and their human posture key points, human posture analysis graphs and dense posture estimation; Step 1.2: Input the collected information of the clothing to be tried on and the user image into the pyramid feature extraction network to obtain multi-scale information; The pyramid feature extraction network in step 1.2 is: The clothing information is input into a pyramid feature extraction network and the human posture feature information is input into another pyramid feature extraction network to extract the feature information of clothing and human posture respectively; the convolution kernel size of each layer of the pyramid feature extraction network is different in order to extract the multi-scale feature information of clothing and human posture; the extracted clothing and human posture feature information is 1 / 2 of the size of the previous layer, wherein the number of layers of the pyramid network in the clothing deformation fitting method based on global flow is set to 4; Step 1.3: The extracted multi-scale information of clothing and user is input layer by layer into the local enhancement information module and the global stripe information matching module to generate a multi-scale appearance stream; wherein, the pyramid feature information is input into the global enhancement information module and the appearance stream regressed by the global stripe information matching module, and is upsampled to be consistent with the clothing feature map of the next layer for deforming the clothing feature map, and then the correlation between the deformed clothing feature map and the human body posture feature information of the same layer is calculated; The local enhancement information module in step 1.3 is: The multi-scale information extracted from the pyramid is firstly used for the convolution operation with a convolution kernel of 1×1 to activate the horizontal and vertical feature information of clothing and human posture respectively; for the activated feature information, the association between adjacent regions is established through the self-attention mechanism, that is, the weak semantic feature information of the adjacent regions of the features to be matched is enhanced, which makes a great contribution to the subsequent improvement of the global stripe information matching accuracy of the multi-scale feature information of clothing and human posture; wherein, the feature information does not change after being output to the local enhancement information module and before being input; the multi-scale human posture information output from the local enhancement information module is input to the global stripe information matching module; The global stripe information matching module process in step 1.3 is as follows: First, according to the size of the input feature map, a pooling window with a length of 1 in the horizontal direction is established, and then a pooling window with a width of 1 in the vertical direction is established; the feature map information of the human body posture in the horizontal and vertical directions of the local enhanced feature information is input into the pooling windows in the horizontal and vertical directions respectively, and the human body posture feature maps focusing on the global feature information in the horizontal and vertical directions are obtained respectively; in the horizontal direction, the global matching degree is calculated between the horizontal feature map of the clothing through the local enhanced information module and the human body posture feature map focusing on the global information in the horizontal direction; in the vertical direction, the global matching degree in the vertical direction can be obtained in the same way; the global matching degree in the horizontal direction and the global matching degree in the vertical direction are superimposed, and then the global appearance flow is obtained through multi-layer convolution operation regression; Step 1.4: Generate the final clothing appearance flow to distort the deformed clothing, and obtain the final distorted deformed clothing; In step 1.4, in order to ensure that the final distorted clothing has a realistic feel, the following loss function is designed: The first-order smooth loss is used to minimize the difference between the deformed clothing and the matching clothing label. The formula is as follows: L1=||S p -S label ||1 Where L1 is the first-order smoothing loss in the clothing deformation stage, S p It is a transformed costume, S label It’s a clothing label; Use perceptual loss to enhance the realism of the generated clothing deformation results. The formula is as follows: Where L per is the perceptual loss in the clothing deformation stage, φ m VGG19 represents the feature map of the mth layer in the pre-trained VGG19 network; The appearance flow of deformed clothing has a large number of degrees of freedom, which may have an adverse effect when there is a significant difference in the appearance flow between adjacent pixels; such a difference may cause unrealistic artifacts in the deformed clothing. This difficulty is addressed by imposing a regularization constraint on the final appearance flow using a smoothness loss: Among them, L smt is the clothing appearance flow smoothing loss in the clothing deformation stage, F s_i is the appearance flow, i represents the i-th iteration of the appearance flow, i = 1, 2, 3, 4; The learning objectives of the clothing deformation stage can be stated as: L warp_loss =λ1·L1+λ per ·L per +λ smt ·L smt Among them, L warp_loss is the total loss in the clothing deformation stage, λ1, λ per , smt Hyperparameters corresponding to first-order smooth loss, perceptual loss, and smooth loss respectively; The U-Net-based clothing virtual try-on process in step 2 is: Step 2.1: Input the deformed clothing and information containing human body posture features into the virtual fitting module; Step 2.2: The virtual try-on module uses the ResUNet network to ensure the authenticity of the virtual try-on results. The ResUNet main framework consists of upsampling layers and downsampling layers to encode and decode the input image. In addition, each module of the encoder and decoder contains residual connections to effectively alleviate the problem of small gradients in the deep learning network. This can fully extract low-frequency information. In addition, this can also enable the fusion of contextual information, thereby effectively alleviating the problem of missing semantic information. The final result of the user trying on clothing is obtained by continuously encoding and decoding through the ResUNet network; In step 2.2, in order to achieve the final result of the user trying on the clothes, that is, the user's virtual trying on image has a realistic feeling, the following loss function is designed: The first-order smoothing loss is used to ensure that the difference between the generated user's try-on image and the corresponding user's try-on result label value is minimized. The formula is as follows: L′1=||P s -P label ||1 Among them, L′1 represents the first-order smoothing loss in the clothing fitting stage, P s is a picture of the user trying on the deformed clothing, P label It is the label picture of the clothes that the user tries on; Use perceptual loss to enhance the realism of the generated user try-on results. The formula is as follows: Among them, L p ' er is the perceptual loss during the clothing fitting phase, φ m VGG19 represents the feature map of the mth layer in the pre-trained VGG19 network; The learning objectives for the clothing fitting phase can be stated as follows: L try_on λ′1·L1′+λ′ per ·L′ per Among them, L try_on is the total loss in the clothing fitting stage, λ′1, λ′ per They correspond to the hyperparameters of the first-order smooth loss and perceptual loss respectively.

2. The virtual fitting method based on global flow clothing transformation according to claim 1 is characterized in that: The specific implementation process of step 1 is as follows: Construct a clothing deformation module to distort the clothing to be tried on input by the user to be consistent with the user's image posture; First, input the clothing to be tried on and the user image. For the clothing image, extract its mask and semantic information; for the input user image, collect its human posture key points, human posture analysis diagram and dense posture estimation information; The obtained clothing information is input into the pyramid feature extraction network to obtain the multi-scale information of clothing; the obtained human posture information is input into the pyramid feature extraction network to obtain the multi-scale information of human posture; the size of the collected multi-scale information is 1 / 2 of the previous layer, and the expression formula is as follows: {P1,P2,...,P n }=FPN_P(P) {S1,S2,...,S n }=FPN_S(S) Among them, FPN_P and FPN_S represent the feature extraction networks of posture and clothing respectively, P and S represent human posture and clothing respectively, and n=4; In step 1.3, the multi-scale clothing and human posture feature information obtained in step 1.2 is respectively activated in the horizontal and vertical directions through a convolution layer with a convolution kernel size of 1×1: S i_v =E1(S4 / S i_warped ); S i_h =E1(S4 / S i_warped ); P i_v =E1(P i ); P i_h =E1(P i ); Among them, E1 is a convolution layer with a convolution kernel of 1×1 size, S i_v , S i_h are the vertical and horizontal feature information of the clothing, P i_v , P i_h They are the vertical and horizontal feature information of human posture, S4 represents the top feature map extracted by the pyramid feature extraction network, S i_warped represents the clothing feature map after being distorted by the appearance flow, i represents the feature map of the first layer, S i_warped where i = 3, 2, 1, P i Represents the multi-layer feature map extracted by the pyramid feature extraction network. i i=4, 3, 2, 1; In step 1.3, the horizontal and vertical feature information S of clothing and human posture is obtained through a 1×1 convolution kernel i_h , S i_v , P i_h , P i_v Input to the local enhancement information module, and enhance the weak semantic feature information to improve the ability of clothing to find matching human posture feature information. The calculation formula is as follows: in, The query and keyword keys represent the attention weights respectively. represents the attention feature vector, represents the matrix multiplication, and d h,w Represents the range of enhanced information of the local enhanced information module, Indicates that after aggregation, M i The feature point at position (h,w), W i Q , W i K , W i V is the weight of the learned attention matrix; it is worth noting that the sizes of the horizontal and vertical information feature maps of clothing and human posture do not change after the aggregation operation, respectively, where S i_v , S i_h After the local enhancement information module, the output φ after the clothing horizontal and vertical information enhancement is obtained v ,φ h ,φ v ,φ h It is the vertical and horizontal feature information enhanced by the local information of clothing; P i_v , P i_h After the local enhancement information module, the output θ after the horizontal and vertical information enhancement of the human body posture is obtained v ,θ h ,θ v ,θ h It is the vertical and horizontal feature information enhanced by the local information of human posture; their sizes are R C×H×W , where C is the number of channels of the feature map, H is the height of the feature map, and W is the width of the feature map; The multi-scale information of human posture outputted from the local enhancement information module is inputted into the global stripe information matching module; firstly, a pooling window with a length consistent with the input feature map and a width of 1 in the horizontal direction is established according to the size of the input feature map, and secondly, a pooling window with a width consistent with the feature map and a length of 1 in the vertical direction is established; the feature map information of the human posture in the horizontal and vertical directions of the local enhancement feature information is respectively inputted into the pooling windows in the horizontal and vertical directions, and the human posture feature maps focusing on the global feature information in the horizontal and vertical directions are respectively obtained; in and is the global feature map of the horizontal and vertical directions of the human body posture, θ h (m,k,n) and θ v (m,n,k) is the feature information enhanced in the horizontal and vertical directions of human posture; m, k, n represent the number of channels, height and width of the feature map respectively; θ h (m,k,n),θ v The size of (m,n,k) is R C×H×W , The size is R C×H , The size is R C×W ; φ h and φ v The size is from R C×H×W Transpose to R H×W×C ,Then the global correlation between clothing and human posture feature map is calculated, and the calculation formula is as follows: φ' h With φ' v Then add them together to get a global correlation calculation matrix F cost ∈R H×W×(H+W) , and then through continuous convolution operations, the global appearance flow F is obtained s_i ∈R H×W×2 ; After the appearance flow of this layer is upsampled to be consistent with the feature map of the next layer of clothing, the clothing feature map of the next layer is first distorted, and then the appearance flow of the next layer is obtained by calculation. The calculation formula is as follows: F s_i =U i (G i (Warp(S i ,F s_(i+1) ),P i ),F s_(i+1) ) Warp means that the feature map of clothing is distorted by the appearance flow, G i (x,y) is used to calculate the global feature correlation between x and y, U i is the upsampling operation, S i is the i-th layer feature map extracted by the pyramid feature extraction network, F s_(i+1) represents the appearance flow of the i+1th layer, P i is the i-th layer feature map extracted by the pyramid feature extraction network; The clothing is deformed for the final appearance flow, and the deformed clothing S is obtained. p .