Next Article in Journal
Irregular Facades: A Dataset for Semantic Segmentation of the Free Facade of Modern Buildings
Previous Article in Journal
Investigation of the Innovative Combined Reuse of Phosphate Mine Waste Rock and Phosphate Washing Sludge to Produce Eco-Friendly Bricks
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Automatic Generation of Standard Nursing Unit Floor Plan in General Hospital Based on Stable Diffusion

School of Architecture and Design, Beijing Jiaotong University, Beijing 100000, China
*
Author to whom correspondence should be addressed.
Buildings 2024, 14(9), 2601; https://doi.org/10.3390/buildings14092601
Submission received: 25 June 2024 / Revised: 11 August 2024 / Accepted: 21 August 2024 / Published: 23 August 2024

Abstract

:
This study focuses on the automatic generation of architectural floor plans for standard nursing units in general hospitals based on Stable Diffusion. It aims at assisting architects in efficiently generating a variety of preliminary plan preview schemes and enhancing the efficiency of the pre-planning stage of medical buildings. It includes dataset processing, model training, model testing and generation. It enables the generation of well-organized, clear, and readable functional block floor plans with strong generalization capabilities by inputting the boundaries of the nursing unit’s floor plan. Quantitative analysis demonstrated that 82% of the generated samples met the evaluation criteria for standard nursing units. Additionally, a comparative experiment was conducted using the same dataset to train a deep learning model based on Generative Adversarial Networks (GANs). The conclusion describes the strengths and limitations of the methodology, pointing out directions for improvement by future studies.

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 x is transformed into a latent representation Z via an encoder ε . In the latent space, the diffusion process starts from the initial noise Z T and progressively denoises it using a Denoising U-Net ϵ θ , resulting in the latent representation Z 0 . 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 Z 0 is converted back to pixel space by a decoder D , yielding the reconstructed image X ~ . 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 ( W ). The fine-tuned weights ( W ) are given by:
W = W + W
The technical principle of LoRA is illustrated in Figure 1b. The input x has a dimension of d , with the left side representing the frozen pretrained weights of the original model ( W ) and the right side representing the newly added branch under the LoRA strategy ( W ). First, through linear layer A , the data dimension is reduced from d to r , and after computation, it is restored from r to d through linear layer B . By fine-tuning the smaller matrices A and B instead of W , 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]:
  • Text-to-Image: Generates an image based on the input text.
  • Image-to-Image: Adds a reference image as a condition to the Text-to-Image task.
  • ControlNet: Adds structured condition signals (such as control_canny, control_depth, control_hed, control_mlsd, etc.) on top of the aforementioned tasks to finely control image content and layout [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):
  • Image-to-Image
    • Add the preprocessed nursing unit boundary image in the Image-to-Image settings.
    • Set various variables for image generation.
    • Compare the generation effects of different hyperparameter values.
    • Determine the optimal hyperparameter settings.
    • Summarize the pros and cons of the method.
  • ControlNet
    • Add the preprocessed nursing unit boundary image in the ControlNet settings.
    • Add the ControlNet preprocessor.
    • Compare the generation effects of different preprocessors and hyperparameter values.
    • Determine the optimal hyperparameter settings.
    • Summarize the pros and cons of the method.
  • Image-to-Image + ControlNet
    • Add the preprocessed nursing unit boundary image in the Image-to-Image settings.
    • Add the preprocessed nursing unit boundary image in the ControlNet settings.
    • Test the best hyperparameters from previous tests.
    • Determine the optimal hyperparameter settings.
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 L (length of the nursing unit), a (depth of the patient rooms), b (width of the main corridor), and S (area of the nursing unit), which align with architectural practice. Additionally, we set variables to control shape variations to meet creative needs: L 1 and L 2 jointly control the position of the corner folds, R 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:
P a s s   r a t e   o f g e n e r a t e d   s a m p l e s = 1 P r e c i s i o n 1 A c c u r a c y
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

  1. 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]
  2. 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]
  3. 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]
  4. Zhou, L.Q. Standardization Design of Nursing Unit Based on Open Building Theories. M.S.; Harbin Institute of Technology: Harbin, China, 2019. [Google Scholar]
  5. 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).
  6. Li, X. The Research on the Evolution of PatientCare Unit for Hospital Buildings in China. M.S; Chongqing University: Chongqing, China, 2017. [Google Scholar]
  7. Ho, J.; Jain, A.; Abbeel, P. Denoising Diffusion Probabilistic Models. Adv. Neural Inf. Process. Syst. 2020, 33, 6840–6851. [Google Scholar]
  8. 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]
  9. 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]
  10. 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]
  11. 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]
  12. 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]
  13. 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]
  14. 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]
  15. 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]
  16. 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]
  17. 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]
  18. Luo, Z.; Huang, W. FloorplanGAN: Vector Residential Floorplan Adversarial Generation. Autom. Constr. 2022, 142, 104470. [Google Scholar] [CrossRef]
  19. 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]
  20. 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]
  21. Ha, D.; Dai, A.; Le, Q.V. HyperNetworks. arXiv 2016, arXiv:1609.09106. [Google Scholar]
  22. 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]
  23. LoRA vs Dreambooth vs Textual Inversion vs Hypernetworks–YouTube. Available online: https://www.youtube.com/watch?v=dVjMiJsuR5o (accessed on 18 July 2024).
  24. 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]
  25. Rombach, R. CompVis/Stable-Diffusion. 2024. Available online: https://github.com/CompVis/stable-diffusion (accessed on 18 July 2024).
  26. AUTOMATIC1111 Stable Diffusion Web UI. 2022. Available online: https://github.com/AUTOMATIC1111/stable-diffusion-webui (accessed on 18 July 2024).
  27. bmaltais GUI. 2024. Available online: https://github.com/bmaltais/kohya_ss (accessed on 18 July 2024).
  28. 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).
  29. 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).
  30. starik222. Starik222/BooruDatasetTagManager. 2024. Available online: https://github.com/starik222/BooruDatasetTagManager (accessed on 18 July 2024).
  31. Nightingale, F. Notes on Nursing: What It Is, and What It Is Not; J.B. Lippincott Company: Philadelphia, PA, USA, 1946. [Google Scholar]
  32. 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).
  33. 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]
  34. 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]
  35. 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]
  36. 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]
  37. 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]
  38. 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]
  39. Cui, H.W. A Comparative Study of Hospital Careunits between China and UK. M.S.; Harbin Institute of Technology: Harbin, China, 2018. [Google Scholar]
  40. Kingma, D.P.; Ba, J. Adam: A Method for Stochastic Optimization. arXiv 2017, arXiv:1412.6980. [Google Scholar]
  41. 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].
Buildings 14 02601 g001
Figure 2. Methodological framework of the experiment.
Figure 2. Methodological framework of the experiment.
Buildings 14 02601 g002
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).
Buildings 14 02601 g003
Figure 4. Stable Diffusion loss.
Figure 4. Stable Diffusion loss.
Buildings 14 02601 g004
Figure 5. Testing and Generation Framework.
Figure 5. Testing and Generation Framework.
Buildings 14 02601 g005
Figure 6. Sampling steps and denoising strength.
Figure 6. Sampling steps and denoising strength.
Buildings 14 02601 g006
Figure 7. Other hyperparameters remain unchanged; the seed is changed.
Figure 7. Other hyperparameters remain unchanged; the seed is changed.
Buildings 14 02601 g007
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.
Buildings 14 02601 g008
Figure 9. ControlNet preprocessors.
Figure 9. ControlNet preprocessors.
Buildings 14 02601 g009
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.
Buildings 14 02601 g010
Figure 11. ControlNet Weight, Guidance Start.
Figure 11. ControlNet Weight, Guidance Start.
Buildings 14 02601 g011
Figure 12. Preprocessor and Guidance End.
Figure 12. Preprocessor and Guidance End.
Buildings 14 02601 g012
Figure 13. Image-to-Image + ControlNet, change the seed.
Figure 13. Image-to-Image + ControlNet, change the seed.
Buildings 14 02601 g013
Figure 14. Parameter-controlled boundary generation.
Figure 14. Parameter-controlled boundary generation.
Buildings 14 02601 g014
Figure 15. Area feature distribution.
Figure 15. Area feature distribution.
Buildings 14 02601 g015
Table 1. Functional partition and Functional Topology Extraction.
Table 1. Functional partition and Functional Topology Extraction.
Main and Sub-Corridor StyleDouble-Corridor Style
Functional partitionBuildings 14 02601 i001Buildings 14 02601 i002
Topological mapBuildings 14 02601 i003Buildings 14 02601 i004
Table 2. Correspondence between function and mask color.
Table 2. Correspondence between function and mask color.
Function ColorRGB
Nurse StationBuildings 14 02601 i005255, 0, 0
Medical and Auxiliary RoomsBuildings 14 02601 i0060, 255, 255
WardsBuildings 14 02601 i0070, 0, 255
Vertical CirculationsBuildings 14 02601 i0080, 255, 0
equipment roomsBuildings 14 02601 i009255, 0, 255
corridorBuildings 14 02601 i010255, 255, 0
Table 3. Nursing unit datasets processing.
Table 3. Nursing unit datasets processing.
Inpatient Building Floor PlanA Single Nursing Unit after DivisionIllustrate
Buildings 14 02601 i011Buildings 14 02601 i012Complete the segmentation position into a rectangle.
Buildings 14 02601 i013Buildings 14 02601 i014When two nursing units share a common vertical circulation, the entire area of the vertical circulation should be preserved during the subdivision into separate units.
Buildings 14 02601 i015Buildings 14 02601 i016Rotate or mirror the divided nursing unit to a horizontal position so that most of the wards face south and patch the edges.
Buildings 14 02601 i017Buildings 14 02601 i018If the intersection is a public activity space, it will be divided into one nursing unit.
Table 4. Testing the Results of LoRA Fine-Tuning.
Table 4. Testing the Results of LoRA Fine-Tuning.
EpochLoRA Weight
0.60.811.21.4
Model1 (epoch4)Buildings 14 02601 i019Buildings 14 02601 i020Buildings 14 02601 i021Buildings 14 02601 i022Buildings 14 02601 i023
Model2 (epoch8)Buildings 14 02601 i024Buildings 14 02601 i025Buildings 14 02601 i026Buildings 14 02601 i027Buildings 14 02601 i028
Model3 (epoch12)Buildings 14 02601 i029Buildings 14 02601 i030Buildings 14 02601 i031Buildings 14 02601 i032Buildings 14 02601 i033
Model4 (epoch16)Buildings 14 02601 i034Buildings 14 02601 i035Buildings 14 02601 i036Buildings 14 02601 i037Buildings 14 02601 i038
Model5 (epoch20) Buildings 14 02601 i039Buildings 14 02601 i040Buildings 14 02601 i041Buildings 14 02601 i042Buildings 14 02601 i043
Table 5. The descriptions of the hyperparameter settings [25,26,27,28].
Table 5. The descriptions of the hyperparameter settings [25,26,27,28].
SetingDescriptions
Input imageThis refers to the initial image used to generate a new image.
Sampling StepsThis refers to the number of sampling iterations performed during the image generation process
SamplerThis is a method used in the denoising process of diffusion models
SeedThis is used to set the initial value for random number generation
Denoising strengthThis 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 6. Test two deep learning models using a real-world planar validation set.
InputOutputDataset Simple
SD + LoRAPix2PixHD (GAN)
Buildings 14 02601 i044Buildings 14 02601 i045Buildings 14 02601 i046Buildings 14 02601 i047
Buildings 14 02601 i048Buildings 14 02601 i049
Buildings 14 02601 i050Buildings 14 02601 i051Buildings 14 02601 i052Buildings 14 02601 i053
Buildings 14 02601 i054Buildings 14 02601 i055
Buildings 14 02601 i056Buildings 14 02601 i057Buildings 14 02601 i058Buildings 14 02601 i059
Buildings 14 02601 i060Buildings 14 02601 i061
Buildings 14 02601 i062Buildings 14 02601 i063Buildings 14 02601 i064Buildings 14 02601 i065
Buildings 14 02601 i066Buildings 14 02601 i067
Buildings 14 02601 i068Buildings 14 02601 i069Buildings 14 02601 i070Buildings 14 02601 i071
Buildings 14 02601 i072Buildings 14 02601 i073
Table 7. Results of each subject in user study.
Table 7. Results of each subject in user study.
Subjects id12345678910Avg.
TP13131312121411121413
FP101010101010131199
TN0122021120
FN7656845678
Precision0.570.570.570.550.550.580.460.520.610.590.55
Recall1.000.930.870.861.000.880.920.920.881.000.92
Accuracy0.430.470.500.470.400.530.400.430.500.430.46
Pass rate of generated samples0.770.820.870.850.760.890.900.840.780.720.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.

Share and Cite

MDPI and ACS Style

Han, Z.; Chen, Y. Automatic Generation of Standard Nursing Unit Floor Plan in General Hospital Based on Stable Diffusion. Buildings 2024, 14, 2601. https://doi.org/10.3390/buildings14092601

AMA Style

Han Z, Chen Y. Automatic Generation of Standard Nursing Unit Floor Plan in General Hospital Based on Stable Diffusion. Buildings. 2024; 14(9):2601. https://doi.org/10.3390/buildings14092601

Chicago/Turabian Style

Han, Zhuo, and Yongquan Chen. 2024. "Automatic Generation of Standard Nursing Unit Floor Plan in General Hospital Based on Stable Diffusion" Buildings 14, no. 9: 2601. https://doi.org/10.3390/buildings14092601

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop