Clothes edge flattening method based on hierarchical modeling and dual-domain optimization

The method of smoothing clothing edges by using layered modeling and dual-domain optimization solves the problem of balancing smoothness and detail realism in clothing edge trimming, achieving a natural and smooth effect for clothing edges, and improving the stability and generalization ability of the model.

CN121708291BActive Publication Date: 2026-07-07XIAMEN ZHENJING TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAMEN ZHENJING TECH CO LTD
Filing Date
2025-11-05
Publication Date
2026-07-07

Smart Images

  • Figure CN121708291B_ABST
    Figure CN121708291B_ABST
Patent Text Reader

Abstract

This invention discloses a method for smoothing clothing edges based on hierarchical modeling and dual-domain optimization. The method includes: separating the clothing region from the background region of the input image; dividing the clothing region into a main region for maintaining overall deformation and texture consistency, and an edge band for handling wrinkles, seams, and contour transitions; extracting the overall structural features of the main region and the local detail features of the edge band using a dual-branch neural network; and optimizing the clothing edges for dual-domain consistency based on the overall structural features and local detail features using image domain constraints and frequency domain constraints. This invention can be used for clothing edge trimming in image generation and editing, effectively solving the problem of irregular fluctuations or wrinkles at clothing edges, achieving a natural and smooth visual effect. This enables high-quality visual effects in applications such as virtual try-on, beauty enhancement, film and television special effects, and virtual human generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method for smoothing clothing edges based on layered modeling and dual-domain optimization. Background Technology

[0002] With the rapid development of deep learning in the field of computer vision, image retouching and editing technologies are gradually being widely used in scenarios such as virtual try-on, fashion e-commerce, and film and television post-production. Among them, smoothing the edges of clothing is an important step in improving the realism and aesthetics of the overall image.

[0003] Traditional methods for garment edge smoothing often rely on image post-processing techniques such as filtering, morphological operations, or rule-based geometric correction. However, these methods struggle to adapt to the complexities of different fabric textures, wrinkles, and edge shapes, often resulting in unnatural, jagged, or detail-loss-prone edges. With the development of deep learning, neural network-based garment smoothing methods have emerged, achieving automatic edge repair and smoothing through end-to-end feature learning. However, existing methods still have the following limitations:

[0004] On the one hand, clothing edges are often accompanied by complex textures and irregular deformations, and existing models have difficulty simultaneously ensuring the smoothness of the edges and the realism of the details, which can easily lead to breakage or a plastic feel. On the other hand, due to the lack of targeted design in model training, instability and jitter are prone to occur in the edge area, and the generalization ability is insufficient in cross-scene applications.

[0005] Therefore, how to preserve fabric details while ensuring edge smoothness, and improve the stability and naturalness of the finishing results, is a problem that existing technologies urgently need to solve. Summary of the Invention

[0006] In view of this, the purpose of this invention is to propose a method for smoothing clothing edges based on layered modeling and dual-domain optimization. This method can be used for clothing edge trimming in image generation and editing, effectively solving the problem of irregular fluctuations or wrinkles at clothing edges, thereby achieving a natural and smooth visual effect. This enables high-quality visual effects in applications such as virtual try-on, beauty enhancement, film and television special effects, and virtual human generation.

[0007] According to one aspect of the present invention, a method for smoothing clothing edges based on hierarchical modeling and dual-domain optimization is provided, the method comprising:

[0008] The clothing area of ​​the input image is separated from the background area, and the clothing area is divided into a main area to maintain overall deformation and texture consistency and an edge zone to handle wrinkles, seams and contour transitions.

[0009] The overall structural features of the main body region and the local detail features of the edge zone are extracted by a dual-branch neural network.

[0010] Based on the overall structural features and local detail features, dual-domain consistency optimization is performed on the clothing edge using image domain constraints and frequency domain constraints to generate a preliminary smooth edge result; wherein, the image domain constraints are used to ensure continuous and smooth edges, and the frequency domain constraints are used to suppress high-frequency artifacts;

[0011] The initially smoothed edge results are subjected to adaptive edge refinement processing. The processing parameters are adaptively adjusted according to the edge complexity, and the final smoothed clothing edge image is output.

[0012] The above technical solution effectively solves the core problems of existing garment edge finishing techniques, such as the difficulty in achieving both smoothness and detail fidelity, insufficient stability, and weak generalization ability, through systematic structural design and technical integration. This method achieves a significant improvement in technical performance through layered division of garment regions, bi-branch feature extraction, bi-domain consistency optimization, and adaptive refinement processing.

[0013] Specifically, the method first establishes a structural foundation for subsequent processing by separating the clothing area from the background and dividing the main body area from the edge band, thus maintaining overall deformation and texture consistency. Simultaneously, local optimization is performed on the wrinkles, seams, and contour transitions of the edge band, effectively preserving the realism of details during edge smoothing. The introduction of a dual-branch neural network extracts overall structural features and local detail features separately, ensuring the coordinated processing of macroscopic and microscopic features and avoiding edge breakage or plastic-like appearance issues. Furthermore, a dual-domain consistency optimization mechanism based on the image and frequency domains ensures continuous and smooth edges through image domain constraints and suppresses high-frequency artifacts through frequency domain constraints, enhancing the visual naturalness and structural stability of the edge results. Finally, the adaptive edge refinement module dynamically adjusts parameters according to edge complexity, improving the method's adaptability to different fabric textures, clothing types, and image conditions, thereby enhancing its generalization and practicality across different scenarios.

[0014] In summary, this method, through the organic combination of hierarchical modeling and dual-domain optimization, ensures edge smoothness while also maintaining detail fidelity and overall structural naturalness, significantly improving the stability and adaptability of garment edge trimming.

[0015] In some embodiments, the clothing area of ​​the input image is separated from the background area, and the clothing area is divided into a main area for maintaining overall deformation and texture consistency and an edge band for handling wrinkles, seams, and contour transitions, including:

[0016] A pre-trained semantic segmentation network is used to separate the clothing area from the background, and the main body area and the edge band are divided by performing morphological operations on the segmentation results or extracting band regions based on width calculation.

[0017] In the above technical solution, by introducing mature segmentation priors and adjustable geometric operations, a precise and adaptive regional foundation is laid for subsequent layered edge modeling, which effectively improves the reliability and robustness of the overall technical solution.

[0018] Specifically, the pre-trained semantic segmentation network can efficiently and accurately separate clothing from the background, ensuring the accuracy of object localization and avoiding interference from background noise in subsequent processing. Based on this, by performing morphological operations on the segmentation results or extracting strip regions based on width calculation, this method can adaptively divide the main body region for maintaining overall stability and the edge band for fine-tuning according to the specific geometric shape of the clothing. This segmentation strategy not only achieves universal adaptation to different clothing styles and sizes, but more importantly, it spatially decouples overall deformation constraints from local detail repair, providing clear physical boundaries and task objectives for maintaining the geometric consistency of the main body region and processing the complex features of the edge band, thus avoiding the loss of details or structural distortion that may result from globally uniform processing.

[0019] In summary, this region segmentation step, as a preprocessing step in the entire technical process, creates favorable conditions for subsequent bi-branch feature extraction and bi-domain optimization.

[0020] In some embodiments, the dual-branch neural network uses a deep convolutional neural network as its backbone, including a main branch and an edge branch;

[0021] The main branch is used to extract the overall shape, texture, and deformation features of the clothing;

[0022] The edge branches are used to extract local features of folds, seams, and contour transitions;

[0023] The main branch and the edge branch maintain global consistency by sharing features.

[0024] In the above technical solution, the dual-branch neural network architecture, through its structured feature decoupling and sharing mechanism, provides key feature learning guarantees for the realization of core technical objectives, and significantly enhances the model's representation ability and coordination performance in complex scenarios.

[0025] Specifically, the shared backbone employs a deep convolutional network that efficiently extracts general low-level features while deriving two dedicated pathways: a main branch and an edge branch. The main branch focuses on capturing the overall macroscopic geometry, global texture patterns, and deformation trends of the garment, providing a robust structural prior and spatial context for edge processing and effectively preventing distortion of the overall structure during optimization. The edge branch focuses on local high-frequency details such as wrinkles, seams, and contour transition areas. Its fine-grained feature extraction capability is key to preserving the realistic texture of the fabric and avoiding a plastic-like appearance after edge smoothing. Crucially, the two branches achieve information interaction and alignment through sharing low-level features. This design establishes an implicit global consistency constraint at the feature level, ensuring that local optimization in edge areas is always coordinated with the main structure of the garment, thus solving the problems of unnatural transitions, visual abruptness, or structural breaks that may result from independent processing.

[0026] In summary, this dual-branch neural network achieves a balance between overall structural stability and local detail fidelity through collaborative design. Its shared feature mechanism is the core innovation for improving the naturalness and structural coherence of the trimming results, providing a high-quality and highly consistent feature foundation for subsequent dual-domain optimization processing.

[0027] In some embodiments, during the training process of the dual-branch neural network, the main region adopts geometric constraints based on shape preservation, while the edge band adopts perceptual constraints based on feature space.

[0028] In the above technical solution, geometric constraints based on shape preservation and perceptual constraints based on feature space are applied to the different characteristics of the main body area and the edge zone, respectively. This differentiated optimization target design is the key to achieving the core goal of structural stability and realistic details.

[0029] Specifically, geometric constraints are introduced into the training of the main branch to regulate the overall deformation of the clothing, effectively maintaining its macroscopic physical form and spatial continuity. This prevents distortion of the main structure or disproportion of the overall proportions caused by edge optimization, providing a solid geometric foundation for the final repair result. Simultaneously, perceptual constraints are employed in the training of the edge branch. By measuring and guiding the consistency between the repair result and the real edge in deep semantics such as texture and style within a high-dimensional feature space, rather than merely pursuing pixel-level precise matching, the model can learn and generate rich fabric details that conform to human visual perception. This effectively avoids excessive smoothing and a plastic-like appearance in edge areas, preserving the realism of key features such as wrinkles and seams. More importantly, these two constraints work synergistically during training, guiding the network learning from both macroscopic geometry and microscopic perception levels. This allows the outputs of the main branch and the edge branch to naturally merge while they specialize in their respective areas, jointly contributing to a visually highly natural and structurally stable and reliable smooth clothing edge effect.

[0030] In summary, this hybrid training constraint strategy ensures the directionality and effectiveness of network feature learning from the source of the optimization objective, enabling the method to balance edge smoothness, structural stability, and detail realism, thus significantly improving the overall quality of the model output.

[0031] In some embodiments, the image domain constraint employs a loss function based on the L1 or L2 norm to compare the edge pixel values ​​of the images before and after optimization in order to maintain the smoothness of the edges; the frequency domain constraint converts the image to the frequency domain and applies a loss function to constrain high-frequency components.

[0032] In the above technical solution, by applying complementary regularization in the multidimensional signal space, the problem of balancing visual continuity and signal purity in edge smoothing is effectively solved.

[0033] Specifically, by directly applying a loss function based on the L1 or L2 norm in the image domain and directly comparing the edge pixel values ​​before and after optimization, the model can be forced to output spatially continuous edge regions with smooth transitions in grayscale or color. This effectively eliminates breaks, jagged edges, and irregular color fluctuations at the pixel level, laying the foundation for edge smoothness. However, relying solely on image domain constraints can easily lead to local optima, potentially causing excessively blurred textures or imperceptible high-frequency artifacts. Therefore, introducing frequency domain constraints is a crucial complement: by converting the image to the frequency domain and applying a loss function targeting high-frequency components, this constraint can accurately identify and suppress anomalous high-frequency noise, rasterization effects, or structural jaggedness introduced by model generation or amplification. These artifacts are often difficult to measure and control effectively in the image domain. This two-pronged strategy allows the optimization process to simultaneously consider macroscopic visual smoothness and microscopic signal quality. Image domain constraints dominate the macroscopic morphological direction of the edges, while frequency domain constraints ensure the purity and naturalness of their microscopic structure.

[0034] In summary, the joint optimization of image domain and frequency domain constraints constitutes a consistency guarantee system that fully covers the spatial and frequency dimensions. This enables the model to not only output edges that are perceived as smooth by the human eye, but also to approximate the high-quality characteristics of real clothing edges from the essence of the signal. Thus, while improving flatness, it significantly enhances the visual fidelity of the results.

[0035] In some embodiments, the adaptive edge thinning process is implemented through a lightweight edge thinning convolutional network, which dynamically adjusts the size of the convolutional kernel or the interpolation strategy based on the complexity features extracted from the edge band.

[0036] In the above technical solution, the dynamic and adjustable local processing mechanism significantly improves the fineness, naturalness and scene adaptability of the final output edge.

[0037] Specifically, a lightweight network design is employed to perform targeted local enhancements on the initially smoothed edges with almost no increase in overall computational overhead. Its core advantage lies in the introduction of a complexity-aware adaptive mechanism: the network dynamically adjusts its core processing parameters based on the complexity features (such as texture density, curvature changes, and noise levels) extracted in real time from the edge bands. For example, it uses larger convolutional kernels or specific interpolation strategies in simple, smooth edge regions to ensure continuity, while switching to smaller convolutional kernels or detail-preserving interpolation strategies in wrinkled, intricate edge regions to maintain realism. This intelligent processing method effectively overcomes the limitations of fixed-parameter methods when dealing with different clothing types, fabric textures, and edge shapes—avoiding insufficient processing in simple areas and preventing detail loss or a plastic-like appearance caused by over-smoothing in complex areas, thus achieving a more precise balance between macroscopic smoothness and microscopic realism.

[0038] In summary, this adaptive edge refinement module refines the relatively uniform preliminary results generated in the preceding steps based on the complexity of the local context. This not only greatly enhances the method's generalization ability and robustness in the face of diverse and unknown scenarios, but also ultimately ensures that while the overall edges of the clothing are smooth, their local transitions approximate the physical and visual characteristics of real fabric as closely as possible.

[0039] According to another aspect of the present invention, a garment edge smoothing device based on hierarchical modeling and dual-domain optimization is provided. Based on the above-described method, the device includes:

[0040] The segmentation module is used to separate the clothing area from the background area of ​​the input image, and divide the clothing area into a main area to maintain overall deformation and texture consistency and an edge zone to handle wrinkles, seams and contour transitions.

[0041] A dual-branch network module is used to extract the overall structural features of the main body region and the local detail features of the edge band through a dual-branch neural network.

[0042] The dual-domain consistency module is used to optimize the clothing edge using image domain constraints and frequency domain constraints based on the overall structural features and local detail features, generating a preliminary smooth edge result; wherein, the image domain constraints are used to ensure continuous and smooth edges, and the frequency domain constraints are used to suppress high-frequency artifacts;

[0043] The adaptive edge refinement module is used to perform adaptive edge refinement processing on the initially smoothed edge result, and adaptively adjust the processing parameters according to the edge complexity to output the final smoothed clothing edge image.

[0044] In order to better utilize the above method, this application proposes a clothing edge smoothing device based on hierarchical modeling and dual-domain optimization. Each module corresponds to a step of the above method, and its specific principle has been described above and will not be repeated here.

[0045] According to another aspect of the present invention, a garment edge smoothing device based on hierarchical modeling and dual-domain optimization is provided, comprising:

[0046] At least one processor and a memory communicatively connected to said at least one processor;

[0047] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method described above.

[0048] In the above technical solution, to better operate and process the method, the method is stored in memory, and the processor executes the stored method. It should be noted that the principle and effect of each step have been described above and will not be elaborated upon here.

[0049] According to another aspect of the present invention, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the above-described method.

[0050] In the above technical solution, to better operate and use the method, the method is stored in a computer-readable storage medium and implemented using a processor. It should be noted that the principle and effect of each step have been described above and will not be elaborated upon here. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a flowchart illustrating an embodiment of a method for smoothing clothing edges based on hierarchical modeling and dual-domain optimization according to the present invention.

[0053] Figure 2 This is a workflow diagram of an embodiment of a method for smoothing clothing edges based on hierarchical modeling and dual-domain optimization according to the present invention.

[0054] Figure 3This is a schematic diagram of an embodiment of a clothing edge smoothing device based on layered modeling and dual-domain optimization according to the present invention. Detailed Implementation

[0055] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the invention. Similarly, the following embodiments are only some, not all, embodiments of the present invention, and all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0056] This invention proposes a method for smoothing clothing edges based on hierarchical modeling and dual-domain optimization. This method divides the clothing area into a main region and an edge zone, modeling the overall structure and local details separately. By combining consistency constraints in the image and frequency domains, it achieves a balance between edge smoothness and natural detail. The aim is to overcome the instability and unnaturalness caused by traditional methods relying solely on post-processing or single supervision, ultimately achieving high-precision, stable, and reliable clothing edge smoothing results.

[0057] Example 1

[0058] Please see Figure 1 , Figure 2 This paper proposes a method for smoothing clothing edges based on hierarchical modeling and dual-domain optimization. Addressing the issues of unevenness, jagged edges, and loss of detail in existing clothing edge trimming methods, this method proposes a new approach based on hierarchical edge modeling and dual-domain consistency optimization. The method includes:

[0059] S1. Separate the clothing area from the background area of ​​the input image, and divide the clothing area into a main area to maintain overall deformation and texture consistency and an edge zone to process wrinkles, seams and contour transitions.

[0060] In this embodiment, the clothing area of ​​the input image is separated from the background area, and the clothing area is divided into a main area for maintaining overall deformation and texture consistency and an edge band for processing wrinkles, seams and contour transitions. This includes: using a pre-trained semantic segmentation network to separate the clothing area from the background, and performing morphological operations on the segmentation results or extracting strip regions based on width calculation to divide the main area and the edge band.

[0061] Specifically, the process involves clothing region separation and segmentation: The input image is first processed by a pre-trained semantic segmentation network to generate a clothing mask. The mask undergoes morphological processing (dilation and erosion) to remove noise and fill holes, resulting in a complete clothing region. Subsequently, strip-shaped regions are generated based on the mask boundaries and local contour features. The area inside the mask is designated as the main body region, while the edge band covers wrinkles, seams, and contour transitions. The width of the edge band is dynamically adjusted based on local curvature, gradient intensity, and texture changes. High-curvature or high-gradient regions have expanded edge bands to cover key details, while smooth regions are shrunk to avoid introducing irrelevant background, thus achieving adaptive segmentation and ensuring the stability and effectiveness of feature extraction and dual-domain optimization for different clothing types and styles. After separating the clothing region from the background using a segmentation network, it is further divided into "main body region" and "edge band." The main body region primarily maintains the overall deformation and texture consistency of the fabric, while the edge band focuses on modeling wrinkles, seams, and contour transitions. This segmentation facilitates subsequent modules in processing the overall structure and local details separately, while reducing redundant computational overhead.

[0062] Furthermore, regarding the pre-trained semantic segmentation network, this scheme incorporates a degradation gain mechanism for the output mask during the model training phase. By applying random degradation (such as edge blurring, local missing values, and noise perturbation) to the mask input during training, the network is guided to exhibit robustness to segmentation errors during learning, thereby reducing the strong dependence of subsequent region segmentation and feature extraction on mask accuracy. This mechanism enables the model to maintain stable recognition and smoothing effects on the main body of clothing and edge regions even when the segmentation results are not entirely accurate.

[0063] S2. Extract the overall structural features of the main body region and the local detail features of the edge zone using a dual-branch neural network;

[0064] In this embodiment, the dual-branch neural network uses a deep convolutional neural network as its backbone, comprising a main branch and an edge branch. The main branch is used to extract the overall shape, texture, and deformation features of the clothing; the edge branch is used to extract local features of folds, seams, and contour transitions. The main branch and edge branch maintain global consistency by sharing features. During training, the main region of the dual-branch neural network employs geometric constraints based on shape preservation, while the edge region employs perceptual constraints based on feature space.

[0065] S3. Based on the overall structural features and local detail features, the edges of the clothing are optimized for dual-domain consistency using image domain constraints and frequency domain constraints to generate a preliminary smooth edge result; wherein, the image domain constraints are used to ensure continuous and smooth edges, and the frequency domain constraints are used to suppress high-frequency artifacts;

[0066] In this embodiment, the image domain constraint employs a loss function based on the L1 or L2 norm, comparing the edge pixel values ​​of the images before and after optimization to maintain edge smoothness. The frequency domain constraint converts the image to the frequency domain and applies a loss function to constrain high-frequency components. The image domain constraint uses L2 loss, primarily to maintain overall edge continuity and smoothness; the frequency domain constraint converts the image to the frequency domain and applies constraints to high-frequency components to suppress edge artifacts and noise. Preservation of edge details mainly relies on perceptual constraints (VGG Loss) and adversarial constraints (GAN Loss). VGG Loss captures local texture and structural features, while GAN Loss uses a discriminative network to compare the generated edges with the real edge distribution, further enhancing the realism of details. This combination of constraints, under multi-scale constraints from coarse to fine, achieves a balance between overall edge smoothness and local detail fidelity, effectively preserving edge features such as wrinkles, seams, and contour transitions during the smoothing process. The frequency domain constraint is mainly used to suppress edge artifacts by applying a loss to high-frequency components to limit abnormal responses, thereby ensuring edge smoothness. To avoid over-smoothing of realistic high-frequency details such as fabric texture, this scheme applies focused constraints only to anomalous high-frequency components in the edge neighborhood during frequency domain constraints. Simultaneously, it combines a dual-branch feature fusion mechanism with VGG Loss and GAN Loss for the edge branches to compensate for and enhance local texture and wrinkle details. In this way, frequency domain constraints primarily suppress artifacts without sacrificing realistic details, achieving a balance between overall smoothness and local texture fidelity in edge smoothing, ensuring effective preservation of details in wrinkles, seams, and contour transitions. In this scheme, image domain and frequency domain constraints are mainly used for edge smoothing, while VGG Loss and GAN Loss are primarily used to preserve local texture and details. To achieve this balance, a weighted joint optimization strategy is employed during training: weight coefficients are set for smoothness and detail constraints in the loss function. Through multi-scale analysis and edge neighborhood weighting, the texture constraint weight in high-curvature or wrinkled regions is relatively increased, while the smoothness constraint dominates in low-curvature or smooth regions, thus ensuring both overall edge continuity and local detail are preserved. Meanwhile, the joint optimization adopts multi-stage iterative training: in the early stage, smoothing constraints are mainly used to ensure the convergence of the overall shape; in the middle stage, VGG and GAN Loss weights are gradually increased to enhance the recovery of details; and finally, convergence is completed under the joint constraints of global and local features, ensuring that the edge smoothing result is both natural and smooth and retains the real texture.

[0067] Specifically, this method introduces a dual supervision mechanism in the image and frequency domains. In the image domain, the edge morphology before and after trimming is compared to ensure continuous and smooth edges; in the frequency domain, high-frequency components are constrained to prevent artifacts such as jagged edges and jitter. This module comprehensively constrains the consistency of clothing edges in different spatial domains, thereby improving the stability and naturalness of the clothing edges.

[0068] The dual-branch neural network uses a deep convolutional neural network as its backbone, processing the main body and edge regions of the clothing through a dual-branch structure. The main body branch is responsible for extracting the overall structural features of the clothing, maintaining the consistency of fabric shape and texture; the edge branch focuses on wrinkles, seams, and contour transitions, extracting local edge features from the input image to provide rich and accurate representations for subsequent smoothing processing, achieving fine optimization of the edge bands. During training, the main body region adopts geometric constraints based on shape preservation to ensure that the overall structure of the clothing is not destroyed; the edge band adopts perceptual constraints based on feature space to ensure the naturalness of edge texture and transitions. Both maintain global consistency by sharing features, thus achieving a balance between the overall and local aspects. The main body region uses geometric constraints (L2 loss) to maintain reasonable overall contour and deformation, while allowing non-rigid deformation through local weighting and multi-scale processing. The edge band adopts perceptual constraints (VGG Loss) and adversarial constraints (GANLoss) to preserve texture and wrinkle details; at the same time, it combines image domain constraints (L1 / L2) to maintain edge smoothness, and frequency domain constraints to suppress abnormal high-frequency artifacts. Joint optimization achieves weight balance through multi-stage training: initially, smoothing constraints dominate to ensure overall convergence; in the middle stage, the weights of detail constraints are gradually increased to recover local features; and finally, convergence is achieved under the joint constraints of global and local data. To reduce dependence on large amounts of labeled data, pre-trained model fine-tuning combined with synthetic data augmentation, including geometric deformation, texture transfer, and occlusion simulation, is used to expand the sample size, achieving stable training and effective convergence of the dual-branch network.

[0069] Furthermore, the shared feature mechanism may be insufficient to ensure global consistency. For example, the overall deformation features of the main branch may conflict with the local details of the edge branches, resulting in unnatural stitching. Therefore, in this application, although the main branch and edge branches achieve information transmission through shared features, to further ensure global consistency, this scheme introduces a cross-branch fusion mechanism in the feature fusion stage. This mechanism coordinates overall deformation and local details through multi-scale feature alignment and attention weighting. Specifically, when the high-resolution local features extracted from the edge branches are fused into the main branch, they are weighted and modulated according to the low-frequency structural features of the main branch, ensuring that local details remain consistent with the overall shape while avoiding local deformation conflicts caused by high-frequency wrinkles or seam information. This design, by forming coarse-to-fine feature constraints within the network, ensures that the overall deformation features of the main branch and the local features of the edge branches maintain a natural connection during stitching or fusion, thereby improving the coherence and visual realism of the edge smoothing results.

[0070] Furthermore, the main body region employs shape-preserving geometric constraints, while the edge band uses feature space-based perceptual constraints. These constraints may not be comprehensive enough. Geometric constraints (such as L2 loss) may be overly smoothed and unable to handle non-rigid deformations; perceptual constraints (such as VGG loss) may introduce texture distortion. In addition, the dual-branch network structure is complex and requires a large amount of labeled data for training. Therefore, in this application, geometric constraints (such as L2 loss) are used in the main body region to maintain overall deformation and contour consistency, while perceptual constraints (such as VGG loss) are used in the edge band to preserve local texture features. Furthermore, to further enhance edge naturalness and suppress high-frequency artifacts, this scheme introduces adversarial constraints (GAN Loss) in the edge band. A discriminative network distinguishes the distribution of generated edges from real edges, improving the realism of edge details. To balance non-rigid deformation and texture fidelity, geometric constraints are locally weighted and multi-scale processed during training, allowing for local flexible deformation, while perceptual constraints and GAN Loss are applied locally in the edge region. By limiting high-frequency anomalous responses and preserving local texture statistical properties, the risk of texture distortion is reduced. This constraint combination achieves a balance between coarse and fine detail, and coordination between local and global aspects, in the training of the dual-branch network. This ensures that both the main branch and edge branches maintain a reasonable overall shape while preserving detailed features such as wrinkles, seams, and contour transitions. Simultaneously, to reduce the dual-branch network's dependence on large amounts of labeled data, the training scheme combines pre-trained model fine-tuning and synthetic data augmentation. It expands the training samples through geometric deformation, texture transfer, and occlusion simulation, achieving stable network training and ensuring edge smoothing performance under various clothing types and complex poses.

[0071] S4. Perform adaptive edge refinement processing on the initially smoothed edge result, and adaptively adjust the processing parameters according to the edge complexity to output the final smoothed clothing edge image.

[0072] In this embodiment, the adaptive edge thinning process is implemented through a lightweight edge thinning convolutional network, which dynamically adjusts the size of the convolutional kernel or the interpolation strategy based on the complexity features extracted from the edge band.

[0073] Specifically, a lightweight edge refinement module is introduced in the generation stage. This module adaptively adjusts the convolutional kernel size and interpolation strategy based on the complexity of the edge band, achieving rapid smoothing of low-complexity edges while preserving fabric details and natural texture in complex edge regions. A lightweight edge refinement network is introduced in the generation stage, quantifying edge complexity through local gradient magnitude, curvature, and texture changes. The network dynamically adjusts the convolutional kernel size and interpolation strategy based on complexity features. Low-complexity regions are quickly smoothed, while high-complexity regions retain details. Abrupt changes are avoided through continuous weight mapping and multi-scale smoothing fusion, achieving automated and dynamic edge refinement. Adaptive edge refinement processing is implemented through a lightweight edge refinement convolutional network. Edge complexity is quantified by calculating indicators such as local gradient magnitude, curvature, and texture changes in the edge band, forming a complexity feature map. The network dynamically selects the convolutional kernel size and interpolation strategy based on this complexity feature map: smaller convolutional kernels and standard interpolation are used in low-complexity regions to quickly smooth edges, while larger convolutional kernels or high-resolution interpolation are used in high-complexity regions to preserve details such as wrinkles, seams, and contour transitions. To avoid abrupt changes between regions of different complexity, the network employs continuous weight mapping and multi-scale smoothing fusion mechanisms, enabling the convolution kernel and interpolation parameters to change continuously in space. This achieves adaptive, automated, and dynamic adjustment of edge refinement, balancing fast smoothing with detail fidelity.

[0074] In this embodiment, the proposed method was validated under different clothing types (such as knitwear, silk, cotton, and linen), multiple poses, and occlusion scenarios. Experimental results show that the layered modeling and dual-domain optimization structure can effectively suppress high-frequency artifacts and wrinkle residues at the edges while maintaining overall deformation consistency under complex lighting, occlusion, and background interference conditions. This significantly improves edge smoothness and visual coherence, demonstrating strong robustness and generalization ability, and proving its strong adaptability even in complex scenes. Furthermore, this scheme establishes a quantitative and subjective evaluation system, using indicators such as boundary F-score, Chamfer distance, structural similarity index (SSIM) ratio, and subjective visual score (MOS) to evaluate the smoothing effect from multiple dimensions including geometric accuracy, texture consistency, and perceptual quality. The method was compared with traditional filtering, single-domain inpainting, and GAN-like methods, validating its significant advantages in edge smoothing and artifact suppression.

[0075] This invention combines hierarchical modeling, dual-domain supervision, and adaptive edge refinement to improve the smoothness and naturalness of clothing edges while preserving the fidelity of fabric texture details. This solves the technical problem of existing methods struggling to balance smoothness and realism. Compared to existing methods such as traditional filtering or single-domain repair, which only smooth edges and easily lose wrinkles and details, and single-branch deep networks which struggle to balance overall shape and local texture, potentially resulting in unnatural edge stitching, this solution achieves a balance between overall smoothness and local detail through hierarchical modeling, dual-branch feature extraction, joint multi-constraint optimization, and adaptive edge refinement. It outperforms existing methods in metrics such as boundary F-score, Chamfer distance, SSIM ratio, and subjective visual score (MOS), while maintaining good generalization performance under complex backgrounds, occlusion, and different clothing types.

[0076] Specifically, the method of the present invention has the following advantages:

[0077] 1. Balancing edge smoothness and detail fidelity: Through layered edge modeling, dual-branch network and dual-domain consistency optimization, this invention can significantly improve the smoothness of clothing edges while preserving details such as folds, seams and contours, enhancing the visual naturalness.

[0078] 2. Stable and natural overall structure: The main area combines geometric constraints to ensure the consistency of the overall shape and texture of the fabric, so that edge optimization will not damage the overall structure of the garment, achieving a smooth and natural unity.

[0079] 3. Strong adaptability and generalization ability: The adaptive edge refinement module can adjust the processing strategy according to the edge complexity, adapt to different clothing types, fabric textures and image conditions, and improve the stability and practicality of the model in various scenarios.

[0080] Example 2

[0081] Please see Figure 3 A garment edge smoothing device based on hierarchical modeling and dual-domain optimization, based on the method described in one embodiment, the device comprising:

[0082] The segmentation module is used to separate the clothing area from the background area of ​​the input image, and divide the clothing area into a main area to maintain overall deformation and texture consistency and an edge zone to handle wrinkles, seams and contour transitions.

[0083] A dual-branch network module is used to extract the overall structural features of the main body region and the local detail features of the edge band through a dual-branch neural network.

[0084] The dual-domain consistency module is used to optimize the clothing edge using image domain constraints and frequency domain constraints based on the overall structural features and local detail features, generating a preliminary smooth edge result; wherein, the image domain constraints are used to ensure continuous and smooth edges, and the frequency domain constraints are used to suppress high-frequency artifacts;

[0085] The adaptive edge refinement module is used to perform adaptive edge refinement processing on the initially smoothed edge result, and adaptively adjust the processing parameters according to the edge complexity to output the final smoothed clothing edge image.

[0086] In this embodiment, in order to better utilize the method described in one of the embodiments, this application proposes a clothing edge smoothing device based on hierarchical modeling and dual-domain optimization. Each module corresponds to each step of the above method, and its specific principle has been described above and will not be repeated here.

[0087] Example 3

[0088] A garment edge smoothing device based on hierarchical modeling and dual-domain optimization includes:

[0089] At least one processor and a memory communicatively connected to said at least one processor;

[0090] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method described in one of the embodiments.

[0091] In this embodiment, to better run and process the method described in one of the embodiments, the above method is stored in a memory, and the stored method is executed using a processor. It should be noted that the principle and effect of each step have been described above and will not be elaborated further here.

[0092] Example 4

[0093] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in one of the embodiments.

[0094] In this embodiment, to better operate and use the method described in one of the embodiments, the above method is stored in a computer-readable storage medium, and the above method is implemented using a processor. It should be noted that the principle and effect of each step have been described above and will not be elaborated further here.

[0095] The above description is only a part of the embodiments of the present invention and does not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made based on the content of the present invention specification and drawings, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for smoothing clothing edges based on hierarchical modeling and dual-domain optimization, characterized in that, The method includes: The clothing area of ​​the input image is separated from the background area, and the clothing area is divided into a main area to maintain overall deformation and texture consistency and an edge zone to handle wrinkles, seams and contour transitions. The overall structural features of the main body region and the local detail features of the edge zone are extracted by a dual-branch neural network. Based on the overall structural features and local detail features, dual-domain consistency optimization is performed on the clothing edge using image domain constraints and frequency domain constraints to generate a preliminary smooth edge result; wherein, the image domain constraints are used to ensure continuous and smooth edges, and the frequency domain constraints are used to suppress high-frequency artifacts; The initially smoothed edge result is subjected to adaptive edge refinement processing. The processing parameters are adaptively adjusted according to the edge complexity, and the final smoothed clothing edge image is output. The dual-branch neural network uses a deep convolutional neural network as its backbone and includes a main branch and edge branches. The main branch is used to extract the overall shape, texture, and deformation features of the clothing; The edge branches are used to extract local features of folds, seams, and contour transitions; The main branch and the edge branch maintain global consistency by sharing features; During the training process, the main body region of the dual-branch neural network adopts geometric constraints based on shape preservation, while the edge band adopts perceptual constraints based on feature space.

2. The method for smoothing clothing edges based on hierarchical modeling and dual-domain optimization as described in claim 1, characterized in that, The clothing area of ​​the input image is separated from the background area, and the clothing area is divided into a main area to maintain overall deformation and texture consistency, and an edge zone to handle wrinkles, seams, and contour transitions, including: A pre-trained semantic segmentation network is used to separate the clothing area from the background, and the main body area and the edge band are divided by performing morphological operations on the segmentation results or extracting band regions based on width calculation.

3. The method for smoothing clothing edges based on hierarchical modeling and dual-domain optimization as described in claim 1, characterized in that, The image domain constraint uses a loss function based on the L1 or L2 norm to compare the edge pixel values ​​of the images before and after optimization in order to maintain the smoothness of the edges; the frequency domain constraint converts the image to the frequency domain and applies a loss function to constrain high-frequency components.

4. The method for smoothing clothing edges based on hierarchical modeling and dual-domain optimization as described in claim 1, characterized in that, The adaptive edge thinning process is implemented through a lightweight edge thinning convolutional network, which dynamically adjusts the size of the convolutional kernel or the interpolation strategy based on the complexity features extracted from the edge band.

5. A garment edge smoothing device based on hierarchical modeling and dual-domain optimization, characterized in that, Based on the method according to any one of claims 1-4, the apparatus comprises: The segmentation module is used to separate the clothing area from the background area of ​​the input image, and divide the clothing area into a main area to maintain overall deformation and texture consistency and an edge zone to handle wrinkles, seams and contour transitions. A dual-branch network module is used to extract the overall structural features of the main body region and the local detail features of the edge band through a dual-branch neural network. The dual-domain consistency module is used to optimize the clothing edge using image domain constraints and frequency domain constraints based on the overall structural features and local detail features, generating a preliminary smooth edge result; wherein, the image domain constraints are used to ensure continuous and smooth edges, and the frequency domain constraints are used to suppress high-frequency artifacts; An adaptive edge refinement module is used to perform adaptive edge refinement processing on the initially smoothed edge result, adaptively adjust the processing parameters according to the edge complexity, and output the final smoothed clothing edge image. The dual-branch neural network uses a deep convolutional neural network as its backbone and includes a main branch and edge branches. The main branch is used to extract the overall shape, texture, and deformation features of the clothing; The edge branches are used to extract local features of folds, seams, and contour transitions; The main branch and the edge branch maintain global consistency by sharing features; During the training process, the main body region of the dual-branch neural network adopts geometric constraints based on shape preservation, while the edge band adopts perceptual constraints based on feature space.

6. A garment edge smoothing device based on hierarchical modeling and dual-domain optimization, characterized in that, include: At least one processor and a memory communicatively connected to said at least one processor; The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 4.