Automatic building plane layout generation method based on diffusion model
Through the automatic generation method of architectural layout based on the diffusion model, combined with semantic segmentation and feature fusion, the problem of incomplete design elements in the existing technology is solved, efficient and diversified architectural design generation is achieved, the design process is simplified and the cost is reduced cost.
Patent Information
- Application Number
- CN202410795819.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-13
AI Technical Summary
It is difficult for existing architectural design methods to fully consider key design elements such as layout area, building category, and outer contour when generating building layouts. As a result, the generated layout cannot meet specific functional and aesthetic requirements, and the training process is complicated, which increases the complexity of the design process. Time and cost, and innovation and adaptability are not enough to cope with diverse design needs and market changes.
An automatic generation method of building floor plan based on diffusion model is adopted. Through the conditional constraints of semantic segmentation, bubble map and contour map, combined with single-channel color mapping and feature fusion, the BBDM Brown Bridge diffusion model and Unet network are used for two-stage training. Loss function and L1 loss function to generate building plans that comply with specifications.
It achieves the generation of building plans that comply with architectural design specifications, has accurate categories and reasonable structures, simplifies the design process, improves the efficiency and diversity of design, can quickly respond to market changes, and reduces the complexity and data requirements of model training.
Smart Images

Figure CN118643572A
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image synthesis, in particular to a method for automatically generating a building plane layout. Technical Background
[0002] In traditional architectural design practice, designers usually need to consider a variety of complex factors, including space utilization efficiency, user needs, building regulations, and environmental factors. These design processes are often time-consuming and costly, and it is difficult to cope with rapidly changing market demands. To address these problems, in recent years, artificial intelligence technologies, especially deep learning, have been introduced into the design process to improve design efficiency and quality. However, existing methods are insufficient in fully considering key design elements such as layout area, building category, and outer contour, resulting in the generated building layout may not meet specific functional and aesthetic requirements. In addition, the training process of existing models is complex, requiring a large amount of data and tuning, which increases the time and cost of the design process. At the same time, the generated layout is limited in innovation and adaptability, and it is difficult to meet diverse design needs and market changes. Summary of the invention
[0003] In view of the limitations of the existing technology, the present invention proposes a method for automatically generating building floor plans based on a diffusion model. The method uses conditional constraints such as bubble maps and contour maps to automatically generate building floor plans that meet building layout specifications, have accurate categories and reasonable structures, and the layout design is easy to train and flexible.
[0004] The technical solution adopted by the present invention to solve the technical problem is:
[0005] The method for automatically generating a building plan layout based on a diffusion model comprises the following steps:
[0006] Step 1: Semantic segmentation and data preprocessing: The RPLAN dataset is used. The RPLAN dataset is a large-scale architectural floor plan dataset that contains more than 80,000 detailed annotated floor plans of real residential buildings. The OpenCV library is used to perform color semantic segmentation according to the data annotations and convert the dataset into a semantic map.
[0007] Step 2: Obtain a doorless semantic map: extract the outer contour of each semantic map by identifying the pixel range; use the semantic color corresponding to the inner wall to block the door part in the semantic map to generate a doorless semantic map.
[0008] Step 3: Draw a bubble map and a contour map: Determine the area size and room type by using the pixel area and color of each room in the semantic map, and place the bubbles converted from the room according to the pixel center point at the location to obtain a bubble map.
[0009] Step 4: Single-channel color mapping: Use the "single-channel color mapping" technique to simplify the model's input data format by converting the traditional three-channel RGB image data into single-channel data. This process not only reduces the complexity of model processing, but also retains the spatial structure and category information that is critical to model training.
[0010] Step 5: Data collation and model training: By effectively pairing the data generated from step 2 to step 4. Specifically, the "bubble map-contour map-no door layout" is combined into one set of data, and the "no door layout" is paired with the "door layout" to form another set of data. These paired data will be used as model input to automatically generate building floor plans.
[0011] Step 6: Feature fusion and loss optimization: The present invention designs a feature fusion layer in the first stage based on the BBDM Brownian Bridge Diffusion model as the basic framework, which effectively fuses the features of the bubble map and the contour map to ensure that the model considers the embedding of these two conditions during the training process, uses set loss in the loss function part, and combines L1 loss and category feature loss for model training. Combined with the training objectives of the original model, the model can not only learn the layout structure information but also consider the accuracy of the category when generating the layout.
[0012] Step 7: Multi-stage generation and refinement: In the second stage of this method, semantic layout graphs with and without doors are used as training data, so that the model can generate complete semantic layout graphs with doors that meet the architectural design specifications based on the basic layout.
[0013] Furthermore, in step 1, the OpenCV library is used to perform semantic segmentation on the RPLAN dataset. Using the color recognition and threshold processing tools in the OpenCV library, semantic segmentation is performed according to the original annotations of the dataset. The specific semantic segmentation rules are as follows: the semantic color of the background is white (255, 255, 255), the semantic color of the outer contour is gray (79, 79, 79), the semantic color of the inner wall is medium gray (128, 128, 128), the semantic color of the door is sky blue (25, 225, 255), the semantic color of the living room is light blue (229, 242, 244), the semantic color of the bedroom is light blue-gray (171, 244, 253), the semantic color of the kitchen is light gray (214, 216, 234), the semantic color of the balcony is light green (135, 216, 208), and the semantic color of the toilet is light yellow (252, 233, 205). This precise color distinction helps the neural network learn and distinguish the layout features of different areas more effectively, improving the efficiency of model training.
[0014] Furthermore, in step 2, the outer contours of each semantic map are extracted, and the color recognition tool of the OpenCV library is used to filter the outer contours of each image according to the semantic color of the outer contour (gray, RGB is 79,79,79). After the screening is completed, these outer contours are redrawn as images in PNG format. The semantic color of the door in the layout is selected using the color recognition tool (sky blue, RGB is 25,225,255), and then the color of these pixels is modified to the semantic color of the interior wall (medium gray, RGB is 128,128,128) to generate a semantic map without a door. This method ensures that the model can focus on the basic structure of the spatial layout without considering the location of the door.
[0015] Furthermore, in step 3, each room is represented by a bubble in the bubble map, and the color of the bubble matches the semantic color of the corresponding room in the original layout to ensure visual continuity and intuitiveness. The size of the bubble is determined by the area of the room, and the specific calculation method is as follows: The radius r of the bubble is calculated based on the sum of the pixel areas of the room m, using the formula The bubble radius calculated in this way ensures that the area of the bubble is proportional to the actual area of the room. The position of each bubble in the bubble diagram is determined by the center point of the corresponding room in the building layout, ensuring that the bubble diagram can accurately reflect the relative spatial relationship between rooms. This setting helps the model better understand and reproduce the layout configuration of the room, providing a basis for subsequent design optimization.
[0016] Furthermore, in step 4, the "single-channel color mapping" technique is used to convert the traditional three-channel RGB image data into single-channel data to simplify the complexity of the input data and accelerate the processing efficiency of the model. Colors with specific semantics are converted into a single grayscale value. This conversion helps to reduce the amount of calculation during data processing while retaining spatial and category information that is critical to model training. The grayscale value of each color represents a specific architectural element, allowing the model to recognize and process image data faster. Through such mapping, the model can focus more on the structural features of the layout during training rather than the complexity of color information.
[0017] Furthermore, in step 5, the present invention details the organization and use of the data set to support the phased training of the model. First, the 'bubble map-contour map-doorless layout' is integrated into the first set of data sets. This set of data sets is mainly used in the first stage of model training, and the purpose is to let the model learn how to generate a preliminary spatial layout based on the bubble map and the contour map. Next, the 'doorless layout' is paired with the 'doored layout' to form a second set of data sets. The second set of data sets is used for the second stage training of the model, focusing on adding doors and other details to the basic layout without doors to generate a complete building plan layout.
[0018] Furthermore, in step 6, the present invention adopts the BBDM model, which is an image translation technology based on a diffusion process, as the basic framework of the present invention. The process of model training and feature fusion includes the following key steps:
[0019] (1) Feature fusion: In the conditional input stage, the features of the bubble map and the contour map are fused. First, the conditional map is downsampled to extract high-dimensional abstract features. Then, these high-dimensional feature attributes are concatenated and fused, and restored to the original dimension through the upsampling layer to retain the details.
[0020] (2) Model training: After feature fusion, the data is first denoised to disrupt the original data information, and then the processed data and time step information are input into the Unet network for training. The Unet network, combined with the self-attention module, can establish a direct dependency relationship between different regions of the image. By dynamically adjusting the response between different regions, the model's perception of local details is enhanced, especially in the recognition of complex door and window structures. The main task of the Unet network is to predict the denoising process, that is, to restore a clear image from the noisy data.
[0021] (3) Training optimization: To improve the quality of generated images, the present invention adopts a composite loss function that combines L1 loss (mean absolute error loss) and category feature loss. L1 loss helps to ensure the accuracy and consistency of the generated image and the target image at the pixel level by calculating the pixel-level difference between the two. Category feature loss uses a pre-trained ResNet-50 model to extract image features and uses cross-entropy loss to measure the accuracy of category prediction. This loss function is designed to improve the model's adaptability to input conditions and the quality of generated results. The formula is as follows:
[0022]
[0023] Among them, L1 represents the sum of element-wise absolute differences, x ij Represents the pixel value of the generated image at position (i, j), y ij Represents the pixel value of the target image at the same position, H and W represent the height and width of the image respectively. Category feature loss is mainly used to ensure that the category features of the generated image are consistent with the target category. The pre-trained ResNet-50 model is used to extract image features, and the cross entropy loss is used to measure the accuracy of category prediction. Specifically, the ResNet-50 model is used to extract features from the generated image and the target image, and these features are used to predict the category of the image. The cross entropy loss function is defined as:
[0024]
[0025] Where M is the total number of categories, y 0,c Represents the true label of category c for observation o (i.e. a specific sample) (usually 0 or 1, where 1 indicates that the sample belongs to this category). is the model’s prediction that the observation O belongs to category c. By minimizing the cross entropy loss, the model is able to learn to accurately predict the category of the generated image, thereby further ensuring that the generated layout is consistent with the target category.
[0026] The model training process is based on optimizing the evidence lower bound (ELBO) of the Brownian bridge diffusion process. By processing a total of 1000 time steps of noisy data, it learns to denoise the input data to varying degrees. Through these two loss functions and combined with ELBO, it ensures that the generated layout is not only accurate at the pixel level, but also maintains consistency in category features, significantly improving the model performance in the layout generation task. ELBO is expressed as:
[0027]
[0028] in represents the expected value of x0, y, ∈; x0 represents the potential representation of the original image in the input domain; y represents the potential representation of the image in the target domain, which is used as the conditional input in training; ∈ represents the Gaussian noise added to the diffusion process; c ∈t is a scaling factor that depends on time t and is used to adjust the loss contribution at different time steps; m t represents the time-dependent mixing weight in the diffusion process from the original image to the target image; δ t Represents the variance in the diffusion process, which is used to control the standard deviation of the noise; ∈ θ (x t ,t) is a function parameterized by a neural network that estimates the current diffusion state x t and the noise at time t.
[0029] Further, in step 7, the present invention uses the gateless semantic graph and the gated semantic graph for comparative training, which is consistent with the execution process of step 6. First, the data is denoised, and then the noisy data and the corresponding time step information are input into the Unet network for training. In addition, this step integrates the self-attention module in the Unet network, allowing the model to establish direct dependencies between different regions of the image. This mechanism significantly enhances the model's perception of local details by dynamically adjusting the responses between different regions, especially in identifying complex door and window structures.
[0030] The main task of the Unet network is to restore clear images from noisy data, simulating and optimizing the process of adding and adjusting doors in the actual building layout. In step 7, only the L1 loss function is used for optimization. L1 loss, also known as mean absolute error loss, is an effective way to quantify the pixel-level difference between the image generated by the model and the real image. Using this simplified loss function helps to focus on the overall accuracy of the image, especially the precise location and size of the doors and windows, ensuring that the final generated layout is not only visually clear, but also meets the design specifications in terms of functional layout.
[0031] In this way, the Unet network can more effectively learn to process and improve the details in the building layout, especially in terms of the location and size of the doors, thereby improving the quality and practicality of the overall layout. Such a training strategy ensures the efficiency and accuracy of the model in performing the task of automatically generating architectural designs.
[0032] The beneficial effects of the present invention include:
[0033] The present invention provides a method for automatically generating a building plan layout based on a diffusion model to address the deficiencies of the prior art:
[0034] (1) Two-stage network model: The PLG-Diff network model includes the stage of generating preliminary floor plans and the stage of refining the layout and adding doors. This two-stage framework optimizes the design process, not only efficiently generates preliminary layouts, but also fine-tunes space planning, solving the shortcomings of traditional methods in dealing with rapid market changes.
[0035] (2) Single-channel color mapping: The model uses a single-channel color mapping method to load the data set, simplifying the floor plan features, reducing the amount of data input to the model, and accelerating model training. This technology effectively reduces the data requirements and complexity of model training in traditional methods.
[0036] (3) Ensemble loss function: Ensemble loss is used, combined with L1 loss and feature loss, to make model learning more in line with the requirements of input conditions and improve the accuracy and adaptability of the design.
[0037] (4) Innovative method of conditional input: conditional input is performed by using a bubble map plus a contour map. Users can enter the approximate location, area, and adjacent relationship of each type of room by drawing or selecting a bubble map, and the contour map is used to control the outer contour of the building, so that the model can generate a layout map that is more in line with needs and more personalized.
[0038] (5) Feature fusion and diffusion model: The feature fusion and diffusion model is combined to provide a comprehensive and effective solution for the architectural design field, significantly improving the accuracy and diversity of design solutions and addressing the limitations of existing methods in comprehensively considering design elements and meeting personalized needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 The overall network model structure diagram of the invention;
[0040] Figure 2 To invent a complete flow chart;
[0041] Figure 3 Generate effect diagrams for one-stage condition constraints;
[0042] Figure 4 The final layout rendering is generated for the second stage. DETAILED DESCRIPTION
[0043] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] The present invention includes the following contents: when inputting the diffusion model, a bubble map plus a contour is used to perform conditional constraints, and a color mapping technique is used to speed up the model training speed and reduce the model working cycle, wherein the conditional information of the bubble map includes the type, size, approximate location and other information of each room in the layout; the contour map includes the outer contour restrictions required for generating the layout to ensure that the contour constraints are considered when the model generates the layout. In addition, in order to achieve multiple conditional constraints on the model, a feature fusion method is used to fuse the bubble map and the contour constraints so that the model can better receive conditional control, and a set loss (L1 loss and category feature loss) is used to adjust the model learning, enhance the model's processing of categories, and enable it to generate a layout map that meets the input constraints. The network model structure diagram is shown in FIG. Figure 1 The complete flow chart of the method is shown in Figure 2 As shown, the specific technical solution is as follows:
[0045] The method for automatically generating a building plan layout based on a diffusion model comprises the following steps:
[0046] Step 1: Semantic segmentation and data preprocessing: The RPLAN dataset is used. The RPLAN dataset is a large-scale architectural floor plan dataset that contains more than 80,000 detailed annotated floor plans of real residential buildings. Color semantic segmentation is performed according to data annotations using the OpenCV library. The color recognition and threshold processing tools in the OpenCV library are used to perform semantic division based on the original annotations of the dataset, and the dataset is converted into a semantic map. The specific semantic division rules are as follows: the semantic color of the background is white (255, 255, 255), the semantic color of the outer contour is gray (79, 79, 79), the semantic color of the inner wall is medium gray (128, 128, 128), the semantic color of the door is sky blue (25, 225, 255), the semantic color of the living room is light blue (229, 242, 244), the semantic color of the bedroom is light blue-gray (171, 244, 253), the semantic color of the kitchen is light gray (214, 216, 234), the semantic color of the balcony is light green (135, 216, 208), and the semantic color of the toilet is light yellow (252, 233, 205). This precise color distinction helps the neural network learn and distinguish the layout features of different areas more effectively, improving the efficiency of model training.
[0047] Step 2: Get the door-free semantic map: Extract the outer contour of each semantic map by identifying the pixel range; use the color recognition tool of the OpenCV library to filter the outer contour of each image according to the semantic color of the outer contour (gray, RGB is 79,79,79). After the screening is completed, redraw these outer contours into PNG format images. Use the color recognition tool to select the semantic color of the door in the layout (sky blue, RGB is 25,225,255), and then change the color of these pixels to the semantic color of the inner wall (medium gray, RGB is 128,128,128). Use the semantic color corresponding to the inner wall to block the door part in the semantic map to generate a door-free semantic map. This method ensures that the model can focus on the basic structure of the spatial layout without considering the location of the door.
[0048] Step 3: Draw bubble maps and contour maps: Determine the area size and room type by using the pixel area and color of each room in the semantic map, and place the bubbles converted from the room according to the pixel center point at the location to obtain a bubble map. Each room is represented by a bubble in the bubble map, and the color of the bubble matches the semantic color of the corresponding room in the original layout to ensure visual continuity and intuitiveness. The size of the bubble is determined by the area of the room, and the specific calculation method is as follows: The radius r of the bubble is calculated based on the sum of the room pixel areas m, using the formula The bubble radius calculated in this way ensures that the area of the bubble is proportional to the actual area of the room. The position of each bubble in the bubble diagram is determined by the center point of the corresponding room in the building layout, ensuring that the bubble diagram can accurately reflect the relative spatial relationship between rooms. This setting helps the model better understand and reproduce the layout configuration of the room, providing a basis for subsequent design optimization.
[0049] Step 4: Single-channel color mapping: Use the "single-channel color mapping" technique to simplify the complexity of input data and accelerate the processing efficiency of the model by converting traditional three-channel RGB image data into single-channel data. This technology converts colors with specific semantics into a single grayscale value through the mapping rules shown in the table below. This conversion helps reduce the amount of computation during data processing while retaining spatial and category information that is critical to model training.
[0050]
[0051]
[0052] The grayscale value of each color represents a specific architectural element, allowing the model to recognize and process image data more quickly. For example, mapping the bright blue color of the door (25,225,255) to the number 3 allows the model to pay special attention to this area, and then more accurately perform functional zoning in subsequent processing. Through such mapping, the model can focus more on the structural features of the layout during training rather than the complexity of color information.
[0053] Step 5: Data collation and model training: The bubble map and contour map generated in steps 2 and 3, as well as the single-channel color mapping results generated in step 4, are paired to form the first set of data sets. This set of data sets is mainly used in the first stage of model training, with the purpose of allowing the model to learn how to generate a preliminary spatial layout based on the bubble map and contour map. At the same time, the layout without doors is paired with the layout with doors to form the second set of paired data sets. The second set of data sets is used for the second stage of model training, focusing on adding doors and other details to the basic layout without doors. These paired data will be used as model input to generate a complete building floor plan layout.
[0054] Step 6: Feature fusion and loss optimization: The present invention designs a feature fusion layer in the first stage based on the BBDM Brownian Bridge Diffusion model as the basic framework, which effectively fuses the features of the bubble map and the contour map to ensure that the model considers the embedding of these two conditions during the training process, uses set loss in the loss function part, and combines L1 loss and category feature loss for model training. Combined with the training objectives of the original model, the model can not only learn the layout structure information but also consider the accuracy of the category when generating the layout.
[0055] In step 6, the present invention adopts the BBDM model, which is an image translation technology based on diffusion process, as the basic framework of the present invention. The training and feature fusion process of the first stage of the model includes the following steps, and its constraint generation effect diagram is as follows: Figure 3 As shown:
[0056] (1) Feature fusion: In the conditional input stage, the features of the bubble map and the contour map are fused. First, the conditional map is downsampled to extract high-dimensional abstract features. Then, these high-dimensional feature attributes are concatenated and fused, and restored to the original dimension through the upsampling layer to retain the details.
[0057] (2) Model training: After feature fusion, the data is first denoised to disrupt the original data information, and then the processed data and time step information are input into the Unet network for training. The Unet network, combined with the self-attention module, can establish a direct dependency relationship between different regions of the image. By dynamically adjusting the response between different regions, the model's perception of local details is enhanced, especially in the recognition of complex door and window structures. The main task of the Unet network is to predict the denoising process, that is, to restore a clear image from the noisy data.
[0058] (3) Training optimization: To improve the quality of generated images, the present invention adopts a composite loss function that combines L1 loss (mean absolute error loss) and category feature loss. L1 loss helps to ensure the accuracy and consistency of the generated image and the target image at the pixel level by calculating the pixel-level difference between the two. Category feature loss uses a pre-trained ResNet-50 model to extract image features and uses cross-entropy loss to measure the accuracy of category prediction. This loss function is designed to improve the model's adaptability to input conditions and the quality of generated results. The formula is as follows:
[0059]
[0060] Among them, L1 represents the sum of element-wise absolute differences, x ij Represents the pixel value of the generated image at position (i, j), y ij Represents the pixel value of the target image at the same position, H and W represent the height and width of the image respectively. Category feature loss is mainly used to ensure that the category features of the generated image are consistent with the target category. The pre-trained ResNet-50 model is used to extract image features, and the cross entropy loss is used to measure the accuracy of category prediction. Specifically, the ResNet-50 model is used to extract features from the generated image and the target image, and these features are used to predict the category of the image. The cross entropy loss function is defined as:
[0061]
[0062] Where M is the total number of categories, y 0,c Represents the true label of category c for observation O (i.e., a specific sample) (usually 0 or 1, where 1 indicates that the sample belongs to this category). is the model’s prediction that the observation O belongs to category c. By minimizing the cross entropy loss, the model is able to learn to accurately predict the category of the generated image, thereby further ensuring that the generated layout is consistent with the target category.
[0063] The model training process is based on optimizing the evidence lower bound (ELBO) of the Brownian bridge diffusion process. By processing a total of 1000 time steps of noisy data, it learns to denoise the input data to varying degrees. Through these two loss functions and combined with ELBO, it ensures that the generated layout is not only accurate at the pixel level, but also maintains consistency in category features, significantly improving the model performance in the layout generation task. ELBO is expressed as:
[0064]
[0065] in represents the expected value of x0, y, ∈; x0 represents the potential representation of the original image in the input domain; y represents the potential representation of the image in the target domain, which is used as the conditional input in training; ∈ represents the Gaussian noise added to the diffusion process; c ∈t is a scaling factor that depends on time t and is used to adjust the loss contribution at different time steps; m t represents the time-dependent mixing weight in the diffusion process from the original image to the target image; δ t Represents the variance in the diffusion process, which is used to control the standard deviation of the noise; ∈ θ (x t ,t) is a function parameterized by a neural network that estimates the current diffusion state x t and the noise at time t.
[0066] The noise is added for a total of 1000 time steps, and the model will learn to perform different degrees of denoising on the input data for different 1000 time steps. By using these two loss functions and combining ELBO, not only the accuracy of the generated layout at the pixel level is ensured, but also the consistency of the generated layout in category features is guaranteed, thereby improving the performance of the model in the layout generation task.
[0067] Step 7: Multi-stage generation and refinement: In the second stage of this method, the gateless semantic graph and the gated semantic graph are used for comparative training, and the constraint generation effect is as follows Figure 4As shown in Figure 1, the data is denoised in accordance with the execution flow of step 6, and then the denoised data and the corresponding time step information are input into the Unet network for training. Using the gateless and gated semantic layout graphs as training data, the self-attention module is integrated into the Unet network, allowing the model to establish direct dependencies between different regions of the image. This mechanism significantly enhances the model's perception of local details by dynamically adjusting the responses between different regions, especially in identifying complex door and window structures.
[0068] The main task of the Unet network is to restore clear images from noisy data, simulating and optimizing the process of adding and adjusting doors in the actual building layout. In step 7, only the L1 loss function is used for optimization. L1 loss, also known as mean absolute error loss, is an effective way to quantify the pixel-level difference between the image generated by the model and the real image. Using this simplified loss function helps to focus on the overall accuracy of the image, especially the precise location and size of the doors and windows, ensuring that the final generated layout is not only visually clear, but also meets the design specifications in terms of functional layout.
[0069] Through this method, the Unet network can more effectively learn to process and improve the details of the building layout, especially the location and size of the door, thereby improving the quality and practicality of the overall layout. Such a training strategy ensures the efficiency and accuracy of the model in performing the task of automatic generation of architectural design, so that the model can generate a complete semantic layout diagram with doors that meets the architectural design specifications based on the basic layout.
Claims
1. Automatic generation method of building plan layout based on diffusion model, Features: Step 1: Semantic segmentation and data preprocessing: The RPLAN dataset is used. The RPLAN dataset is a large-scale architectural floor plan dataset that contains more than 80,000 detailed annotated floor plans of real residential buildings. The OpenCV library is used to perform color semantic segmentation according to the data annotations to convert the dataset into a semantic map. Step 2: Obtain a doorless semantic map: The outer contour of each semantic map is extracted by identifying the pixel range; the door part of the semantic map is blocked using the semantic color corresponding to the inner wall to generate a doorless semantic map. Step 3: Draw a bubble map and contour map: The area size and room type are determined by the pixel area and color of each room in the semantic map, and the bubbles converted from the room are placed according to the pixel center point at the location to obtain a bubble map. Step 4: Single-channel color mapping: The "single-channel color mapping" technology is used to convert the traditional three-channel RGB image data into a single-channel image. Step 5: Data collation and model training: By effectively pairing the data generated in steps 2 to 4, the "bubble map-contour map-no door layout" is combined into a set of data sets, and the "no door layout" is paired with the "door layout" to form another set of data sets. These paired data will be used as model input for automatically generating building floor plans; Step 6: Feature fusion and loss optimization: A feature fusion layer is designed on the first stage of the BBDM Brownian Bridge Diffusion Model as the basic framework to effectively fuse the features of the bubble map and the contour map. The set loss is used in the loss function part, and the L1 loss and the category feature loss are jointly used for model training, combined with the training objectives of the original model; Step 7: Multi-stage generation and refinement: In the second stage of this method, the semantic layout maps with and without doors are used as training data, so that the model can generate a complete semantic layout map with doors that meets the architectural design specifications on the basic layout.
2. The method for automatically generating a building plan layout based on a diffusion model according to claim 1, Features: In step 1, the OpenCV library is used to perform semantic segmentation on the RPLAN dataset. The color recognition and threshold processing tools in the OpenCV library are used to perform semantic segmentation according to the original annotations of the dataset. The specific semantic segmentation rules are as follows: the semantic color of the background is white (255, 255, 255), the semantic color of the outer contour is gray (79, 79, 79), the semantic color of the inner wall is medium gray (128, 128, 128), the semantic color of the door is sky blue (25, 225, 255), the semantic color of the living room is light blue (229, 242, 244), the semantic color of the bedroom is light blue-gray (171, 244, 253), the semantic color of the kitchen is light gray (214, 216, 234), the semantic color of the balcony is light green (135, 216, 208), and the semantic color of the toilet is light yellow (252, 233, 205).
3. The method for automatically generating a building plan layout based on a diffusion model according to claim 1, Features: In step 2, the outer contour of each semantic map is extracted, and the color recognition tool of the OpenCV library is used to filter the outer contour of each image according to the semantic color of the outer contour (gray, RGB is 79,79,79). After the screening is completed, these outer contours are redrawn as images in PNG format, and the semantic color of the door in the layout is selected using the color recognition tool (sky blue, RGB is 25,225,255). Then, the color of these pixels is modified to the semantic color of the inner wall (medium gray, RGB is 128,128,128) to generate a semantic map without a door.
4. The method for automatically generating a building plan layout based on a diffusion model according to claim 1, Features: Furthermore, in step 3, each room is represented by a bubble in the bubble map. The color of the bubble matches the semantic color of the corresponding room in the original layout. The size of the bubble is determined by the area of the room. The specific calculation method is as follows: The radius r of the bubble is calculated based on the sum of the pixel areas m of the room, using the formula The bubble radius calculated in this way can ensure that the area of the bubble is proportional to the actual area of the room. The position of each bubble in the bubble map is determined by the center point of the corresponding room in the building layout.
5. The method for automatically generating a building plan layout based on a diffusion model according to claim 1, Features: In step 4, the "single-channel color mapping" technique is used to convert the traditional three-channel RGB image data into a single channel data, and the colors with specific semantics are converted into a single grayscale value, and the grayscale value of each color represents a specific architectural element.
6. The method for automatically generating a building plan layout based on a diffusion model according to claim 1, Features: In step 5, the 'bubble map-contour map-no gate layout' is integrated into the first set of data sets, which is mainly used for the first stage of model training. The 'no gate layout' is paired with the 'gate layout' to form the second set of data sets, which is used for the second stage of model training.
7. The method for automatically generating a building plan layout based on a diffusion model according to claim 1, Features: In step 6, the diffusion-based image translation technology BBDM model is used as the basic framework. The model training and feature fusion process includes the following key steps: (1) Feature fusion: In the conditional input stage, the features of the bubble map and the contour map are fused, and the conditional map is downsampled to extract high-dimensional abstract features. These high-dimensional feature attributes are spliced and fused, and restored to the original dimension through the upsampling layer; (2) Model training: After feature fusion, the data is denoised to disrupt the original data information. The processed data and time step information are input into the Unet network for training. The Unet network is combined with the self-attention module to establish direct connections between different areas of the image. The Unet network can dynamically adjust the response between different regions to enhance the model's perception of local details, especially in the recognition of complex door and window structures. The main task of the Unet network is to predict the denoising process, that is, to restore a clear image from the noisy data. (3) Training optimization: A composite loss function is used to combine the mean absolute error loss L1 and the category feature loss. This is achieved by calculating the pixel-level difference between the two. The category feature loss uses a pre-trained ResNet-50 model to extract image features, and uses cross entropy loss to measure the accuracy of category prediction. This loss function is designed to improve the model's adaptability to input conditions and the quality of generated results. The formula is as follows: Among them, L1 represents the sum of element-wise absolute differences, x ij Represents the pixel value of the generated image at position (i, j), y ij Represents the pixel value of the target image at the same position, H and W represent the height and width of the image respectively. The category feature loss is mainly used to ensure that the category features of the generated image are consistent with the target category. The pre-trained ResNet-50 model is used to extract image features, and the cross entropy loss is used to measure the accuracy of category prediction. The ResNet-50 model is used to extract features from the generated image and the target image, and the features are used to predict the category of the image. The cross entropy loss function is defined as: Where M is the total number of categories, y 0,c represents the true label of category c for observation o (i.e. a specific sample) (usually 0 or 1, where 1 indicates that the sample belongs to this category), c is the model’s prediction that the observation O belongs to category c. By minimizing the cross entropy loss, the model is able to learn to accurately predict the category of the generated image. The model training process is based on optimizing the evidence lower bound (ELBO) of the Brownian bridge diffusion process. By processing the noisy data for a total of 1000 time steps, it learns to denoise the input data to varying degrees. Through these two loss functions and combined with ELBO, ELBO is expressed as: in Indicates x 0 ,y,∈, the expected value of x 0 represents the potential representation of the original image in the input domain; y represents the potential representation of the image in the target domain, which is used as the conditional input in training; ∈ represents the Gaussian noise added to the diffusion process; c ∈t is a scaling factor that depends on time t and is used to adjust the loss contribution at different time steps; m t represents the time-dependent mixing weight in the diffusion process from the original image to the target image; δ t Represents the variance in the diffusion process, which is used to control the standard deviation of the noise; ∈ θ (x t ,t) is a function parameterized by a neural network that estimates the current diffusion state x t and the noise at time t.
8. The method for automatically generating a building plan layout based on a diffusion model according to claim 1, Features: In step 7, the gateless semantic graph and the gated semantic graph are used for comparative training. The execution process is consistent with step 6. The data is denoised, and then the noisy data and the corresponding time step information are input into the Unet network for training. The self-attention module is integrated into the Unet network to allow the model to establish direct dependencies between different areas of the image. The main task of the Unet network is to restore a clear image from noisy data, simulate and optimize the process of adding and adjusting doors in the actual building layout, and only the L1 loss function is used for optimization in step 7.
Citation Information
Cited By
Two-stage product design generation method, system, equipment and medium
CN119475470A
Two-stage product design generation method, system, device and medium
CN119475470B
Method for quickly and automatically modeling macroscopic evacuation network model based on semantic segmentation
CN120510246A
Building plane intelligent generation method considering indoor environment
CN121598489A
