Lightweight diffusion virtual fitting algorithm for high-resolution clothing human body image

By using a lightweight diffusion virtual try-on algorithm, combined with a flow-based clothing deformation module, a diffusion try-on module, and a Poisson fusion module, the problems of detail loss and high computational resource consumption in high-resolution virtual try-on are solved, achieving an efficient and detail-preserving virtual try-on effect.

CN121707676APending Publication Date: 2026-03-20XI'AN POLYTECHNIC UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511827701.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing virtual try-on methods based on generative adversarial networks suffer from detail loss and visual artifacts in high-resolution scenes. Traditional diffusion models are large in size, have high computational resource requirements, and are difficult to preserve local features.

Method used

A lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images is designed. It adopts a flow-based clothing deformation module, a diffusion try-on module, and a Poisson fusion-based feature fusion module, combined with DWSA attention blocks and the Poisson equation to optimize the image generation process.

Benefits of technology

It significantly improves the visual quality of generated images, solves the problems of detail loss and visual artifacts, reduces the computational resource requirements, preserves local feature details, and achieves efficient high-resolution virtual try-on.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121707676A_ABST
    Figure CN121707676A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight diffusion virtual fitting algorithm for a high-resolution clothing human body image. The algorithm specifically comprises the following steps: step 1, acquiring a disclosed high-resolution virtual fitting data set; 2, preprocessing the clothing image and the reference figure image in the high-resolution virtual fitting data set obtained in the step 1 to obtain a figure image irrelevant to clothing; 3, constructing a lightweight diffusion virtual fitting model aiming at the high-resolution clothing human body image, and designing a required loss function; and step 4, training the lightweight diffusion virtual fitting model for the high-resolution clothing human body image by using the high-resolution clothing human body data set in the step 1. According to the method, the problems of detail loss and visual artifacts in a high-resolution scene in a virtual fitting method based on the generative adversarial network are solved, and the defects that a traditional diffusion model is huge in volume, high in computing resource demand and difficult to retain local features are overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision, and more specifically to a lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images. Background Technology

[0002] With the rapid development of e-commerce and the growing demand for personalized shopping experiences, Virtual Try-On (VTON) technology has become a research hotspot in computer vision and artificial intelligence. This technology allows consumers to preview the wearing effect of clothing without physically trying it on by seamlessly synthesizing the target garment into the user's image, significantly reducing online shopping return rates and improving user experience. Although virtual try-on methods based on Generative Adversarial Networks (GANs) have achieved some success, they often suffer from detail loss and visual artifacts in high-resolution scenes. Diffusion models, with their advantages in high-quality image generation, have brought new opportunities to virtual try-on. However, the large size of these models, high computational resource requirements, and difficulty in preserving local features limit their practical application.

[0003] Against the backdrop of the development of deep learning technology, Generative Adversarial Networks (GANs) have been widely used in the field of virtual try-on due to their powerful image generation capabilities. Some of the related works are: CAGAN (Jetchev N, Bergmann U. The conditional analogy gan: Swappingfashionarticles on people images[C] / / Proceedings of the IEEE InternationalConference on Computer Vision Workshops.2017:2287-2292[DOI: 10.1109 / ICCVW.20-17.269].), VITON (Han X, Wu Z, Wu Z, et al. al. Viton: An image-based virtual try-on network[C] / / Proceedings of the IEEE conference on computer vision and pattern recognition. 2018: 7543-7552.[DOI:10.1109 / CVPR.2018.00787].), CP-VTON (Wang B, Zheng H, Liang X, et al. Toward characteristic-preserving image-based virtual try-on network[C] / / Proceedings of the European Conference on Computer Vision (ECCV). 2018: 589-604.), VITON-HD (Choi S, Park S, Lee M, etal. Viton-hd: High-resolution virtual try-on via misalignment-awarenormalization[C] / / Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition. 2021: 14131-14140.[DOI:10.1109 / CVPR46437.2021.01391].)、SAL-VTON (Yan K, Gao T, Zhang H, et al. LinkingGarment With Person via Semantically Associated Landmarks for Virtual Try-On[C] / / Proceedings of the IEEE / CVF Conference on Computer Vision and PatternRecognition. 2023: 17194-17204.[DOI: 10.1109 / CVPR52729.2023.01649].)、COTTON(Chen C Y, Chen Y C, Shuai H H, et al. Size Does Matter: Size-aware VirtualTry-on via Clothing-oriented Transformation Try-on Network[C] / / Proceedings ofthe IEEE / CVF International Conference on Computer Vision. 2023: 7513-7522.[DOI: 10.1109 / ICCV51070.2023.00691].)、GP-VTON (Xie Z Y, Huang Z Y, Dong X, etal. GP-VTON: Towards General Purpose Virtual Try-on via Collaborative Local-Flow Global-Parsing Learning. In CVPR,2023: 23550-23559. [DOI: 10.1109 / CVPR52729.2023.02255].)。.

[0004] CAGAN was the first to formalize virtual try-on as an image-to-image transformation task, enabling the swapping of clothing between two images of a person. VITON employs a coarse-to-fine strategy to seamlessly map clothing onto corresponding areas of the human body, overcoming the problem of insufficient training triplet data; however, the synthesized effect lacks realism and suffers from significant loss of detail. CP-VTON introduces a learnable geometric matching module (GMM) to estimate the thin-plate-spline (TPS) parameters, alleviating the problem of clothing feature preservation caused by directly calculating TPS parameters in VITON, achieving more accurate clothing deformation and texture preservation. VITON-HD proposes the ALIAS (ALIgnment-Aware Segment) normalization method for high-resolution (1024×768) datasets, reducing pixel artifacts in misaligned areas, but unnatural filling issues still exist in severely misaligned areas. SAL-VTON guides local deformation and size adjustment by defining semantic landmark pairs between clothing and try-on images; COTTON combines landmarks and segmentation maps to achieve precise deformation guidance; GP-VTON decouples the deformation process using Local Flow and Global Resolution (LFGP) modules and employs Dynamic Gradient Truncation (DGT) strategy to prevent texture compression in overlapping areas; SD-VITON decomposes the appearance flow into a Target Dominant (TVOB) layer and a Task Coexistence (TACO) layer to alleviate texture collapse problems in areas such as cuffs. Despite continuous iterative optimization, these methods still suffer from performance instability when faced with highly complex textures and poses, making it difficult to meet the demands of high-quality, high-resolution virtual try-on.

[0005] Diffusion models, as a generative framework based on Markov chains, have made continuous breakthroughs in image synthesis tasks since their introduction by Ho et al., especially after the advent of Denoising Diffusion Probabilistic Models (DDPM), whose applications in high-resolution and multimodal generation have been continuously expanding. Rombach's Latent Diffusion Models (LDM) achieve high-resolution, high-fidelity image synthesis while reducing computational costs by performing a diffusion process in a compressed latent space, thus driving the emergence of virtual try-on methods based on diffusion models. These methods exhibit significant advantages in image fidelity and generation stability.

[0006] Related representative works include: DCI-VTON (Gou J, Sun S, Zhang J, et al. Taming the power of diffusion models for high-quality virtual try-on with appearance flow[C] / / Proceedings of the 31st ACM International Conference on Multimedia. 2023: 7599-7607. [DOI:10.1145 / 3581783.3612255].), MGD (Baldrati A, Morelli D, Cartella G, et al. Multimodal garment designer: Human-centric latent diffusion models for fashion image editing[C] / / Proceedings of the IEEE / CVF International conference on computer vision. 2023: 23393-23402. [DOI:10.1109 / ICCV51070.20-23.02138].), LaDI-VTON (Morelli D, Baldrati A, Cartella G, et al. Ladi-vton: Latent diffusion textual-inversion enhanced virtual try-on[C] / / Proceedings of the 31st ACM international conference on multimedia. 2023: 8580-8589.), TryOnDiffusion (Zhu L, Yang D, Zhu T, et al. Tryondiffusion: A tale of two unets[C] / / Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2023: 4606-4615. [DOI: 10.1109 / CVPR52729.2023.00447].), CAT-DM (Zeng J, Song D, Nie W, et al.Cat-dm: Controlable accelerated virtual try-on with diffusion model[C] / / Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2024:8372-8382. [DOI: 10.1109 / CVPR52733.2024.00800].), StableVITON (Kim J, Gu G,Park M, et al. Stableviton: Learning Semantic correspondence with latentdiffusion model for virtual try-on[C] / / Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2024: 8176-8185. [DOI: 10.1109 / CVPR52733.2024.00781].). .

[0007] DCI-VTON and MGD directly use a pre-trained CLIP encoder to extract texture features from the reference garment; LaDI-VTON introduces a text inversion module, mapping the visual features of the garment to the CLIP tag embedding space, generating pseudo-word tag embeddings to provide conditions for the diffusion process, enhancing the encoding and expressive power of garment image features. Some studies have integrated Vision Transformer or auxiliary U-Net into the model to better capture high-frequency texture and local structural features; TryOnDiffusion proposes a parallel UNet architecture, using a cross-attention mechanism to synchronously complete garment deformation and detail preservation within the same network, achieving end-to-end human-garment fusion; CAT-DM integrates ControlNet to strengthen conditional control over key points and poses, and uses a pre-trained GAN implicit distribution to accelerate reverse denoising, reducing the sampling steps in the diffusion process; StableVITON learns the semantic correspondence between garment and human body in the latent space of a pre-trained diffusion model, introducing zero-cross attention blocks and total variational loss of attention to improve the detail fidelity of the generated image.

[0008] However, despite the progress made in image quality by virtual try-on methods based on diffusion models, the efficient generation of high-fidelity try-on images remains largely unexplored. Existing methods often rely on large-scale pre-trained models to extract overall semantics, making it difficult to preserve high-frequency local information such as stripes, wrinkles, and patterns. They lack effective modeling mechanisms for these detailed features, resulting in insufficient local realism in the generated images. Furthermore, the computational complexity of traditional global self-attention mechanisms increases quadratically when processing high-resolution images, significantly increasing training and inference costs. These problems urgently require further solutions. Summary of the Invention

[0009] The purpose of this invention is to provide a lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images. It aims to solve the problems of detail loss and visual artifacts that often exist in virtual try-on methods based on generative adversarial networks (GANs) in high-resolution scenes, as well as the shortcomings of traditional diffusion models, such as large size, high computational resource requirements, and difficulty in preserving local features.

[0010] The technical solution adopted in this invention is a lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images, specifically: Step 1: Obtain publicly available high-resolution virtual try-on datasets; Step 2: Preprocess the clothing images and reference person images in the high-resolution virtual try-on dataset obtained in Step 1 to obtain person images unrelated to clothing. Step 3: Construct a lightweight diffusion virtual try-on model for high-resolution clothing and human body images, and design the required loss function; Step 4: Train a lightweight diffusion virtual try-on model for high-resolution clothing and human body images using the high-resolution clothing and human body dataset from Step 1.

[0011] The invention is further characterized in that: In step 1, VITON-HD is selected as the clothing and human body dataset required for virtual try-on. The clothing and human body dataset required for virtual try-on includes clothing image C and reference human body image. .

[0012] Step 2 specifically involves: for the reference image... Images of clothing Openpose uses a human body parser and pose estimator to obtain a reference human image. Human body segmentation diagram of Chinese figures Clothing Images mask Reference figures attitude diagram Remove human body segmentation map and reference figures From the clothing area and the arm area containing sleeve length information, a human body segmentation map independent of clothing is obtained. Color illustrations .

[0013] In step 3, the lightweight diffusion virtual try-on model for high-resolution clothing and human body images consists of a flow-based clothing deformation module, a diffusion try-on module, and a feature fusion module based on Poisson fusion.

[0014] Step 3.1: Construct a flow-based clothing deformation module and design the loss function for the flow-based clothing deformation module during training; Step 3.2: Construct the diffusion trial module and design the loss function for the diffusion trial module during training; Step 3.3: Construct a feature fusion module based on Poisson fusion.

[0015] In step 3.1, the flow-based clothing deformation module consists of two encoders, which extract multi-level features. The encoder is composed of The feature pyramid is composed of residual blocks containing downsampling layers, and the output features form the feature pyramid. Add total variational loss to the training of the flow-based clothing deformation module. Total variational loss Specifically, it is calculated using the following formula: (1) In the formula, This represents the total variational loss; This represents the summation of the flow field losses from layer 1 to layer N; Indicates the first Layer smoothness Find the gradient; This indicates L1 norm operation, which involves calculating the L1 norm of the gradient result to constrain the smoothness of the flow field; Second-order smoothing constraint loss was also introduced. Second-order smoothing constraint loss The calculation method is as follows: (2) In the formula, This represents the second-order smoothing constraint loss; This represents the summation of the flow field losses from layer 1 to layer N; This represents summing over each point t in the i-th layer of the flow field; This represents the summation of π over each neighborhood π in the neighborhood set of point t; It is the generalized Charbonnier loss function, where This represents the t-th point in the flow field diagram; Let represent the set of the neighborhood around the t-th point in the horizontal, vertical, and two diagonal directions; In addition, it is also used in training. Loss and perceived loss The definitions of the two are as follows: (3) (4) In the formula, and They represent Mask and Clothing as a cover; Represents the transformation function, Represents the downsampling function; This indicates the first [unit / level] in the VGG-19 network pre-trained on ImageNet. Each feature map; Based on the above considerations, the total loss function of the entire flow-based clothing deformation module is determined. The expression is: (5) In the formula, , , , This represents a hyperparameter that controls the weights between different losses; After constructing the flow-based clothing deformation module, the human body segmentation map is... With attitude diagram Connect, and then with the clothing image. Together, they are input into a flow-based garment deformation module to predict the appearance flow field and obtain the deformed garment image. Then, the deformed clothing image The color image obtained in step 2 Combined, a rough fitting result image is generated. .

[0016] In step 3.2, the diffusion try-on module is generated by a pre-trained encoder. UnetModel block and pre-trained decoder composition; The process of the diffusion try-on module for processing image data is as follows: First, it uses a pre-trained encoder... The rough fitting result image obtained in step 3.1 The process maps from the image space to the latent space, using the latent representation of the coarse fitting result as the starting point for the diffusion process to obtain a noisy coarse fitting result image. Subsequently, the noisy coarse fitting result image is concatenated with a downsampled mask and combined with clothing features extracted by CLIP, serving as input to the UnetModel block. During the diffusion process, latent variables are progressively denoised and optimized to generate a synthetic image. After obtaining the noise predicted by the model, the denoised refined latent variables are obtained through inverse operations, and a pre-trained decoder is then used. Restore the final fitting image result; The UnetModel block of the diffusion trial module includes a multi-level upsampling module, a downsampling module, and an intermediate block. The upsampling module contains 4 levels, the downsampling module contains 4 levels, the number of channels gradually increases, and then a DWSA attention block is introduced at the corresponding feature map size. The intermediate block further extracts deep features. The upsampling module and the downsampling module are symmetrical. The DWSA attention block consists of a dynamic window attention layer and a cross attention layer. The specific operation of DWSA attention block processing of image data is as follows: The input feature map x of the UNetModel upsampling block is first normalized and then dimensionally matched by 1×1 convolution to project the number of channels. Then it enters the dynamic window self-attention layer. Based on the dynamic window size and overlap ratio, local self-attention is calculated in parallel on the projected feature map. Next, the self-attention output sequence is fed into the cross-attention layer. The cross-attention layer injects clothing feature information for weighted reconstruction output so that the image features are aligned and fused with the clothing features, thereby achieving accurate alignment and detail supplementation. Finally, after two layers of feedforward network and zero-initialized 1×1 convolution mapping, it is added to the residual branch to complete a closed loop of "attention enhancement + feedforward + residual". After constructing the diffusion trial module, the loss function for its training process is designed. The diffusion trial module uses an objective function for end-to-end training, the specific expression of which is: (6) In the formula, This represents the total loss function of the diffusion trial module. , The model is based on the input Potential characteristics of clothing Downsampling mask Overall conditions of clothing and time step Predicted noise, It is a hyperparameter used to balance these two types of losses.

[0017] In step 3.3, the feature fusion module based on Poisson fusion uses a seamless fusion method based on the Poisson equation to achieve continuous transition of color and texture and seamless integration of input and generated images by minimizing the L2 norm difference between the gradient of the target region and the gradient of the source region. The process of image data processing by the feature fusion module based on Poisson fusion is as follows: The generated image from the diffusion try-on module is given, and the input reference image is the original image. The area to be integrated is The boundary is ; at the border Above, the fused image With the original image Completely overlap to ensure seamless connection at the fusion point; after discretization, for each pixel ,make Representing the set of its four neighboring pixels, we obtain the discrete Poisson equation, the specific expression of which is: (7) In the formula, Indicates the area to be merged A specific pixel position within; This indicates that the fused image F is at the pixel point Pixel values; Indicates the fused image F in One of my neighbors Pixel values ​​in (four neighboring regions); Represents the original image G in pixels Pixel values; Original image G in pixels Neighbors Pixel value at; left side For the merged image In position Discrete Laplace operator value at, right side This is the original image. exist with his neighbors The sum of the first-order differences between them represents the original image in... Gradient distribution within.

[0018] The beneficial effects of this invention are: This invention employs a compact UNetModel backbone network and introduces a lightweight attention optimization strategy to enhance feature representation capabilities. This significantly reduces training and inference time while substantially improving the visual quality of generated images. It addresses the issues of detail loss and visual artifacts in high-resolution scenes in virtual try-on methods based on generative adversarial networks, as well as the drawbacks of traditional diffusion models, such as large size, high computational resource requirements, and difficulty in preserving local features. In the final fusion stage, a Poisson fusion method is used to effectively suppress unnatural gaps and artifacts, ensuring smooth clothing-human body fusion while preserving detailed features such as skin contours and body posture, further reducing boundary issues in the generated images. Attached Figure Description

[0019] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a comparison of the effectiveness of the method in this invention with a GAN-based virtual fitting method; Figure 3 This refers to the preprocessing operation of the input image in the method of the present invention; Figure 4 This is a diagram of the overall network architecture in the method of the present invention; Figure 5 This is a network architecture diagram of the diffusion generation module in the method of the present invention; Figure 6 This is a detailed architecture diagram of DWSA in the method of the present invention; Figure 7 This is a schematic diagram of the dynamic attention mechanism in the method of the present invention. Figure 8 This is a comparison chart showing the effects of the feature fusion method based on Poisson fusion in this invention and the traditional direct fusion method; Figure 9 The results are inferences on the test set for the method of this invention, the GAN-based fitting method, and other diffusion model-based methods. Figure 10 The method of this invention adjusts the parameter values ​​and visualizes the inference, training time and evaluation metrics of the baseline method on the dataset. Figure 11 These are the ablation experiment results of the method of the present invention. Detailed Implementation

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

[0021] This invention provides a lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images, such as... Figure 1 As shown, specifically: Step 1: Obtain publicly available high-resolution virtual try-on datasets; In step 1, VITON-HD is selected as the clothing and human body dataset required for virtual try-on. The clothing and human body dataset required for virtual try-on includes clothing image C and reference human body image. The clothing images in this dataset are used This indicates that the reference image is used. This dataset is an authoritative dataset designed specifically for high-resolution virtual try-on tasks, containing 13,679 pairs of human images and corresponding clothing images, with a resolution of up to 1024×768, 16 times that of traditional datasets. The data was collected from real street photography and commercial platforms, covering human figures of different genders, ages, and body types, as well as various clothing styles. Complex poses (such as sideways turns and raised arms) and lighting conditions further enhance the model's generalization ability.

[0022] Step 2: Preprocess the clothing images and reference person images in the high-resolution virtual try-on dataset obtained in Step 1 to obtain person images unrelated to clothing, so as to eliminate the influence of the original target person's clothing on subsequent try-on steps.

[0023] Step 2 is as follows: The clothing images and reference person images in the high-resolution virtual try-on dataset obtained in step 1 are preprocessed to obtain human body images unrelated to the clothing, thus eliminating the influence of the original clothing worn by the target person on subsequent try-on steps. (See...) Figure 3 As shown, the specific operation is as follows: For the reference image... Images of clothing Openpose uses a human body parser and pose estimator to obtain a reference human image. Human body segmentation diagram of Chinese figures Clothing Images mask Reference figures attitude diagram Remove human body segmentation map and reference figures From the clothing area and the arm area containing sleeve length information, a human body segmentation map independent of clothing is obtained. Color illustrations .

[0024] Step 3: Construct a lightweight diffusion virtual try-on model for high-resolution clothing and human body images, and design the required loss function; In step 3, the lightweight diffusion virtual try-on model for high-resolution clothing and human body images consists of a flow-based clothing deformation module, a diffusion try-on module, and a Poisson fusion-based feature fusion module. Its overall network structure is as follows: Figure 4As shown, the lightweight diffusion virtual try-on model for high-resolution clothing and human body images consists of two processes: clothing deformation and diffusion refinement. First, the clothing deformation module spatially deforms the clothing based on its pose to generate a rough try-on result. Then, the diffusion try-on module refines the repaired area to obtain the final try-on image. During the deformation stage, the... This involves connecting a segmentation map unrelated to the clothing with a dense pose map, then inputting this image along with the clothing into a clothing deformation module to predict the appearance flow field and obtain the deformed clothing. The deformed clothing... And characters unrelated to clothing Combined with the generated rough fitting results Then, the coarse result is refined by noise reduction through the diffusion try-on module. The coarse try-on result image is then injected into the diffusion generation module, and the tried-on clothing is introduced as a global condition through the DWSA attention mechanism to guide the generation of details such as the texture and color of the clothing, resulting in a more refined try-on result. .

[0025] Step 3.1: Construct a flow-based clothing deformation module and design the loss function for the flow-based clothing deformation module during training; In step 3.1, the flow-based clothing deformation module consists of two encoders, which extract multi-level features. The encoder is composed of ( =5) residual blocks containing downsampling layers, the output features form a feature pyramid; the flow field predicted in each layer of the encoder. It will be passed to the next layer for optimization before output. until the final output stream is obtained. Final output It is a set of two-dimensional coordinate vectors, where each vector indicates the clothing image that should be used. Which pixels in the image are used to fill the reference person image? The corresponding position in; After constructing the flow-based clothing deformation module, the loss function of the flow-based clothing deformation module during the training process is designed. In the constructed flow-based garment deformation module, to address the issue of uneven deformation caused by the high degree of freedom of the appearance flow, a total variational loss is incorporated into the training of the flow-based garment deformation module. Total variational loss Specifically, it is calculated using the following formula: (1) In the formula, This represents the total variational loss, used to constrain the smoothness of the flow field; This represents the summation of the flow field losses from layer 1 to layer N; Indicates the first Layer smoothness Find the gradient; This indicates the L1 norm operation, which calculates the L1 norm on the gradient result to constrain the smoothness of the flow field.

[0026] Second-order smoothing constraint loss was also introduced. This further enhances the smoothness of the flow field, with second-order smoothing constraint loss. The calculation method is as follows: (2) In the formula, This represents the second-order smoothing constraint loss; This represents the summation of the flow field losses from layer 1 to layer N; This represents summing over each point t in the i-th layer of the flow field; This represents the summation of π for each neighborhood in the neighborhood set of point t (including horizontal, vertical, and diagonal neighborhoods); It is the generalized Charbonnier loss function, where This represents the t-th point in the flow field diagram. Let represent the set of the neighborhood around the t-th point in the horizontal, vertical, and two diagonal directions; In addition, to ensure that the deformed clothing retains its original texture while better conforming to the human body, it is also used in training. Loss and perceived loss The definitions of the two are as follows: (3) (4) In the formula, and They represent Mask and Clothing as a cover; Represents the transformation function, Represents the downsampling function; This indicates the first [unit / level] in the VGG-19 network pre-trained on ImageNet. Each feature map; Based on the above considerations, the total loss function of the entire flow-based clothing deformation module is determined. The expression is: (5) In the formula, , , , This represents the hyperparameter that controls the weights between different losses.

[0027] After constructing the flow-based clothing deformation module, the input clothing image... The deformed clothing image is obtained by deforming the clothing using a flow-based clothing deformation module, and then combined with the clothing-independent human body image obtained in step 2 to obtain a rough fitting result. Figure 4 As shown, the human body segmentation diagram With attitude diagram Connect, and then with the clothing image. Together, they are input into a flow-based garment deformation module to predict the appearance flow field and obtain the deformed garment image. Then, the deformed clothing image The color image obtained in step 2 Combined, a rough fitting result image is generated. ; Step 3.2: Construct the diffusion trial module and design the loss function for the diffusion trial module during training; In step 3.2, as Figure 5 As shown, the diffusion try-on module consists of a pre-trained encoder. UnetModel block and pre-trained decoder composition; The process of the diffusion try-on module for processing image data is as follows: First, it uses a pre-trained encoder... The rough fitting result image obtained in step 3.1 Mapping from the image space to the latent space, the latent representation of the coarse fitting result is used as the starting point for the diffusion process to obtain a noisy coarse fitting result image. Subsequently, the noisy coarse fitting result image is concatenated with a downsampled mask and combined with clothing features extracted by CLIP, serving as input to the UnetModel block. During the diffusion process, latent variables are progressively denoised and optimized to generate a more realistic and detailed synthetic image. After obtaining the noise predicted by the model, the denoised refined latent variables are obtained through inverse operations, and a pre-trained decoder is used. Restore the final fitting image result; like Figure 5 As shown, the UnetModel block of the diffusion trial module includes a multi-level upsampling module, a downsampling module, and an intermediate block. The upsampling module contains 4 levels, and the downsampling module contains 4 levels, with the number of channels gradually doubling. Then, a DWSA attention block is introduced at the corresponding feature map size to enhance the model's ability to perceive key regions. The intermediate block further extracts deep features. The upsampling module is symmetrical to the downsampling module. Through the multi-level downsampling module and upsampling module structure, combined with residual blocks and attention mechanisms, high-quality image results can be generated. To enhance the style consistency and detail reproduction capabilities of the generated images, a DWSA attention block is introduced into the UnetModel block of the diffusion try-on module. The DWSA attention block consists of a dynamic window attention layer and a cross-attention layer. It's an attention mechanism introduced into the upsampling and downsampling blocks of the UnetModel block in the diffusion try-on module. The feature map of the UnetModel block is first input to the dynamic window self-attention layer, and then to the cross-attention layer. The DWSA attention block can adaptively adjust the window size according to the input feature map size and introduce overlapping regions through an adjustable overlap ratio to enhance contextual modeling capabilities. This achieves an excellent balance between computational and generation costs while maintaining the quality of generated details.

[0028] The specific steps of DWSA attention block processing image data are as follows: Figure 6 As shown, specifically: the input feature map x of the UNetModel upsampling block is first normalized and then dimensionality matched by channel number projection with a 1×1 convolution. It then enters a dynamic window self-attention layer, where local self-attention is computed in parallel on the projected feature map based on the dynamic window size and overlap ratio. Next, the self-attention output sequence is fed into a cross-attention layer, where clothing feature information is injected for weighted reconstruction output, aligning and fusing image features with clothing features, thus achieving precise alignment and detail enhancement. In this way, at each attention injection level, the UNetModel can perform both self-attention to integrate information within the space and cross-modal cross-attention, rationally fusing human and clothing features. Finally, after two layers of feedforward network and a zero-initialized 1×1 convolution mapping, it is added to the residual branch, completing a closed loop of "attention enhancement + feedforward + residual". Figure 7 In the DWSA shown, the core window size of the dynamic window attention block is determined by the `window_size` and `overlap_ratio` passed during construction. The `overlap_ratio` allows for flexible adjustment of the `overlap_win_size`, which determines how many surrounding pixels each query window additionally pulls as context when extracting Key / Value pairs. This mitigates the boundary effects that "windowed attention" might cause, ensuring seamless information exchange between overlapping windows. With the same proportion of layers, DWSA can exchange information earlier and more smoothly between local and neighboring regions, achieving more continuous local-cross-window-global information flow.

[0029] After constructing the diffusion trial module, the loss function for its training process is designed. Overall, the diffusion trial module uses an objective function for end-to-end training, specifically expressed as follows: (6) In the formula, This represents the total loss function of the diffusion trial module. , The model is based on the input Potential characteristics of clothing Downsampling mask Overall conditions of clothing and time step The predicted noise is reconstructed using a loss function designed to make the noise predicted by the model approximate the actual noise, thereby achieving denoising and image generation. The loss measure is used to measure the difference between the generated image and the real image in the VGG-19 feature space, aiming to make the generated image more perceptually similar to the real image. These are hyperparameters used to balance these two types of losses; Step 3.3: Construct a feature fusion module based on Poisson fusion; In step 3.3, the feature fusion module based on Poisson fusion uses the Poisson Seamless Cloning method to achieve continuous transitions in color and texture and seamless integration of the input and generated images by minimizing the L2 norm difference between the gradients of the target and source regions. The final fusion stage of virtual try-on requires seamlessly pasting the try-on area generated by the diffusion model onto the reference image; that is, using the generated result within the clothing area and maintaining the original image in the remaining areas. However, if... Figure 8 As shown, for the latent diffusion model, a pre-trained encoder is used to encode the image into a low-dimensional latent space. Then, the proposed DWSA attention blocks are used to replace the attention blocks in the input, intermediate, and output layers of the original model, thus significantly reducing the computational cost. However, this replacement introduces pixel loss to some extent, especially in detailed areas such as the hands and eyes of the portrait, leading to a decrease in the fidelity of the reconstructed image in these areas, thereby affecting the realism of the try-on effect. We introduce a Poisson Seamless Cloning method based on the Poisson equation.

[0030] The process of image data processing by the feature fusion module based on Poisson fusion is as follows: The generated image from the diffusion try-on module is given, and the input reference image is the original image. The area to be merged (mask) is The boundary is We hope to solve for the fused image. This makes it possible to integrate the region For each pixel within the range, its Laplacian operator satisfies the same gradient as the original image. At the boundary... Above, the fused image With the original image Complete overlap is required to ensure seamless connection at the fusion point; after discretizing the above continuous optimization problem, for each pixel... ,make Representing the set of its four neighboring pixels, we obtain the discrete Poisson equation, the specific expression of which is: (7) In the formula, Indicates the area to be merged A specific pixel position within; This indicates that the fused image F is at the pixel point Pixel values; Indicates the fused image F in One of my neighbors Pixel values ​​in (four neighboring regions); Represents the original image G in pixels Pixel values; Original image G in pixels Neighbors Pixel value at; left side For the merged image In position Discrete Laplace operator value at, right side This is the original image. exist with his neighbors The sum of the first-order differences between them represents the original image in... Gradient distribution within.

[0031] By solving this discrete Poisson equation, the gradient field of the original image can be injected into... This allows for a smooth transition at the edges while preserving the original texture and details. For example... Figure 8 As shown, the Poisson fusion method achieves a smooth transition at the edges, effectively preserving the features of human body parts (such as the ring on the hand), seamlessly integrating the generated clothing area into the original image, and also solving the problem of traces caused by image stitching.

[0032] The lightweight diffusion virtual try-on model constructed for high-resolution clothing and human body images uses the Poisson mixing method in the final fusion stage, which better preserves the human body features of non-clothing parts, effectively suppresses unnatural gaps and artifacts, and ensures smooth clothing and human body fusion, further reducing the boundary problems of the generated images.

[0033] Step 4: Using the lightweight diffusion virtual try-on model for high-resolution clothing and human body images constructed in Step 3, train the invented lightweight diffusion virtual try-on model for high-resolution clothing and human body images using the high-resolution clothing and human body dataset VITON-HD from Step 1 to obtain the final lightweight diffusion virtual try-on model for high-resolution clothing and human body images.

[0034] After completing model training, to verify the model's quality and accuracy in virtual try-on, the lightweight diffusion virtual try-on model for high-resolution clothing and human images obtained in step 4 was compared with current mainstream virtual try-on models based on GANs (VITON-HD, SD-VITON) and diffusion models (LADI-VTON, DCI-VTON) on the VITON-HD dataset test set. The evaluation and recording of these models' SSIM (Structural Similarity), LPIPS (Learned Perceptual Image Patch Similarity), and FID (Frechet Inception Distance) metrics were used to evaluate and record the try-on effect images generated under different clothing styles (shirts, coats, dresses), complex poses (such as sideways movement, raised arms), and lighting conditions. This verified the model's quality and accuracy in virtual try-on. This method allows for a direct comparison of the performance differences between other advanced models and our improved model under the same test conditions.

[0035] Example 1 Case Analysis and Method Validation The hardware and environmental parameters used in this experiment are shown in Table 1. Table 1 Experimental hardware equipment and environmental parameters

[0036] The comparison results are as follows Figure 2 and Figure 9 As shown. Figure 2 This is a comparison of the GAN-based method and the method of this invention on the VITON-HD dataset. It can be seen that: in the first row, the images generated by VITON-HD and SD-VITON show severe distortion, with some clothing parts, such as the arms, missing; in the second row, the stripes on the upper body of the clothing are missing, and the details of the clothing cannot be well restored; the method of this invention can generate high-quality results, perfectly preserving the details of the clothing. Figure 9 To visually compare the method of this invention with GAN-based VITON-HD and SD-VITON, and diffusion model-based LADI-VTON and DCI-VTON, such as... Figure 9As shown, the method of the present invention generates convincing fitting results.

[0037] Specifically, methods like VITON-HD based on GANs can lead to distorted clothing textures and missing facial features. For example... Figure 9 In the first row, the clothing textures generated by VITON-HD and SD-VITON are distorted and deformed. Figure 9 In the second line, the texture of the figure trying on clothes generated by VITON-HD is severely distorted, and there is a white ghosting on the right arm near the wrist of SD-VITON. Figure 9 In the third row, the fitting images of VITON-HD and SD-VITON show shadows on the shoulders of the clothing, severe misalignment of the clothing area, and the incorrect generation of the arm area. Figure 9 In line 4, the logo part of the clothing area is missing in the GAN-based method and is not restored well.

[0038] While diffusion-based methods can produce good fitting results, they also suffer from a lack of detail and are affected by the original clothing, failing to accurately reproduce the characteristics of the tried-on garment. For example... Figure 9 In line 1, the shoulder area of ​​the LADI-VTON garment is generated incorrectly, creating the illusion of sleeves, and the hands of the DCI-VTON garment are blurred. Figure 9 In the second line, the collar of the clothes being tried on is a round neck, but the collar features in the try-on results generated by DCI-VTON are incorrectly consistent with the original clothing features on the person. LADI-VTON's arms are more exposed and there is a shadow on the right arm. Figure 9 In the third row, the fitting image generated by LADI-VTON does not match the target clothing in many ways (collar, sleeves, and clothing color), and there is overlap in the clothing on the shoulders of the person in the DCI-VTON generated image. Figure 9 In line 4, the logos for the clothing being tried on, LADI-VTON and DCI-VTON, were not generated correctly. However, the method of this invention can accurately reproduce the details of the clothing, not only generating a realistic effect identical to the original garment but also better preserving human features outside the clothing area, resulting in a realistic try-on image with clear skin-to-clothing boundaries.

[0039] The comparison results are shown in Table 2.

[0040] Table 2 Comparative experimental results of different methods on the VITON-HD dataset

[0041] Table 2 presents the quantitative comparison results between the method of this invention and VITON-HD, PF-AFN and SD-VITON, PaintbyExample, LADI-VTON, and DCI-VTON. Bold values ​​indicate the best results, and underlined values ​​indicate the second best results. It can be seen that the method of this invention is relatively superior in all metrics. Compared with current state-of-the-art virtual try-on methods, the method of this invention improves the LPIPS metric by 0.002 (3.17%) and the SSIM metric by 0.012 (1.36%). We attribute these improvements to our novel attention block and feature fusion design, and the quantitative metrics demonstrate the superiority of the method of this invention.

[0042] To validate the effectiveness of the proposed components in the diffusion model-based virtual try-on framework, we conducted a series of ablation experiments. Specifically, we compared the performance of the complete model containing the proposed DWSA module and Poisson feature fusion module with variants lacking these components. Experiments were conducted on the VITON-HD dataset in paired and unpaired settings, using metrics such as training / inference speed, SSIM, LPIPS, and visual fidelity. We evaluated the impact of adjusting the attention mechanism used in the DWSA module compared to the original diffusion model on overall performance.

[0043] After introducing DWSA, we conducted comparative experiments with the original model by setting the initial window value and diffusion value to 16,0.5, 8,0.5, and 4,0.5 respectively. Figure 10 As shown, for easier observation, we increased the LPIPS value by a factor of ten and decreased the FID value by a factor of ten. Both training and inference were performed on an A100, with units of hours, representing the training time per round and the inference time for the entire test dataset, respectively. The training time per round and the inference time for the entire test dataset increased with the increase of the window value. When the value was set to 16 and 0.5, the SSIM and LPIPS metrics achieved the best results. The effect weakened when the value was set to 8 and 0.5, and the worst result was achieved when the value was set to 4 and 0.5, although the training and inference times were still better than the baseline. In summary, the method of this invention can flexibly control the computational complexity, training, and inference time of the model. The larger the window value, the closer it is to global attention. By reasonably setting the window value, the training time per round in the training phase was reduced by 10%, and the inference time was also reduced by one-fifth. This is crucial for real-time applications, enabling faster image generation. Furthermore, from... Figure 11 As can be observed from the first and second rows of results, the method of the present invention can better preserve the local details (logo, texture) and other features of the clothing, clearly generate the original logo of the clothing, and better restore the features of the clothing.

[0044] To verify the effectiveness of the Poisson fusion module, we compared the fitting results generated using the Poisson fusion model with those generated without it. Figure 11 As shown, without introducing Poisson fusion, there is a large shadow between the clothing and the human body in the generated image, and Figure 8 For details such as hands in the generated image, the process is more efficient. Figure 11 Traditional methods often fail to preserve the details of a person's neck effectively. However, the method of this invention eliminates artifacts at the interface between clothing and the human body, fully preserving the original features of the person and resulting in a clearer boundary between clothing and skin with a smoother transition.

[0045] To verify the effectiveness of the added module on virtual try-on, the metrics for each label in the test dataset are shown in Table 3.

[0046] Table 3 Ablation Experiment Results

[0047] As shown in Table 3, when only the DWSA block is applied, the index decreases compared to the original global attention mechanism, but the difference is not significant. This issue can be ignored relative to the speed improvement, and this deficiency can be compensated by Poisson fusion. The method of this invention has achieved the best results on SSIM and LPIPS, and the training and inference speeds have been greatly improved, with the inference speed improved by nearly 20%.

[0048] In summary, the method of this invention generates convincing virtual try-on results, solving the problems of detail loss and visual artifacts that often exist in virtual try-on methods based on generative adversarial networks (GANs) in high-resolution scenes; as well as the shortcomings of traditional diffusion models, such as large size, high computational resource requirements, and difficulty in preserving local features.

[0049] Example 2 A lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images is as follows: Step 1: Obtain publicly available high-resolution virtual try-on datasets; Step 2: Preprocess the clothing images and reference person images in the high-resolution virtual try-on dataset obtained in Step 1 to obtain person images unrelated to clothing. Step 3: Construct a lightweight diffusion virtual try-on model for high-resolution clothing and human body images, and design the required loss function; Step 4: Train a lightweight diffusion virtual try-on model for high-resolution clothing and human body images using the high-resolution clothing and human body dataset from Step 1.

[0050] Example 3 A lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images is as follows: Step 1: Obtain publicly available high-resolution virtual try-on datasets; In step 1, VITON-HD is selected as the clothing and human body dataset required for virtual try-on. The clothing and human body dataset required for virtual try-on includes clothing image C and reference human body image. .

[0051] Step 2: Preprocess the clothing images and reference person images in the high-resolution virtual try-on dataset obtained in Step 1 to obtain person images unrelated to clothing. Step 3: Construct a lightweight diffusion virtual try-on model for high-resolution clothing and human body images, and design the required loss function; Step 4: Train a lightweight diffusion virtual try-on model for high-resolution clothing and human body images using the high-resolution clothing and human body dataset from Step 1.

[0052] Example 4 Step 1: Obtain publicly available high-resolution virtual try-on datasets; Step 2: Preprocess the clothing images and reference person images in the high-resolution virtual try-on dataset obtained in Step 1 to obtain person images unrelated to clothing. Step 2 specifically involves: for the reference image... Images of clothing Openpose uses a human body parser and pose estimator to obtain a reference human image. Human body segmentation diagram of Chinese figures Clothing Images mask Reference figures attitude diagram Remove human body segmentation map and reference figures From the clothing area and the arm area containing sleeve length information, a human body segmentation map independent of clothing is obtained. Color illustrations .

[0053] Step 3: Construct a lightweight diffusion virtual try-on model for high-resolution clothing and human body images, and design the required loss function; Step 4: Train a lightweight diffusion virtual try-on model for high-resolution clothing and human body images using the high-resolution clothing and human body dataset from Step 1.

[0054] Example 5 A lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images is as follows: Step 1: Obtain publicly available high-resolution virtual try-on datasets; Step 2: Preprocess the clothing images and reference person images in the high-resolution virtual try-on dataset obtained in Step 1 to obtain person images unrelated to clothing. Step 3: Construct a lightweight diffusion virtual try-on model for high-resolution clothing and human body images, and design the required loss function; In step 3, the lightweight diffusion virtual try-on model for high-resolution clothing and human body images consists of a flow-based clothing deformation module, a diffusion try-on module, and a feature fusion module based on Poisson fusion.

[0055] Step 4: Train a lightweight diffusion virtual try-on model for high-resolution clothing and human body images using the high-resolution clothing and human body dataset from Step 1.

[0056] Example 6 A lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images is as follows: Step 1: Obtain publicly available high-resolution virtual try-on datasets; Step 2: Preprocess the clothing images and reference person images in the high-resolution virtual try-on dataset obtained in Step 1 to obtain person images unrelated to clothing. Step 3: Construct a lightweight diffusion virtual try-on model for high-resolution clothing and human body images, and design the required loss function; In step 3, the lightweight diffusion virtual try-on model for high-resolution clothing and human body images consists of a flow-based clothing deformation module, a diffusion try-on module, and a feature fusion module based on Poisson fusion.

[0057] Step 3.1: Construct a flow-based clothing deformation module and design the loss function for the flow-based clothing deformation module during training; Step 3.2: Construct the diffusion trial module and design the loss function for the diffusion trial module during training; Step 3.3: Construct a feature fusion module based on Poisson fusion.

[0058] Step 4: Train a lightweight diffusion virtual try-on model for high-resolution clothing and human body images using the high-resolution clothing and human body dataset from Step 1.

Claims

1. A lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images, characterized in that, Specifically: Step 1: Obtain publicly available high-resolution virtual try-on datasets; Step 2: Preprocess the clothing images and reference person images in the high-resolution virtual try-on dataset obtained in Step 1 to obtain person images unrelated to clothing. Step 3: Construct a lightweight diffusion virtual try-on model for high-resolution clothing and human body images, and design the required loss function; Step 4: Train a lightweight diffusion virtual try-on model for high-resolution clothing and human body images using the high-resolution clothing and human body dataset from Step 1.

2. The lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images according to claim 1, characterized in that, In step 1, VITON-HD is selected as the clothing and human body dataset required for virtual try-on. The clothing and human body dataset required for virtual try-on includes clothing image C and reference human body image. .

3. The lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images according to claim 2, characterized in that, Step 2 specifically involves: for the reference image... Images of clothing Openpose uses a human body parser and pose estimator to obtain a reference human image. Human body segmentation diagram of Chinese figures Clothing Images mask Reference figures attitude diagram in Remove human body segmentation map and reference figures From the clothing area and the arm area containing sleeve length information, a human body segmentation map independent of clothing is obtained. Color illustrations .

4. The lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images according to claim 2, characterized in that, In step 3, the lightweight diffusion virtual try-on model for high-resolution clothing and human body images consists of a flow-based clothing deformation module, a diffusion try-on module, and a feature fusion module based on Poisson fusion.

5. The lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images according to claim 4, characterized in that, Step 3.1: Construct a flow-based clothing deformation module and design the loss function for the flow-based clothing deformation module during training; Step 3.2: Construct the diffusion trial module and design the loss function for the diffusion trial module during training; Step 3.3: Construct a feature fusion module based on Poisson fusion.

6. The lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images according to claim 5, characterized in that, In step 3.1, the flow-based clothing deformation module consists of two encoders, which extract multi-level features. The encoder is composed of The feature pyramid is composed of residual blocks containing downsampling layers, and the output features form the feature pyramid. Add total variational loss to the training of the flow-based clothing deformation module. Total variational loss Specifically, it is calculated using the following formula: (1) In the formula, This represents the total variational loss; This represents the summation of the flow field losses from layer 1 to layer N; Indicates the first Layer smoothness Find the gradient; This indicates L1 norm operation, which involves calculating the L1 norm of the gradient result to constrain the smoothness of the flow field; Second-order smoothing constraint loss was also introduced. Second-order smoothing constraint loss The calculation method is as follows: (2) In the formula, This represents the second-order smoothing constraint loss; This represents the summation of the flow field losses from layer 1 to layer N; This represents summing over each point t in the i-th layer of the flow field; This represents the summation of π over each neighborhood π in the neighborhood set of point t; It is the generalized Charbonnier loss function, where This represents the t-th point in the flow field diagram; Let represent the set of the neighborhood around the t-th point in the horizontal, vertical, and two diagonal directions; In addition, it is also used in training. Loss and perceived loss The definitions of the two are as follows: (3) (4) In the formula, and They represent mask and Clothing as a cover; Represents the transformation function, Represents the downsampling function; This indicates the first [unit / level] in the VGG-19 network pre-trained on ImageNet. Each feature map; Based on the above considerations, the total loss function of the entire flow-based clothing deformation module is determined. The expression is: (5) In the formula, , , , This represents a hyperparameter that controls the weights between different losses; After constructing the flow-based clothing deformation module, the human body segmentation map is... With attitude diagram Connect, then with clothing images Together, they are input into a flow-based garment deformation module to predict the appearance flow field and obtain the deformed garment image. Then, the deformed clothing image The color image obtained in step 2 Combined, a rough fitting result image is generated. .

7. The lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images according to claim 5, characterized in that, In step 3.2, the diffusion try-on module is generated by a pre-trained encoder. UnetModel block and pre-trained decoder composition; The process of the diffusion try-on module for processing image data is as follows: First, it uses a pre-trained encoder... The rough fitting result image obtained in step 3.1 The process maps from the image space to the latent space, using the latent representation of the coarse fitting result as the starting point for the diffusion process to obtain a noisy coarse fitting result image. Subsequently, the noisy coarse fitting result image is concatenated with a downsampled mask and combined with clothing features extracted by CLIP, serving as input to the UnetModel block. During the diffusion process, latent variables are progressively denoised and optimized to generate a synthetic image. After obtaining the noise predicted by the model, the denoised refined latent variables are obtained through inverse operations, and a pre-trained decoder is then used. Restore the final fitting image result; The UnetModel block of the diffusion trial module includes a multi-level upsampling module, a downsampling module, and an intermediate block. The upsampling module contains 4 levels, the downsampling module contains 4 levels, the number of channels gradually increases, and then a DWSA attention block is introduced at the corresponding feature map size. The intermediate block further extracts deep features. The upsampling module and the downsampling module are symmetrical. The DWSA attention block consists of a dynamic window attention layer and a cross attention layer. The specific operation of DWSA attention block processing of image data is as follows: The input feature map x of the UNetModel upsampling block is first normalized and then dimensionally matched by 1×1 convolution to project the number of channels. Then it enters the dynamic window self-attention layer. Based on the dynamic window size and overlap ratio, local self-attention is calculated in parallel on the projected feature map. Next, the self-attention output sequence is fed into the cross-attention layer. The cross-attention layer injects clothing feature information for weighted reconstruction output so that the image features are aligned and fused with the clothing features, thereby achieving accurate alignment and detail supplementation. Finally, after two layers of feedforward network and zero-initialized 1×1 convolution mapping, it is added to the residual branch to complete a closed loop of "attention enhancement + feedforward + residual". After constructing the diffusion trial module, the loss function for its training process is designed. The diffusion trial module uses an objective function for end-to-end training, the specific expression of which is: (6) In the formula, This represents the total loss function of the diffusion trial module. , The model is based on the input Potential characteristics of clothing Downsampling mask Overall conditions of clothing and time step Predicted noise, It is a hyperparameter used to balance these two types of losses.

8. The lightweight diffusion virtual try-on algorithm for high-resolution clothing and human body images according to claim 5, characterized in that, In step 3.3, the feature fusion module based on Poisson fusion uses a seamless fusion method based on the Poisson equation to achieve continuous transition of color and texture and seamless integration of input and generated images by minimizing the L2 norm difference between the gradient of the target region and the gradient of the source region. The process of image data processing by the feature fusion module based on Poisson fusion is as follows: The generated image from the diffusion try-on module is given, and the input reference image is the original image. The area to be integrated is The boundary is ; at the border Above, the merged image With the original image Completely overlap to ensure a seamless connection at the fusion point; After discretization, for each pixel ,make Representing the set of its four neighboring pixels, we obtain the discrete Poisson equation, the specific expression of which is: (7) In the formula, Indicates the area to be merged A specific pixel position within; Represents fused images At pixel Pixel values; Represents fused images exist One of my neighbors Pixel values ​​in (four neighboring regions); Represents the original image In pixels Pixel values; Original image In pixels Neighbors Pixel value at; left side For the merged image In position Discrete Laplace operator value at, right side This is the original image. exist with his neighbors The sum of the first-order differences between them represents the original image in... Gradient distribution within.

Citation Information

Cited By

  • Anti-disturbance generation active defense method for virtual fitting model

    CN121961834A