An intelligent building decoration design method based on deep learning
By employing a deep learning-based intelligent building decoration design method, and utilizing a custom loss function and dynamic weight design, combined with a diffusion model and conditional generative adversarial networks, the problem of low efficiency and lack of innovation among designers is solved, generating high-quality personalized design drawings and improving design efficiency and customer satisfaction.
Patent Information
- Application Number
- CN202411448567.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-10-16
AI Technical Summary
Designers face problems such as low design efficiency, insufficient time for innovation, and design quality being affected by pressure. Furthermore, intensified market competition puts pressure on designers to provide more design solutions in a short period of time.
We employ a deep learning-based intelligent building decoration design method. By designing a custom loss function and dynamic weights, combined with a diffusion model and a pre-trained conditional generative adversarial network, and utilizing variational autoencoder technology, we can generate design drawings that meet customer requirements.
It improves design efficiency, generates design drawings that meet personalized needs, enhances the model's generalization ability and training speed, reduces the workload of designers, and enhances design quality and customer satisfaction.
Smart Images

Figure CN119397647B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of architectural decoration design, and particularly relates to an intelligent architectural decoration design method based on deep learning. BACKGROUND
[0002] With the continuous emergence of new technologies and new materials, designers need to constantly learn and update their knowledge to adapt to industry development, which has scattered the designers' attention and affected the design efficiency; at the same time, due to work pressure and time constraints, the designers' time for innovative thinking is compressed, resulting in a lack of originality in design works; with the intensification of market competition, designers are under pressure to provide more design schemes in a shorter time, affecting the quality of design.
[0003] At the same time, the emergence of deep learning technology has improved design efficiency. It can quickly analyze a large amount of data to provide valuable perspectives and help make more scientific design decisions. SUMMARY
[0004] The purpose of the application is to overcome the above shortcomings, and the purpose of the application is to provide an intelligent architectural decoration design method based on deep learning. Through the design of self-defined loss function and dynamic weight, the generalization ability of the model is improved, and the over-optimization of the specific type of loss is avoided, and the training convergence speed is accelerated; at the same time, the diffusion model and the pre-trained conditional generative adversarial network are used to provide innovative design schemes for designers; finally, through the variational autoencoder technology, the quality of the generated design drawing in terms of clarity and integrity is ensured, and the efficiency of architectural decoration design is improved.
[0005] Technical scheme: In order to achieve the above purpose, the application provides an intelligent architectural decoration design method based on deep learning, comprising the following steps: S1) using a monocular camera to take pictures of the building from various angles to obtain an original picture; S2) extracting keywords and making prompt words according to customer needs; S3) collecting relevant architectural decoration data according to the keywords; S4) data screening and preprocessing to obtain a training set; S5) defining a loss function and training the diffusion model using the training set to obtain a trained diffusion model; S6) inputting the original picture into the trained diffusion model to generate a preliminary image; inputting the preliminary image and the prompt words into the pre-trained conditional generative adversarial network to obtain a preliminary design drawing; S7) inputting the preliminary design drawing into the pre-trained variational autoencoder to improve the clarity and integrity of the preliminary design drawing, and obtaining an architectural decoration design reference drawing for assisting designers in design.
[0006] Further, the self-defined loss function in S5) combines mean square error loss (MSE Loss) and Dice loss, and sets dynamic weights, and the specific process includes:
[0007] S501):define a basic loss function;
[0008] S502):set a change rate of loss value;
[0009] S503):adjust weight;
[0010] S504):calculate a self-defined loss;
[0011] The specific operation of the S501) defining a basic loss function is as follows:
[0012] The mean square error loss calculation formula is as follows:
[0013]
[0014] Wherein, Q is the total number of samples; y i is the true label (target value) of the i-th sample; is the predicted value of the i-th sample;
[0015] The Dice loss calculation formula is as follows:
[0016]
[0017] Wherein, y i is the true label (target value) of the i-th sample; is the predicted value of the i-th sample;
[0018] The specific operation of the S502) setting a change rate of loss value is as follows:
[0019] Calculate the change rate of loss value in two consecutive training steps; suppose the mean square error loss value at time step t is MSE t , and the Dice loss value is Dice t , then the change rate formula is as follows:
[0020] The change rate of mean square error loss is:
[0021]
[0022] The change rate of Dice loss is:
[0023]
[0024] The specific formula of the S503) adjusting weight is as follows:
[0025]
[0026] λ2=1-λ1
[0027] Wherein, λ1 and λ2 are dynamic weights of mean square error loss and Dice loss respectively, and k is an adjustment factor for controlling the sensitivity of weight change.
[0028] The specific operation of calculating the custom loss is as follows:
[0029] The formula of the custom loss function is as follows:
[0030] Combined Loss=λ1·MSE Loss+λ2·Dice Loss
[0031] Wherein, λ1 and λ2 are dynamic weights for balancing mean square error loss and Dice loss. The design of the custom loss function improves the generalization ability of the model, avoids over-optimization of a specific type of loss, and speeds up the training convergence speed; at the same time, the dynamic weight can be automatically adjusted according to the performance of the model in the training process, so that the model can better adapt to different data distribution and changes.
[0032] Further, the S2) keyword extraction specifically extracts important sentences or keywords in the text by using the TextRank algorithm, wherein the provided text is the customer's demand;
[0033] First, the word vector is obtained through the pre-trained word embedding model;
[0034] Next, the relationship between nodes is determined by cosine similarity, and a threshold is set. If the threshold is exceeded, an edge is established. The formula for cosine similarity is:
[0035]
[0036] Wherein, M and N are two word vectors; θ is the angle between M and N;
[0037] Then, set the initial importance score for each node, usually set to equal value, and update the importance score of the node itself according to the importance of the nodes connected to the current node; The formula is as follows:
[0038]
[0039] Wherein, B is a node connected to node A by an edge; d is a damping factor, usually taking 0.85; Score(B) is the current importance score of node B; OutDegree(B) is the out-degree of node B, indicating the number of edges connected to node B.
[0040] Finally, wait for the convergence of the calculation, and sort the keywords according to the importance score. The TextRank algorithm does not need to pre-train the relevant documents, and is simple and effective, and can be applied to various text data.
[0041] Further, the specific operation of the S3) diffusion model training is as follows:
[0042] In the forward diffusion process of the diffusion model, the model gradually adds noise to the original data and finally converts it to a standard normal distribution. The process of gradually adding noise can be regarded as a Markov chain, where each state corresponds to a version of the data with gradually increasing noise. The formula of the Markov chain is as follows:
[0043]
[0044] Where x t is the data state at time step t; β t is the noise ratio parameter at time t; ∈ t is the noise sampled from the standard normal distribution N(0, I) at time t; time step t is an integer from 1 to T, T is the time step length, and T is the pure noise at time T.
[0045] The network structure selected for the reverse process is U-Net. The time step length, noise ratio parameter, and custom loss function (Combined Loss) are set, and the Adam optimization algorithm is used for optimization. The diffusion model can capture the complex structure and statistical characteristics of the data by learning the distribution of the data, so as to realize the subsequent generation of design drawings.
[0046] Further, the specific operation of the S6) inputting the original drawing into the trained diffusion model and generating a preliminary image is as follows: the original image is cropped and normalized as the input of the trained diffusion model; the trained diffusion model is subjected to reverse diffusion to iteratively generate a first preliminary image. Cropping and normalization standardize the image, ensuring that important parts of the image are preserved, which helps subsequent iterative generation.
[0047] Further, the specific operation of the S6) inputting the preliminary image and the prompt into the pre-trained conditional generative adversarial network to obtain a preliminary design drawing is as follows:
[0048] S601): Import the pre-trained conditional generative adversarial network model and import the pre-trained weights, and set the model to evaluation mode;
[0049] S602): Read the first preliminary image and adjust the preliminary image to the input size required by the pre-trained conditional generative adversarial network model to obtain a second preliminary image;
[0050] S603): Normalize the pixel values of the second preliminary image to the range used by the pre-trained conditional generative adversarial network model to obtain a third preliminary image;
[0051] S604):Convert the prompt word into a prompt word vector through a pre-trained word embedding model;
[0052] S605):Input the third preliminary image and the prompt word vector into the pre-trained conditional generative adversarial network model to obtain a preliminary design drawing. The prompt word is input as a condition, so that the preliminary image can generate a design drawing that is more in line with a specific style or theme in the pre-trained conditional generative adversarial network model.
[0053] Further, the specific operation of S2) making a prompt word is: combining the extracted keywords with the expert prompt words of the designer to complete the construction of the prompt word. The advantage of combining the key words with the expert prompt words improves the accuracy of the prompt word, and ensures that the generation direction of the subsequent design drawing will not deviate from the customer's demand.
[0054] Further, the specific operation of S3) collecting related building decoration data according to the keywords is: collecting related pictures from a building decoration public platform through an automatic crawler according to the keywords. The automatic crawler collects information, so that the data collection is more convenient and convenient.
[0055] Further, the specific operation of S4) data filtering and preprocessing to obtain a training set is as follows: the designer reviews the collected pictures, leaves the pictures that meet the customer's demand, and integrates related pictures in the own design drawings to obtain a picture data set; the picture data set is cropped and normalized to obtain a training set. Data filtering and preprocessing reduces noise interference during model training and improves the quality of generated images.
[0056] The above technical solutions can be seen that the present application has the following beneficial effects:
[0057] 1、The intelligent building decoration design method based on deep learning can reduce the labor of designers and improve work efficiency by automatically processing images and generating preliminary design drawings.
[0058] 2、The intelligent building decoration design method based on deep learning designs a custom loss function and sets a dynamic weight for the custom loss function, improves the generalization ability of the model, avoids over-optimization of a certain type of loss, accelerates convergence, and makes the model converge to the optimal solution faster, improving the model training speed.
[0059] 3、The intelligent building decoration design method based on deep learning can generate design drawings that meet individual needs by making prompt words from customer feedback keywords and requirements, and improve customer satisfaction.
[0060] 4、The intelligent building decoration design method based on deep learning disclosed in the application generates a preliminary design drawing through a diffusion model and a pre-trained conditional generative adversarial network, and provides an innovative design scheme. BRIEF DESCRIPTION OF DRAWINGS
[0061] Figure 1 A flowchart of the intelligent building decoration design method based on deep learning described in the application;
[0062] Figure 2 A flowchart of the self-defined loss function of the intelligent building decoration design method based on deep learning described in the application;
[0063] Figure 3 A flowchart of the model training used by the intelligent building decoration design method based on deep learning described in the application;
[0064] Figure 4 A detailed flowchart of step S6 of the intelligent building decoration design method based on deep learning described in the application. DETAILED DESCRIPTION
[0065] Embodiments of the application are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by reference to the accompanying drawings are exemplary and are intended to explain the application, and cannot be understood as a limitation of the application.
[0066] Embodiment 1
[0067] In this embodiment, as Figure 1 The application discloses an intelligent building decoration design method based on deep learning, comprising the following steps:
[0068] S1) : using a monocular camera to take pictures of the building from various angles to obtain an original drawing;
[0069] S2) : according to customer requirements, keywords are extracted and prompt words are made;
[0070] S3) : related building decoration data is collected according to the keywords;
[0071] S4) : data is screened and preprocessed to obtain a training set;
[0072] S5) : a self-defined loss function is used to train the diffusion model using the training set, and a trained diffusion model is obtained;
[0073] S6) : the original drawing is input into the trained diffusion model, and a preliminary image is generated; the preliminary image and the prompt words are input into a pre-trained conditional generative adversarial network to obtain a preliminary design drawing;
[0074] S7):input the preliminary design drawing into the pre-trained variational autoencoder to improve the clarity and integrity of the preliminary design drawing, and obtain a building decoration design reference drawing for assisting the designer in design.
[0075] Embodiment 2
[0076] On the basis of embodiment 1, in the present embodiment, the present application discloses an intelligent building decoration design method based on deep learning, like Figure 1 and Figure 2 The self-defined loss function in S5) combines mean square error loss (MSE Loss) and Dice loss, and sets dynamic weights, and the specific process includes:
[0077] S501):define a basic loss function;
[0078] S502):set the change rate of the loss value;
[0079] S503):adjust the weight;
[0080] S504):calculate the self-defined loss;
[0081] The specific operation of S501) defining the basic loss function is as follows:
[0082] The mean square error loss calculation formula is as follows:
[0083]
[0084] Wherein, Q is the total number of samples; y i is the true label (target value) of the i-th sample; is the predicted value of the i-th sample;
[0085] The Dice loss calculation formula is as follows:
[0086]
[0087] Wherein, y i is the true label (target value) of the i-th sample; is the predicted value of the i-th sample;
[0088] The specific operation of S502) setting the change rate of the loss value is as follows:
[0089] Calculate the change rate of the loss value in two consecutive training steps; suppose the mean square error loss value at time step t is MSE t , and the Dice loss value is Dice t , then the change rate formula is as follows:
[0090] The rate of change of the mean square error loss is:
[0091]
[0092] The rate of change of the Dice loss is:
[0093]
[0094] The specific formula for adjusting the weight in S503) is as follows:
[0095]
[0096] λ2 = 1 - λ1
[0097] Where λ1 and λ2 are the dynamic weights of the mean square error loss and the Dice loss respectively, and k is an adjustment factor for controlling the sensitivity of weight change.
[0098] In particular, k can be set to 0.1 at the beginning of training to prevent overfitting; subsequent training is adjusted according to the fitting situation.
[0099] The specific operation of calculating the custom loss in S504) is as follows:
[0100] The custom loss function formula is as follows:
[0101] Combined Loss = λ1·MSE Loss + λ2·Dice Loss
[0102] Where λ1 and λ2 are the dynamic weights for balancing the mean square error loss and the Dice loss.
[0103] In this embodiment, as Figure 1 and Figure 3 S2) keyword extraction specifically uses the TextRank algorithm to extract important sentences or keywords in the text, where the provided text is the customer's demand;
[0104] First, the word vector is obtained through the pre-trained word embedding model;
[0105] Next, the relationship between nodes is determined by cosine similarity, and if the threshold is exceeded, an edge is established; the cosine similarity formula is:
[0106]
[0107] Where M and N are two word vectors; θ is the angle between M and N;
[0108] Then, set the initial importance score for each node, usually set to equal value, and update the importance score of the node itself according to the importance of the node connected to the current node; The formula is as follows:
[0109]
[0110] Where B is the node connected to node A with an edge; d is the damping factor, usually 0.85; Score(B) is the current importance score of node B; OutDegree(B) is the out-degree of node B, indicating the number of edges connected to node B.
[0111] Finally, wait for the convergence of the calculation, and sort the keywords according to the importance score.
[0112] Specifically, the TextRank algorithm can be implemented by importing the jieba library in the Python package.
[0113] In this embodiment, as Figure 1 and Figure 3 , the specific operation of S3) diffusion model training is as follows:
[0114] In the forward diffusion process of the diffusion model, the model gradually adds noise to the original data and finally converts it to a standard normal distribution. The process of gradually adding noise can be regarded as a Markov chain, where each state corresponds to a version of the data with gradually increasing noise. The formula of Markov chain is as follows:
[0115]
[0116] Where x t is the data state at time step t; β t is the noise ratio parameter at time t; ∈ t is the noise sampled from the standard normal distribution N(0,I) at time t; time step t is an integer from 1 to T, T is the time step length, and T is the pure noise at time T;
[0117] The network structure selected in the reverse process is U-Net, the time step length and the noise ratio parameter are set, the custom loss function (Combined Loss) is used, and the Adam optimization algorithm is used for optimization.
[0118] Specifically, set the top time step length T to 2000, and set the noise ratio parameter to increase linearly with the time step length T, as follows:
[0119]
[0120] Where t is the current time step;
[0121] Specifically, the diffusion model can be built by importing the diffusers package of the Hugging Face platform into the local python environment.
[0122] In the embodiment, as Figure 1 and Figure 3 , the specific operation of S6) inputting the original image into the trained diffusion model and generating a preliminary image is that the original image is cropped and normalized as the input of the trained diffusion model; the trained diffusion model is reversely diffused to iteratively generate a first preliminary image.
[0123] Specifically, the cropping and normalization operation can be realized by importing the Pillow library of the python package.
[0124] In the embodiment, as Figure 1 , Figure 3 and Figure 4 , the specific operation of S6) inputting the preliminary image and the prompt into the pre-trained conditional generative adversarial network to obtain a preliminary design image is as follows:
[0125] S601): import the pre-trained conditional generative adversarial network model and import the pre-trained weights, and set the model to evaluation mode;
[0126] S602): read the first preliminary image, and adjust the preliminary image to the input size required by the pre-trained conditional generative adversarial network model to obtain a second preliminary image;
[0127] S603): normalization, scale the pixel value of the second preliminary image to the range used by the pre-trained conditional generative adversarial network model to obtain a third preliminary image;
[0128] S604): convert the prompt into a prompt word vector through the pre-trained word embedding model;
[0129] S605): input the third preliminary image and the prompt word vector into the pre-trained conditional generative adversarial network model to obtain a preliminary design image.
[0130] Specifically, after the third preliminary image is input into the pre-trained conditional generative adversarial network model, it is first converted into a tensor format, spliced with the prompt word vector, and then input into the subsequent generator network to generate a preliminary design image.
[0131] In the embodiment, as Figure 1 , the specific operation of S2) making the prompt is to combine the extracted keywords with the expert prompt of the designer to complete the construction of the prompt.
[0132] In the embodiment, as Figure 1The specific operation of S3) keyword-based relevant building decoration data collection is collecting relevant pictures from the building decoration public platform through automatic crawler according to the keywords.
[0133] Specifically, the automatic crawler can be implemented by using the requests, BeautifulSoup, Scrapy and other libraries imported into the python library.
[0134] In the embodiment, as shown in Figure 1 The specific operation of S4) data filtering and preprocessing to obtain the training set is as follows:
[0135] The designer reviews the collected pictures, leaves the pictures meeting the customer's demand, and integrates the related pictures in the own design drawings to obtain a picture data set; the picture data set is cropped and normalized to obtain a training set.
[0136] The above only describes the preferred embodiments of the present application, and it should be noted that those skilled in the art can make several improvements without departing from the principles of the present application, and these improvements should also be considered as the protection scope of the present application.
Claims
1. A deep learning-based intelligent building decoration design method, characterized in that: Includes the following steps: S1): Use a monocular camera to take pictures of the building from various angles to obtain the original image; S2): Based on customer needs, extract keywords and create prompts. Specifically, combine the extracted keywords with the designer's expert prompts to complete the construction of prompts. S3): Collect relevant architectural decoration data based on keywords; S4): Data filtering and preprocessing to obtain the training set; S5): Define a custom loss function and train the diffusion model using the training set to obtain the trained diffusion model; the custom loss function combines mean squared error loss (MSE Loss) and Dice loss, and sets dynamic weights. The specific process includes: S501): Define the basic loss function; S502): Set the rate of change of the loss value; S503): Adjust the weights; S504): Calculate the custom loss; S6): Input the original image into the trained diffusion model to generate a preliminary image; input the preliminary image and prompt words into the pre-trained conditional generative adversarial network to obtain a preliminary design image; The specific operation of inputting the original image into the trained diffusion model and generating a preliminary image in S6) is as follows: cropping and normalizing the original image as input to the trained diffusion model; the trained diffusion model performs reverse diffusion and iteratively generates the first preliminary image. The specific steps in S6) to input the preliminary image and prompt words into the pre-trained conditional generative adversarial network to obtain the preliminary design map are as follows: S601): Import the pre-trained conditional generative adversarial network model and import the pre-trained weights, and set the model to evaluation mode. S602): Read the first preliminary image and adjust it to the input size required by the pre-trained conditional generative adversarial network model to obtain the second preliminary image; S603): Normalization, which scales the pixel values of the second preliminary image to the range used by the pre-trained conditional generative adversarial network model to obtain the third preliminary image; S604): Convert prompt words into prompt word vectors using a pre-trained word embedding model; S605): Input the third preliminary image and the word vector of the prompt word into the pre-trained conditional generative adversarial network model to obtain the preliminary design diagram; S7): Input the preliminary design drawings into the pre-trained variational autoencoder to improve the clarity and completeness of the preliminary design drawings and obtain architectural decoration design reference drawings to assist designers in their design work.
2. The intelligent building decoration design method based on deep learning according to claim 1, characterized in that: The specific steps for defining the basic loss function in S501 are as follows: The formula for calculating the mean squared error loss is as follows: Where Q is the total number of samples; It is the true label (target value) of the i-th sample; It is the predicted value of the i-th sample; The formula for calculating Dice loss is as follows: in, It is the true label (target value) of the i-th sample; It is the predicted value of the i-th sample; The specific operation for setting the rate of change of the loss value in S502 is as follows: Calculate the rate of change of the loss value between two consecutive training steps; assume the mean squared error loss value at time step t is MSE. t Dice loss value is Dice t The formula for the rate of change is as follows: The rate of change of mean squared error loss is: The rate of change of Dice loss is: The specific formula for adjusting the weights in S503 is as follows: in, and These are the dynamic weights of the mean squared error loss and the Dice loss, respectively, and k is an adjustment factor used to control the sensitivity of weight changes. The specific steps for calculating the custom loss in S504 are as follows: The formula for the custom loss function is as follows: in, and It is a dynamic weight used to balance the mean squared error loss and the Dice loss.
3. The intelligent building decoration design method based on deep learning according to claim 1, characterized in that: S2) Keyword extraction specifically uses the TextRank algorithm to extract important sentences or keywords from the text, where the provided text is the customer's requirement; First, word vectors are obtained through a pre-trained word embedding model; Next, the relationships between nodes are determined using cosine similarity. A threshold is set; if the threshold is exceeded, an edge is created. The cosine similarity formula is: Where M and N are two word vectors; θ is the angle between M and N; Then, an initial importance score is set for each node, usually set to an equal value, and the node's own importance score is updated based on the importance of the current node and the nodes it is connected to; the formula is as follows: Where B is a node connected to node A by an edge; d is the damping factor, usually taken as 0.85; Score(B) is the current importance score of node B; OutDegree(B) is the out-degree of node B, representing the number of edges connected to node B. Finally, wait for the calculation to converge, and obtain the keywords by sorting them according to their importance scores.
4. The intelligent building decoration design method based on deep learning according to claim 2, characterized in that: The specific steps for training the S3) diffusion model are as follows: In the forward diffusion process of the diffusion model, the model gradually adds noise to the original data, eventually transforming it into a standard normal distribution. The process of gradually adding noise can be regarded as a Markov chain, where each state corresponds to a version of the data with gradually increasing noise; the formula for a Markov chain is as follows: Where, x t It refers to the data status at time step t; It is the noise ratio parameter at time t; It is noise sampled from the standard normal distribution N(0,I) at time t; the time step t ranges from 1 to T and is an integer, where T is the time step size, and time T is pure noise; The reverse process uses U-Net as the network architecture, sets the time step and noise ratio parameters, adopts a custom loss function (Combined Loss), and optimizes it using the Adam optimization algorithm.
5. The intelligent building decoration design method based on deep learning according to claim 1, characterized in that: The specific operation of collecting relevant architectural decoration data based on keywords in S3 is as follows: collect relevant images from the public platform of architectural decoration using automated crawlers based on keywords.
6. The intelligent building decoration design method based on deep learning according to claim 1, characterized in that: The specific operations for data filtering and preprocessing in S4 to obtain the training set are as follows: Designers review the collected images, retain those that meet the client's requirements, and integrate relevant images from their own design drawings to obtain an image dataset. The image dataset is then cropped and normalized to obtain a training set.
Citation Information
Patent Citations
Home decoration design drawing generation method and device
CN110795858A
Three-dimensional model automatic modeling method based on text information guidance
CN115994990A
Mask optimization method based on semantic segmentation network
CN117058362A
Model training method, building effect picture generation method, equipment and medium
CN117351325A
Three-dimensional deep learning model for spinal image segmentation
CN117830795A