A method, system and medium for generating texture image of decorative surface material
The method based on the latent diffusion model solves the problem that traditional texture generation technology is difficult to handle complex textures, and realizes the automatic generation of high-quality and diverse decorative surface material texture images. It is suitable for interior design, has a short creation cycle and is suitable for mass production. .
Patent Information
- Application Number
- CN202410741555.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Traditional texture generation technology is difficult to handle complex or unknown texture types, is time-consuming and labor-intensive, and is difficult to maintain long-distance consistency and diversity of textures.
Using a method based on the latent diffusion model, the image generation model is trained by constructing a decorative surface material image data set. The input decorative surface material image and text information are encoded into embedding vectors, and the multi-head attention mechanism is used to map them into the image generation model to generate The texture image associated with the input image.
It realizes the automatic generation of inspiring interior designs, has a short creation cycle, is suitable for mass production, can effectively capture the inner structure and details of complex textures, and improves texture consistency and diversity.
Smart Images

Figure CN118314243B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and in particular to a method, system and medium for generating a texture image of a decorative surface material guided by a condition and based on a potential diffusion model. Background Art
[0002] As architectural projects become more and more complex, designers need more diverse materials and maps to meet the needs of different projects. High-quality material texture generation is essential to improving visual realism. Traditional texture generation techniques mainly rely on manual creation or copying and splicing texture samples collected from the real world. Although these methods can achieve the desired effect to some extent, they are often time-consuming and labor-intensive, and have difficulty handling highly complex or unknown texture types.
[0003] In recent years, the development of deep learning, especially generative adversarial networks (GANs) and variational autoencoders (VAEs), has opened up new avenues for automatically generating high-quality textures. However, these methods still face challenges in generating textures with complex structures and high details, especially in maintaining the long-distance consistency and diversity of textures. Latent Diffusion Models (LDMs), as an emerging deep generative model, generate data by simulating the diffusion process of the distribution of data in the latent space. Compared with traditional generative models, LDMs can better capture and reproduce the intrinsic structure and complexity of data, making them a strong candidate for solving the above problems. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a method, system and medium for generating a texture image of a decorative surface material based on a potential diffusion model guided by conditions.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] A method for generating a texture image of a decorative surface material comprises the following steps:
[0007] S1, constructing a decorative surface material image dataset, and using the decorative surface material image dataset to train an image generation model;
[0008] S2, encoding the input decorative surface material image and text information into embedded vectors respectively and inputting them into the image generation model as guiding information;
[0009] S3. The image generation model generates a target decorative surface material image having a texture associated with the input decorative surface material image.
[0010] Furthermore, step S1 is specifically as follows:
[0011] Construct a dataset of decorative surface material images of different categories and textures, including category, texture, style, color and detail information, and delete items with unclear textures to construct a paired dataset of decorative surface material images; and construct four common categories of decorative surface material images for training and testing, including marble decorative surface materials, wood grain decorative surface materials, stone decorative surface materials and rock slab decorative surface materials;
[0012] During the training process, the decorative surface material image dataset is used to learn and generate the distribution of latent variables, and the output reflects the potential changes of the input data, which is then converted into actual latent variable samples through linear transformation and nonlinear activation function, and then input into the latent space to perform diffusion and noise operations; the latent variables in the latent space are mapped back to the original input space to generate reconstructed data.
[0013] Furthermore, step S2 is specifically as follows:
[0014] Extract features from the input decorative surface material image, encode the decorative surface material image as guidance information into an embedding vector, and map it to the image generation model through a multi-head attention mechanism;
[0015] Features are extracted from the input text information, the text information serving as guidance information is encoded into an embedding vector, and mapped to the image generation model through a multi-head attention mechanism.
[0016] Furthermore, step S3 is specifically as follows:
[0017] The input noise image is gradually downsampled through convolution operations to extract high-level features of the noise image. Multiple levels of high-level feature extraction are used to capture different scale information in the decorative surface material image. The output feature map is gradually upsampled to restore the detail information of the decorative surface material texture image.
[0018] A system for generating a texture image of a decorative surface material includes a processor and a memory, wherein the memory stores a program or an instruction, and when the program or the instruction is executed by the processor, the following steps are implemented:
[0019] S1, constructing a decorative surface material image dataset, and using the decorative surface material image dataset to train an image generation model;
[0020] S2, encoding the input decorative surface material image and text information into embedded vectors respectively and inputting them into the image generation model as guiding information;
[0021] S3. The image generation model generates a target decorative surface material image having a texture associated with the input decorative surface material image.
[0022] Furthermore, when the program or instruction is executed by the processor, the following steps are specifically implemented:
[0023] Construct a dataset of decorative surface material images of different categories and textures, including category, texture, style, color and detail information, and delete items with unclear textures to construct a paired dataset of decorative surface material images; and construct four common categories of decorative surface material images for training and testing, including marble decorative surface materials, wood grain decorative surface materials, stone decorative surface materials and rock slab decorative surface materials;
[0024] During the training process, the decorative surface material image dataset is used to learn and generate the distribution of latent variables, and the output reflects the potential changes of the input data, which is then converted into actual latent variable samples through linear transformation and nonlinear activation function, and then input into the latent space to perform diffusion and noise operations; the latent variables in the latent space are mapped back to the original input space to generate reconstructed data.
[0025] Furthermore, when the program or instruction is executed by the processor, the following steps are specifically implemented:
[0026] Extract features from the input decorative surface material image, encode the decorative surface material image as guidance information into an embedding vector, and map it to the image generation model through a multi-head attention mechanism;
[0027] Features are extracted from the input text information, the text information serving as guidance information is encoded into an embedding vector, and mapped to the image generation model through a multi-head attention mechanism.
[0028] Furthermore, when the program or instruction is executed by the processor, the following steps are specifically implemented:
[0029] The input noise image is gradually downsampled through convolution operations to extract high-level features of the noise image. Multiple levels of high-level feature extraction are used to capture different scale information in the decorative surface material image. The output feature map is gradually upsampled to restore the detail information of the decorative surface material texture image.
[0030] A computer-readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method for generating a texture image of a decorative surface material are implemented.
[0031] The beneficial effects of the present invention are:
[0032] The invention provides a decorative surface material texture image generation method, system and medium, which uses a constructed decorative surface material image data set to train an image generation model; then the input decorative surface material image and text information are respectively encoded into embedded vectors and input into the image generation model as guide information; finally, the image generation model generates a target decorative surface material image with a texture associated with the input decorative surface material image. The decorative surface material texture image generation, system and medium provided by the invention can automatically create an "inspirational" interior design from existing visual objects, and the creation cycle is relatively short, which is conducive to mass production. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 Shown is a flow chart of the steps of a method for generating a texture image of a decorative surface material according to the present invention;
[0034] Figure 2 The figure shows a structural block diagram of a decorative surface material texture image generation system of the present invention;
[0035] Figure 3 The figure shows a model structure diagram corresponding to a decorative surface material texture image generation system of the present invention;
[0036] Figure 4 The figure shows a design result corresponding to a method for generating a texture image of a decorative surface material according to the present invention;
[0037] Description of Figure Numbers:
[0038] 1-Processor; 2-Memory. DETAILED DESCRIPTION
[0039] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments:
[0040] like Figure 1 As shown, the present invention provides a method for generating a texture image of a decorative surface material, comprising the following steps:
[0041] S1, constructing a decorative surface material image dataset, and using the decorative surface material image dataset to train an image generation model;
[0042] S2, encoding the input decorative surface material image and text information into embedded vectors respectively and inputting them into the image generation model as guiding information;
[0043] S3. The image generation model generates a target decorative surface material image having a texture associated with the input decorative surface material image.
[0044] From the above description, it can be seen that the present invention has the following beneficial effects:
[0045] The invention provides a decorative surface material texture image generation method, which uses a constructed decorative surface material image data set to train an image generation model; then the input decorative surface material image and text information are respectively encoded into embedded vectors and input into the image generation model as guide information; finally, the image generation model generates a target decorative surface material image having a texture associated with the input decorative surface material image. The decorative surface material texture image generation method provided by the invention can automatically create an "inspirational" interior design from an existing visual object, and the creation cycle is relatively short, which is conducive to mass production.
[0046] Furthermore, step S1 is specifically as follows:
[0047] Construct a dataset of decorative surface material images of different categories and textures, including category, texture, style, color and detail information, and delete items with unclear textures to construct a paired dataset of decorative surface material images; and construct four common categories of decorative surface material images for training and testing, including marble decorative surface materials, wood grain decorative surface materials, stone decorative surface materials and rock slab decorative surface materials;
[0048] During the training process, the decorative surface material image dataset is used to learn and generate the distribution of latent variables, and the output reflects the potential changes of the input data, which is then converted into actual latent variable samples through linear transformation and nonlinear activation function, and then input into the latent space to perform diffusion and noise operations; the latent variables in the latent space are mapped back to the original input space to generate reconstructed data.
[0049] From the above description, it can be seen that the decorative surface material image dataset is composed of the decorative surface material images of the above-mentioned different categories and different textures, and the image generation model is obtained through specific training, which is used to automatically generate a target decorative surface material image with the same texture as the input decorative surface material image, so as to achieve an "inspirational" interior design.
[0050] Furthermore, step S2 is specifically as follows:
[0051] Extract features from the input decorative surface material image, encode the decorative surface material image as guidance information into an embedding vector, and map it to the image generation model through a multi-head attention mechanism;
[0052] Features are extracted from the input text information, the text information serving as guidance information is encoded into an embedding vector, and mapped to the image generation model through a multi-head attention mechanism.
[0053] From the above description, it can be seen that by combining the decorative surface material image and text information as guidance information and encoding them into an embedded vector, the generation direction of the model can be effectively guided, which is crucial for the texture generation of decorative surface materials for interior design.
[0054] Furthermore, step S3 is specifically as follows:
[0055] The input noise image is gradually downsampled through convolution operations to extract high-level features of the noise image. Multiple levels of high-level feature extraction are used to capture different scale information in the decorative surface material image. The output feature map is gradually upsampled to restore the detail information of the decorative surface material texture image.
[0056] It can be seen from the above description that the texture of the decorative surface material can be processed by adopting the above method.
[0057] like Figure 2 As shown, the present invention also provides a decorative surface material texture image generation system, including a processor 1 and a memory 2, wherein the memory 2 stores a program or instruction, and when the program or instruction is executed by the processor 1, the following steps are implemented:
[0058] S1, constructing a decorative surface material image dataset, and using the decorative surface material image dataset to train an image generation model;
[0059] S2, encoding the input decorative surface material image and text information into embedded vectors respectively and inputting them into the image generation model as guiding information;
[0060] S3. The image generation model generates a target decorative surface material image having a texture associated with the input decorative surface material image.
[0061] From the above description, it can be seen that the present invention has the following beneficial effects:
[0062] The present invention provides a decorative surface material texture image generation system, which uses a constructed decorative surface material image data set to train an image generation model; then the input decorative surface material image and text information are respectively encoded into embedded vectors and input into the image generation model as guide information; finally, the image generation model generates a target decorative surface material image with associated texture with the input decorative surface material image. The decorative surface material texture image generation system provided by the present invention can automatically create an "inspirational" interior design from existing visual objects, and the creation cycle is relatively short, which is conducive to mass production.
[0063] Furthermore, when the program or instruction is executed by the processor, the following steps are specifically implemented:
[0064] Construct a dataset of decorative surface material images of different categories and textures, including category, texture, style, color and detail information, and delete items with unclear textures to construct a paired dataset of decorative surface material images; and construct four common categories of decorative surface material images for training and testing, including marble decorative surface materials, wood grain decorative surface materials, stone decorative surface materials and rock slab decorative surface materials;
[0065] During the training process, the decorative surface material image dataset is used to learn and generate the distribution of latent variables, and the output reflects the potential changes of the input data, which is then converted into actual latent variable samples through linear transformation and nonlinear activation function, and then input into the latent space to perform diffusion and noise operations; the latent variables in the latent space are mapped back to the original input space to generate reconstructed data.
[0066] From the above description, it can be seen that the decorative surface material image dataset is composed of the decorative surface material images of the above-mentioned different categories and different textures, and the image generation model is obtained through specific training, which is used to automatically generate a target decorative surface material image with the same texture as the input decorative surface material image, so as to achieve an "inspirational" interior design.
[0067] Furthermore, when the program or instruction is executed by the processor, the following steps are specifically implemented:
[0068] Extract features from the input decorative surface material image, encode the decorative surface material image as guidance information into an embedding vector, and map it to the image generation model through a multi-head attention mechanism;
[0069] Features are extracted from the input text information, the text information serving as guidance information is encoded into an embedding vector, and mapped to the image generation model through a multi-head attention mechanism.
[0070] From the above description, it can be seen that by combining the decorative surface material image and text information as guidance information and encoding them into an embedded vector, the generation direction of the model can be effectively guided, which is crucial for the texture generation of decorative surface materials for interior design.
[0071] Furthermore, when the program or instruction is executed by the processor, the following steps are specifically implemented:
[0072] The input noise image is gradually downsampled through convolution operations to extract high-level features of the noise image. Multiple levels of high-level feature extraction are used to capture different scale information in the decorative surface material image. The output feature map is gradually upsampled to restore the detail information of the decorative surface material texture image.
[0073] It can be seen from the above description that the texture of the decorative surface material can be processed by adopting the above method.
[0074] A computer-readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method for generating a texture image of a decorative surface material are implemented.
[0075] From the above description, it can be seen that the present invention has the following beneficial effects:
[0076] The computer-readable storage medium provided by the present invention uses a constructed decorative surface material image data set to train an image generation model; then the input decorative surface material image and text information are respectively encoded into embedded vectors and input into the image generation model as guide information; finally, the image generation model generates a target decorative surface material image having an associated texture with the input decorative surface material image. The computer-readable storage medium provided by the present invention can automatically create an "inspirational" interior design from existing visual objects, and the creation cycle is relatively short, which is conducive to mass production.
[0077] Several preferred embodiments or application examples are listed below to help those skilled in the art better understand the technical content of the present invention and the technical contribution made by the present invention relative to the prior art:
[0078] Preferred embodiment one:
[0079] like Figures 1 to 4 As shown, the present invention provides a method for generating a texture image of a decorative surface material, comprising the following steps:
[0080] S1, constructing a decorative surface material image dataset, and using the decorative surface material image dataset to train an image generation model;
[0081] In this embodiment, step S1 is specifically as follows:
[0082] Construct a dataset of decorative surface material images of different categories and textures, including category, texture, style, color and detail information, and delete items with unclear textures to construct a paired dataset of decorative surface material images; and construct four common categories of decorative surface material images for training and testing, including marble decorative surface materials, wood grain decorative surface materials, stone decorative surface materials and rock slab decorative surface materials;
[0083] During the training process, the decorative surface material image dataset is used to learn and generate the distribution of latent variables, and the output reflects the potential changes of the input data, which is then converted into actual latent variable samples through linear transformation and nonlinear activation function, and then input into the latent space to perform diffusion and noise operations; the latent variables in the latent space are mapped back to the original input space to generate reconstructed data.
[0084] S2, encoding the input decorative surface material image and text information into embedded vectors respectively and inputting them into the image generation model as guiding information;
[0085] In this embodiment, step S2 is specifically as follows:
[0086] Extract features from the input decorative surface material image, encode the decorative surface material image as guidance information into an embedding vector, and map it to the image generation model through a multi-head attention mechanism;
[0087] Features are extracted from the input text information, the text information serving as guidance information is encoded into an embedding vector, and mapped to the image generation model through a multi-head attention mechanism.
[0088] S3. The image generation model generates a target decorative surface material image having a texture similar to the input decorative surface material image.
[0089] In this embodiment, step S3 is specifically as follows:
[0090] The input noise image is gradually downsampled through convolution operations to extract high-level features of the noise image. Multiple levels of high-level feature extraction are used to capture different scale information in the decorative surface material image. The output feature map is gradually upsampled to restore the detail information of the decorative surface material texture image.
[0091] Preferred embodiment 2:
[0092] like Figures 1 to 4 As shown, the conditionally guided decorative surface material texture generation system based on the latent diffusion model specifically includes a decorative surface material image variational autoencoder, a decorative surface material image UNet denoising module, a decorative surface material image CLIP encoder and a CLIP text encoder, which aims to learn to integrate the feature representation of the style of the decorative surface material texture image from the source domain and the decorative surface material texture image from the target domain in a supervised manner;
[0093] The decorative surface material image variational autoencoder includes a feature encoder and a feature decoder. The feature encoder is used to compress and encode the original decorative surface material image to obtain low-dimensional compressed data, which is then input into the latent space to perform a diffusion noise operation. After the latent data is noised, it is gradually denoised by the decorative surface material image UNet denoising module and then input into the decoder of the decorative surface material image variational autoencoder to decode it back to the original image.
[0094] The texture image of the decorative surface material as the guiding condition is encoded into an embedding vector through the decorative surface material image CLIP encoder, and is mapped to the decorative surface material image UNet denoising module as guiding information through the multi-head attention mechanism;
[0095] The text information used as the guiding condition is encoded into an embedding vector through the CLIP text encoder and mapped to the UNet denoising module as the guiding information through the multi-head attention mechanism.
[0096] Specifically, the feature encoder consists of multiple neural network layers, which are used to map the full-size image encoding to the latent variable representation in the low-dimensional latent space. During the training process, the goal of the feature encoder is to learn to generate the distribution of latent variables so that the output can accurately reflect the potential changes of the input data. In order to make the distribution of the feature encoder output close to the preset Gaussian distribution, the variational autoencoder introduces a reparameterization technique. This technique decomposes the sampling process of the latent variable into sampling a noise vector from the standard normal distribution, and then converts it into an actual latent variable sample through a linear transformation and a nonlinear activation function.
[0097] The task of the feature decoder is to map the latent variables in the latent space back to the original input space, thereby generating reconstructed data. The feature decoder also consists of multiple neural network layers, and its structure is symmetrical to that of the feature encoder. The feature decoder receives the denoised latent variables as input, and then gradually decodes them through the neural network layers, and finally generates reconstructed data that matches the size and features of the original input image.
[0098] The UNet denoising module for decorative surface material images is a neural network structure for variable denoising, which plays an important role in the potential diffusion model. The UNet denoising module for decorative surface material images consists of a noise image encoder and a feature map decoder, and adopts a U-shaped network structure, which can effectively restore a clear image from the noise variable.
[0099] Specifically, the noise image encoder is responsible for gradually downsampling the input noise variable through convolution operations to extract high-level features of the image. The noise image encoder uses a combination of convolutional layers and pooling layers to capture different scale information in the texture image of the decorative surface material through multiple levels of feature extraction. Each encoder layer increases the number of channels of the feature map while reducing the size of the feature map.
[0100] The feature map decoder is responsible for gradually upsampling the output feature map of the noise image encoder to restore the detail information of the texture image of the decorative surface material. The feature map decoder uses deconvolution layers and skip connections to upsample and fuse the feature maps layer by layer. Skip connections refer to connecting the feature maps of the corresponding layers in the noise image encoder with the feature maps in the decoder to retain more low-level and detail information. This structural design helps to improve the network's information transmission capability and reconstruction quality.
[0101] In the UNet denoising module for decorative surface material images, there are multiple layers between the noisy image encoder and the feature map decoder, and each layer is connected together through jump connections. This structure enables the network to utilize both low-level and high-level features to better restore the details and structure of the image. To further improve the denoising effect, the UNet denoising module for decorative surface material images usually introduces residual connections in each layer of the noisy image encoder and feature map decoder. Residual connections can help the network better learn the difference between noisy images and clear images, thereby restoring the image more accurately.
[0102] The decorative surface material image CLIP encoder is a component for converting the decorative surface material image as a guided condition into a latent space vector representation. CLIP is a model based on contrastive learning for jointly encoding images and texts. The image encoder is an important component of the CLIP model and is responsible for converting the input image into a vector representation with semantic information. The decorative surface material image CLIP encoder adopts a convolutional neural network as the basic structure. It usually uses a pre-trained convolutional neural network such as ResNet or ViT as a backbone network to extract features from the input image. The main goal of the decorative surface material image CLIP encoder is to generate a vector representation with semantic consistency, which means that similar images should have closer vector representations in the latent space. To achieve this, it uses a contrastive learning method to learn the vector representation of the image by maximizing the similarity between similar image and text pairs and minimizing the similarity between dissimilar image and text pairs. This contrastive learning method enables the CLIP encoder to learn the semantic information and features of the image.
[0103] During the training process, the decorative material image CLIP encoder and the text encoder are jointly trained to learn the encoding of images and texts. By jointly encoding large-scale image and text data, the decorative material image CLIP encoder can learn rich semantic information and generate vector representations with semantic consistency. This vector representation can be used for tasks such as image search, image classification, similar image generation, and interaction and matching with text.
[0104] The CLIP text encoder is a component for converting text information into a latent space vector representation, and is used in combination with the decorative surface material image CLIP encoder as a guiding condition of the network. The text encoder is an important part of the CLIP model, responsible for converting the input text into a vector representation with semantic information. The CLIP text encoder uses the Transformer model as its basic structure. Transformer is a sequence modeling model based on the self-attention mechanism, which can effectively capture the contextual relationship and semantic information in the text. The goal of the CLIP text encoder is to generate a vector representation with semantic consistency so that similar texts have closer vector representations in the latent space. To achieve this, the CLIP text encoder also adopts a contrastive learning method. It learns the vector representation of text by maximizing the similarity between similar image and text pairs and minimizing the similarity between dissimilar image and text pairs. By jointly encoding large-scale image and text data, the CLIP text encoder can learn rich semantic information and generate a vector representation with semantic consistency. The output vector of the CLIP text encoder can be used for tasks such as text search and text classification. By encoding images and text into a shared latent space vector representation, the CLIP model is able to establish semantic connections between images and text, thereby supporting a variety of cross-modal applications and tasks.
[0105] The present invention provides a method for generating a texture image of a decorative surface material, comprising the following steps:
[0106] Construct a decorative surface material image dataset, which must include a variety of decorative surface material categories, including texture and color, and is paired with texture decorative surface material images.
[0107] Design a variational autoencoder for decorative surface material images: The variational autoencoder for decorative surface material images includes a feature encoder and a feature decoder; the feature encoder is used to compress and encode the original image to obtain low-dimensional compressed data of the image, which is then input into the latent space to perform a diffusion noise operation; after the latent data is noised, the noise is eliminated through the decorative surface material image UNet denoising module and then input into the feature decoder of the variational autoencoder to be decoded back to the original image.
[0108] Design a UNet denoising module for decorative surface material images: The UNet denoising module for decorative surface material images consists of a noise image encoder and a feature map decoder, and adopts a U-shaped network structure, which can effectively restore a clear image from a noisy image; the noise image encoder is responsible for gradually downsampling the input noise image through convolution operations, extracting high-level features of the image, and capturing different scale information in the decorative surface material texture image through multiple levels of feature extraction; the feature map decoder is responsible for gradually upsampling the output feature map of the encoder to restore the detail information of the decorative surface material texture image.
[0109] Design a decorative surface material image CLIP encoder: The decorative surface material image CLIP encoder adopts a convolutional neural network as the basic structure, uses the pre-trained convolutional neural network ResNet as the backbone network, extracts features from the input image, encodes the decorative surface material texture image as a guiding condition into an embedding vector, and maps it to the UNet denoising module through a multi-head attention mechanism.
[0110] Design of CLIP text encoder: The CLIP text encoder adopts the Transformer model as its basic structure. Transformer is a sequence modeling model based on the self-attention mechanism, which can effectively capture the contextual relationship and semantic information in the text. The CLIP text encoder extracts features from the input text, encodes the text information as the guiding condition into an embedding vector, and maps it to the UNet denoising module as the guiding information through the multi-head attention mechanism.
[0111] Furthermore, the construction of the decorative surface material image data set comprises the following steps:
[0112] Construct a dataset of decorative surface material images of different categories and textures, integrate keyword search items of interior design and decoration, including category, texture, style, color and detail information, delete items with unclear texture, and construct a dataset of paired decorative surface material images. Since there are few paired texture decorative surface material image samples, we crop each decorative surface material image to obtain 10 decorative surface material images of 256×256 and 512×512 sizes (this value is not a fixed value, and a larger number can be cropped). For every 10 images, they are cropped from the same decorative surface material image, so the textures are similar. Pairing them can construct 45 pairs of similar decorative surface material image data pairs, which can greatly expand the number of datasets.
[0113] Four common categories of decorative surface material images are constructed for training and testing, including marble decorative surface materials, wood grain decorative surface materials, stone decorative surface materials, and rock slab decorative surface materials. The image data amounts of these four categories of decorative surface materials are different, and each category is randomly divided into a training data set and a test data set. Marble decorative surface materials contain 50,000 pairs of training images and 20,000 pairs of test images, wood grain decorative surface materials contain 110,000 pairs of training images and 40,000 pairs of test images, stone decorative surface materials contain 220,000 pairs of training images and 80,000 pairs of test images, and rock slab decorative surface materials contain 320,000 pairs of training images and 100,000 pairs of test images.
[0114] In this embodiment, a dataset of decorative surface materials images of different categories and styles is constructed. The training data used comes from Jayne Company. The present invention mainly constructs paired decorative surface material single product information of different categories, textures and styles. The training dataset contains four categories of decorative surface materials related to interior design, including marble decorative surface materials, wood grain decorative surface materials, stone decorative surface materials, and rock slab decorative surface materials.
[0115] Furthermore, the design of the decorative surface material image variational autoencoder comprises the following steps:
[0116] The decorative surface material image variational autoencoder includes a feature encoder and a feature decoder; the feature encoder is composed of multiple neural network layers, which is used to map the full-size image code to a latent variable representation in a low-dimensional latent space. During the training process, the goal of the encoder is to learn to generate the distribution of latent variables so that the output of the encoder can accurately reflect the potential changes of the input data. In order to make the distribution of the encoder output close to the preset Gaussian distribution, the variational autoencoder introduces a reparameterization technique. This technique decomposes the sampling process of the latent variable into sampling a noise vector from a standard normal distribution, which is then converted into an actual latent variable sample through a linear transformation and a nonlinear activation function, and then input into the latent space to perform a diffusion noise operation.
[0117] The task of the feature decoder is to map the latent variables in the latent space back to the original input space, thereby generating reconstructed data. The feature decoder is also composed of multiple neural network layers, and its structure is symmetrical to that of the feature encoder. The feature decoder receives the denoised latent variables as input, and then gradually decodes them through the neural network layers, and finally generates reconstructed data that matches the size and features of the original input image.
[0118] It should be noted that: the design of the decorative surface material image variational autoencoder includes a feature encoder E and a feature decoder D. For the decorative surface material image in the RGB pixel space , the feature encoder E encodes the image x into a latent representation , the feature decoder D reconstructs the image from the latent space, i.e. ,in Importantly, the feature encoder E downsamples the surface material image by a factor f = H / h = W / w. We study different downsampling factors ,in . The feature encoder consists of multiple neural network layers. During the training process, the feature encoder learns to generate the distribution of latent variables, and the output can accurately reflect the potential changes of the input data. The sampling process of the latent variables is decomposed into sampling a noise vector from the standard normal distribution, and then converting it into an actual latent variable sample through linear transformation and nonlinear activation function, and then inputting it into the latent space to perform diffusion and noise operations. The feature decoder maps the latent variables in the latent space back to the original input space to generate reconstructed data. The feature decoder consists of multiple neural network layers, and its structure is symmetrical to the feature encoder. The feature decoder receives the denoised latent variables as input and decodes them to generate reconstructed data that matches the size and features of the original input image x. .
[0119] Furthermore, the design of the decorative surface material image UNet denoising module includes the following steps:
[0120] The decorative surface material image UNet denoising module consists of a noise image encoder and a feature map decoder, and adopts a U-shaped network structure, which can effectively restore a clear image from a noisy image; the noise image encoder is responsible for gradually downsampling the input noise image through convolution operations, extracting high-level features of the image, and capturing different scale information in the decorative surface material texture image through multiple levels of feature extraction; the feature map decoder is responsible for gradually upsampling the output feature map of the noise image encoder to restore the detail information of the decorative surface material texture image.
[0121] Specifically, the goal of the UNet denoising module for decorative surface material images is to denoise the latent data z after adding noise. t Perform a step-by-step denoising operation to restore it to the potential representation z0. The UNet denoising module for decorative surface material images consists of a noise image encoder and a feature map decoder. It adopts a U-shaped network structure and can effectively restore a clear image from a noisy image. The noise image encoder is responsible for gradually downsampling the input noise image through convolution operations, extracting high-level features of the image, and capturing different scale information in the texture image of decorative surface materials through multiple levels of feature extraction. The feature map decoder is responsible for gradually upsampling the output feature map of the noise image encoder, restoring the detail information of the texture image of the decorative surface material, and restoring the potential representation z0 as the input of the feature decoder D of the variational autoencoder of the decorative surface material image. The UNet denoising module for decorative surface material images mainly performs a diffusion cycle on the latent representation z after adding noise.t Iterative denoising is performed, and each predicted noise is guided by the guiding condition and Timesteps. The UNet denoising module for decorative surface material images adds a Time Embedding module, a Spatial Transformer (Cross Attention) module, and a Self-Attention module based on the codec structure.
[0122] Time Embedding is a technology used to represent time information in time series data. The purpose of time embedding is to encode time as a feature in order to better learn time-related features. The basic idea is to map time information to a continuous vector space so that the relationship between time can be learned and utilized by the model. It is introduced into UNet to help it predict noise calmly during the diffusion process. It encodes Time into the network, allowing UNet to predict noise more appropriately in each iteration. The Time Embeddings module + the original convolutional layer in the feature map encoder form a Residual Block structure. It contains two convolutional layers, a Time Embedding and a SkipConnection. The fully connected layer here transforms the Time Embedding into the same dimension as the Latent Feature, and finally completes the encoding of Time by adding the two.
[0123] Cross Attention is a multi-head attention mechanism that can establish associations between two different input sequences and pass the information of one input sequence to the other input sequence. The Cross Attention module controls the fusion interaction of the guidance condition information and the input image information. Latent Feature and Context Embedding are used as inputs, and the two are cross-attenetioned to fuse the image information and the guidance condition information.
[0124] Potential Representation z t The loss function of the diffusion process in the latent space is expressed as: ;
[0125] Neural backbone of the model is implemented as a time-conditional UNet network. Since the forward process is fixed, z can be effectively obtained from the encoder E during training. t , and the samples of p(z) can be decoded into the image space once by the decoder D.
[0126] Furthermore, the design decorative surface material image CLIP encoder comprises the following steps:
[0127] The decorative surface material image CLIP encoder adopts a convolutional neural network as the basic structure and uses a pre-trained convolutional neural network ResNet as the backbone network to extract features from the input image, encode the decorative surface material texture image as a guiding condition into an embedded vector, and map it to the UNet denoising module as guiding information through a multi-head attention mechanism.
[0128] Specifically, the goal of the decorative surface material image CLIP encoder is to encode the decorative surface material image as a guided condition into an embedding vector, which is mapped to the UNet denoising module through a multi-head attention mechanism. By enhancing the underlying UNet backbone network of the diffusion model with a cross-attention mechanism, the diffusion model is turned into a more flexible conditional image generator, which is effective for learning attention-based models with various input modalities. In order to pre-process the guided condition decorative surface material image y1 from the image guidance mode, a domain-specific encoder is introduced (Decoration Material Image CLIP Encoder), which projects y1 to an intermediate representation , and then implement Attention(Q,K,V)= The cross attention layer maps it to the middle layer of UNet, where , , . Representation Implementation The intermediate representation of UNet, , and is a learnable projection matrix. The loss function of the latent diffusion model based on the guided condition is expressed as: ;
[0129] This conditional mechanism is flexible because Can be parameterized with a specific domain, such as Transformers when y is a text prompt.
[0130] The CLIP text encoder adopts the Transformer model as its basic structure. Transformer is a sequence modeling model based on the self-attention mechanism, which can effectively capture the contextual relationship and semantic information in the text. The CLIP text encoder extracts features from the input text, encodes the text information as the guiding condition into an embedding vector, and maps it to the UNet denoising module as the guiding information through the multi-head attention mechanism.
[0131] Specifically, the goal of the CLIP text encoder is to encode the input text information into an embedding vector and map it to the UNet denoising module through a multi-head attention mechanism. In order to pre-process the guided conditional text information y2 from the text-guided pattern, we introduce a domain-specific encoder (CLIP text encoder), which projects y2 into an intermediate representation , and then implement Attention(Q,K,V)= The cross attention layer maps it to the middle layer of UNet, where , , . Representation Implementation The intermediate representation of UNet, , and is a learnable projection matrix. The loss function of the latent diffusion model based on the guided condition is expressed as (same as step S4): ;
[0132] It should be noted that the latest progress in deep learning technology has made this intelligent assisted design feasible. Among them, the diffusion model is a powerful tool for similar image generation. Most current image generation work focuses on the study of diffusion models. These methods are less applicable in the field of decorative surface material texture generation. Therefore, it is necessary to develop a supervised method based on the latent diffusion model to learn the texture similarity of paired images to complete the design of interior decorative surface material images. The latent diffusion model mainly uses text as a guiding condition. The text is encoded into an embedding vector by an encoder and added to the UNet network. However, the text cannot accurately describe the texture information of the decorative surface material, which makes it difficult to accurately capture the texture information and generate the texture image of the decorative surface material. By adding an image encoder to encode the feature information of the guiding condition into an embedding vector, the generation direction of the model can be effectively guided, which is crucial for the texture generation of decorative surface materials for interior design.
[0133] The main contributions of the present invention are summarized as follows: A method, system and medium for generating textures of decorative surface materials based on a latent diffusion model guided by conditions are proposed, which automatically completes the generation of decorative surface material texture images to realize the intelligent design of interior decorative surface material images, and can assist designers in completing the process of inspirational design. The decorative surface material texture generation system based on a latent diffusion model guided by conditions includes a decorative surface material image variational autoencoder, a decorative surface material image UNet denoising module, a decorative surface material image CLIP encoder and a text CLIP encoder, which aims to learn to integrate the feature representation of the style of decorative surface material texture images from the source domain and the decorative surface material texture images from the target domain in a supervised manner; the decorative surface material image variational autoencoder includes a feature encoder and a feature decoder, the feature encoder is used to compress and encode the original image to obtain the latent data of the image, and then input it into the latent space to perform a diffusion noise operation, and then input the denoised noise variable into the feature decoder to decode and restore the attributes and texture information of the decorative surface material image; the latent After the data is denoised, the noise is gradually eliminated through the UNet denoising module of the decorative surface material image and then input into the feature decoder of the decorative surface material image variational autoencoder to be decoded back to the original image; the decorative surface material texture image as a guiding condition is encoded into an embedding vector through the decorative surface material image CLIP encoder, and mapped to the UNet denoising module as guiding information through the multi-head attention mechanism; the text information as a guiding condition is encoded into an embedding vector through the CLIP text encoder, and mapped to the UNet denoising module as guiding information through the multi-head attention mechanism; the proposed conditionally guided decorative surface material texture generation network based on the latent diffusion model has great potential in practical application fields such as indoor intelligent design and user interactive design.
[0134] The present invention has been described by the above-mentioned relevant embodiments and drawings, but the above-mentioned embodiments are only examples for implementing the present invention. It must be pointed out that the disclosed embodiments do not limit the scope of the present invention. On the contrary, modifications and equivalent settings included in the spirit and scope of the claims are all included in the scope of the present invention.
Claims
1. A method for generating a texture image of a decorative surface material, It is characterized in that The following steps are involved: S1, constructing a decorative surface material image dataset, and using the decorative surface material image dataset to train an image generation model; S2, encoding the input decorative surface material image and text information into embedded vectors respectively and inputting them into the image generation model as guiding information; S3, the image generation model generates a target decorative surface material image having a texture associated with the input decorative surface material image; Step S1 is specifically as follows: Construct a dataset of decorative surface material images of different categories and textures, including category, texture, style, color and detail information, and delete items with unclear texture to construct a paired decorative surface material image dataset; and construct four common categories of decorative surface material images for training and testing, including marble decorative surface materials, wood grain decorative surface materials, stone decorative surface materials and rock slab decorative surface materials; wherein, the paired decorative surface material image dataset is constructed by cropping the same decorative surface material image, and pairing them two by two to construct similar decorative surface material image data pairs; During the training process, the decorative surface material image dataset is used to learn and generate the distribution of latent variables, and the output reflects the potential changes of the input data, which is then converted into actual latent variable samples through linear transformation and nonlinear activation function, and then input into the latent space to perform diffusion and noise operations; the latent variables in the latent space are mapped back to the original input space to generate reconstructed data.
2. A method for generating a texture image of a decorative surface material according to claim 1, It is characterized in that Step S2 is specifically as follows: Extract features from the input decorative surface material image, encode the decorative surface material image as guidance information into an embedding vector, and map it to the image generation model through a multi-head attention mechanism; Features are extracted from the input text information, the text information serving as guidance information is encoded into an embedding vector, and mapped to the image generation model through a multi-head attention mechanism.
3. A method for generating a texture image of a decorative surface material according to claim 2, It is characterized in that Step S3 is specifically as follows: The input noise image is gradually downsampled through convolution operations to extract high-level features of the noise image. Multiple levels of high-level feature extraction are used to capture different scale information in the decorative surface material image. The output feature map is gradually upsampled to restore the detail information of the decorative surface material texture image.
4. A system for generating texture images of decorative surface materials, It is characterized in that The system comprises a processor and a memory, wherein the memory stores a program or an instruction, and when the program or the instruction is executed by the processor, the following steps are implemented: S1, constructing a decorative surface material image dataset, and using the decorative surface material image dataset to train an image generation model; S2, encoding the input decorative surface material image and text information into embedded vectors respectively and inputting them into the image generation model as guiding information; S3, the image generation model generates a target decorative surface material image having a texture associated with the input decorative surface material image; When the program or instruction is executed by the processor, the following steps are specifically implemented: Construct a dataset of decorative surface material images of different categories and textures, including category, texture, style, color and detail information, and delete items with unclear texture to construct a paired decorative surface material image dataset; and construct four common categories of decorative surface material images for training and testing, including marble decorative surface materials, wood grain decorative surface materials, stone decorative surface materials and rock slab decorative surface materials; wherein, the paired decorative surface material image dataset is constructed by cropping the same decorative surface material image, and pairing them two by two to construct similar decorative surface material image data pairs; During the training process, the decorative surface material image dataset is used to learn and generate the distribution of latent variables, and the output reflects the potential changes of the input data, which is then converted into actual latent variable samples through linear transformation and nonlinear activation function, and then input into the latent space to perform diffusion and noise operations; the latent variables in the latent space are mapped back to the original input space to generate reconstructed data.
5. A system for generating a texture image of a decorative surface material according to claim 4, It is characterized in that When the program or instruction is executed by the processor, the following steps are specifically implemented: Extract features from the input decorative surface material image, encode the decorative surface material image as guidance information into an embedding vector, and map it to the image generation model through a multi-head attention mechanism; Features are extracted from the input text information, the text information serving as guidance information is encoded into an embedding vector, and mapped to the image generation model through a multi-head attention mechanism.
6. A system for generating a texture image of a decorative surface material according to claim 5, It is characterized in that When the program or instruction is executed by the processor, the following steps are specifically implemented: The input noise image is gradually downsampled through convolution operations to extract high-level features of the noise image. Multiple levels of high-level feature extraction are used to capture different scale information in the decorative surface material image. The output feature map is gradually upsampled to restore the detail information of the decorative surface material texture image.
7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method for generating a texture image of a decorative surface material according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Semantic unwrapping generative adversarial network based on thermodynamic diagram guidance and costume inspiration design method thereof
CN114970194A
Rain scene image synthesis method and device learning from rendering, and storage medium
CN116777805A
Super-resolution reconstruction method for single image with potential features
CN117078510A
Garment secondary design system and method
CN117576246A
Method for editing face image through text, terminal and storage medium
CN117576257A
