Search

CN-119478089-B - Lace texture image diffusion generation method based on ADM and dynamic denoising filter model

CN119478089BCN 119478089 BCN119478089 BCN 119478089BCN-119478089-B

Abstract

The invention provides a lace texture image diffusion generation method based on an ADM and dynamic denoising filter model, wherein the model combines a learnable Gaussian blur layer with a high-pass filter technology, and the Gaussian blur layer aims to adaptively adjust the blur strength of an image according to different input images and reduce high-frequency noise in a lace texture image. The high-pass filtering technology highlights the main texture features of the image by enhancing the key areas such as the outline, the edge and the like of the main pattern in the image. The module is added into a downsampling layer of the ADM network, so that the phenomenon of excessive smoothness in the lace texture image generated by the original model is improved, and the texture layering sense of the image is enhanced.

Inventors

  • ZHONG SHANGPING
  • DENG KUN
  • CHEN KAIZHI

Assignees

  • 福州大学

Dates

Publication Date
20260505
Application Date
20241031

Claims (5)

  1. 1. A lace texture image diffusion generation method based on an ADM and a dynamic denoising filter model is characterized by comprising the following steps: Step S1, a data set is established, namely, a lace real object is converted into a lace texture image, firstly, image screening is carried out, all lace texture images with blank edges are cut, and a part with patterns is reserved; Step S2, constructing a fusion network based on dynamic denoising filtering, namely an encoder-decoder structure based on Unet networks, wherein the front four layers of the encoder consist of a residual error network ResBlock and a dynamic denoising filtering module G (x), the rear three layers consist of a self-attention module AttentionBlock and a residual error network, the encoder extracts characteristic information of an input image to obtain a characteristic image, the dynamic denoising filtering module is positioned in the encoder and used for denoising the extracted characteristic image and enhancing high-frequency components in the image, the decoder corresponds to a characteristic image restoration process and acquires image information of the encoding process through jump connection to assist the process, the self-attention mechanism is respectively positioned in the encoder and the decoder to acquire global dependency relation of the image to enhance high-frequency characteristics, and the network target is denoised through a forward learning process and generates a clean image in a reverse process; Step S3, constructing loss calculation in a training process, wherein the training process is to learn a noise-added image and finally output a predicted clean image to obtain a predicted noise amount, the target hope predicted noise value of the network is close to the noise value of an input image, the loss function is L2 loss, the input image is compared with the image after the network is denoised, if the predicted noise is closer to the real noise, the loss is lower, the image is closer to the real noise, the learning effect is better, and the image quality effect generated in the reverse process is better; step S4, training the fusion network constructed in the step S2 by using the lace texture image data set constructed in the step S1, wherein a loss calculation function in the step S3 is used in the training process; S5, after training is completed, inputting a random noise image by using a model obtained through training to generate a clean lace texture image; The fusion network based on dynamic denoising filtering in the step S2 comprises the following steps: (1) Unet overall network: The encoder and the decoder are respectively provided with seven layers, each layer is connected through a jump and is in a symmetrical structure, each layer of the encoder comprises two residual error networks and a lower sampling pooling layer, each layer of the decoder comprises an upper sampling pooling layer and then two residual error networks, the residual error networks extract characteristic images, the lower sampling pooling layer reduces images to one half of the original images, the upper sampling pooling layer amplifies the images by 2 times, the encoder is used for extracting image characteristics, the decoder restores the images through the characteristic images obtained by the encoder, finally, the restored image result is output, the images are 6 channels, the self-attention mechanism carries out attention calculation on the extracted high-level semantic characteristics, the global dependency relationship is obtained, the high-frequency characteristics of the images are enhanced, the dynamic denoising filter module is the first four layers of the main encoder and is connected behind each residual error network, and the texture characteristics are enhanced; (2) Dynamic denoising and filtering module: the method comprises the steps of a learnable Gaussian blur layer, convolution layers and a Sigmoid activation function, wherein the learnable Gaussian blur layer consists of two serialized 3x3 convolution products and a ReLU activation function, each layer is two-dimensional grouping convolution, the convolution kernel size is 3x3, the filling is 1, the number of input channels is consistent with that of output channels, the ReLU activation function is behind each convolution layer to ensure nonlinear expression capability, the convolution layers are 3x3 convolution, convolution operation is grouping convolution, each channel is independently processed, blurred images are generated through two convolutions of an input image and the ReLU activation function, the Sigmoid activation function is used for carrying out nonlinear mapping on the output, and an output value is compressed to the range of [0, 1] to generate filtering weights.
  2. 2. The method for generating lace texture image diffusion based on ADM and dynamic denoising filter model according to claim 1, wherein the process of establishing the data set in step S1 comprises the following steps: Step 11, data screening, namely checking the collected images, removing the images containing characters or other images not belonging to lace content from the images, and picking out lace images with blank edges on two sides of the images to ensure that all the images are clean and blank-free; Step S12, correcting and scaling the images selected in the step S11, deleting blank contents left on two sides of the images by using professional image correction software, ensuring that all the images only keep image main bodies, combining unprocessed images and processed images into a data set, scaling all the images, and unifying the length and the width of each image; And step 13, image filling and scaling, namely performing blank filling on the images processed in the step 12 to ensure that the length and the width of each image are equal, and scaling the image to 512 x 512 pixels in an equal ratio to ensure that the patterns of all the images are centered and have the same size.
  3. 3. The method for generating lace texture image diffusion based on ADM and dynamic denoising filter model according to claim 1, wherein the loss calculation process in step S3 comprises two parts: (1) The forward additive noise calculation formula is as follows: Wherein the method comprises the steps of , , Representing the image of the desired added noise, Represented as an added noise image; to actually add noise, t is the time step of training, Scheduling for variance of any time step t, so the final noise adding formula is obtained as follows: (2) Loss function: The final goal of the model generation is to enable the neural network to learn to generate a clean image, namely, the neural network needs to learn to denoise the image added with noise in the reverse process, and the formula of the reverse process is as follows: Wherein the method comprises the steps of And Are all parameters of Is a neural network predicted value of (1); during the training phase, the variance of the forward process Can be learned by re-parameterization or remain unchanged as a super-parameter, usually fixed Is constant Will be Comparing with the forward posterior, the training targets for the forward process are obtained as follows: Wherein the method comprises the steps of As the variance of the posterior distribution, Is the mean of posterior distribution, but is not directly to be used in the training phase And (3) with Because the goal in the generation phase is to restore the clean image from the noisy image, the noise is predicted Better, so that the comparison of the loss functions is the ratio of the losses between the real noise and the predicted noise, the mean square error is calculated, and the obtained loss functions are as follows: Wherein the method comprises the steps of Adding variance learning and loss term plus penalty term in training process Obtaining the final loss function ; Where v is the vector of the model output, Is a new variance.
  4. 4. The method for generating lace texture image diffusion based on ADM and dynamic denoising filter model as claimed in claim 1, wherein the training process in step S4 is as follows: step S41, before each round of training is started, inputting data of a batch into a current diffusion model network, randomly selecting a time step t from [1,2000], and adding noise conforming to the front distribution to the batch of images; s42, inputting the noise-added data in the S41 into a neural network for training, carrying out a denoising process of extracting and restoring the characteristics of the image, predicting noise and obtaining a model denoised image; Step S43, comparing the predicted noise with the real noise, namely comparing the L2 loss of the real image with that of the predicted image, and calculating the loss of the current batch data, wherein the calculating method is shown in step S3; and S44, gradient back propagation, wherein the network parameters are optimized by using an Adam optimizer, and the learning rate is 1e-5.
  5. 5. The method for generating lace texture image diffusion based on ADM and dynamic denoising filter model as claimed in claim 1, wherein the step S5 is characterized in that the judging step is as follows: Step S51, randomly sampling a noise image, and inputting the number of steps of the restored image; s52, inputting the image into a neural network, and carrying out noise prediction in the reverse process to obtain a denoised image; and step S53, finally outputting the obtained de-noised 512-pixel color lace texture image.

Description

Lace texture image diffusion generation method based on ADM and dynamic denoising filter model Technical Field The invention relates to the technical field, in particular to a lace texture image diffusion generation method based on an ADM and a dynamic denoising filter model. Background Currently, lace is widely used for various clothes, and is an important element in clothes design from being used as an ornament of clothes to being used nowadays. Lace is a product with artistic color, and people have subjectivity for appreciation. Therefore, how to design a lace product with enough diversity and high quality is a worthy research problem. Currently, human designers pay a great deal of time, cost and effort in lace design, but there are still products that are not aesthetically pleasing to the customer. In order to meet the demand of people for new ideas and aesthetic patterns, more diversified and high-quality lace products need to be designed, and new technologies and new methods in the current computer vision field are needed. The rapid development of the image generation field benefits from the progress of deep learning technology, at present, the image synthesis has been greatly developed in recent years, and new generation models, especially diffusion models, are continuously proposed, so that the quality and diversity of image generation are greatly improved, and the field has remarkable achievement in academic research and practical application. Denoising diffusion models have proven to be capable of generating high quality and diversity images compared to other models, and are superior to the current most advanced generation models. But there still exist problems in the generated image such as insufficient texture features, excessively smooth color expression, and insufficient texture levels, which result in reduced diversity and quality of the image. Disclosure of Invention In view of the above, the present invention aims to provide a lace texture image diffusion generation method based on an ADM and dynamic denoising filter model, wherein the model combines a learnable gaussian blur layer with a high-pass filter technology, and the gaussian blur layer aims to adaptively adjust the blur strength of an image according to different input images, so as to reduce high-frequency noise in a lace texture image. The high-pass filtering technology highlights the main texture features of the image by enhancing the key areas such as the outline, the edge and the like of the main pattern in the image. The module is added into a downsampling layer of the ADM network, so that the phenomenon of excessive smoothness in the lace texture image generated by the original model is improved, and the texture layering sense of the image is enhanced. In order to achieve the purpose, the invention adopts the following technical scheme that the lace texture image diffusion generation method based on the ADM and the dynamic denoising filter model comprises the following steps: Step S1, a data set is established, namely, a lace real object is converted into a lace texture image, firstly, image screening is carried out, all lace texture images with blank edges are cut, and a part with patterns is reserved; Step S2, constructing a fusion network based on dynamic denoising filtering, wherein the fusion network is shown in FIG. 1, based on Unet network, namely encoder-decoder structure, the front four layers of the encoder consist of a residual error network ResBlock and a dynamic denoising filtering module G (x), the rear three layers consist of a self-attention module AttentionBlock and a residual error network, each layer of the encoder consists of the self-attention module and the residual error network, the encoder extracts characteristic information of an input image to obtain a characteristic image, the dynamic denoising filtering module is positioned in the encoder to denoise the extracted characteristic image and enhance high-frequency components in the image, the decoder corresponds to the characteristic image restoration process to obtain image information of the encoding process through jump connection to assist the process, the self-attention mechanism is respectively positioned in the encoder and the decoder to obtain global dependence of the image, the high-frequency characteristics are enhanced, and the network target denoises through a learning forward process and generates a clean image in a reverse process; Step S3, constructing loss calculation in a training process, wherein the training process is to learn a noise-added image and finally output a predicted clean image to obtain a predicted noise amount, the target hope predicted noise value of the network is close to the noise value of an input image, the loss function is conventional L2 loss, the input image is compared with the image after the network is denoised, if the predicted noise is closer to the real noise, the lower the loss is, the closer the image