A Deep Learning Approach toward Energy-Effective Residential Building Floor Plan Generation

: The ability of deep learning has been tested to learn graphical features for building-plan generation. However, whether the deeper space allocation strategies can be obtained and thus reduce energy consumption has still not been investigated. In the present study, we aimed to train a neural network by employing a characterized sample set to generate a residential building floor plan (RBFP) for achieving energy reduction effects. The network is based on Pix2Pix, including two sub-models: functional segmentation layout (FSL) generation and building floor plan (BFP) generation. To better characterize the energy efficiency, 98 screened floor plans of Solar Decathlon (SD) entries were labeled as the sample set. The data augmentation method was adopted to improve the performance of the FSL sub-model after the preliminary testing. Three existing residential buildings were used as cases to observe whether the network-generated RBFP gained the effect of decreasing energy consumption with decent space allocation. The results showed that, under the same simulation settings and building exterior profile (BEP) conditions, the function arrangement of the generated scheme was more reasonable compared to the original scheme in each case. The annual total energy consumption was reduced by 13.38%, 12.74%, and 7.47%, respectively. In conclusion, trained by the sample set that characterizes energy efficiency, the RBFP generation network has a positive effect in both optimizing the space allocation and reducing energy consumption. The implemented data augmentation method can significantly improve the network’s training results with a small sample size.


Introduction
The space allocation problem (SAP) is one of the well-known algorithmic issues in generative design for buildings, which aims to generate building plans based on certain spatial topology and geometric restrictions [1]. SAP, like traditional architectural design, is constrained by a variety of subjective and objective factors. With the emergence of systems theory and cybernetics [2], researchers tried to deal with the great complexity and uncertainty of the problem through artificial intelligence (AI) approaches [3][4][5][6]. Another major issue related with building SAP is the energy consumption. China's building industry consumed 2.147 billion tce for the whole life cycle in 2018, accounting for 46.5% of the national energy consumption. Residential buildings consume about 62% of the total building energy consumption during the building operation phase [7], which is extremely more staggering than other costs. Improving energy efficiency or designing the potential of an energy-saving strategy when dealing with building SAP is a critical concern of building generative design.
Since the rise of computer-aided design (CAD) in the 1960s, academics have attempted to address the generative design of architectural plans to cope with SAP [8,9]. Pattern languages [10][11][12] and formal grammar [13,14] became the theoretical anchors and sources of ideas [15] during the first low-tide era of development following the introduction of AI [16]. Various studies and systems based on case-based reasoning (CBR) and case-based design (CBD) [17][18][19] emerged in that period. With the rapid increase of computer arithmetic power, constant improvement of algorithms, and the massive amount of data brought by information technology, the development and application of AI have reached a higher level. Many impressive studies have been conducted using the graph structure technique for the development of building plans and layouts [20][21][22]. Image-toimage translation has been possible since Goodfellow et al. first developed the generative adversarial network (GAN) [23]. Following studies have proposed derivative models to improve the performance of learning and generation, such as conditional GAN (CGAN), deep convolutional GAN (DCGAN), and cycle-consistent adversarial network (Cy-cleGAN) [24][25][26][27][28][29][30]. After the publication of the interactive GAN (iGAN) [31], Isola et al. established the network architecture of Pix2Pix. This network is trained in a supervised manner. The labels are made out of a pair of images and their translated image [32]. Based on it, many studies in terms of recognizing and generating architectural elements [6,[33][34][35][36] and general architectural layouts [37][38][39] were presented and demonstrated the potential ability of such networks to learn image features in mapping relationships [40,41]. In terms of building physical performance improvement, researchers have developed several performance mapping models based on artificial neural networks. These models are widely used for occupant counting, daylight simulation prediction, wind environment simulation prediction, traffic performance, solar radiation prediction, etc. [42][43][44][45]. The performance of deep learning for predicting building energy performance was also discussed [46,47], while the information of AI-aided energy saving in the building generative design is still limited and underestimated.
The SAP of the building determines the implementation route of different energysaving strategies [48], while these strategies highly influence the final presentation of the BFP. For example, the design of the building mass influences the BEP of the BFP, which may further lead to various possibilities for the FSL and the location of the thermal buffer zone. The natural lighting or ventilation requirements may determine whether the BFP has sunrooms or atriums [49][50][51]. Thus, despite the previous studies in image translation or physical performance prediction that have been undertaken, the field remains fragmented. When addressing SAP, it is rarely studied to enable the generated results to clearly reflect the interaction between layout and energy efficiency.
In this study, we proposed to enhance the BFP generation results by improving the quality of energy efficiency characterization in each sample and help deep learning networks to better understand the complex challenges and multi-objective requirements described above. To achieve this goal, the Solar Decathlon (SD) entries were adopted as samples for training the network, since they have a thorough consideration and coordination in terms of both adequate FSL and significant energy efficiency [52]. The network architecture was based on Pix2Pix, and two sub-models were developed, each for training the generative capability from BEP to FSL and from FSL to BFP. Data augmentation methods for small size sample networks were also examined during the training phase. Three existing houses were performed as case studies to test the network's capabilities in terms of spatial layout optimization and energy efficiency. This study will establish the novel AIbased strategy for next-generation design and also allows for further exploration into generating the building's 3D spatial layout.

Materials and Methods
The network, named SD-GAN in this study, was constructed based on the GAN architecture and sampled by the SD competition entries. Through deep learning, SD-GAN makes it possible to enhance energy efficiency by improving building space allocation. Figure 1. depicts the SD-GAN training and testing phases of this study: 1. Training phase (gray box): SD-GAN is divided into two sub-models. By learning from samples, Model 1 can generate FSL from BEP, while FSL-to-BFP translation is possible with Model 2. A refined SD-GAN network could be obtained after this phase. 2. Generation phase (green box): after SD-GAN has been trained and qualified, the BEPs of three existing cases are fed into SD-GAN to generate the optimized BFPs. 3. Simulation and evaluation phase (blue box): the energy consumption of the existing cases and the generated schemes are modeled for simulating separately by Design-Builder, and the results are compared.

Network Architecture
Both SD-GAN sub-models have the same architecture, which consists of a generator and a discriminator ( Figure 2). The discriminator is fed a result generated by the generator based on the learned samples. Then, it determines whether this input is real or machinegenerated. If it is not fooled, the generator continues to train and evolve, generating the second generation of output to be discriminated against again. The discriminator evolves in sync with the generator, resulting in a stricter judgment of the input. The generator and discriminator can reach an equilibrium state after repeated training so that the generated data are as close to the real data as possible. Consistent with the Pix2Pix model, the generator uses the U-Net architecture, and the discriminator uses the PatchGAN architecture [53]. As shown in Figure 2a, the SD-GAN generator is symmetrically set with 8 convolutional layers and 8 deconvolutional layers. Two 4 × 4 convolution kernels with a step size of 2 and a padding of 1 are used to repeat the convolving of the convolution layers. All layers use BatchNorm and Leaky ReLU (LReLU) as activation functions except for layers 1 and 8, which use only LReLU and start the inversion after reaching the bottleneck layer ( Figure 2, red box). For upsampling, the deconvolution process employs a 4 × 4 convolution kernel and a 2 × 2 deconvolution, with a padding of 1. All layers use BatchNorm and Rectified Linear Unit (ReLU) as activation functions except for the first deconvolution layer, which uses TanH ( Figure 2, blue box). The unique Skip-Connection of U-Net allows each deconvolution layer in the generator's input to include both the previous layer's output and the output of the corresponding convolution layer. This allows the generated image to retain as much of the original image's information as possible ( Figure 2, green box).
The discriminator consists of 5 convolutional layers, as shown in Figure 2b. The size of the convolutional kernel is set to 4 × 4. The activation function for the discriminator's first convolutional layer is LReLU. The BatchNorm and LReLU functions are used in the second, third, and fourth layers, while sigmoid is used in the last layer of the network and has the advantages of smoothness and ease of derivation.

Network Training and Testing
The generator and the discriminator are called simultaneously during network training. Using cross-entropy loss, which is commonly used for binary classification, the loss function measures the loss of true and false classification on each corresponding image chunk of the discriminator.
The Adam optimizer is used to optimize the network with the momentum parameter set to 0.5. The learning rate is set to 0.0002 empirically. An epoch in training indicates that all the data are fed into the network for one forward calculation and back propagation, i.e., the model completes one whole learning cycle for all samples. The epoch is set to 400 in the preliminary training to achieve a better fit (fuller learning effect).
Both sub-models are operated using the same three steps as shown in Figure 3: 1. The processed training set is fed into SD-GAN for the training step. Model 1 takes BEP as input to output colored FSL. Model 2 takes FSL as input and produces BFP. The output will become closer to the real data as the generator and discriminator evolve simultaneously. 2. The test set is used to test the capability of SD-GAN once the generator and discriminator have converged to an equilibrium state. The BEP of the test set can be input, and then the output generated results can be visually compared to the original image.

Data Set Arrangement
All of the data for this study came from previous entries of the SD competition. We collected the project manuals and technical atlases of all prior competition entries, from 2007 to 2018. The rich passive energy-saving strategies embedded in the floor plans of the entries may make them valuable as data samples for BFP generation to achieve passive energy saving in residential buildings.

Data Screening
Data screening was performed to eliminate data with significant discrepancies or errors, which helped to improve data consistency. The screening principles are as follows: 1. Entries with two or more floors were screened out to make the sample processing easier, and only those with a single floor were retained. 2. Some entries were designed with variable space to improve space utilization. Entries with flexible variable space and extremely flexible functional layouts were screened out since this type of space cannot accurately define the functional zoning attributes.
Ninety-eight entries were counted for the screened sample size, distributed as shown in Table 1. In total, 90 of the 98 cases were randomly selected as the training set, while the other 8 were selected as the testing set. The original drawings of the collected entries were not uniform in form since each team's drawing methods and presentation details vary substantially. Therefore, a unified data processing is still required, as follows: 1. Uniform drawings: Redraw each entry's architectural plans and unify the overall furniture style, doors, and windows of the drawings. Each functional space was characterized by specific furniture. 2. Uniform annotation: The screened entries had a relatively similar functional layout, with a living room, dining area, kitchen, one or two bedrooms, study or workspace, bathrooms, and equipment rooms. According to the annotation principle (Figure 4), the FSL corresponding to the floor plan of each entry was first created. Then, the building area was filled with black to generate the BEP, as shown in Figure 5

Data Augmentation
Deep learning network training frequently requires a substantial amount of training data. Insufficient data samples often lead to overfitting problems. However, in practical research, the amount of data that can be directly collected is often limited. Meanwhile, manually collecting and labeling data is time-consuming and arduous. Therefore, data augmentation methods have emerged. These methods can expand the data set similar to the real data based on the original data to improve the generalization ability of the model and thus the accuracy of the prediction. The existing data augmentation methods are classified into two categories: supervised data augmentation and unsupervised data augmentation [54][55][56].
We adopted the geometric transformation method to expand the existing training samples to improve the training performance of Model 1 (unsatisfactory training result, see Section 3.1). The 90 training samples of Model 1 were flipped vertically and horizontally, rotated 90° both clockwise and counterclockwise, and rotated 180°, without modifying the scale, the proportion of the building layout, or the color distribution of FSL. The expanded training sample data set comprised a total of 400 labels after augmentation.

Evaluation of the Approach: Case Study and Simulation
To validate the feasibility and effectiveness of the SD-GAN proposed in this study, we drew the BEPs and BFPs based on three actual residential houses in Jianchang Village, Beijing (Figure 7). The BEPs were fed into the SD-GAN, and the corresponding BFPs were generated. Following that, the energy consumption simulations were carried out by DesignBuilder software based on the existing and the generated schemes. Finally, the results are analyzed and discussed.

Case Background
The site is the most remote township in the west of Beijing, with an altitude of 480-2303 m, an average annual temperature of 9 °C, average annual precipitation of 400-600 mm, a cumulative temperature of 2300-2800 °C, and a significant temperature difference between day and night.
The main part of the three houses is three bays, each with 5 or 6 rooms. The base area of Case A is roughly 160 m 2 while the indoor area is about 95 m 2 with the form of a singlestory monolith. It was renovated in 2009 and is fully functional. The width of the building is about 12.8 m, and the depth is about 7.8 m. As shown in Figure 8a, the living room is in the middle of the house. The bedrooms are on the south side separated by the living room. The kitchen and bathroom are located at two corners of the north side. Case B building form is single-story L-shaped, with an area of about 110 m 2 . As shown in Figure 8b, the living room is in the middle with 3 bedrooms on the east and west sides. The kitchen and storage room have independent entrances to the courtyard. The building area of Case C is about 90 m 2 with a single-story U shape. As shown in Figure 8c, the living room is also in the middle, but two bedrooms are located on the east side only. The kitchen, storage room, and bathroom are arranged on the west side, and the kitchen has a separate opening to the courtyard.

Building Energy Consumption Simulation Based on DesignBuilder
DesignBuilder is a comprehensive simulation software for building energy consumption including heating, cooling, lighting, and ventilation, etc., based on EnergyPlus dynamic simulation engine [57][58][59][60]. It will provide a data-supported reference for determining the energy-saving contribution of the generated design.
Through field investigation, there are 3, 3, and 2 permanent family members in households A, B, and C, respectively. The indoor thermal disturbance setting is 5 W/m 2 for lighting and 3.8 W/m 2 for home appliance equipment. The calculated indoor temperature is 18 °C, with 0.5 ACH of ventilation exchange. The envelope of the cases includes external walls, roofs, and external windows. The construction method and film coefficients of each part are shown in Table 2. The remaining parameters were set according to the building thermal design criteria of GB 50716-93 "Thermal Design Code for Civil Buildings", and the epw meteorological data of Beijing were used for analysis.

Preliminary Training
As mentioned in Section 2.1.2, the training results of Model 1 were tested by eight testing samples. The inputs are the BEPs, the ground truths are the original FSLs of the testing samples, and the outputs are the prediction results of Model 1. The training results of Model 2 are also tested by eight testing samples. The inputs are FSLs, the ground truths are the original BFPs of the testing samples, and the outputs are the prediction results of Model 2 (Table 3). The test results of Model 1 were evaluated in terms of CAS, RFD, and CCB and scored using the score scale indicated in Section 2.1.2. The test results of Model 2 were evaluated in terms of WGA and FGA. Table 4 shows the outcome of the evaluation. The majority of the Model 1 results were not clear enough for CSA (score: 2.25), CCB (score: 2.25), or not reasonable enough for RFD (score: 1.875). The level of performance stability was insufficient. It is more critical to generate a clear and explicit FSL first in order to generate a reasonable and complete building plan. Model 1′s experimental process had to be improved further.
The overall results of Model 2 reveal that the BFP generated from the FSL based on 90 training samples can basically satisfy the requirements, and the generated positions of walls (score: 4.875) and furniture (score: 4.375) are more accurate, which can accurately represent the functions of each space. The performance is also much more stable.

Data Augmentation Testing
To compare the performance of different numbers of training samples on the generated results, 240 and 400 samples were selected for training Model 1-1 and Model 1-2, respectively. Both of them were set with 200 epochs. Models 1-1 and 1-2 were tested independently with the same eight testing samples (Table 5) and evaluated according to the same criteria as above. Comparison results (Table 6) show that the results of Model 1-1 with 240 training samples and 200 epochs have no significant improvement compared with Model 1. There are still problems of unclear CSA, CCB, and unreasonable RFD with unstable performance. Model 1-2 with 400 training samples and 200 epochs shows significant improvement compared to Models 1 and 1-1, with clear and complete CSA (score: 4.875), CCB (score: 4.25), and reasonable RFD (score: 4.625), as well as stable performance in all aspects. This demonstrates the feasibility of enhancing learning ability by expanding the data set through the geometric transformation method.

SD-GAN Implementation and Case Study
After thorough training, SD-GAN was fed with the three actual case's BEPs to generate the FSLs and BFPs, which shown in Table 7. The results show that each functional segmentation, boundary, and plan is sufficiently obvious for further simulation, while the layout generated is fairly reasonable. Based on the generated BFPs, we performed modeling and simulation in DesignBuilder. The results are shown in the last rows of Table 7.

Generative Design and Efficiency
Architectural design schemes are constrained by multiple objective factors in the design process, such as spatial requirements, cultural context, environmental considerations, etc. Meanwhile, the design behavior of architects is not usually accessible or measurable. With the rapid development of artificial intelligence and deep learning technology in recent years, many hard-to-perceive abilities can be captured by computers.
In this study, Generated A adds a bathroom and adjusts the location of the kitchen compared to the original. It further optimizes the size of each room and reduces the size of the living room opening. Generated B adds a bathroom and adjusts the location of the kitchen and storage room, making the function more integral and convenient. The bedrooms are placed on the south side. Generated C adds a kitchen and dining room. It optimizes the functional layout and places the bedrooms on the south side to make full use of natural light. The storage room, kitchen, dining room, and bathroom are placed on the north side to form an isolation zone to save energy consumption.
In general, most of the generated schemes adopt the strategy of placing the heat producing and auxiliary spaces on the north side, the bedrooms on the south side, and the living spaces in the middle. This strategy not only partly blocks the cold air intrusion from the north side in winter but also promotes the natural lighting of the bedrooms. The central area is conducive to buffering the temperature difference between the north and south rooms. This is a strong signal that SD-GAN is sensitive to some latent awareness embedded in the design behavior of residential buildings in cold regions. The simulation results also show that such space allocation reduces the heating energy consumption to a greater extent. Cases A, B, and C reduced annual heating energy consumption by 15.8%, 16.83%, and 9.41%, respectively (Figure 9). This largely influenced the reduced values of energy consumption for the year, which were 13.38%, 12.74%, and 7.47% ( Figure 10).  However, the reduction of the cooling energy consumption in summer is not to be expected, particularly in Case C. Cases A, B, and C reduced annual cooling energy consumption by 9.70%, 12.48%, and 0.03%, respectively ( Figure 11). This may be relevant to the larger shape factor of Case C. The answer deserves to be further investigated through more cases.

SD-GAN Training
In terms of SD-GAN training, the following two issues should be noticed: 1. With the same network architecture, Model 2 performed remarkably better than Model 1, partly because the graphical features that correspond to FSL and BFP are more consistent. The network could easily perceive the correspondence between color boundaries and partition walls. On the other hand, the furniture varies more in different rooms. This implies that the network can quickly understand the mapping relationship between color and furniture arrangement. In contrast, the BEP-to-FSL mapping relationship of the Model 1 input is very ambiguous. The network may only be able to suspect from the proportional relationship of contours, orientation, etc. Hence, the learning ability performed weakly. 2. There was rarely much difference between the learning performance of the 240 and the initial 90 samples after data augmentation. However, the learning ability of the 400 samples improved dramatically. This is probably a case of the network becoming stuck in a "local optimal solution" during the learning process. More samples help it to jump out of that optimal solution and solve faster to the global optimum. This also explains why Model 1-2 performed better than Model 1 with 400 epochs after only 200 epochs, improving the solving ability and saving a lot of repetitive and invalid learning.

Conclusions
In the field of architecture design, most of the research on deep learning is focusing on enhancing generation capacities or the accuracy of energy consumption prediction. The comprehensive competence of the network in performance-based design has yet to be clarified. To address this issue, we first proposed the concept of training and testing SD-GAN with energy-effective performance based on Pix2Pix, and SD competition entries were used as the sample set. To achieve it, we systematically labeled samples from previous SD competition entries from around the world. The training data set was produced under given screening principles. During the testing of SD-GAN, we employed the geometric transformation method to expand the training set of the FSL generation model and compared the effects of adding different numbers of training samples to the generation results. The results showed that the data augmentation method is effective in improving training results and also provides a high reference value for our future studies. Therefore, we conclude this study as following: 1. Trained an integrated RBFP generation network SD-GAN with energy-effective performance based on Pix2Pix with SD competition entries as sample set. 2. SD-GAN with two steps of model configuration is capable of generating reasonable spatial and functional floor plans for single-floor residential buildings. 3. SD-GAN trained with embedded energy-efficiency characteristics samples and also has the capacity to generate energy-saving RBFPs. 4. Compared with three actual buildings by using DesignBuilder simulation, the RBFP generation network showed a positive effect in both optimizing the function arrangement and reducing energy consumption. 5. Proper data augmentation method can significantly improve the network's training results with small size sample.
However, there are still some limitations to the SD-GAN, which should be studied in the future: 1. The screened entries with small shape differences may potentially limit the generative capacity of the network. The variability of the sample data should be expanded to enhance the generative possibility. 2. Model training for multiple climate zones was not performed due to the limited data.
The applicability under various climatic conditions will be investigated based on more samples. 3. In design practice, the BEP, or building form, is an emerged result of complicated surroundings. Rather than being given, the complex external environment (road conditions, topographic features, surrounding business, urban context, etc.) may be considered in the future to generate BEP. 4. The energy-saving design of a house is a complex process, including the design of various passive and active energy-saving strategies. In this study, SD-GAN has been experimentally demonstrated to learn latent SAP-solving strategies, resulting in certain passive energy-saving properties. In the future, it is necessary to build a more comprehensive model of an energy-effective generation network from the perspective of a 3D scheme, integrating both passive and active strategies.
DAMlab (Digital Architecture and Manufacture Laboratory) Tianjin Sector in Tianjin Chengjian University for providing highly qualified equipment support during this study.

Conflicts of Interest:
The authors declare no conflict of interest.