1. Introduction
As artificial intelligence develops, using deep learning models for architectural floor plan generation has become a cutting-edge research hotspot in the field of architectural design. Relevant research has already made breakthroughs in the residential building type, producing relatively ideal results [
1,
2]. This can significantly reduce repetitive labor time for architects during the planning phase and even allow ordinary people to participate in the architectural design process. The success in using residential buildings as research subjects can be attributed to two main reasons: First, there is a large amount of floor plan data available, such as the open-source dataset RPLAN [
3], which contains more than 80,000 residential floor plans that researchers can directly access for deep learning training. Secondly, the functional relationships in residential buildings are relatively simple, and the generated results have a high tolerance for errors, providing a relaxed premise for research. However, architects need to design a variety of building types, and due to data protection measures by different companies, it is often difficult to obtain large datasets for special types of buildings like those available for residential buildings. Therefore, research on floor plan generation based on small sample size data is highly necessary.
1.1. Nursing Units as Research Objects
After the COVID-19 pandemic, the demand for the construction of general hospitals in China has gradually increased. Choosing the standard nursing units of general hospitals as research objects has practical significance. In a general hospital, a standard nursing unit consists of a fully equipped team (doctors, nurses, and support staff), several patient beds, related diagnostic and treatment facilities, as well as associated medical, living, administrative, and circulation spaces. It operates with functional independence. It is typically connected to medical technology departments and outpatient departments via vertical circulation, ensuring horizontal independence [
4,
5,
6]. The floor plans of these units have undergone many years of development, and their functional configurations and spatial organizations have become increasingly mature, highly standardized, and typified [
4]. However, in nursing units, the various functions are highly interrelated. Taking the centralized nursing unit as an example, the nurse station must be positioned at the center of the unit to better serve patients. Patient rooms need to be situated on the southern side of the unit for better daylighting, and corridors must connect every space to avoid functional overlaps and intersections. These factors pose certain challenges for research.
A standard nursing unit typically encompasses wards for fundamental medical disciplines such as internal medicine, surgery, ENT, obstetrics and gynecology, and pediatrics. The required supporting facilities for these wards are generally similar. However, specialized nursing units such as infection wards and ICUs require unique workflow designs and are not included within the scope of this study.
1.2. Using SD + LoRA as the Generation Method
The emergence of the Diffusion model [
7] has propelled the significant advancement of deep generative models, marking a new milestone for the AI industry as it transitions from the era of traditional deep learning to the era of Artificial Intelligence Generated Content (AIGC). The Stable Diffusion (SD) model [
8], a large generative model based on a latent diffusion process, is a fully open-source project with a vast application community. Techniques like Low-Rank Adaptation (LoRA) [
9] can be used for parameter-efficient fine-tuning, enabling personalized adjustments under conditions of small sample data to meet various generative task requirements. Additionally, the SD model supports multiple generation control methods, granting it substantial generative flexibility to satisfy diverse application needs. Notably, the SD model incorporates innovative modules such as self-attention and cross-attention mechanisms [
10], significantly enhancing the model’s generative quality and control precision.
1.3. Highlights
This study innovatively employed the SD model to generate floor plans for standard nursing units. The input consisted of bitmap images of the nursing unit boundaries, and the output was the functional layout of the nursing unit. Before the experiment, we first studied the layout composition of nursing units and created a dataset based on their characteristics. Subsequently, we fine-tuned the Stable Diffusion model using LoRA. Then, during the generation process, hyperparameter adjustments and the combination of various control methods were the focus of the research. Multiple control variable experiments were conducted for different hyperparameters and control methods. Additionally, the introduction of major control structures into the input conditions optimized the generation results and improved the qualification rate of the generated layouts. Ultimately, through quantitative analysis of the generated samples and real samples, the study demonstrated that the workflow of fine-tuning the SD model with LoRA can serve as a method for automatic floor plan generation for buildings with small sample sizes, and it established an automated workflow from parameter-controlled generation of nursing unit boundaries to functional layout generation by the SD model.
2. Related Work
Before 2022, research on architectural floor plan generation based on deep learning mainly employed Generative Adversarial Network (GAN) models [
11]. GAN models consist of a generator and a discriminator. The generator is responsible for generating new data samples similar to the training data samples, while the discriminator determines whether the input data is real training data or fake data. The generator accepts random noise input and attempts to generate data that can deceive the discriminator, while the discriminator strives not to be deceived by the generator. The two form an adversarial training process, alternating optimization, ultimately achieving high-quality generated data that is difficult to distinguish from real data. The widespread application of GAN models in the field of architectural floor plan generation can be attributed to the pix2pix model, improved by Isola P. et al. (2017) from GAN, which realized Image-to-Image translation using paired data [
12]. This was followed by the derivation of pix2pixHD, which can generate higher-resolution images [
13].
In recent years, most research applying GAN models for architectural floor plan generation has employed the aforementioned Image-to-Image approach, predominantly focusing on residential buildings. Huang W. et al. (2018) used pix2pixHD for residential floor plan generation and first proposed the method of marking functional rooms in apartment floor plans with color blocks to construct training sets and generate results [
14]. Chaillou S. (2019) trained a workflow with pix2pix to gradually generate and associate derivations from building contours to room segmentation to furniture layout, simulating the architect’s design process [
15]. At the CAADRIA conference in 2020, Zheng H. et al. demonstrated the use of apartment datasets from China and Japan to train the pix2pixHD model separately, achieving satisfactory generation results [
16]. Pan Y. et al. (2021) first attempted to use the upgraded version of the pix2pixHD model, GauGAN, for generation experiments. They used data on roads, buildings, and other information from northern Chinese communities to train the GauGAN model to generate residential building layouts, aiming for higher resolution and more diverse generation results, as well as adapting to irregular contour conditions [
17].
In 2021, Nelson N. et al. introduced the HouseGAN++ model, which improved the model network using relational GANs and conditional GANs, achieving iterative refinement by making the previous generation result a constraint condition for the next generation [
2]. Luo Z. et al. (2022) proposed a GAN model framework that combines vector generation and raster image discrimination capable of directly generating vector floor plans, though limited to rectangular room blocks [
18].
The use of GAN models for automatic architectural floor plan generation has formed a relatively common and effective methodology, namely dividing architectural floor plans into specific functional areas, establishing segmentation masks for rooms or different functional areas to form identifiable training data, thereby establishing a deep learning model for training and simulation. This approach reduces the complexity of machine recognition and learning of architectural floor plans and significantly improves generation efficiency.
From late 2022, the field gradually began to see research using diffusion models as the primary tool. Shabani et al. introduced a new method for generating vector floor plans using diffusion models, named HouseDiffusion [
1]. The authors represented floor plans as one-dimensional polygonal rings, with each ring corresponding to a room or door. By denoising the two-dimensional coordinates of these two inference targets, vector graphic floor plans were directly generated. Qualitative and quantitative evaluations indicated that the proposed system outperformed the state-of-the-art technology House-GAN++ [
2]. In other research directions, Fan Y. et al. (2023) enhanced indoor lighting ambiance by converting optimized shading patterns into landscape or animal patterns using customized LoRA models [
19]. Wang L. et al. (2023) conducted generation experiments for shear wall layout in residential floor plans using the SD model, comparing the generation results with those of GAN and CNN models [
20]. This study’s methodology draws on the approaches used in the aforementioned research on residential floor plan generation [
14,
15,
16]. However, it differs by focusing on nursing unit floor plans with small sample sizes, marking the first known attempt to use SD+LoRA for automatic floor plan generation of healthcare-type buildings.
3. Preliminary
Figure 1a depicts the architecture of the Latent Diffusion Model (LDM) [
8], which forms the foundation of the SD model. Initially, the input image
is transformed into a latent representation
via an encoder
. In the latent space, the diffusion process starts from the initial noise
and progressively denoises it using a Denoising U-Net
, resulting in the latent representation
. The Denoising U-Net incorporates conditional information (such as semantic maps, text descriptions, representations, and images) during the denoising process, integrating external conditions at each step through a cross-attention mechanism. Finally, the latent representation
is converted back to pixel space by a decoder
, yielding the reconstructed image
. This approach allows for efficient denoising and generation in the latent space, while leveraging conditional information to control the generation outcomes. The SD model can generate high-quality images based on given text descriptions. Training foundational models requires substantial computational resources, which small research teams cannot independently manage. Researchers have developed cost-effective fine-tuning methods [
9,
21,
22], making it possible to deploy SD models on consumer-grade GPUs. From the perspectives of generation quality, time efficiency, and the size of the required training dataset, LoRA is a superior choice [
23].
LoRA (Low-Rank Adaptation) is a technique that reduces the complexity of large models by fitting their high-dimensional structures with low-dimensional ones. Instead of fine-tuning the entire model, LoRA focuses on training the “residual” part of the model (
). The fine-tuned weights (
) are given by:
The technical principle of LoRA is illustrated in
Figure 1b. The input
has a dimension of
, with the left side representing the frozen pretrained weights of the original model (
) and the right side representing the newly added branch under the LoRA strategy (
). First, through linear layer
, the data dimension is reduced from
to
, and after computation, it is restored from
to
through linear layer
. By fine-tuning the smaller matrices
and
instead of
, the hyperparameters that need to be fine-tuned are significantly reduced [
9].
As a powerful generative AI model, SD can be applied to various generation tasks, with its main input control methods including Text-to-Image [
8], Image-to-Image [
8], and ControlNet [
24]:
The relationship among these three control conditions is as follows: a reference image can be added to the Text-to-Image task to transform it into an Image-to-Image task, and further adding ControlNet allows for more precise control of the image structure. Of course, ControlNet can also be directly added to the Text-to-Image task to perform image generation [
25,
26,
27,
28,
29].
4. Methodology and Testing Process
The experimental process was carried out in three steps: dataset processing, model training, and model testing and generation, as shown in
Figure 2.
The dataset processing involved manually labeling the collected floor plans to create functional space segmentation masks, thereby establishing the dataset. Unlike the application of GAN models, the SD is a text-prompt-guided image generation model. Therefore, we used a tagging tool [
30] to attach corresponding descriptive text to each image, generating a corresponding .txt file. The image files and .txt files together form the final training dataset.
This experiment relied on the Google Colab platform, utilizing the interactive computing environment Jupyter Notebook for model training and dataset debugging.
Model testing and generation involved hyperparameter tuning and image output. This step was performed on the Stable Diffusion WebUI platform, a Python web UI framework suitable for showcasing deep learning tasks. It incorporates various common functionalities of the SD model and supports extensions such as ControlNet and LoRA [
25,
26,
27,
28].
4.1. Producing Datasets
4.1.1. Study on the Topology of Standard Nursing Units
The development of nursing units can be traced back to the late 19th and early 20th centuries, when the Nightingale ward layout was proposed and evolved. Its primary characteristics included an open elongated ward configuration, centralized nursing functions at the ward’s terminus, and an emphasis on improving ventilation, daylighting, and other environmental conditions within the ward spaces [
31]. This layout served as a significant milestone in the spatial evolution of hospital architecture. Entering the 1930s to 1950s, air conditioning technology saw widespread application in buildings, significantly reducing the need for natural ventilation. Concurrently, the need to optimize workflow efficiency for medical staff became increasingly pressing. In 1955, the Nuffield Hospital Study Group published the “Report on the Functions and Design of Hospitals”, recommending the centralized placement of nurse stations within the core area of nursing units [
32]. Subsequently, this centralized layout paradigm gained widespread popularity, spawning various derivative forms such as double-corridor, single-corridor, and radial configurations. Early scholarly studies compared the nursing efficiency across these layout variations [
33]. To further enhance nursing efficiency, decentralized nurse station layouts emerged and were implemented, proving beneficial in improving patient safety and mitigating nurse fatigue [
34,
35,
36,
37,
38].
In China, the development of modernized nursing units commenced in the late 1970s, predominantly adopting centralized nurse station layouts. These layouts evolved into single-corridor, double-corridor, and other composite forms. However, due to regulatory constraints and cultural norms, Chinese nursing units prioritized natural ventilation and daylighting, favoring south-facing patient rooms. The centralized nurse station layout remained predominant, while decentralized configurations were not widely adopted. In recent years, the single-corridor layout has gradually diminished due to its limited capacity and singular circulation organization. It has been supplanted by the main and sub-corridor typology, which ensured space for patient rooms on the south side while expanding the depth of medical support spaces to the north, thereby enhancing the auxiliary functions for medical care [
39]. The nursing units of general hospitals typically feature two layout types: main and sub-corridor style and double-corridor style (
Table 1). The primary differences between the two lie in the location of the vertical circulation, the accessibility of the corridors, and the depth of the north-side rooms. The double-corridor layout has a more complex functional topology, compared to the main and sub-corridor style.
4.1.2. Processing of the Dataset
For this experiment, 80 standard nursing unit cases from inpatient departments of general hospitals were collected, mostly from key general hospital projects across various provinces and cities in China, either completed, under construction, or in the bidding stage. These cases represent the mainstream design approaches for standard nursing units in contemporary general hospitals.
The original drawings were simplified by marking each major function with color blocks [
14,
15,
16], as shown in
Table 2. To ensure that the bitmaps match the scale of the actual architectural drawings, a unified scale and annotation method were used: the dimensions marked on the floor plans served as the basis for converting to a unified scale. All samples were printed at a scale of 1:100 on 500 mm × 1000 mm white background images, with the image resolution set to 512 × 1024. A consistent image resolution also helped reduce the difficulty of training, allowing LoRA to more accurately extract image features. In addition, If a standard floor of an inpatient building comprises two or three nursing units, it should be subdivided into individual nursing units based on the following principles (
Table 3).
After removing highly similar images, we ended up with a dataset consisting of 110 floor plans of standard nursing units in a main and sub-corridor layout (
Figure 3). Due to insufficient and inconsistent data collection for the double-corridor standard nursing unit, it was excluded from subsequent experiments. The experiment focused solely on main and sub-corridor nursing units.
When fine-tuning a large model with LoRA, it is theoretically best to keep the labels as consistent with the official model as possible to achieve optimal generation performance. However, the subject of this study is rather unique, as it is an abstracted concept derived from reality, possessing a high degree of specificity. Therefore, when labeling the dataset, it is only necessary to ensure the use of uncommon words to describe the data, allowing the large model to learn from this dataset without interfering with the content of the original training set [
25,
26,
27,
28]. The objective of this training is to generate functional zoning diagrams for a specific typology of nursing units. Internal room-level information has been simplified, rendering the text prompt a non-decisive factor for layout variations. The text prompt serves solely as a trigger condition for the generation process. Consequently, the text prompt can remain consistent across instances, such as “a floor plan of a nursing unit” for this training. This approach reduces training complexity and enhances the efficiency and accuracy of the model generation [
25,
26,
27,
28].
4.2. LoRA Fine-Tuning
The training is based on Stable Diffusion V1.5, using the Adam8bit [
40] optimizer with decoupled weight decay. The training consists of 22 k steps with a batch size of 1. The initial learning rate is 1 × 10
−4, and a single Tesla T4 GPU is used. The training is planned for 20 epochs, and a total of 5 LoRA fine-tuned models are recorded. The change in the loss function value (Loss) was also recorded. The loss function is an important metric for evaluating the training effectiveness of the model. Generally, as the number of training iterations increases, the loss function tends to converge, indicating that the model training has converged [
24].
Figure 4 shows the trend of the loss function value changing with the increase in training iterations during the training process. It can be observed that, as the number of training iterations increases, the loss function value gradually decreases, indicating effective training [
41]. However, if the training loss decreases too much, it may indicate overfitting. Therefore, it is necessary to monitor the model’s performance using a validation set and test each set of fine-tuned model weights to ensure generalization. Finally, the model needs to be evaluated on an independent test set to ensure its effectiveness in practical applications [
16].
Without changing the main hyperparameters, the effects of each fine-tuned model were tested by varying the LoRA weight values (
Table 4). The test results show that epochs 6 to 10 can produce relatively excellent LoRA models, characterized by well-defined functional partitions, clear boundaries, and accurate color values for functional blocks. Model 5, which is the tenth generation model, can be selected for subsequent generation experiments. The LoRA model weight value should be set in the range of 1 to 1.2.
4.3. Testing Process
The hyperparameter settings of the SD model are crucial to the quality of the generated results, necessitating controlled variable experiments for generation testing. Given the determined version of the SD base model, the variables significantly impacting the results include: input boundaries, selection of the LoRA model, LoRA model weight values, sampling steps, sampler, classifier-free guidance (CFG) scale, random seed, and denoising strength (
Table 5) [
8,
26].
The number of sampling steps affects the model’s sampling efficiency. If the value is too low, the control exerted by the text on the image will be weak, resulting in high randomness. Conversely, if the value is too high, it will lead to low sampling efficiency and increased computational load on the GPU. The CFG scale serves a similar function to the number of sampling steps. Since a unified text description is used, the default value is adopted and is not included in the comparative test. The sampler is a method used in the denoising process of diffusion models. Currently, the Stable Diffusion web UI supports dozens of samplers. After preliminary testing, we will proceed with experiments using the “Euler a” sampler. The random seed determines the initial state of diffusion and is crucial for the generalizability of the generated floor plans. Denoising strength, a hyperparameter in Image-to-Image control, refers to the proportion of the reference image’s features extracted by the model [
7].
Draw the nursing unit boundaries on a blank image with a resolution of 512 × 1024, preprocess it into a mask image, set the text description to “a_floorplan_of_nurse_unit”, add the LoRA model, and set the weight values. Design the following three test methods (
Figure 5):
The optimal values obtained from these three test paths can be used interchangeably to reduce repetitive testing.
4.3.1. Image-to-Image
Sampling steps and denoising strength: When other hyperparameters remain unchanged, changing the sampling steps and denoising strength produces the results shown in
Figure 6. The following phenomena can be observed: when both the denoising strength and sampling steps are relatively low, the generated results show minimal changes compared to the input image. However, with higher denoising strength, the generated image boundaries slightly deviate from the input boundaries. Nevertheless, when the denoising strength exceeds 0.94, the image quality does not significantly improve. With sampling steps between 15 and 30, the generated images maintain a high quality, but further increasing the sampling steps may result in unclear boundaries of color blocks. Additionally, the higher the sampling steps, the greater the computational resource consumption. Therefore, to achieve clear functional zoning and accurate color values in the generated floor plan images, it is recommended to set the denoising strength between 0.94 and 0.95 and the sampling steps between 20 and 25. This ensures the balance between image quality, computational resource consumption, and processing efficiency.
Input image and seed: The testing mentioned above represents the better outcomes achieved under the same random seed input. When other hyperparameters remain unchanged but different random seeds are used, the generated functional color blocks exhibit weaker regularity, and the area of each color block does not match the corresponding functional area of the nursing unit (
Figure 7). By introducing a significant spatial organizational condition (in this case, a main corridor) to the input image, the generation results can be significantly improved (
Figure 8). Under unchanged hyperparameters, this approach enables the generation of relatively ideal architectural floor plan color block images with clear functional block boundaries, reasonable layouts, and relatively reasonable shapes and area ratios of functional zones, regardless of the random seed used. However, the outer boundary of the nursing unit may change.
Summarize: Under the Image-to-Image control, the denoising strength and sampling steps affect the boundaries and color values of the generated image blocks. When the color values are accurately represented, the boundaries of the output result may exhibit slight deformation, making them inconsistent with the input image. Adding control structures to the input image can effectively optimize the layout of various functions in the generated image. Under different random seed inputs, good results can be obtained.
4.3.2. ControlNet
This section of testing is conducted under the Text-to-Image option. The input images are processed directly by ControlNet in the SD-WebUI, bypassing the influence of the Image-to-Image section. The main factor affecting the results is the choice of the ControlNet preprocessor. Therefore, this section focuses on testing the output results of different preprocessors under different random seeds.
Figure 9 and
Figure 10 show the generated effects of four ControlNet preprocessors under the optimal hyperparameters determined in the previous sections. It can be seen that none of the preprocessors can generate images that meet the basic requirements (reasonable color block arrangement, accurate color values), and even the background color fails to generate as white. Placing a main corridor also yielded similar results. However, the advantage is that the boundaries of the output results from each preprocessor generally match the input boundaries.
4.3.3. Image-to-Image + ControlNet
Through separate testing of the Image-to-Image and ControlNet methods, it is evident that neither method alone can generate images that fully meet the requirements. However, it can be concluded that Image-to-Image control can produce more accurate color values, color block layouts, and a pure white background, while ControlNet can precisely control the boundaries of the generated layout. Therefore, the next step is to combine both methods for generation testing.
Since ControlNet is a post-processing extension of the Image-to-Image function, this test will set the optimal hyperparameters for Image-to-Image to control the boundaries of the generated image. In ControlNet controls, besides the preprocessor directly influencing the results, there are three other variables that can affect its degree of control over the Image-to-Image process: ControlNet weight, Guidance Start, and Guidance End.
Preprocessor, ControlNet weight, Guidance Start, and Guidance End: In this section of the test, we first selected Control_canny as the preprocessor and disabled the Guidance End time option to test the ControlNet weight and Guidance Start time. As shown in
Figure 11, it can be seen that a ControlNet weight greater than 0.6 can exert significant boundary control on the image result. Increasing the value beyond this threshold does not have a noticeable impact on the results. The Guidance Start time must be set to the initial moment, as intervening at any intermediate point in the Image-to-Image process with ControlNet does not influence the outcome. With the aforementioned hyperparameters held constant, setting the ControlNet weight to 1.2 produced the results shown in
Figure 12. The chart indicates that if ControlNet starts at time 0.0 in the Image-to-Image process, the Guidance End time has no significant effect on the final image. Regarding the choice of preprocessor, Control_canny and Control_hed demonstrated more stable performance, achieving reasonable boundary, color block layout, and area proportions.
Seed: As previously mentioned, the random seed determines the generalization capability of the SD model. Each random seed represents the initial random state during image generation. If reasonable images can be generated under any random seed input, it demonstrates that the LoRA model trained in this hyperparameter combination can achieve the desired spatial layout for nursing units.
Figure 13 shows images generated with different random seeds, covering five random intervals with a total of 25 outputs. Preliminary assessment indicates that approximately 20 of these results (highlighted with dashed lines) are reasonably valid. This demonstrates that the combination of Image-to-Image generation and ControlNet for spatial layout generation is feasible and capable of producing reasonably accurate results.
Summaries: The above tests prove that integrating ControlNet into the Image-to-Image process is feasible and can address the issue of weak boundary control in Image-to-Image generation. Under the recommended hyperparameter settings from previous tests, ControlNet’s preprocessor should be set to Control-canny or Control-hed. The ControlNet weight should be above 0.6, ideally at 1.2. The guidance start time needs to be set at 0.0, while the guidance end time does not affect the final image. With these hyperparameter settings, any random seed input has about an 80% probability of generating results with accurate color values and reasonable layouts.
4.4. Baseline: Pix2pixHD
To evaluate whether the SD model-based method offers advantages over the GAN model-based method, this paper conducted a comparative experiment. The pix2pixHD model, a widely used and effective GAN-based model, is capable of generating images with a maximum resolution of 2048 × 1024. To ensure a fair comparison, this experiment used the same small sample dataset for training the pix2pixHD model.
The test data was derived from real floor plans. We selected the best results from pix2pixHD training for comparison.
Table 6 shows five results generated by the SD model and the pix2pixHD model, along with their corresponding real floor plans. The qualitative evaluation of the results is based on the following three aspects:
Reasonableness of Functional Layout: Both models can generate relatively reasonable functional layouts. Pix2pixHD tends to conform closely to the training dataset, with few instances of layouts not present in the training data. The SD model, however, can control parameters such as iteration steps, denoising strength, and random seeds to generate reasonable layouts.
Generality of Functional Layout: Since pix2pixHD does not have extensive parameter inputs for generation, its generality is mainly reflected in generating different layouts under varying boundary conditions. The SD model, on the other hand, can generate desirable layouts under the same boundary conditions by controlling parameters and can produce a wide variety of derivative floor plans based on the existing dataset by controlling the random seed, offering more options.
Image Quality of Generated Floor Plans: This metric mainly reflects the clarity of the generated image boundaries and the accuracy of the color values for each functional block. If both values are ideal, the generated result can facilitate operations such as region recognition. From the generated results, the pix2pixHD model trained under the same conditions as the SD model cannot produce very clear and straight functional block boundaries, although the color values for each block are generally correct. The SD model, however, can produce results with both clear functional block boundaries and accurate color values, making the generated images more suitable for subsequent processing and analysis.
By comparing these aspects, it can be inferred that the SD model-based method shows certain advantages over the GAN model-based method, particularly in the clarity and accuracy of the generated images and the versatility in generating diverse layouts.
5. Experiment and Discussion
5.1. Combining Boundary Generation for Automation
After training and testing, we identified the optimal input conditions and hyperparameter configurations for generating the best results with the SD model. If boundary generation for nursing units can be controlled through parameter adjustments, further automation can be achieved. We use the Rhino and Grasshopper platform to implement this part, as illustrated in
Figure 14. The primary variables include
(length of the nursing unit),
(depth of the patient rooms),
(width of the main corridor), and
(area of the nursing unit), which align with architectural practice. Additionally, we set variables to control shape variations to meet creative needs:
and
jointly control the position of the corner folds,
controls the angle of the folds, and c controls the radius of the chamfers. These variables can manage the generation of nursing unit boundaries in straight, cornered, and curved forms.
Using the aforementioned method, we generated six nursing unit boundaries with different scales, corner positions, and curvatures. These boundaries were input into the SD model, and each boundary was used with different random seeds to produce 20 results, resulting in a total of 120 outputs.
5.2. Principal Component Analysis
We employed domain-specific feature extraction methods to assess the authenticity of the generated samples from an architectural perspective. In the design of nursing unit floor plans, the area ratios of functional zones are a crucial metric for evaluating design rationality. Thus, we computed the area ratios of each functional zone relative to the total area in the output samples and consolidated these ratios into a six-dimensional feature array to characterize the nursing unit areas. These features were then visualized using line charts for clarity.
Additionally, we compared these results with the corresponding metrics from the real data in the training set to perform an effective comparative analysis. We overlaid the line charts of the generated samples and real samples, as shown in
Figure 15. The analysis reveals significant overlap between the generated and real samples in terms of functional zone area proportions, with only a few deviations from the main trend. This indicates that the generated samples exhibit a high degree of similarity to the real samples in terms of functional zone area ratios, demonstrating that the generation model performs well in this regard. This analysis not only validates the reasonableness of the generated samples but also provides a basis for further optimization and application.
5.3. User Study
Functional topology is also a critical factor in evaluating nursing unit floor plans. In residential floor plan generation studies, the Manhattan distance is often used to assess the spatial relationships between rooms. However, the relationships between functions in a nursing unit are more complex, and many samples feature non-right-angle coordinate planes, making this metric unsuitable. Therefore, we conducted a user study to analyze this aspect.
We used the functional topology of standard nursing units as a reference standard and invited 10 professionals to participate in the user study, including 5 medical architects and 5 graduate students in architecture. We constructed a dataset consisting of 230 samples by mixing 120 generated samples with 110 real samples. For each session, 30 samples were randomly selected from this dataset, and the participants were asked to evaluate the authenticity of these samples based on the functional topology of standard nursing units and their professional expertise, categorizing the samples accordingly. To ensure the accuracy of the experiment, the participants were not informed of the experimental objectives or the sample proportions beforehand.
We applied classification model performance evaluation methods to analyze the obtained data, with the statistical results shown in
Table 7. The accuracy rate represents the proportion of real samples among all randomly selected samples, with a statistical result of 46%. Precision refers to the accuracy of the participants in predicting real samples, with a result of 55%, which is close to the accuracy rate. This indicates that the generated samples are sufficiently realistic and capable of deceiving the participants. The recall rate is 92%, indicating that the participants accurately identified real samples, and most of the samples classified as fake were generated samples. This finding is consistent with the previous analysis, where some generated samples failed to produce accurate results.
The probability of a generated sample being classified as real by the participants can be calculated using the following formula:
The final statistical result shows that the probability of generated samples being classified as real by the participants is 82%.
In this experiment, participants not only compared the generated samples with the functional topology of standard nursing units but also considered the morphology and boundaries of the functional zones. The results of the user study indicate that, from a professional perspective, the generated nursing unit floor plans are also considered ideal.
5.4. Discussion
This study explored the automatic generation of architectural floor plans using SD models, focusing specifically on standard nursing units in general hospitals. The results indicate that deep learning models, particularly diffusion models, can effectively generate preliminary architectural layouts that align with established design principles and functional requirements. The generated layouts demonstrate potential for assisting architects in the early design stages, providing a foundation for more detailed and customized planning.
The main sections of this paper are concentrated in
Section 4 and
Section 5.
Section 4 extensively describes the generation process testing of the SD model, which is crucial for finding the optimal solution. It was ultimately discovered that incorporating the main-corridor into the input image and combining Image-to-Image generation with ControlNet methods is highly effective. By controlling different random seed inputs, diverse layouts meeting the requirements can be generated.
Section 5 successfully completed the automated process from parameter-controlled boundary generation to SD-generated functional layouts, further controlling parameters such as area, main-corridor location, and length, making the study practically valuable. Additionally, the effectiveness of the method was demonstrated through a comparative analysis of a large number of generated samples against real samples.
Two methods were used in the analysis section. Firstly, area assessment is essential, as the proportion of functional areas determines whether the nursing unit meets the project specifications. Different RGB value intervals were set to distinguish color blocks, facilitating the calculation of area ratios. This step also identified results with inaccurate RGB values.
Figure 15 shows that most results align with the real area features, though some results deviate significantly, reflecting the instability of the SD model. Further research is needed to improve control in this part. Secondly, user research was conducted on the topological relationships of the generated results, with statistical analysis using classification model performance evaluation methods. The final statistics showed that 82% of the generated samples met the evaluation criteria, consistent with preliminary conclusions from the testing chapter.
While the independence of the nursing unit avoids analyzing the relationship with other functions within the hospital system, the internal relationships among various functions are complex, such as accessibility analysis of the nurse station, visual analysis of the nurse station, the number of patient rooms, and the relationship between traffic flow and the number of serviced patients. This study does not delve into these aspects, but they can serve as interesting starting points for future work.
The analysis and discussion above indicate that AI-assisted generated floor plans for nursing units are comparable to traditional design methods in terms of spatial layout rationality and clarity of functional zones. At the same time, AI methods demonstrate significant advantages in reducing design time and improving design efficiency. However, since this study focuses on standard nursing units, further research is needed to assess the performance of AI tools when dealing with non-standardized building types and complex engineering conditions.
6. Conclusions and Future Work
This paper conducted an experiment on generating architectural floor plans for standard nursing units in general hospitals using the SD model. The experiment successfully demonstrated that clear, readable, and functionally reasonable floor plan images with colored functional blocks can be quickly and automatically generated by inputting a boundary range. The experiment validated the methods for dataset processing, model training, and the overall effectiveness of the entire workflow.
Under conditions with relatively few training samples, the SD model-based method for generating architectural floor plans exhibited advantages such as reasonable layout, strong generalizability, and clear, easily readable image boundaries. When the input conditions include significant spatial features of the floor plan type, the model’s generalization capability is even more pronounced, resulting in better generation outcomes.
Using deep learning to generate architectural floor plans is not the only approach to floor plan generation, but it still demonstrates significant potential for research applications. Although the generated color block images do not represent traditional floor plans in a practical sense, they can provide valuable insights for architects during the building design phase.
The limitations of this experiment are quite evident. The only effective control parameters are the boundaries of the nursing unit and the main corridor. While LoRA can generate functionally coherent layouts, it also introduces randomness. Additionally, quantitative metrics such as room area, room scale, and room count, which are of great concern to architects, are difficult to represent at the functional layout level. This is inherently tied to the operational mode of the Stable Diffusion image-generation process. Future work in this research aims to explore the text-based control capabilities of the Stable Diffusion model to actively participate in the generation process. Furthermore, we will vectorize the output functional block images and automate the layout for each functional room, allowing the generated results to be quantitatively represented and more closely aligned with architects’ workflows.
In the current study, we focus primarily on the application of AI tools in the architectural design process, particularly in the generation of standard floor plans for nursing units in general hospitals. However, if the scope of research were to be expanded to other complex building types, engineering design requirements such as structural safety and MEP (Mechanical, Electrical, and Plumbing) system configurations would also be crucial. Although the emphasis of this study is on architectural design, the proposed methods also hold potential for integration with engineering design. AI tools can learn from images of engineering design layouts to provide recommendations on aspects such as structural loads and system configurations, thereby optimizing the overall design. This approach can assist architects in anticipating and addressing potential engineering issues at the early design stage, enhancing the scientific basis and feasibility of the design. As AI technology in architectural design is still in its early stages, future research should further explore how to better integrate AI with engineering design needs to improve overall design quality and practicality.
Author Contributions
Conceptualization, Z.H. and Y.C.; Methodology, Y.C.; Validation, Y.C.; Resources, Z.H.; Data curation, Z.H.; Writing—original draft, Z.H.; Writing—review & editing, Z.H.; Supervision, Y.C.; Funding acquisition, Y.C. All authors have read and agreed to the published version of the manuscript.
Funding
This research was supported by Beijing Jiaotong University Horizontal Project of Social Sciences (No. A24SK00020): Big Data Management System Project for Medical Building Space.
Data Availability Statement
Data is contained within the article.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Shabani, M.A.; Hosseini, S.; Furukawa, Y. HouseDiffusion: Vector Floorplan Generation via a Diffusion Model with Discrete and Continuous Denoising. In Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), IEEE, Vancouver, BC, Canada, 18–22 June 2023; pp. 5466–5475. [Google Scholar]
- Nauata, N.; Hosseini, S.; Chang, K.-H.; Chu, H.; Cheng, C.-Y.; Furukawa, Y. House-GAN++: Generative Adversarial Layout Refinement Networks. arXiv 2021, arXiv:2103.02574. [Google Scholar]
- Wu, W.; Fu, X.-M.; Tang, R.; Wang, Y.; Qi, Y.-H.; Liu, L. Data-driven interior plan generation for residential buildings. ACM Trans. Graph. 2019, 38, 1–12. [Google Scholar] [CrossRef]
- Zhou, L.Q. Standardization Design of Nursing Unit Based on Open Building Theories. M.S.; Harbin Institute of Technology: Harbin, China, 2019. [Google Scholar]
- Jia, M.; Zhou, Y.M. The Design of Nursing Unit in Western Nursing Home and the Enlightenment to China. Archit. Tech. 2017, 108–111. Available online: https://kns.cnki.net/kcms2/article/abstract?v=MBTPQIn9ZKG0NDfhk54ic1Feth2SLrZU0CoFC43LnTsStgl4iBRD16NRQaPqFch8tv_xY5M5cpLTKmkW9_s0kZhw1amFMgKQ_RVLWMDjDrZNUDnXVxEC0NhK1zfArHWzJbOScJpb6u-dosH2JBmnapA4YWIaYDH0T4IBYAUVe9k=&uniplatform=NZKPT (accessed on 18 July 2024).
- Li, X. The Research on the Evolution of PatientCare Unit for Hospital Buildings in China. M.S; Chongqing University: Chongqing, China, 2017. [Google Scholar]
- Ho, J.; Jain, A.; Abbeel, P. Denoising Diffusion Probabilistic Models. Adv. Neural Inf. Process. Syst. 2020, 33, 6840–6851. [Google Scholar]
- Rombach, R.; Blattmann, A.; Lorenz, D.; Esser, P.; Ommer, B. High-Resolution Image Synthesis with Latent Diffusion Models. In Proceedings of the 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), IEEE, New Orleans, LA, USA, 19–21 June 2022; pp. 10674–10685. [Google Scholar]
- Hu, E.J.; Shen, Y.; Wallis, P.; Allen-Zhu, Z.; Li, Y.; Wang, S.; Wang, L.; Chen, W. LoRA: Low-Rank Adaptation of Large Language Models. arXiv 2021, arXiv:2106.09685. [Google Scholar]
- Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention Is All You Need. arXiv 2023, arXiv:1706.03762. [Google Scholar]
- Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; Bengio, Y. Generative Adversarial Networks. Commun. ACM 2020, 63, 139–144. [Google Scholar] [CrossRef]
- Isola, P.; Zhu, J.-Y.; Zhou, T.; Efros, A.A. Image-to-Image Translation with Conditional Adversarial Networks. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), IEEE, Honolulu, HI, USA, 21–26 July 2017; pp. 5967–5976. [Google Scholar]
- Wang, T.-C.; Liu, M.-Y.; Zhu, J.-Y.; Tao, A.; Kautz, J.; Catanzaro, B. High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, IEEE, Salt Lake City, UT, USA, 18–23 June 2018; pp. 8798–8807. [Google Scholar]
- Huang, W.; Zheng, H. Architectural Drawings Recognition and Generation through Machine Learning. In Proceedings of the 38th Annual Conference of the Association for Computer Aided Design in Architecture, Mexico City, Mexico, 18–20 October 2018; pp. 156–165. [Google Scholar]
- Chaillou, S. ArchiGAN: Artificial Intelligence x Architecture. In Architectural Intelligence; Yuan, P.F., Xie, M., Leach, N., Yao, J., Wang, X., Eds.; Springer: Singapore, 2020; pp. 117–127. ISBN 9789811565670. [Google Scholar]
- Zheng, H.; An, K.; Wei, J.; Ren, Y. Apartment Floor Plans Generation via Generative Adversarial Networks. In Proceedings of the 25th International Conference of the Association for Computer-Aided Architectural Design Research in Asia (CAADRIA), Bangkok, Thailand, 5–8 August 2020; pp. 599–608. [Google Scholar]
- Pan, Y.; Qian, J.; Hu, Y. A Preliminary Study on the Formation of the General Layouts on the Northern Neighborhood Community Based on GauGAN Diversity Output Generator. In Proceedings of the 2020 DigitalFUTURES; Yuan, P.F., Yao, J., Yan, C., Wang, X., Leach, N., Eds.; Springer: Singapore, 2021; pp. 179–188. ISBN 978-981-334-399-3. [Google Scholar]
- Luo, Z.; Huang, W. FloorplanGAN: Vector Residential Floorplan Adversarial Generation. Autom. Constr. 2022, 142, 104470. [Google Scholar] [CrossRef]
- Fan, Y.; Xue, J.; Zheng, H.; Lai, D. Draw to Shade: A Personalized Daylighting Regulation Method through User-Involved Paintings for Enhanced Indoor Visual Comfort and Aesthetics Experience. J. Build. Eng. 2023, 80, 108014. [Google Scholar] [CrossRef]
- Wang, L.; Liu, J.; Cheng, G.; Liu, E.; Chen, W. Constructing a Personalized AI Assistant for Shear Wall Layout Using Stable Diffusion. arXiv 2023, arXiv:2305.10830. [Google Scholar]
- Ha, D.; Dai, A.; Le, Q.V. HyperNetworks. arXiv 2016, arXiv:1609.09106. [Google Scholar]
- Ruiz, N.; Li, Y.; Jampani, V.; Pritch, Y.; Rubinstein, M.; Aberman, K. DreamBooth: Fine Tuning Text-to-Image Diffusion Models for Subject-Driven Generation. arXiv 2023, arXiv:2208.12242. [Google Scholar]
- LoRA vs Dreambooth vs Textual Inversion vs Hypernetworks–YouTube. Available online: https://www.youtube.com/watch?v=dVjMiJsuR5o (accessed on 18 July 2024).
- Zhang, L.; Rao, A.; Agrawala, M. Adding Conditional Control to Text-to-Image Diffusion Models. In Proceedings of the 2023 IEEE/CVF International Conference on Computer Vision (ICCV), IEEE, Paris, France, 1 October 2023; pp. 3813–3824. [Google Scholar]
- Rombach, R. CompVis/Stable-Diffusion. 2024. Available online: https://github.com/CompVis/stable-diffusion (accessed on 18 July 2024).
- AUTOMATIC1111 Stable Diffusion Web UI. 2022. Available online: https://github.com/AUTOMATIC1111/stable-diffusion-webui (accessed on 18 July 2024).
- bmaltais GUI. 2024. Available online: https://github.com/bmaltais/kohya_ss (accessed on 18 July 2024).
- Lora-Scripts/README-Zh.Md at Main Akegarasu/Lora-Scripts. Available online: https://github.com/Akegarasu/lora-scripts/blob/main/README-zh.md (accessed on 18 July 2024).
- Ryu, S. Low-Rank Adaptation for Fast Text-to-Image Diffusion Fine-Tuning. 2024. Available online: https://github.com/cloneofsimo/lora (accessed on 18 July 2024).
- starik222. Starik222/BooruDatasetTagManager. 2024. Available online: https://github.com/starik222/BooruDatasetTagManager (accessed on 18 July 2024).
- Nightingale, F. Notes on Nursing: What It Is, and What It Is Not; J.B. Lippincott Company: Philadelphia, PA, USA, 1946. [Google Scholar]
- Trust, N. Studies in the Functions and Design of Hospitals. Available online: https://www.nuffieldtrust.org.uk/research/studies-in-the-functions-and-design-of-hospitals (accessed on 18 July 2024).
- Trites, D.K.; Galbraith, F.D.; Sturdavant, M.; Leckwart, J.F. Influence of Nursing-Unit Design on the Activities and Subjective Feelings of Nursing Personnel. Environ. Behav. 1970, 2, 303–334. [Google Scholar] [CrossRef]
- Zborowsky, T.; Bunker-Hellmich, L.; Morelli, A.; O’Neill, M. Centralized vs. Decentralized Nursing Stations: Effects on Nurses’ Functional Use of Space and Work Environment. HERD Health Environ. Res. Des. J. 2010, 3, 19–42. [Google Scholar] [CrossRef]
- Becker, F. Nursing Unit Design and Communication Patterns: What Is “Real” Work? HERD Health Environ. Res. Des. J. 2007, 1, 58–62. [Google Scholar] [CrossRef]
- Kalisch, B.J.; Russell, K.; Lee, K.H. Nursing Teamwork and Unit Size. West. J. Nurs. Res. 2013, 35, 214–225. [Google Scholar] [CrossRef] [PubMed]
- Hua, Y.; Becker, F.; Wurmser, T.; Bliss-Holtz, J.; Hedges, C. Effects of Nursing Unit Spatial Layout on Nursing Team Communication Patterns, Quality of Care, and Patient Safety. HERD Health Environ. Res. Des. J. 2012, 6, 8–38. [Google Scholar] [CrossRef] [PubMed]
- Pati, D.; Thomas, E. Harvey, J.; Redden, P.; Summers, B.; Pati, S. An Empirical Examination of the Impacts of Decentralized Nursing Unit Design. HERD Health Environ. Res. Des. J. 2015, 8, 56–70. [Google Scholar] [CrossRef] [PubMed]
- Cui, H.W. A Comparative Study of Hospital Careunits between China and UK. M.S.; Harbin Institute of Technology: Harbin, China, 2018. [Google Scholar]
- Kingma, D.P.; Ba, J. Adam: A Method for Stochastic Optimization. arXiv 2017, arXiv:1412.6980. [Google Scholar]
- Anzanello, M.J.; Fogliatto, F.S. Learning Curve Models and Applications: Literature Review and Research Directions. Int. J. Ind. Ergon. 2011, 41, 573–583. [Google Scholar] [CrossRef]
Figure 1.
(
a) the basic architecture of the SD model: Latent Diffusion Model [
8]; (
b) LoRA [
9].
Figure 1.
(
a) the basic architecture of the SD model: Latent Diffusion Model [
8]; (
b) LoRA [
9].
Figure 2.
Methodological framework of the experiment.
Figure 2.
Methodological framework of the experiment.
Figure 3.
Main and sub-corridor style nursing units floor plan dataset (portion).
Figure 3.
Main and sub-corridor style nursing units floor plan dataset (portion).
Figure 4.
Stable Diffusion loss.
Figure 4.
Stable Diffusion loss.
Figure 5.
Testing and Generation Framework.
Figure 5.
Testing and Generation Framework.
Figure 6.
Sampling steps and denoising strength.
Figure 6.
Sampling steps and denoising strength.
Figure 7.
Other hyperparameters remain unchanged; the seed is changed.
Figure 7.
Other hyperparameters remain unchanged; the seed is changed.
Figure 8.
Other hyperparameters remain unchanged; the input image is added to the main corridor and the seed is changed.
Figure 8.
Other hyperparameters remain unchanged; the input image is added to the main corridor and the seed is changed.
Figure 9.
ControlNet preprocessors.
Figure 9.
ControlNet preprocessors.
Figure 10.
ControlNet preprocessors with the input image added to the main corridor.
Figure 10.
ControlNet preprocessors with the input image added to the main corridor.
Figure 11.
ControlNet Weight, Guidance Start.
Figure 11.
ControlNet Weight, Guidance Start.
Figure 12.
Preprocessor and Guidance End.
Figure 12.
Preprocessor and Guidance End.
Figure 13.
Image-to-Image + ControlNet, change the seed.
Figure 13.
Image-to-Image + ControlNet, change the seed.
Figure 14.
Parameter-controlled boundary generation.
Figure 14.
Parameter-controlled boundary generation.
Figure 15.
Area feature distribution.
Figure 15.
Area feature distribution.
Table 1.
Functional partition and Functional Topology Extraction.
Table 2.
Correspondence between function and mask color.
Table 2.
Correspondence between function and mask color.
Function | Color | RGB |
---|
Nurse Station | ![Buildings 14 02601 i005]() | 255, 0, 0 |
Medical and Auxiliary Rooms | ![Buildings 14 02601 i006]() | 0, 255, 255 |
Wards | ![Buildings 14 02601 i007]() | 0, 0, 255 |
Vertical Circulations | ![Buildings 14 02601 i008]() | 0, 255, 0 |
equipment rooms | ![Buildings 14 02601 i009]() | 255, 0, 255 |
corridor | ![Buildings 14 02601 i010]() | 255, 255, 0 |
Table 3.
Nursing unit datasets processing.
Table 4.
Testing the Results of LoRA Fine-Tuning.
Table 5.
The descriptions of the hyperparameter settings [
25,
26,
27,
28].
Table 5.
The descriptions of the hyperparameter settings [
25,
26,
27,
28].
Seting | Descriptions |
---|
Input image | This refers to the initial image used to generate a new image. |
Sampling Steps | This refers to the number of sampling iterations performed during the image generation process |
Sampler | This is a method used in the denoising process of diffusion models |
Seed | This is used to set the initial value for random number generation |
Denoising strength | This refers to the intensity of noise removal during the image generation process |
Table 6.
Test two deep learning models using a real-world planar validation set.
Table 7.
Results of each subject in user study.
Table 7.
Results of each subject in user study.
Subjects id | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Avg. |
---|
TP | 13 | 13 | 13 | 12 | 12 | 14 | 11 | 12 | 14 | 13 | |
FP | 10 | 10 | 10 | 10 | 10 | 10 | 13 | 11 | 9 | 9 | |
TN | 0 | 1 | 2 | 2 | 0 | 2 | 1 | 1 | 2 | 0 | |
FN | 7 | 6 | 5 | 6 | 8 | 4 | 5 | 6 | 7 | 8 | |
Precision | 0.57 | 0.57 | 0.57 | 0.55 | 0.55 | 0.58 | 0.46 | 0.52 | 0.61 | 0.59 | 0.55 |
Recall | 1.00 | 0.93 | 0.87 | 0.86 | 1.00 | 0.88 | 0.92 | 0.92 | 0.88 | 1.00 | 0.92 |
Accuracy | 0.43 | 0.47 | 0.50 | 0.47 | 0.40 | 0.53 | 0.40 | 0.43 | 0.50 | 0.43 | 0.46 |
Pass rate of generated samples | 0.77 | 0.82 | 0.87 | 0.85 | 0.76 | 0.89 | 0.90 | 0.84 | 0.78 | 0.72 | 0.82 |
| Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).