ITU A|Z • Vol 17 No 2 • July 2020 • 185-198 GAN as a generative architectural layout tool: A case study for training DCGAN with Palladian and evaluation of DCGAN outputs

Can UZUN1, Meryem Birgül ÇOLAKOĞLU2, Arda İNCEOĞLU3 1 [email protected] • Architectural Computing, Graduate School of Science Engineering and Technology, Istanbul Technical University, Istanbul, Turkey 2 [email protected] • Department of , Faculty of Architecture, Istanbul Technical University, Istanbul, Turkey 3 [email protected] • Computer Engineering, Graduate School of Science Engineering and Technology, Istanbul Technical University, Istanbul, Turkey

Received: October 2019 • Final Acceptance: February 2020

Abstract This study aims to produce Andrea Palladio’s architectural plan schemes au- tonomously with generative adversarial networks(GAN), and to evaluate the plan drawing productions of GAN as a generative plan layout tool. GAN is a class of deep neural nets which is a generative model. In deep learning models, repetitive processes can be automated. is a repetitive process in the act of architecture and plan drawing process can be made automated. For the automation of plan production system we used deep convolutional generative ad- versarial network (DCGAN) which is a subset of GAN models. And we evaluated the outputs of the DCGAN Palladian Plan scheme productions. Results show that not geometric similarities (shapes), but probabilistic models are at the centre of the generative system of GAN. For this reason, it should be kept in mind that while GAN algorithms are used as a generative system, they will produce statis- tically close visual models rather than geometrically close models. Nonetheless, GAN can generate both statistically and geometrically close models to the dataset. In first section we introduced a brief description about the place of the drawing in architecture field and future foresight of architecture drawings. In the second section, we gave detailed information about the literature on autonomous plan drawing systems. In the following sections, we explained the methodology of this study and the process of creating the plan drawing dataset, the algorithm training procedure, at the end we evaluated the generated plan schemes with rapid scene categorization and Frechet inception score. Keywords Andrea Palladio, Artificial Intelligence (AI), GAN, Plan generator, Generative doi: 10.5505/itujfa.2020.54037 doi: system. 186

1. Introduction date back to the 1960s. Although the Architectural drawing is the most methods used vary, we can see from repetitive process in the discipline of the literature that deep learning algo- architecture. During the 2000s BC, a rithms are the most promising tools for Sumerian plan was sculpted in clay autonomous plan drawing as a genera- (Donald, 1962). With this drawing, tive design tool. we can say that architectural drawings have a history of at least 4000 years. 2. Studies on autonomous Now, creating architectural drawings architecture plan layout generators manually could be defined as an ar- Studies on the autonomous produc- chaic action. Architectural plans are a tion of plans in architectural design subset of architectural drawings. Ar- started in the 1960s. Grason (1971) chitects draw plans based on spatial stated that in the mid-60s, the linear organization decisions, such as the lo- graph technique was an important in- cation of the , the size of the strument for the description of a plan. space, the relation between the spac- In the 1970s, autonomous plan gener- es, etc. Plan production is a repetitive ation was realized by determining the drawing process where spatial organi- geometries to be used in the design zation decisions are made. and the relationships of those geom- An can draw an architec- etries. It was also possible to derive tural plan without thinking of any cog- plans using the shape grammar theory nitive aspects of the design. However, that emerged in the 1970s. In addition, behind the drawing action, a highly de- genetic algorithms were tested in the tailed and sophisticated process is un- autonomous generation system of a folding in the mind. Formally describ- plan. There are also studies on the pro- ing these design processes in order to duction of plans using traditional ma- train an algorithm would not be pos- chine learning techniques. Today, deep sible or efficient. This falls into the- ar learning algorithms have been used in tificial intelligence (AI) problem space. studies on the autonomous production Goodfellow et al. (2016) states that the of plans. real challenge for AI is being able to Krejcirik (1969) developed his work solve tasks that people can do easily on the optimal placement of the plan but formally have difficulty explaining. plane with computer-aided design. Human beings solve such problems in- Weinzapfel et al. (1971) defined spac- tuitively. It is quite difficult to formally es as geometric entities and used the describe the act of designing in archi- relationships between these geome- tecture, too. For autonomous drawing tries as design constraints to produce processes, instead of trying to formally spatial arrangements in 3-dimensional explain the design, an algorithm can computer-aided design process. Levin derive meaningful solutions through (1964) and Grason (1971) used graph drawing datasets. Today, with the con- theory for spatial arrangement in plans. cept of big data, algorithms can evalu- Eastman (1973) proposed a system ate data, and deep learning algorithms called General Space Planner (GSP) for can be trained without needing to for- autonomous spatial in two mally describe processes. dimensions. According to Eastman, The repetitive process in the design- the goal in autonomous spatial plan- ing and drawing of architectural plans ning software is not to completely re- can be produced autonomously using move the human from the design pro- the GAN model, a deep learning al- cess, but to automate non-creative and gorithm. As such, we aimed to evalu- repetitive processes in spatial planning. ate the GAN algorithm as a generative Eastman identified four variables for plan design tool in architecture. As a an autonomous space design system: cased study, we focused on the auton- space, design units, relations between omous generation of Andrea Palladio’s design units, and operators to manip- villa plans with DCGAN, a subset of ulate these relations. Operators manip- the GAN algorithm. Studies on the au- ulating the design are not well-defined. tonomous production of plan drawing Therein lies the potential for creativity

ITU A|Z • Vol 17 No 2 • July 2020 • C. Uzun, M.B. Çolakoğlu, A. İnceoğlu 187 in the design process. Furthermore, the they produced works semi-autono- relations between the design units are mously, and the design is developed by defined as Boolean functions. Eastman the ’s orientation and selection emphasized that the challenge in spa- of the algorithm. The Multi-Objective tial planning was to produce an infinite Genetic Algorithm (MOGA) is used in number of orientation and positioning the system developed for semi-autono- possibilities for design units. Finally, he mous design. Nagy et al. (2017) stated emphasized that the problem of auton- that thanks to MOGA, instead of deal- omous spatial planning is a problem of ing with a single problem in the design the AI domain. problem space, the designer can deal Stiny & Mitchell (1978) aimed to with multidimensional problems in a organize Palladio’s plan grammar rules large problem space and achieve opti- into a modern and productive system. mal results. This has the power to rad- Using the grammar of Palladio’s plan ically change the act of design. In this system, the Villa Malcontenta plan was way, problems that can be overlooked produced (Stiny & Mitchell, 1978). In in the design process can be solved. this study, Stiny and Mitchell did not The plan production software, produce an autonomous plan of Palla- Finch, developed with the parametric dio. However, they were able to create design tool, Grasshopper, can make the necessary algorithm for the auton- autonomous decisions about the spa- omous generation of Palladian plans. tial arrangement, square meters, and Koning & Eizenberg (1981) contrib- furnishing in plans. In this software, an uted the development of autonomous increase or decrease in the total square processes in architectural design using meters of the plan redesigns the fur- Frank Lloyd Wright’s cottage grammar nishing and the spatial arrangement rules. Many authors (Duarte, 2005; autonomously (Ravenscroft, 2019). Colakoglu, 2005) used the productive Nowadays, the development of deep system of shape grammar to produce learning technology is becoming estab- architectural layouts. lished in the field of autonomous plan Ahmad et al. (2004) used genetic al- production systems. In their study, gorithms in their studies to use space Huang and Zheng (2018) were able efficiently in plans. They minimized the to design plans using GAN networks. boundary line of the plan by searching GANs are generative deep neural for the optimum solution with genet- networks. GAN networks are strong ic algorithms. Rojas and Torres (2006) enough to generate visual data. The used genetic algorithms to design bank GAN system that Huang and Zheng office plans. Dalgicet al. (2017) stated used was a specialized GAN network that the positioning of shelves within called Pix2pixHD. This network can a store is an important point for prod- derive visual information from labels. uct sales. Therefore, considering the For example, if the label is the kitchen visibility problem of shelves in stores, label, drawings of the kitchen plan are they designed a plan generator system generated on that label. In the dataset that works with genetic algorithms. As used by Huang and Zheng, features a result of these studies, Dalgic et al. (furnishing, walls, and bearing sys- (2017) stated that genetic algorithms tems) are produced autonomously on are a useful technique in creating a plan drawings using the GAN network. plan to produce many possible design Chaillou’s (2019) work is another study proposals quickly and finding the op- on plan generation with GAN net- timum solution to a design problem. works. In this study, GAN networks Nagy et al. (2017) produced a 45-di- generate plans in three steps. In the mensional design problem space with first step, the total shape of the plan 15 neighbourhood relationships and is generated. In the second step, GAN three parameters to regulate these produces interior partitioning and spa- neighbourhood relationships. Using tial arrangement. The third step ends this problem space, they developed a with furnishing and plan production. system that can find design solutions This study reveals the power of GAN using a productive system. The system networks in autonomous plan gener-

GAN as a generative architectural plan layout tool: A case study for training DCGAN with Palladian Plans and evaluation of DCGAN outputs 188 ation. In Chaillou’ s work, the result- GAN, a subset of GAN algorithms, has ing plans are very clear, right down to been proposed (Radford; 2015). The the details of the plan, the openings in following is a detailed description of the walls and the spatial organization DCGAN architecture. (Chaillou, 2019) GAN (Goodfellow (2016)) is spe- cial type of network that learns the

3. Methodology distribution of the input datax~pdata For the DCGAN training process, and generates new samplesx~pmodel we conducted two experiment using from learned distribution. The overall two different datasets. The first dataset network is composed of two sub-net- contained original villa plans produced works, namely generator (g) and dis- by architect Andrea Palladio (16th cen- criminator (d) networks. The generator tury). The second dataset was created takes a random noise vectorz~p, where with Palladian plans generated using pis a Gaussian or Uniform distribu- Palladian grammar rules. The Palla- tion, as an input and generates a new dian grammar rule set for generating samplex=g(z; θg). The discriminator plans is defined by Stiny & Mitchell takes both real and fake (i.e. generated) (1978).By referring to their bilateral data as input and returns a probability symmetry; Palladian plans can be eas- valuep= d(x; θd), indicating whether x ily evaluated. Due to their simple lay- is a real or fake sample.θg and θd are outs and reference for evaluation, these learnable parameters of the generator villa plan drawings were used as cases and discriminator networks, respec- for testing DCGAN plan generation. tively. There is competition between The purpose of the study was to ex- these two networks. While the genera- amine the effectiveness of DCGAN tive network tries to generate a sample networks in the design process of Pal- such that the discriminator can no lon- ladian plans as a generative plan design ger identify whether it is a fake or real tool. We evaluate the DCGAN outputs sample, the discriminator gets better at discriminating between real and gen- using qualitative (rapid scene catego- erated samples. rization) and quantitative (Frechet In- The objective is to find: ception Distance) methods. For rapid scene categorization, we used both Pal- ladian grammar rules and space syntax analysis.

4. Case study: GAN training with the Palladian Villa Plan Dataset where: The case study was carried out through two experiments. The first was DCGAN training with an original Andrea Palladio villa plan set. The sec- ond was DCGAN training with plans produced according to Palladian gram- DCGAN Architecture: mar rules. The first experiment outputs In DCGAN architecture, the gen- were noisy and not clean enough to erator and discriminator networks are evaluate the DCGAN outputs. There- composed of convolutional layers. We fore, we decided to repeat the training adopted a similar architecture (Fig- with a cleaner dataset. In the second ure 1) to that proposed by Radford et. training, Palladian grammar rules were al(2015). The generator network con- used to create a cleaner Palladian plan sists of three convolutional layers, each dataset. For both DCGAN training ex- with 128, 128 and 64 filters, respec- periments, we used the same DCGAN tively. There are batch normalization architecture and hyperparameters. layers and Leaky ReLU (α=0.2) is used as nonlinearity. The discriminator net- 4.1. DCGAN architecture work is composed of four convolution- This section explains the GAN algo- al blocks. In each block, the convolu- rithm training using the Palladian villa tional layer is followed by Leaky ReLU plans. In order to generate images, DC- ITU A|Z • Vol 17 No 2 • July 2020 • C. Uzun, M.B. Çolakoğlu, A. İnceoğlu 189

(α=0.2), dropout (p=0.25) and batch found a total of 125 plans by scanning normalization layers. The convolution- eight books (Giaconi, G., Williams, K., al layers have 16, 32, 64 and 128 filters, & Palladio, A. (2003)., Foscari, A., Ca- respectively. nal, B., & Façade, GT (2010). , Hem- Training Details: soll, D. (2016)., Boucher, B. (1998)., We trained for 10,000 epochs with a Puppi, L. (1973)., Puppi, L., Codato, P., batch size of 32. We used Adam optimi- Palladio, A., & Venchierutti, M. (2005) sation with the following hyperparam- Rykwert, J., & Schezen, R. (1999)., eters: learning rate: 0.0002, beta1:0.5, Wundram, M., Marton, P., & Pape, T. and beta2: 0.999. At the pre-process- (1993)). All 125 plans are shown in Fig- ing stage, all images were converted to ure 2. We scrubbed the plans of redun- grayscale and resized. In order to stabi- dant data (measurements, arrows, text, lize training, we applied label smooth- etc.) with photoshop, so that only outer ing (0.1 for real image labels and 0.9 walls, inner walls and stairs were left. for fake image labels).Different image We converted the colours of the plan to sizes were examined. Increasing the black and white, but the colour channel image size from 128x128 to 256x256 of the plan images was based on RGB pixels increased the resolution in terms values. In the algorithm training pro- of detail in generated images. However, cess, we converted the colour channel the level of detail remained unchanged of the dataset from RGB to grayscale. when increasing the image size. Since the dataset consists of 125 First experiment: GAN network images, we thought that the dataset training with original Andrea may be insufficient. Primarily we used Palladio Villa Plans Dataset Euclidean transformations (rotation, Preparation of Dataset translation, symmetry operations) to We collected Andrea Palladio’s villa increase the amount of data. After the plans for the dataset. During the data data augmentation process, we ob- collection process, we searched for Pal- tained 1,000 images for the dataset. Af- ladio’s villa plans in the library. We car- ter training the DCGAN model, we ob- ried out the data collection process by served that the training was not stable, scanning the plans in books about Pal- given the loss values of the generator ladio. In the scanned plans, we identi- function. The unstable training process fied and removed repeated plans. We was related to either the dataset or the GAN model. However, we know that the DCGAN model is a stable train- ing model in GAN networks. So, we focused on the dataset as the problem. With the data augmentation methods that we used, we may have generated outlier data that confused the training process. Therefore, we decided to use only the original Palladian plan data for the dataset. Figure 1. DCGAN Architecture. Outputs of DCGAN For the DCGAN training session, we used the same architecture and hy- perparameters described in the DC- GAN Architecture section. For most of the DCGAN plan productions, we observed that DCGAN tried to gener- ate bilateral symmetric plans (Figure 3). In addition, we saw staircases on some generated samples. However, the outputs of DCGAN were too noisy to evaluate DCGAN’s plan generation. The reason for noisy samples was the Figure 2. Andrea Palladio Original Plan Schema Dataset fact that the original plan dataset was (125 Plan Schemas). not clean enough. So, we decided to

GAN as a generative architectural plan layout tool: A case study for training DCGAN with Palladian Plans and evaluation of DCGAN outputs 190 generate a new, clean Palladian plan function. dataset. While creating the new data- In the first epochs of the training set, we used Palladian grammar. session, the algorithm did not learn Second experiment: DCGAN very well and could not generalize training with plans derived using through the Palladian plan. However, Palladian grammar rules after the 600th epoch, DCGAN start- In this experiment, we trained the ed generating reasonable plans (Figure DCGAN model with a dataset pro- 6). At the end of the training sessions, duced using Palladian grammar rules. we decided that the quality of the pro- Preparation of dataset ductions and loss value of the gener- Stiny & Mitchell (1978) defined the ator was good enough for the evalu- Palladian grammar rules for Palladian ation of the DCGAN Palladian plan villa plans. SWAP Architekten has de- generation process. Thus, we ended the veloped a web-based shape grammar training process at the 10000th epoc. interpreter (SGI) based on the rules of Palladian grammar (Grasl, n.d.). This web-based SGI Palladian grammar, called GRAPE, can generate Palladian plans. For the second experiment, we generated the Palladian plan dataset using the GRAPE software. The plan generation process takes place through the definition of a series of rules. The rules were: - Create a grid from square units (3x3, 3x4, 3x5, 5x3, 3x7 grids, with 30 plans for each) - Define the walls for the plan - Decide which square units in the grid to merge with which square units, according to Palladian grammar rules (combining the square units in the grid to generate T, I and + forms on the grid, joining the square units in the grid on the east-west and north-south axes) -Loggia addition -Portico addition -Door and window voids defined on the east-west and north-south axes Figure 3. GAN Plan Scheme Production Result with Original 150 Palladian plans were generated Palladio Plan Dataset. using the web-based GRAPE SGI in accordance with the Palladian gram- mar rules defined above (Figure 4). Outputs of DCGAN For this experiment, we used the same architecture and hyperparame- ters described in the DCGAN Archi- tecture section. In addition to the same DCGAN architecture, label smoothing was used in this experiment. We ob- served that label smoothing decreased the loss value of the generator and cre- ated a more robust training process. The values of the generator and dis- criminator loss functions during the training process are shown in Figure 5. With label smoothing we obtained Figure 4. The Dataset that is generated with Palladian lower loss values for the generator Grammar Interpreter, GRAPE-SGI (150 Plan Schemas).

ITU A|Z • Vol 17 No 2 • July 2020 • C. Uzun, M.B. Çolakoğlu, A. İnceoğlu 191

5. Evaluation of DCGAN production scene categorization, rating and prefer- in the second experiment ence judgment, evaluating mode drop In this section, we evaluate the and mode collapse, investigating and outputs of the DCGAN. The GAN al- visualization of internals of network gorithm has no standard evaluation (Borji, 2019). technique, but there are many differ- Beside qualitative methods, there ent techniques which can be used to are many quantitative methods that evaluate the performance of GAN al- measure the efficiency of GAN algo- gorithms. GAN evaluation techniques rithm productions. These include av- are divided into two groups: qualitative erage log-likelihood, coverage metrics, and quantitative methods. In this pa- inception score (IS), Frechet Inception per we used both methods to under- Score (FIS), mode score, and Frechet stand the behaviour of GAN. Inception Distance (FID). Some of Qualitative methods of GAN evalu- these techniques measure the resolu- ation include nearest neighbours, rapid tion quality of the image generated by GAN, while others look for similarity between the training dataset and the outputs of GAN through statistical cal- culations. For the qualitative evaluation meth- od, we used rapid scene categorization; for the quantitative evaluation method, we used FID.

5.1. Evaluation through rapid scene categorization We compared the DCGAN outputs with the dataset used to train the DC- GAN model. We made comparisons on the basis of the Palladian grammar rules and space syntax values. As a re- sult of this comparison, we evaluated Figure 5. Loss Values of DCGAN with LabelSmoothing (0.1 how effectively the GAN network gen- for real image labels and 0.9 for fake image labels). erated Palladian plans. Rapid scene categorization is a visu- al examination method based on hu- man perception (Borji, 2019). Through this evaluation, the observer classifies the true and false outputs of GAN. Since a human is the observer in the evaluation, this evaluation technique can be considered subjective and intu- itive. GAN generates thousands of vi- suals. As such, the observer must work quickly yet still be careful while check- ing the visual outputs. Because of the large amount of visuals to be evaluated, some misclassification might occur in terms of true or false decisions. Thus, the reliability of this technique is vari- able. Nonetheless, rapid scene catego- rization is fast and useful in measuring the performance of GAN. For rapid scene categorization, we used the Palladian grammar rules to be precise while labelling the outputs Figure 6. GAN Plan Scheme Production Result with GRAPE ‘DCGAN(true)’ or ‘DCGAN(false)’. SGI Palladio Plan Scheme Dataset. Palladian grammar rule checking is

GAN as a generative architectural plan layout tool: A case study for training DCGAN with Palladian Plans and evaluation of DCGAN outputs 192 based on the ‘y axis’ symmetry rule, ates spaces with these grid units. In the grid merging decisions and portico middle axis of the grid, the grid squares generation rules. Among the samples merge to form I, T, or + shapes on the generated by DCGAN, we found that plan. The grid can merge through the very few of the samples did not have a north-south direction but must obey portico. the bilateral rule. A portico is created As merely visual inspection is not on the axis of bilateral symmetry and reliable enough for evaluation, we an- the entrance axis of the villa is defined. alysed the true and false samples using The door and window openings are de- space syntax analysis. Although space fined on the north-south and east-west syntax gives quantitative result, this axes in accordance with bilateral sym- method also can be included in the metry. At the end of the grammar rule rapid scene categorization since it still application process, the entrance door examines the shapes but without pro- is created on the axis of bilateral sym- viding any statistical comparison result metry on the portico wall. between the training dataset and DC- Figure 7 shows the 25 GRAPE-SGI GAN-generated samples. generated Palladian plans within the Palladian grammar rule training dataset, 25 DCGAN generat- categorization ed plans which are in accordance with GRAPE SGI software can derive a Palladian grammar rules by Stiny & Palladian plan in a semi-autonomous Mitchell (1978) and 25 DCGAN gener- manner according to the Palladian ated plans which are not in accordance grammar rules. According to Stiny and with Palladian grammar rules. Mitchell (1978), the prominent feature When we examined the DCGAN in Palladian plans is bilateral symme- production, the majority of DC- try. In most of Palladio’s villa plan di- GAN-generated plans were not in agrams, bilateral symmetry appears. accordance with bilateral symmetry. There is always a portico as well. Among the 2,525 plans generated by The Palladio Grammar rule starts DCGAN, we saw that only 63 plans with a grid decision. The grids de- complied with Palladian grammar signed by Palladio are mostly in 5x3 (bilateral symmetry), and DCGAN arrangements. In Palladian grammar, generated the majority of the plans the grid begins with a unit square. with a 7x3 grid layout. We trained the This grid is augmented according to DCGAN with a dataset that included the grammatical rules from the east, the same number of 3x3, 3x4, 3x5, 5x3 west, north and south directions. The and 7x3 grid layouts, but we observed grid augmentation process is per- that DCGAN generated only 7x3 grid formed under bilateral symmetry. If a layouts. The main reason for the dom- unit grid square is added to the east, inance of 7x3 layouts may be related another grid unit must be added to to the probability distribution of the the west. This rule is not sought in the pixels in the dataset. This means that north-south direction. After the grid while training the DCGAN with dif- is completed, the Palladian rule gener- ferent grid layouts, DCGAN learned

Figure 7. 25 Palladian Plan Schemes that is generated with Palladian SGI & 50 Palladian Plan Schemes that is generated with DCGAN(left=true, right=false).

ITU A|Z • Vol 17 No 2 • July 2020 • C. Uzun, M.B. Çolakoğlu, A. İnceoğlu 193 and accepted the 7x3 layout as a true used l-shape merging on the north- probability. south middle axis. For the false outputs In Figure 8, we selected one plan of DCGAN, we labelled the outputs as per group among GRAPE SGI, DC- DCGAN(false(5,a).The rules applied for GAN(true) and DCGAN(false) plan obtaining the DCGAN(false)(5,a) plan generation results. We carried out re- were not in accordance with Palladian verse engineering to obtain each of the grammar rules. The DCGAN(false)(5,a) plans with Palladian grammar rules plan does not have bilateral symmetry. (Stiny & Mitchell, 1978) from scratch. The reason for this problem was that In this way, we aimed to check the true the grids were merged asymmetrically. and false outputs of DCGAN in terms In the Palladian grammar rule set there of Palladian grammar rules. For the is no L-shape grid merging as it would

GRAPE SGI(5,a) and DCGAN(true)(5,a) spoil the bilateral symmetry. However, plans, we were able to obtain the same in the DCGAN(false)(5,a) plan, we were plans. However, DCGAN(false(5,a) able to derive this plan by applying the could only be derived with different L-shape merging rule. rule sets not included in Palladian By inspecting all the 2,525 plans grammar rules. generated by DCGAN using this In Figure 8, each of the three plans methodology (Palladian grammar have the same 7x3 grid layout, so we rules), we classified 63 of 2,525 plans applied the Palladian grammar rule to as DCGAN(true), and the other 2,462 obtain a 7x3 grid layout. While gen- samples as DCGAN(false). Whether erating our dataset we used the same the plan was in compliance with the steps in GRAPE SGI plan(5,a). The rules grammar rule, all the plans generated that we applied were: a 7x3 grid, east- by DCGAN had the portico in front of west axes grid merging, north-south the bilateral symmetry axis. The reason axes grid merging, T-shape grid merg- for this must be related to the dataset. ing (this shape can be either “T”, “I” or All the data within the dataset had a “+” shape as mentioned in the Prepa- portico and they are all the same. So ration of Dataset section), creation of DCGAN generated the same pixel val- window and door openings, and final- ues in the correct places. ly addition of a portico. For the true From all these results we can deduce output, we labelled the output as DC- that DCGAN does not read the gram-

GAN(true)(5,a) and for this output, we mar rules, but it reads the probability were able to apply the same list of Pal- distribution of the pixel values in the ladian grammar rules as in the GRAPE dataset. Plans generated in accordance SGI, with one exception. Instead of with the Palladian grammar rules are using the T-shape merging , here we just a subset of probability distribu-

Figure 8. Grammar Rules of one plan scheme per groups in Figure 7; GRAPE SGI(5,a), DCGAN(TRUE)(5,a) & DCGAN(FALSE)(5,a).

GAN as a generative architectural plan layout tool: A case study for training DCGAN with Palladian Plans and evaluation of DCGAN outputs 194 tion of the pixel values in the dataset. ated plans, 25 DCGAN(true) plans and Thus, we observed some true Palladian 25 DCGAN(false) plans. The select- grammar rule plans, but we also ob- ed plans are the same as in the Rapid served many other possibilities which Scene Categorization: Palladian Gram- are not in accordance with the Palladi- mar Rules section. Figure 9 shows the an grammar rules. visualization of the connectivity val- Space syntax categorization ues of each of the GRAPE SGI, DC- In the previous section we evaluat- GAN(true) and DCGAN(false) Palla- ed DCGAN generation using Palladi- dian plans. an grammar rules with the rapid scene When we examined the connectiv- categorization technique. We classified ity values of the GRAPE SGI-gener- the outputs as DCGAN(true) and DC- ated 7x3 layout grid plan results, we GAN(false) subjectively, even though observed that the axis parallel to the we used the grammar rules as a basis. portico axes showed the largest con- That means we may have misinterpret- nectivity value since the grid layout ed or missed out some features in the was 7x3. The corridor parallel to the outputs. Although rapid scene cate- portico is formed by 7 grid units. So, gorization is a qualitative method and this corridor has more connection with space syntax is a quantitative method, the other spaces in the plan than the with the help of space syntax we were other spaces have. The second high- able to categorize the outputs not sub- est values were observed in the either jectively but objectively. As such, we entrance hall or the halls near the east incorporated the space syntax method and west walls of the plan. The lowest into rapid scene categorization. In this connectivity values were detected just way, we were able to evaluate the out- east and west of the entrance hall. So puts more precisely than we did with these spaces in the 7x3 grid system are Palladian grammar rules. the deepest spaces in the plan. In this section, we compare the The connectivity values of DC- GRAPE SGI Palladian plans, DC- GAN(true) were almost the same as GAN(true) and DCGAN(false) Palla- the GRAPE SGI results. However, the dian plans according to space syntax DCGAN(false) connectivity values values. Space syntax is mostly used were not the same, but similar to the in urban analysis studies. However, it GRAPE SGI results. This shows that can also be used for analysis of spatial whether the plan is DCGAN(true) arrangement, visibility, space privacy, or DCGAN(false), the space syntax and integration of spaces on the ar- values did not change significantly. chitectural scale. Space syntax can be The reason for this must be related to used to calculate the relationships be- the grid rule (7x3) and similar door tween spaces within a system (Hillier openings between spaces in both DC- & Stonor, 2010). In this study, we used GAN(true) and DCGAN(false). Pixel the connectivity values of space syntax probability distribution in the dataset to evaluate the plans. Connectivity in- may correlate with the space syntax dicates how many spaces are connected values. So, although the DCGAN pro- to another space. There is a direct pro- ductions are not in accordance with portion between connectivity and in- Palladian grammar rules, the syntax tegration values. A connectivity value values can still be similar to the syntax gives the measures of the distances be- values of the dataset. In other words, tween all subspaces in a space and then DCGAN learned the structure of the it compares and calculates the farthest Palladian plans through probability and the closest subspace to each sub- distribution. So, DCGAN(true) out- space in the space. The resulting values puts are 100% accurate both in terms for connectivity are represented by a of Palladian grammar rules and space heatmap, with red indicating the most syntax values, and DCGAN(false) re- integrated space, while blue defines the sults are 100% false in terms of Palla- most isolated space. Furthermore, this dian grammar rules but not 100% false value gives information about the cir- in terms of space syntax values. We can culation on the layout of the spaces. deduce that DCGAN created almost We selected 25 GRAPE SGI-gener- similar data to the dataset.

ITU A|Z • Vol 17 No 2 • July 2020 • C. Uzun, M.B. Çolakoğlu, A. İnceoğlu 195

lated the FID scores between the 150 5.2. Evaluation through the Frechet images from the dataset and each of Inception Distance (FID) the150 outputs generated by DCGAN In section 5.1 we evaluated the DC- between 0th-600th, 2500th-3100th, GAN outputs using the rapid scene 5000th-5600th, 7500th-8100thand categorization technique, which is a 9400th-10000th epochs. Figure 10 qualitative technique. In this section shows the FID scores. we use FID as a quantitative method to According to Figure 10, DCGAN measure the performance of DCGAN. improved in learning the Palladian Since there is not a single and exact plan dataset per iteration. The FID method to evaluate the performance of scores decrease per iteration, and DC- GAN algorithms, we used both qual- GAN generated more similar results to itative and quantitative methods to the dataset. However, after around the understand the behaviour of DCGAN 3000th epoch, the FID score did not better. change significantly, but minor chang- With FID, we can calculate the dis- es were observable. From the outputs tributions of embedding for images in of DCGAN, we can see that the reso- the dataset and images generated by lutions of the images improved per it- DCGAN. Embeddings are the vector eration, but the structure of the images representation of the variables in the did not change significantly after the data (Koehrsen, 2018). FID compares 3000th epoch. If the DCGAN overfits, the distances between these vector the FID score would be around 0. Thus, representations. For FID calculation the FID not being 0 is a good thing. a special network, the Inception V3 Comparison between the first epoch network, was used. The distance was and the 3000th epoch shows that DC- calculated using the Gaussian distribu- GAN learned the structure of Palladi- tions of the data from the dataset and an plan dataset, so the FID score de- the data from DCGAN-generated im- creased dramatically until the 3000th ages (Borji, 2019). The following func- epoch. Although most of the outputs tion from Borji (2019) shows the FID of DCGAN were not in accordance with Palladian grammar rules, the FID scores show that DCGAN learned the probability distribution of pixel val- score equation. ues on the plans and generated almost Features of real and generated data mathematically correct Palladian plan are defined with values mu1 and mu2, results.

respectively, while C1 and C2 denote the covariance matrix for real and gen- 6. Results and conclusion erated data (Brownlee, 2019). Covari- In this study, we aimed to evaluate ance shows the relation between two the effectiveness and the performance variables of two different dataset. If the of the GAN algorithm as a generative FID score is low, this means the dataset system in architectural plan drawing. and the outputs are similar, but if the We choose Palladian plans as a case FID score is high it means generated study for the GAN evaluation process. outputs are different from the dataset. For the training sessions, we used DC- By using this equation, we calcu- GAN, a subset of GAN algorithms. We

Figure 9. Connectivity Values, Syntax Results of 25 Palladian Plan Schemes that is generated with GRAPE SGI & Syntax Results of 50 Palladian Plan Schemes (True & False) that is generated with DCGAN.

GAN as a generative architectural plan layout tool: A case study for training DCGAN with Palladian Plans and evaluation of DCGAN outputs 196 used the default hyperparameters in mar rules, and categorization through DCGAN. We performed two exper- space syntax analysis. The third eval- iments with the DCGAN algorithm. uation technique was a quantitative In the first experiment, we used 125 method: Frechet Inception Distance. original Palladio villa plans to train the FID is a method for calculating the DCGAN algorithm. DCGAN results probability distribution distance be- were noisy because the dataset was not tween the real and generated plans. So sufficiently clean. For this reason, we FID score gives a probabilistic result. derived 150 Palladian plans using Pal- When we look at the results of Palla- ladian grammar with GRAPE SGI soft- dian grammar rule rapid scene catego- ware. These plans constituted the sec- rization, only 63 plans out of 2525 gen- ond dataset to be used in the training erated plans were in accordance with of DCGAN. We used the label smooth- the Palladian grammar rule. We clas- ing method to optimize the DCGAN sified these 63 plans as DCGAN(true). generator function’s loss value. Before The others were labelled DCGAN(- label smoothing, the value of the loss false). These results show that DC- function of the generator function was GAN is not sufficiently effective for the high. After label smoothing, the loss training of Palladian grammar rules. value of the generator function de- To confirm these results, we conduct- creased below 1. The training process ed space syntax analysis, another rapid was more stable with label smoothing. scene categorization. When we com- We evaluated both the datasets and pared the Palladian grammar rules found that the first dataset, which in- with the space syntax values, we saw cluded 125 original Palladian plans, similar syntax values to the dataset. was too heterogeneous. Because of Upon evaluation of the FID results, the heterogeneous dataset, during the we found that DCGAN improved at training process of DCGAN, a high imitating the dataset, despite the fact variance low bias problem occurred they did not comply Palladian gram- and the outputs of the DCGAN failed mar rules. This means that almost cor- in producing reasonable results. The rect results were generated by DCGAN GRAPE SGI-generated dataset was mathematically, but does not mean that homogenous so the training process DCGAN can read the grammar rules. of DCGAN was more stable using this The reason for the DCGAN(true) gen- dataset, and the results were of a better erations may be that the results com- quality. We continued the evaluation patible with Palladian grammar rules process of DCGAN with the GRAPE were a subset of the probability distri- SGI-generated dataset. We terminated bution of the pixel values of each item the training process of the algorithm at of data in the dataset. the10000th epoch, since the loss value After the evaluation of the DCGAN was sufficiently low. DCGAN generat- ed 2525 Palladian plans with a 7x3 grid layout. After the training process, we evalu- ated the generated plans to understand the performance and the effectiveness of DCGAN as a generative plan lay- out production tool. The first intuitive evaluation was that DCGAN somehow focused on the generation of 7x3 grid layout plans. The reason for this consti- tuted an engineering research problem, so we simply evaluated these plans. We used three different evaluation meth- ods. Two of the methods fall under the rapid scene categorization technique, a qualitative evaluation method of GAN outputs. These two methods were: cat- egorization through Palladian gram- Figure 10. FID Score Comparison.

ITU A|Z • Vol 17 No 2 • July 2020 • C. Uzun, M.B. Çolakoğlu, A. İnceoğlu 197 plan outputs, we can say that GAN al- and Planning B: Planning and Design, gorithms can take part in generative 32(1), 141-149. systems in architecture for plan pro- Dalgic, H. O., Bostanci, E., & Guzel, duction. Dinçer et al. (2014) classified M. S. (2017). Genetic Algorithm Based the generative design tools under five Floor Planning System. arXiv preprint headings. These generative design tools arXiv:1704.06016. are listed as shape grammars, genetic Dinçer, A. E., Çağdaş, G., & Tong, H. algorithms, L-Systems, cellular autom- (2014). Toplu Konutların Ön Tasarımı ata, and collective intelligence-swarm İçin Üretken Bir Bilgisayar Modeli. behaviour. We can add the GAN algo- Megaron, 9(2). rithms to this list as the sixth generative Donald, T. (1962). A Sumerian Plan design tool. Not geometric similarities in The John Rylands Library1. Journal (shapes), but probabilistic models are of Semitic Studies, 7(2), 184-190. at the centre of the generative system of Duarte, J. P. (2005). A discur- GAN. For this reason, it should be kept sive grammar for customizing mass in mind that while GAN algorithms housing: the case of Siza’s at are used as a generative system, they Malagueira. Automation in Construc- will produce statistically close visual tion, 14(2), 265-275. models rather than geometrically close Eastman, C. M. (1973). Automated models. Nonetheless, GAN can gener- space planning. Artificial intelligence, ate both statistically and geometrically 4(1), 41-64. close models to the dataset. Therefore, Foscari, A., Canal, B., & Façade, G. GAN algorithms can take part in the T. (2010). Andrea Palladio. Unbuilt class of generative design tools for plan Venice. Baden: Lars Muller Publishers. generation. Generative adversarial network. (2019). Retrieved from https://en.wiki- References pedia.org/wiki/Generative_adversari- Ahmad, A. R., Basir, O. A., Hassa- al_network nein, K., & Imam, M. H. (2004). Im- Giaconi, G., Williams, K., & Palla- proved placement algorithm for layout dio, A. (2003). The Villas of Palladio. optimization. In Proc. of the 2nd Int’l Princeton Architectural. Industrial Engineering Conf.(IIEC’04). Goodfellow, I., Bengio, Y., & Cour- Boucher, B. (1998). Andrea Palla- ville, A. (2016). Deep learning. MIT dio: the architect in his time. Abbeville press. Press. Grasl, T. (n.d.). GRAPE For Web - Borji, A. (2019). Pros and cons of Shape grammar interpreter. Retrieved GANevaluation measures. Computer from http://grape.swap-zt.com/App/ Vision and Image Understanding, 179, PalladianGrammar 41-65. Grason, J. (1971, June). An approach Brownlee, J. (2019, October 10). to computerized space planning using How to Implement the Frechet Inception graph theory. In Proceedings of the Distance (FID) for Evaluating GANs. 8th Design automation workshop (pp. Retrieved December 5, 2019, from 170-178). ACM. https://machinelearningmastery.com/ Hemsoll, D. (2016). Palladian De- how-to-implement-the-frechet-incep- sign: The Good, the Bad and the Unex- tion-distance-fid-from-scratch/ pected. Brock, A., Donahue, J., & Simonyan, Hillier, B., & Stonor, T. (2010). Space K. (2018). Large scale gan training for Syntax-Strategic Urban Design. City high fidelity natural image synthesis. Planning Review, The City Planning In- arXiv preprint arXiv:1809.11096. stitute of Japan, 59(3), 285. Chaillou, S. (2019). AI & Archi- Huang, W., & Zheng, H. (2018). Ar- tecture. Retrieved from https://to- chitectural drawings recognition and wardsdatascience.com/ai-architec- generation through machine learning. ture-f9d78c6958e0 In Proceedings of the 38th Annu- Colakoglu, B. (2005). Design by al Conference of the Association for grammar: an interpretation and gen- Computer Aided Design in Architec- eration of vernacular hayat houses in ture, Mexico City, Mexico. contemporary context. Environment Koehrsen, W. (2018, October 2).

GAN as a generative architectural plan layout tool: A case study for training DCGAN with Palladian Plans and evaluation of DCGAN outputs 198

Neural Network Embeddings Ex- S. (2015). Unsupervised representation plained. Retrieved January 9, 2020, learning with deep convolutional gener- from https://towardsdatascience.com/ ative adversarial networks. arXiv pre- neural-network-embeddings-ex- print arXiv:1511.06434. plained-4d028e6f0526 Ravenscroft, T. (2019). Wallgren Koning, H., & Eizenberg, J. (1981). Arkitekter and BOX Bygg create para- The language of the prairie: Frank metric tool that generates adaptive Lloyd Wright’s prairie houses. Environ- plans. Retrieved from https://www.de- ment and planning B:planning and de- zeen.com/2019/06/27/adaptive-floor- sign, 8(3), 295-323. plans-wallgren-arkitekter-box-bygg- Krejcirik, M. (1969). Computer-aid- parametric-tool/ ed plant layout. Computer-Aided De- Rojas, G. S., & Torres, J. F. (2006). sign, 2(1), 7-19. Genetic algorithms for designing bank Levin, P. H. (1964). Use of graphs to offices layouts. In Prosiding Third In- decide the optimum layout of build- ternational Conference on Production ings. The ’ Journal, 7, 809-815. Research–Americas’ Region. Nagy, D., Lau, D., Locke, J., Stoddart, Rykwert, J., & Schezen, R. (1999). J., Villaggi, L., Wang, R., ... & Benjamin, The palladian ideal.New York: Rizzoli. D. (2017, May). Project Discover: An Stiny, G., & Mitchell, W. J. (1978). application of generative design for ar- The palladian grammar.Environment chitectural space planning. In Proceed- and planning B: Planning and design, ings of the Symposium on Simulation 5(1), 5-18. for Architecture and Urban Design (p. Weinzapfel, G., Johnson, T. E., & 7). Society for Computer Simulation Perkins, J. (1971, June). IMAGE: an in- International. teractive computer system for multi-con- Puppi, L. (1973). Andrea Palladio strained spatial synthesis. In Proceed- (Vol. 2). Milano: Electa. ings of the 8th Design Automation Puppi, L., Codato, P., Palladio, A., & Workshop (pp. 101-108). ACM. Venchierutti, M. (2005). Andrea Palla- Wundram, M., Marton, P., & Pape, dio: introduzione alle architetture e al T. (1993). Andrea Palladio 1508-1580: pensiero teorico. Arsenale. Architect between the renaissance and Radford, A., Metz, L., & Chintala, baroque. Taschen.

ITU A|Z • Vol 17 No 2 • July 2020 • C. Uzun, M.B. Çolakoğlu, A. İnceoğlu