Method for generating lacy texture image diffusion based on EDM2 and non-classifier guide strategy

By employing a hybrid diffusion sampling method combining EDM2 and a classifier-free guidance strategy, along with self-perturbation and overfitting model back-guidance, the problems of texture blurring and unclear patterns in lace generation were solved, thereby improving image quality and diversity.

CN123160710APending Publication Date: 2026-11-24福建辅布司纺织有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611304624.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-26
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing diffusion models suffer from problems such as blurred and blocky textures, unclear main patterns, and overly similar features in lace generation tasks. Furthermore, a single generation guidance strategy is prone to overfitting with a small number of samples, leading to a decrease in image diversity.

Method used

A hybrid diffusion sampling method based on EDM2 and a classifier-free guidance strategy is adopted. By introducing time-step self-perturbation guidance and overfitting model back guidance during the inference stage, combined with the self-perturbation offset constrained by the boundary truncation, feature response difference fusion is performed to improve image quality and style diversity.

Benefits of technology

It effectively improves the texture detail accuracy and pattern clarity of lace images, enhances the generation quality and style diversity, solves the problems of blurred and blocky textures and unclear patterns, and reduces image copying in the case of few samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160710A_ABST
    Figure CN123160710A_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer vision image generation technology, and particularly to a method for generating lace texture images based on EDM2 and a classifier-free guidance strategy. The method includes: constructing a training set by removing edges and proportionally scaling and filling the original lace image; training a master model that has not fully converged and an overfitted model that has fully converged after encoding and adding noise; introducing random perturbation into the inference sampling to calculate the perturbation time step; interpolating and fusing the prediction results at the current and perturbation time steps to obtain self-perturbed prediction features; extracting the feature responses of the overfitted model, performing difference fusion to guide the master model in reverse, and decoding the output image. This invention enhances the accuracy of texture details by injecting temporal consistency constraints through self-perturbed feature fusion, and effectively alleviates the image copying problem by using overfitted features as a repulsive signal to guide the master model in reverse, thereby improving the clarity and style diversity of generated lace images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision image generation technology, and in particular to a method for generating lace texture images based on EDM2 and a classifier-free guided strategy. Background Technology

[0002] The lace industry plays a significant role in driving the upstream and downstream textile supply chains. With the increasing demand for personalized products and services, utilizing deep learning technology to automatically generate high-quality lace material libraries has become an effective way to lower design barriers, save trial-and-error costs, and free up human resources. In recent years, denoising diffusion models, leveraging their probabilistic modeling advantages, have achieved a leap forward in the realism and semantic consistency of image synthesis. Compared to earlier image generation models, diffusion models, by progressively removing noise in the latent space, can generate extremely high-quality texture images. This provides core underlying technical support for the industrial transformation of the creative industries and the efficient diffusion generation of lace textures.

[0003] However, current diffusion models generally suffer from problems such as blurred and blocky textures, unclear and indistinct main patterns, and overly similar features in generated images when applied to lace generation tasks. In addition, in existing single generation guidance strategies, time step perturbation guidance is prone to exacerbating model overfitting with few samples, leading to a decrease in image diversity. On the other hand, simple overfitting reverse guidance is difficult to effectively improve image clarity. It is difficult to simultaneously take into account both generation quality and style richness. Summary of the Invention

[0004] To overcome the above shortcomings, this invention provides a lace texture image diffusion generation method based on EDM2 and a classifier-free guidance strategy, aiming to improve the problems of blurred and blocky image textures, unclear subjects, and overly similar generated images in existing lace generation models.

[0005] This invention provides the following technical solution: a method for generating lace texture images based on EDM2 and a classifier-free guidance strategy, comprising: S1. Remove blank edges from the original lace image while retaining the main body of the pattern. After filling the blanks to unify the length and width, scale it proportionally to the preset pixel size to construct a lace texture training dataset. S2. Encode the images in the lace texture training dataset into the latent space and construct a noisy input to train the EDM2 model. Obtain and save the main model that has not fully converged and the overfitted model that has fully converged. S3. In the inference sampling loop of the main model, a random perturbation parameter is introduced for the current sampling time step, and the time step is truncated within the preset upper and lower bounds. The corresponding perturbation time step is calculated and obtained. S4. Using the main model, the original prediction result and the perturbation prediction result are obtained at the current sampling time step and the perturbation time step, respectively. The original prediction result and the perturbation prediction result are then linearly interpolated and fused using a preset guiding coefficient to obtain the self-perturbation prediction feature. S5. Extract the feature response of the overfitted model as the target signal, and use a preset intensity coefficient to perform difference fusion between the target signal and the self-perturbation prediction feature to guide the main model in reverse. S6. After completing all time steps of the inference sampling loop, use the decoder to decode and restore the latent spatial features generated by the master model, and output a colored lace texture image.

[0006] Preferably, in step S1, the step of constructing the lace texture training dataset includes: The collected raw lace images were initially screened to remove interfering samples containing text information or non-lace patterns, and pure lace images with blank edges on both sides were extracted. Image processing tools were used to perform cropping correction on the edge blank areas of the pure lace image, and redundant background elements were removed to ensure that the main features of the lace pattern were preserved within the image field of view. The corrected image is filled with equal-ratio whitespace around its edges to unify the aspect ratio. Then, the image after the equal-ratio whitespace filling is globally scaled to a preset pixel size, so that the lace body is centered and the lace texture training dataset is constructed.

[0007] Preferably, in step S2, the step of training the EDM2 model includes: The extracted batch image data is mapped to the latent space by an encoder, and intensity noise generated by random normal distribution variables is superimposed to construct a noisy input with time step identifiers. The noisy input is fed into the denoising network of the EDM2 model to perform forward propagation calculation, outputting the denoising prediction features and logarithmic variance values ​​at the current noise level, and calculating the uncertainty loss based on the denoising prediction features and logarithmic variance values. Gradient backpropagation is performed based on the uncertainty loss, and the network weights are continuously updated in combination with a dynamic learning rate adjustment strategy until the main model in an incomplete convergence state and the overfitted model in a fully converged state are obtained respectively.

[0008] Preferably, in step S3, the step of calculating and obtaining the corresponding perturbation time step includes: In the current iteration of the inference sampling loop, the current sampling time step is obtained, and the potential feature mapping state corresponding to the current sampling time step is set; The random perturbation parameter, which is composed of the product of the hyperparameter controlling the perturbation amplitude and the standard normally distributed random variable, is introduced into the current sampling time step to generate a small self-perturbation offset in the time dimension; The current sampling time step is superimposed with the self-disturbance offset, and the superposition result is limited to between the preset minimum lower bound and maximum upper bound of the time step using a boundary truncation function, and the final disturbance time step is output.

[0009] Preferably, in step S4, the step of obtaining the original prediction result and the perturbation prediction result respectively includes: At the current sampling time step, the noisy latent feature states are synchronously input into the denoising mapping network of the main model for forward feature extraction; The neuron parameters of the main model are used to perform convolution and attention operations on the latent feature state, and the original prediction result corresponding to the current sampling time step is decoded and output. Keeping the input feature state unchanged, the time step condition is replaced with the perturbation time step and fed back into the denoising mapping network to perform forward prediction, thereby obtaining the perturbation prediction result with time consistency constraint characteristics.

[0010] Preferably, in step S4, the step of performing linear interpolation fusion includes: Extract the multidimensional feature tensors of the original prediction result and the perturbation prediction result in the latent space, and calculate the numerical deviations of the original prediction result and the perturbation prediction result in the corresponding channel and spatial dimension; A preset guiding coefficient is introduced to adjust the influence of the perturbation amplitude, and the numerical deviation is multiplied by the guiding coefficient to quantize the perturbation guiding gradient. The quantized perturbation-guided gradient is added to the perturbation prediction result, and time consistency constraint information is injected into the network output to obtain the self-perturbation prediction feature with improved detail accuracy and structural stability.

[0011] Preferably, in step S5, the step of extracting the feature response of the overfitted model as the target signal includes: After completing the self-perturbation-guided fusion at the current time step, load the fully converged overfitted model retained from the pre-training phase. The latent feature data, after self-perturbation correction, is input into the deep network architecture of the overfitted model to perform independent inference forward propagation; Extract the feature response map with memory properties generated by the output of the overfitted model for the current feature, and solidify the feature response map into the target signal for subsequent reverse guidance constraints.

[0012] Preferably, in step S5, the step of performing difference fusion includes: A preset strength coefficient with a value greater than zero is set to control the weight ratio and guidance intensity of network diversity features injected into the normally generated trajectory. Calculate the gradient difference matrix between the target signal and the self-perturbation prediction feature to generate a guiding gradient field; The intensity coefficient is used to scale the amplitude of the guiding gradient field, and the scaled guiding gradient field is then superimposed onto the output features of the main model to complete the difference fusion.

[0013] Preferably, in step S6, the step of outputting the colored lace texture image includes: After completing all time steps of the inference sampling loop, the pure latent space feature matrix output by the main model in the last sampling iteration is extracted, and preparation is made to perform cross-domain transformation to pixel space. The latent spatial feature decoder that matches the model's pre-encoder is invoked, and the pure latent spatial feature matrix is ​​fed into a mapping network consisting of multi-level upsampling and convolution for amplification and restoration. The decoded high-dimensional feature tensor is mapped to a color pixel grid with RGB channels, and finally the color lace texture image with the target resolution and clear texture is rendered and exported.

[0014] The present invention has the following beneficial effects: 1. In this invention, a hybrid guided diffusion sampling strategy is proposed. By simultaneously introducing time-step self-perturbation guidance and overfitting model reverse guidance during the inference stage, the interpolation fusion of self-perturbation features is used to inject time consistency constraints to enhance the texture detail accuracy of lace images. At the same time, the feature response of the overfitting model is used as a repulsive signal for reverse guidance, thereby effectively improving the image copying problem in the case of few samples and improving the generation quality and style diversity of lace images.

[0015] 2. In this invention, an auxiliary perturbation time step is generated by constructing a self-perturbation offset with boundary truncation constraints, so that the model can obtain dual-track prediction responses under different time conditions in the same noisy state. The calculated perturbation-guided gradient is used to directly superimpose and intervene in the network output, which effectively improves the problems of texture blurring and insufficient clarity of the main body of the pattern that are easy to occur in the traditional diffusion model in the lace generation task.

[0016] 3. In this invention, the special shape of the lace pattern is addressed by using edge whitening and proportional whitening based on the longest side. This ensures that the image meets the matrix dimension input requirements of the underlying network while maintaining the original length-width ratio of the lace. This effectively avoids texture deformation caused by conventional forced stretching and scaling operations, and provides standardized data with consistent size and format for the diffusion model to extract high-quality semantic features in the latent space. Attached Figure Description

[0017] Figure 1 This is a flowchart of the lace texture image diffusion generation method based on EDM2 and a classifier-free guidance strategy proposed in this invention. Figure 2 This is a flowchart of the model training process proposed in this invention; Figure 3 This is a flowchart of the model generation process proposed in this invention. Detailed Implementation

[0018] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] In embodiments of the present invention, the present invention provides a method for generating lace texture images based on EDM2 and a classifier-free guidance strategy, such as... Figure 1 As shown, it includes: S1. Remove blank edges from the original lace image while retaining the main body of the pattern. After filling the blanks to unify the length and width, scale it proportionally to the preset pixel size to construct a lace texture training dataset. Further, step S1, the step of constructing the lace texture training dataset, includes: The collected raw lace images were initially screened to remove interfering samples containing text information or non-lace patterns, and pure lace images with blank edges on both sides were extracted. Image processing tools were used to remove and correct the white areas at the edges of the pure lace image, and redundant background elements were stripped away to ensure that the main features of the lace pattern were preserved within the field of view of the image. The corrected image is filled with equal-ratio whitespace around its edges to unify the aspect ratio. Then, the image after the equal-ratio whitespace filling is globally scaled to a preset pixel size, so that the lace body is centered and the lace texture training dataset is constructed.

[0020] Specifically, when constructing the lace texture training dataset, the collected original lace images were first screened. By examining the image pixel content, interfering samples containing text information or non-lace patterns were removed, and pure lace images with blank edges on both sides were extracted from the remaining data. This operation eliminated noise features unrelated to lace, ensuring the visual purity of the model input data.

[0021] Next, image processing tools were used to perform cropping correction on the white space at the edges of the clean lace image. By scanning and cropping the solid-color background pixels at the image edges, redundant background elements were removed, ensuring that only the main features of the lace pattern remained within the image's field of view. The effective width of the clean lace image after cropping correction was set to [value missing]. And the effective height is In order to meet the requirements of the diffusion model for a square input matrix and to avoid destroying the original physical aspect ratio of the lace pattern, a proportional blanking operation is performed around the corrected image.

[0022] In the proportional whitespace fill operation, the longest side of the corrected image is used as the reference size to calculate the number of whitespace pixels to be filled. The side length of the filled square image is set to... The total number of blank pixels in the horizontal direction is The total number of blank pixels in the vertical direction is The corresponding formula for calculating space dimensions is as follows: ; ; ; In the above formula, This represents the function that takes the maximum value. After obtaining the total fill amount, Divide the image into two equal parts and attach them to the left and right edges respectively. The image is divided into two equal parts and appended to the top and bottom edges of the image respectively. The fill area uses the same blank pixels as the original background, thus ensuring that the physical dimensions of the image are strictly equal.

[0023] The image, after undergoing proportional whitespace filling, will then be globally scaled to a preset pixel size. The side length of this preset pixel size is set to... The bilinear interpolation image scaling algorithm is used to scale images with a side length of... The square image is mapped proportionally to × Within a pixel grid, and considering actual lace generation conditions, the preset pixel size is set to 1024×1024 pixels. This process ensures that the main body of the lace pattern is centered within an image matrix of perfectly uniform size, thus completing the construction of the lace texture training dataset.

[0024] This step standardizes the size and spatial location of all input images, avoiding lace texture distortion caused by conventional forced stretching and scaling, and providing a standardized data source for feature learning of the diffusion model.

[0025] S2. Encode the images in the lace texture training dataset into the latent space and construct a noisy input to train the EDM2 model. Obtain and save the master model that has not fully converged and the overfitted model that has fully converged. Furthermore, step S2, the step of training the EDM2 model, includes: The extracted batch image data is mapped to the latent space by an encoder, and intensity noise generated by random normal distribution variables is superimposed to construct a noisy input with time step identifiers. The noisy input is fed into the denoising network of the EDM2 model to perform forward propagation calculation, outputting the denoised prediction features and logarithmic variance values ​​at the current noise level, and calculating the uncertainty loss based on the denoised prediction features and logarithmic variance values. Gradient backpropagation is performed based on uncertainty loss, and the network weights are continuously updated by dynamically adjusting the learning rate until the main model in a state of incomplete convergence and the overfitted model in a state of complete convergence are obtained respectively.

[0026] Specifically, during model training, batches of lace images are first extracted from the constructed lace texture training dataset. An image feature encoder is then used to map the extracted batches of lace images into a reduced-dimensional latent space, obtaining the latent space feature representation corresponding to that batch of images. The mapping process satisfies the following formula: ; In this formula, Represents batch lace image data, The nonlinear mapping function operator representing the encoder, This represents the latent spatial feature representation generated after image dimensionality reduction. In this scheme, to meet the computational efficiency requirements of the underlying network architecture, the feature tensor dimension of this latent spatial feature representation is preferably 64×64×4.

[0027] Next, a noisy input with time step identifiers needs to be constructed for the latent spatial features. The corresponding intensity noise is generated using a random normally distributed variable; the formula for generating this noise intensity is: ; In this formula, This represents the standard deviation of continuous noise intensity corresponding to the time step identifier. Let be a random variable that follows a standard normal distribution. This represents the standard deviation parameter in the preset distribution mechanism. This represents the mean parameter in the preset distribution mechanism. In this scheme, to ensure that the noise scheduling matches the lace image features, the mean parameter in the preset distribution mechanism is preferably -1.2, and the standard deviation parameter is preferably 1.2. Then, this intensity noise is superimposed on the latent space feature representation to construct a noisy input, and the superposition formula is: ; In this formula, This represents the completed noisy input. It is a random noise variable with the same dimension as the latent space features and which follows a standard normal distribution.

[0028] The constructed noisy input is fed into the denoising network of the EDM2 model for forward propagation calculation. The denoising network performs feature extraction and denoising processing on the input based on the current continuous noise intensity standard deviation, and outputs the denoised predicted features and logarithmic variance at the current noise level. The forward propagation formula is: ; In this formula, This represents the current weight parameter. EDM2 denoising network, The denoised predicted features representing the network output are essentially the latent features of pure lace predicted by the network. The logarithmic variance of the network output is used to quantify the uncertainty of the current recovery calculation. Subsequently, the uncertainty loss of the model is calculated based on the latent features of pure lace predicted by the network and the logarithmic variance.

[0029] Based on the uncertainty loss obtained above, gradient backpropagation is performed on the network weight parameters, and the model network parameters are continuously iteratively updated using a dynamic learning rate adjustment strategy, covering the complete training loop of the above forward calculation and backpropagation, as follows: Figure 2 As shown. During the training process, a set of network weights is extracted and saved at a specified intermediate iteration step node, serving as the master model in an incompletely converged state. After saving the master model, backpropagation is continued to update the network weights until the model's loss function is completely reduced to a minimum and the network fully fits the detailed features in the lace training set. The corresponding network weights at this point are then saved as the fully converged overfitted model.

[0030] This step establishes a paradigm for noise addition and feature recovery of lace patterns in the latent space, and provides the necessary network structure foundation for the implementation of subsequent hybrid guidance strategies by separating and extracting two different convergence states of the network model in a single training process.

[0031] S3. In the inference sampling loop of the main model, introduce random perturbation parameters for the current sampling time step, truncate and limit them within the preset upper and lower bounds of the time step, and calculate and obtain the corresponding perturbation time step. Further, step S3, the step of calculating and obtaining the corresponding perturbation time step, includes: In the current iteration of the inference sampling loop, obtain the current sampling time step and set the potential feature mapping state corresponding to the current sampling time step; A random perturbation parameter, consisting of the product of a hyperparameter controlling the perturbation amplitude and a standard normally distributed random variable, is introduced into the current sampling time step to generate a small self-perturbation offset in the time dimension. The current sampling time step is superimposed with the self-disturbance offset, and the superposition result is limited to the preset minimum lower bound and maximum upper bound of the time step using a boundary truncation function, and the final perturbation time step is output.

[0032] Specifically, when performing the inference sampling loop for the lace texture image using the master model that has not fully converged, the current iteration of the inference sampling loop is entered first. In this stage, the noise reduction generation process using a hybrid guided strategy is applied sequentially, such as... Figure 3 As shown, the system extracts the current sampling time step allocated in the scheduler and sets the lace latent feature mapping state corresponding to this current sampling time step. This latent feature mapping state is determined by the denoising output of the previous sampling iteration, or by the initial Gaussian random noise if it is the first iteration.

[0033] To inject temporal consistency constraints into the denoised trajectory to stabilize the lace pattern structure, a random perturbation parameter is introduced into the current sampling time step, generating a small self-perturbation offset in the time dimension. The formula for calculating this small self-perturbation offset is as follows: ; In this formula, This represents the tiny self-perturbation offset in the time dimension of the generated data. This represents a hyperparameter that indicates the pre-defined amplitude of the control disturbance. Let represent a random variable that follows a standard normal distribution. In this scheme, the hyperparameter controlling the perturbation amplitude is preferably 0.1 to ensure that the introduced self-perturbation offset provides effective constraints without deviating excessively from the original generated trajectory.

[0034] After obtaining the small self-perturbation offset, the current sampling time step is arithmetically superimposed with this offset. To prevent the superimposed time step from exceeding the bounds and causing model collapse, a boundary truncation function is used to limit the superposition result, forcing it to be between the minimum lower bound and the maximum upper bound of the time step preset by the diffusion model. The formula for outputting the final perturbation time step is as follows: ; In this formula, This represents the final perturbation time step output after truncation and constraint. This represents the boundary truncation function. Indicates the current sampling time step. This represents the minimum lower bound of the preset time steps during the diffusion generation process. This represents the maximum upper bound of the preset time step during the diffusion generation process. In this scheme, the minimum lower bound of the time step is preferably 0.002, and the maximum upper bound of the time step is preferably 80.

[0035] This step provides the generating network with an auxiliary temporal condition in a neighboring state by applying a random offset with boundary protection on the normal diffusion time step, laying the temporal dimension foundation for implementing hybrid sampling.

[0036] S4. Using the main model, obtain the original prediction results and the perturbation prediction results at the current sampling time step and the perturbation time step respectively, and perform linear interpolation fusion on the original prediction results and the perturbation prediction results through the preset guiding coefficient to obtain the self-perturbation prediction features. Further, step S4, which involves obtaining the original prediction result and the perturbation prediction result respectively, includes: At the current sampling time step, the noisy latent feature states are synchronously input into the denoising mapping network of the main model for forward feature extraction; The convolution and attention operations are performed on the latent feature states using the neuron parameters of the main model, and the decoded output is the original prediction result corresponding to the current sampling time step; Keeping the input feature state unchanged, the time step conditions are replaced with perturbation time steps and fed back into the denoising mapping network to perform forward prediction, thereby obtaining perturbation prediction results with time consistency constraints.

[0037] Furthermore, step S4, the step of performing linear interpolation fusion, includes: Extract the multidimensional feature tensors of the original prediction results and the perturbation prediction results in the latent space, and calculate the numerical deviations of the original prediction results and the perturbation prediction results in the corresponding channels and spatial dimensions. A preset guiding coefficient is introduced to adjust the influence of the perturbation amplitude, and the numerical deviation is multiplied by the guiding coefficient to quantize the perturbation guiding gradient. The quantized perturbation-guided gradient is added to the perturbation prediction result, and the time consistency constraint information is injected into the network output to obtain self-perturbation prediction features with improved detail accuracy and structural stability.

[0038] Specifically, at the current sampling time step, the noisy lace latent feature state generated in the previous step is synchronously input into the denoising mapping network of the main model for forward feature extraction. The denoising mapping network uses its neuron parameters to perform convolutional feature extraction and attention feature aggregation operations on the input latent feature state, and decodes and outputs the lace clean image prediction benchmark corresponding to the current sampling time step, i.e., the original prediction result.

[0039] Subsequently, auxiliary prediction features within the temporal neighborhood need to be obtained. The input tensor containing noisy lace latent feature state data is kept unchanged in the hardware memory. The time step condition at the input of the diffusion model is replaced with the perturbation time step calculated in the previous stage, and then fed back into the aforementioned denoising mapping network to perform independent forward prediction, thereby obtaining an auxiliary feature representation with temporal consistency constraints, i.e., the perturbation prediction result.

[0040] After obtaining the denoised prediction outputs under the two different time conditions, the multidimensional feature tensors of the original prediction results and the perturbation prediction results in the latent space are extracted, and the numerical deviations between the original prediction results and the perturbation prediction results in the corresponding channels and spatial dimensions are calculated. A preset guiding coefficient is introduced to adjust the influence of the perturbation amplitude, and the numerical deviation is multiplied by the preset guiding coefficient to quantize the perturbation guiding gradient. Finally, the quantized perturbation guiding gradient and the perturbation prediction results are added together. The calculation formula for this linear interpolation fusion is as follows: ; In this formula, This represents the self-perturbation prediction feature generated after linear interpolation fusion. This represents the potential characteristic state of lace containing noise. Indicates the current sampling time step. Indicates the time step of the disturbance. This represents the forward inference process of the denoising mapping network in the main model. This represents the original prediction result calculated by the network. This represents the disturbance prediction result calculated by the network. This represents the preset guiding coefficient. This represents the numerical deviation calculated by subtracting the two values. In this scheme, the preset guiding coefficient is preferably 1.5, thereby injecting smoothness and consistency information to the maximum extent without destroying the global structure of the image.

[0041] This step improves the problem of unclear subject in lace-generated images by fusing the feature responses of the original time step and the perturbed time step under the same feature state, forcing the smooth and consistent information of the time dimension to be injected into the final output of the network.

[0042] S5. Extract the feature response of the overfitted model as the target signal, and use the preset intensity coefficient to perform difference fusion between the target signal and the self-perturbation prediction feature to guide the main model in reverse. Further, step S5, the step of extracting the feature response of the overfitted model as the target signal, includes: After completing the self-perturbation-guided fusion at the current time step, load the fully converged overfitted model retained from the pre-training phase. The latent feature data, after self-perturbation correction, is input into the deep network architecture of the overfitted model to perform independent inference forward propagation; Extract the feature response map with memory properties generated by the output of the overfitted model for the current features, and solidify the feature response map into the target signal for subsequent reverse guidance constraints.

[0043] Furthermore, step S5, the step of performing difference fusion, includes: Set a preset strength coefficient with a value greater than zero to control the weight ratio and guidance intensity of network diversity features injected into the normally generated trajectory. Calculate the gradient difference matrix between the target signal and the self-perturbation prediction features to generate the guiding gradient field; The magnitude of the guiding gradient field is scaled using an intensity coefficient, and the scaled guiding gradient field is then superimposed onto the output features of the main model to complete the difference fusion.

[0044] Specifically, after completing the self-perturbation-guided fusion at the current time step, the system loads the fully converged overfitted model retained from the pre-training phase. The lace latent feature data obtained in the previous steps, after self-perturbation correction, is input into the deep network architecture of this overfitted model, and independent inference forward propagation computation is performed within this architecture. The lace feature response map with memorization properties generated by the output of the overfitted model for the current features is extracted, and this feature response map is solidified as the target signal for subsequent reverse guidance constraints.

[0045] A preset intensity coefficient with a value greater than zero is then set. This coefficient controls the weighting ratio and guidance intensity of the network's diverse features injected into the normally generated trajectory. The system calculates the gradient difference matrix between the target signal and the self-perturbed predicted features, thereby generating a guiding gradient field pointing to the diversified lace data manifold. This guiding gradient field is then scaled using the aforementioned intensity coefficient, and the scaled guiding gradient field is then superimposed onto the output features of the main model. The calculation formula for this difference fusion is as follows: ; In this formula, This represents the final network feature vector output after difference fusion. This parameter represents the forward inference result of the denoising network of the main model. In conjunction with the steps of this implementation, this parameter corresponds to the input self-perturbation prediction feature. This parameter represents the forward inference result of the denoising network in the overfitted guided model. In the context of this implementation, this parameter corresponds to the extracted target signal. This indicates the set strength coefficient. This represents the gradient difference matrix calculated between the target signal and the self-perturbation prediction features. This represents the latent space features of the input lace. This parameter represents the noise level corresponding to the sampling time step. This represents the conditional information variables in the model. In this scheme, the intensity coefficient is preferably set to 0.8 to perfectly balance the relationship between model diversity generation and image fidelity.

[0046] This step utilizes the extreme feature responses extracted by the overfitted network as a repulsive signal to guide the main model away from the easily homogenized generation trajectory, effectively alleviating the image copying problem and improving the diversity of generated lace texture images.

[0047] S6. After completing all time steps of the inference sampling loop, use the decoder to decode and restore the latent spatial features generated by the master model, and output a colored lace texture image.

[0048] Further, step S6, the step of outputting the colored lace texture image, includes: After completing all time steps of the inference sampling loop, the pure latent space feature matrix output by the main model in the last sampling iteration is extracted, and preparation is made to perform cross-domain transformation to pixel space. The latent spatial feature decoder that matches the model's pre-encoder is invoked, and the pure latent spatial feature matrix is ​​fed into a mapping network consisting of multi-level upsampling and convolution for amplification and restoration. The decoded high-dimensional feature tensor is mapped to a color pixel grid with RGB channels, and finally a color lace texture image with the target resolution and clear texture is rendered and exported.

[0049] Specifically, after completing all time steps of the inference sampling loop, the model finishes all denoising processing of the input. The system extracts the clean latent space feature matrix output by the main model in the last sampling iteration, preparing to perform a cross-domain transformation from abstract data to pixel space. This clean latent space feature matrix highly compresses the texture details and semantic structure of the generated lace image.

[0050] Then, the latent spatial feature decoder, matched with the model's pre-encoder, is invoked, feeding the extracted pure latent spatial feature matrix into this decoding network. This decoder internally consists of a mapping network composed of alternating upsampling and convolutional layers, used to progressively enlarge the spatial dimensions of the abstract matrix and restore its features. The calculation formula for this feature decoding and restoration process is as follows: ; In this formula, This represents the pure latent space feature matrix characterizing the lace pattern, output by the main model in the last sampling iteration. This represents the latent spatial feature decoder network function, which consists of multiple levels of upsampling and convolution. This represents the high-dimensional feature tensor output after being amplified and recalculated by the decoder.

[0051] After the decoder outputs a high-dimensional feature tensor, the mapping layer at the end of the network linearly maps its channel dimensions into a color pixel grid with RGB channels. The system then truncates and renders the tensor values ​​of this color pixel grid using a standard image format, ultimately exporting a color lace texture image with the target resolution and clear texture. Based on the actual lace generation network structure settings, the target resolution is 512×512 pixels.

[0052] This step successfully transforms the high-dimensional abstract data in the latent space, optimized by a hybrid guidance strategy, into a visually perceptible pixel array, completing the final rendering and output of a high-quality lace image.

[0053] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for generating lace texture images based on EDM2 and a classifier-free guided strategy, characterized in that, include: S1. Remove blank edges from the original lace image while retaining the main body of the pattern. After filling the blanks to unify the length and width, scale it proportionally to the preset pixel size to construct a lace texture training dataset. S2. Encode the images in the lace texture training dataset into the latent space and construct a noisy input to train the EDM2 model. Obtain and save the main model that has not fully converged and the overfitted model that has fully converged. S3. In the inference sampling loop of the main model, a random perturbation parameter is introduced for the current sampling time step, and the time step is truncated within the preset upper and lower bounds. The corresponding perturbation time step is calculated and obtained. S4. Using the main model, the original prediction result and the perturbation prediction result are obtained at the current sampling time step and the perturbation time step, respectively. The original prediction result and the perturbation prediction result are then linearly interpolated and fused using a preset guiding coefficient to obtain the self-perturbation prediction feature. S5. Extract the feature response of the overfitted model as the target signal, and use a preset intensity coefficient to perform difference fusion between the target signal and the self-perturbation prediction feature to guide the main model in reverse. S6. After completing all time steps of the inference sampling loop, use the decoder to decode and restore the latent spatial features generated by the master model, and output a colored lace texture image.

2. The lace texture image diffusion generation method based on EDM2 and a classifier-free guidance strategy according to claim 1, characterized in that, Step S1, the step of constructing the lace texture training dataset, includes: The collected raw lace images were initially screened to remove interfering samples containing text information or non-lace patterns, and pure lace images with blank edges on both sides were extracted. Image processing tools were used to perform cropping correction on the edge blank areas of the pure lace image, and redundant background elements were removed to ensure that the main features of the lace pattern were preserved within the image field of view. The corrected image is filled with equal-ratio whitespace around its edges to unify the aspect ratio. Then, the image after the equal-ratio whitespace filling is globally scaled to a preset pixel size, so that the lace body is centered and the lace texture training dataset is constructed.

3. The method for generating lace texture images based on EDM2 and a classifier-free guidance strategy according to claim 1, characterized in that, Step S2, the step of training the EDM2 model, includes: The extracted batch image data is mapped to the latent space by an encoder, and intensity noise generated by random normal distribution variables is superimposed to construct a noisy input with time step identifiers. The noisy input is fed into the denoising network of the EDM2 model to perform forward propagation calculation, outputting the denoising prediction features and logarithmic variance values ​​at the current noise level, and calculating the uncertainty loss based on the denoising prediction features and logarithmic variance values. Gradient backpropagation is performed based on the uncertainty loss, and the network weights are continuously updated in combination with a dynamic learning rate adjustment strategy until the main model in an incomplete convergence state and the overfitted model in a fully converged state are obtained respectively.

4. The method for generating lace texture images based on EDM2 and a classifier-free guided strategy according to claim 1, characterized in that, Step S3, the step of calculating and obtaining the corresponding perturbation time step, includes: In the current iteration of the inference sampling loop, the current sampling time step is obtained, and the potential feature mapping state corresponding to the current sampling time step is set; The random perturbation parameter, which is composed of the product of the hyperparameter controlling the perturbation amplitude and the standard normally distributed random variable, is introduced into the current sampling time step to generate a small self-perturbation offset in the time dimension; The current sampling time step is superimposed with the self-disturbance offset, and the superposition result is limited to between the preset minimum lower bound and maximum upper bound of the time step using a boundary truncation function, and the final disturbance time step is output.

5. The method for generating lace texture images based on EDM2 and a classifier-free guidance strategy according to claim 1, characterized in that, Step S4, the step of obtaining the original prediction result and the perturbation prediction result respectively, includes: At the current sampling time step, the noisy latent feature states are synchronously input into the denoising mapping network of the main model for forward feature extraction; The neuron parameters of the main model are used to perform convolution and attention operations on the latent feature state, and the original prediction result corresponding to the current sampling time step is decoded and output. Keeping the input feature state unchanged, the time step condition is replaced with the perturbation time step and fed back into the denoising mapping network to perform forward prediction, thereby obtaining the perturbation prediction result with time consistency constraint characteristics.

6. The method for generating lace texture images based on EDM2 and a classifier-free guidance strategy according to claim 1, characterized in that, In step S4, the step of performing linear interpolation fusion includes: Extract the multidimensional feature tensors of the original prediction result and the perturbation prediction result in the latent space, and calculate the numerical deviations of the original prediction result and the perturbation prediction result in the corresponding channel and spatial dimension; A preset guiding coefficient is introduced to adjust the influence of the perturbation amplitude, and the numerical deviation is multiplied by the guiding coefficient to quantize the perturbation guiding gradient. The quantized perturbation-guided gradient is added to the perturbation prediction result, and time consistency constraint information is injected into the network output to obtain the self-perturbation prediction feature with improved detail accuracy and structural stability.

7. The method for generating lace texture images based on EDM2 and a classifier-free guidance strategy according to claim 1, characterized in that, In step S5, the step of extracting the feature response of the overfitted model as the target signal includes: After completing the self-perturbation-guided fusion at the current time step, load the fully converged overfitted model retained from the pre-training phase. The latent feature data, after self-perturbation correction, is input into the deep network architecture of the overfitted model to perform independent inference forward propagation; Extract the feature response map with memory properties generated by the output of the overfitted model for the current feature, and solidify the feature response map into the target signal for subsequent reverse guidance constraints.

8. The method for generating lace texture images based on EDM2 and a classifier-free guided strategy according to claim 1, characterized in that, In step S5, the step of performing difference fusion includes: A preset strength coefficient with a value greater than zero is set to control the weight ratio and guidance intensity of network diversity features injected into the normally generated trajectory. Calculate the gradient difference matrix between the target signal and the self-perturbation prediction feature to generate a guiding gradient field; The intensity coefficient is used to scale the amplitude of the guiding gradient field, and the scaled guiding gradient field is then superimposed onto the output features of the main model to complete the difference fusion.

9. The method for generating lace texture images based on EDM2 and a classifier-free guidance strategy according to claim 1, characterized in that, Step S6, the step of outputting the colored lace texture image, includes: After completing all time steps of the inference sampling loop, the pure latent space feature matrix output by the main model in the last sampling iteration is extracted, and preparation is made to perform cross-domain transformation to pixel space. The latent spatial feature decoder that matches the model's pre-encoder is invoked, and the pure latent spatial feature matrix is ​​fed into a mapping network consisting of multi-level upsampling and convolution for amplification and restoration. The decoded high-dimensional feature tensor is mapped to a color pixel grid with RGB channels, and finally the color lace texture image with the target resolution and clear texture is rendered and exported.