Title
Utilising Generative Adversarial Networks (GANs) and genetic algorithms to design sustainable urban blocks
Authors
(1) Efthimis Kapsalis, (1,2) Ioannis Daganis
(1): AP Engineering, (2): Aristotle University
Abstract
Modern computational techniques have been incorporated into architecture and urban planning, opening the door for creative responses to the rising need for ecologically friendly practices. A growing number of researchers have recently examined the possible uses of genetic algorithms and generative adversarial networks (GANs) in regard to creating sustainable architectural or urban design solutions. In this paper, we present a workflow for producing sustainability-oriented urban design forms through utilising advanced computational methods. Specifically, we describe how a combination of GANs and genetic algorithms can further the form-finding process for urban blocks, by generating numerous design alternatives against spatial and environmental criteria. The paper also included a case study to demonstrate the applicability of the proposed workflow in real-world projects. Results from the case study indicate the usability of our approach in generating a diverse set of building layouts, optimising them based on multiple criteria, and ultimately selecting a solution for designing an urban block that is well-aligned with project goals and constraints. We conclude by discussing the potential contributions of our approach as well as a series of possible refinements to increase its efficiency.
Keywords: generative AI, Generative Adversarial Networks (GANs), genetic algorithms, design optimisation, sustainable urban design, form-finding
1. Introduction
The integration of advanced computational methods in architecture and urban design has paved the way for innovative solutions that address the increasing demand for environmentally sustainable practices. Among these methods, deep neural networks (LeCun et al., 2015) and evolutionary computation (Eiben & Smith, 2015) have emerged as prominent approaches, offering the potential to revolutionize the design process by generating novel design solutions and optimizing them for environmental sustainability. The application of these techniques in architectural and urban design not only accelerates the exploration of the design space but also ensures that the resulting solutions meet specific criteria, such as maximizing sunlight exposure for improved energy efficiency and occupant well-being (Carpo, 2017). Lately, a significant body of work has explored the potential of Generative Adversarial Networks and Genetic Algorithms in relation to developing sustainable architectural or urban design solutions (Caetano et al., 2020)
Generative Adversarial Networks (GANs) are a class of machine learning algorithms that consist of two neural networks, namely the generator and discriminator, that compete with each other to produce realistic outputs (Goodfellow et al., 2020). Recently, these algorithms have been employed in the field of architectural and urban design, offering advantages such as accelerating the design process by rapidly generating multiple design alternatives, thus reducing the time spent on manual ideation and exploration (Newton, 2019) Also, GANs enhance creativity by producing diverse and novel design solutions that may not have been considered by human designers, pushing the boundaries of conventional design thinking (Wu et al., 2022). Lastly, GANs can be tailored to cater to user preferences or specific design requirements, ensuring that generated designs are well-suited to their intended context and purpose (ibid.) In Chaillou's (2019) study, the author used a dataset of 10,000 labelled images of buildings to train the ArchiGAN model, and incorporated user preferences and design constraints to generate functional floorplans. Wu et al. (2021) applied a GAN-based framework by firstly vectorising building elements on floor plan images and then repairing the topological inconsistencies between the building elements, separates indoor spaces, to eventually generate numerous indoor maps and alternative design models. In Alkhayyat et al.'s (2021) research, the authors used a dataset of high-resolution satellite images to train GANs, enabling the
generation of realistic urban patterns that could inform more sustainable urban planning practices. To summarise, GANs have proven to be an invaluable tool in the realm of architectural and urban design, offering a multitude of benefits, such as accelerated design processes, enhanced creativity, and the ability to generate designs that cater to specific user preferences or requirements.
Genetic algorithms (GAs) are a class of evolutionary computation techniques that mimic the process of natural selection to solve optimization and search problems (Holland, 1992). Different types of GAs include binary, real-coded, and permutationbased algorithms, each suited for specific problem domains (ibid.). In the field of architectural and urban design, GAs offer several advantages, particularly in optimizing 3D models during the early stages of design by efficiently exploring the vast solution space and identifying the most suitable designs based on predefined criteria, such as energy efficiency, structural integrity, and aesthetic appeal (Makki et al., 2022) One notable study by Caldas (2008) applied genetic algorithms for the optimization of building envelope design, focusing on energy performance and daylighting. The author used a GA-based tool, GENE_ARCH, that optimizes form and material properties, demonstrating its potential to inform architects about sustainable design strategies. In another work, Turrin et al. (2011) employed genetic algorithms to optimize the topology of a free-form steel grid shell structure, where the methodology integrates both structural and fabrication constraints. The study showcases GAs' ability to generate structurally efficient and economically viable designs. Deb et al. (2021) used a multi-objective genetic algorithm, NSGA-II, for optimising urban layouts to minimize energy consumption and enhance pedestrian comfort. Their methodology combines GIS data and environmental simulations to evaluate generated urban layouts, demonstrating the potential of GAs in sustainable urban planning In another study, Duering et al. (2020) developed a methodology that enables the generation of sustainable, efficient, and liveable urban systems by considering multiple objectives and constraints in the design process. To achieve that, they utilised a combination of GANs, genetic algorithms, and environmental simulation tools, such as the Ladybug software. In summary, genetic algorithms have shown great promise in architectural and urban design, particularly in optimizing 3D models during early design stages by efficiently exploring various design solutions and identifying optimal designs based on predefined criteria.
Taking inspiration from previous research, particularly works of Alkhayyat et al. (2021) and Duering et al. (2020), we propose a workflow for producing sustainabilityoriented urban design forms through utilising advanced computational methods. Specifically, the following lines present how a combination of GANs and genetic algorithms can further the form-finding process for urban blocks, by generating numerous design alternatives against spatial and environmental criteria The paper also includes a case study to demonstrate the applicability of the proposed workflow.

2. Methods used
This research primarily employs Pix2Pix GAN and the Octopus genetic algorithm to generate building volumes subject to specific controllable parameters and environmental constraints. Two types of datasets, which comprise of 2D images representing building footprints in black-and-white plan views, are created for GAN training, and then used to predict a specific plot layout. The resulting layout is imported as image into the Rhinoceros 3D CAD platform (Mc Neel, 2022), where it can be easily converted into vector entities by the user. Then, the Octopus tool is utilised in the Grasshopper 3D visual-programming plugin of Rhinoceros 3D to generate alternative volumetric (3D) forms. The parameters considered include building height restrictions and plot ratios, while environmental constraints include maximum sunshine hours as calculated by Grasshopper’s add-on Ladybug Tools. The proposed workflow is illustrated in Figure 1.
2.1. Data collection
To address the fundamental issue of urban block generation, i.e., controlling building density, plot ratio, and other morphological indicators, a two-step generation process is designed. The GAN model is trained using datasets sorted by building densities,
i.e., one set representing high density layouts and another one representing low density layouts, allowing the model to generate residential building layouts within a specified range of densities. Meanwhile, plot ratio control is taken into consideration during volume generation using genetic algorithms For the area of interest, the GeoPandas Python package (GeoPandas, 2022) is used to process building and land use data, extract residential land data, calculate building densities, and classify them accordingly. Figure 1 depicts the training set construction for both dataset types. Each sample in the training set consists of a conditioning image and an original image of building footprints, with an image size of 256*256 pixels to meet GAN requirements.
2.2. Pix2Pix GAN training
GANs utilise an unsupervised architecture, comprising two independent network sets engaged in mutual confrontation. In this approach, we have utilised the Pix2Pix GAN, which learns a conditional generation model, establishing the relationship between input and output images (Isola et al., 2018). Pix2Pix consists of two primary components: a Generator (G) and a Discriminator (D), as shown in Figure 2.
The Generator is responsible for producing images that resemble the target images given a specific input image. In Pix2Pix, the generator adopts a U-Net-like architecture (Ronneberger et al., 2015), which is an encoder-decoder structure with skip connections between corresponding layers in the encoder and decoder. The encoder part captures the semantic information and compresses the input image into a lower-dimensional representation. The decoder part then up-samples this lowerdimensional representation and generates the output image. The skip connections

help preserve the fine-grained details of the input image during the generation process.
The Discriminator's role is to classify whether the generated image is real (from the actual dataset) or fake (produced by the Generator). The Discriminator in Pix2Pix adopts a PatchGAN architecture (Isola et al., 2018), which focuses on classifying individual patches of the image rather than the entire image itself. This approach not only reduces the computation cost but also helps in preserving the high-frequency details in the generated images. PatchGAN architecture encourages the Discriminator to consider both local and global information in the images.
During the training process, the Generator and Discriminator engage in a two-player minimax game. The Generator aims to produce images that can fool the Discriminator into classifying them as real, while the Discriminator tries to accurately distinguish between real and generated images. This adversarial training process continues until a state of equilibrium is reached, where the Generator creates highly realistic images that are challenging for the Discriminator to differentiate from real ones. The Pix2Pix GAN is trained using a combination of an adversarial loss and a reconstruction loss.
The adversarial loss is derived from the standard GAN objective, where the generator tries to fool the discriminator, and the discriminator tries to correctly classify the real and generated images. The adversarial loss function is represented in Equation 1.
L_adv(G, D) = E_{x, y}[log D(x, y)] + E_{x, z}[log(1 - D(x, G(x, z)))] (1)
Here, x represents the input image, y represents the target image, and z is a random noise vector. G(x, z) is the generated image from the generator, and D(x, y) and D(x, G(x, z)) represent the discriminator's classification of real and generated image pairs, respectively.
To ensure that the generated images are not only realistic but also preserve the structure and content of the input images, a reconstruction loss is added to the objective. The reconstruction loss is typically an L1 or L2 loss between the generated image and the target image. L1 loss is used in the original Pix2Pix architecture for
better training stability and improved generated image quality. The reconstruction loss function is shown in Equation 2.
L_rec(G) = E_{x, y, z}[||y - G(x, z)||_1] (2)
Here, ||.||_1 denotes the L1 norm between the target image y and the generated image G(x, z).
The final objective combines both the adversarial loss and the reconstruction loss, with a weight factor λ to balance their contributions (Equation 3).
L(G, D) = L_adv(G, D) + λ * L_rec(G) (3)
The experiments involve assigning a weight of 125 (λ = 125) to the weight variable, in order to underscore the importance of L1 loss in the given task.
2.3. Octopus optimisation tool
Octopus is an optimization tool for Grasshopper3D that enables multi-objective optimization based on evolutionary algorithms. It is designed to handle multiple conflicting objectives simultaneously, seeking to find a set of Pareto-optimal solutions. Pareto-optimal solutions represent trade-offs between objectives, where no single solution is strictly better than any other in all objectives.
Octopus uses an evolutionary algorithm to explore the design space and optimise the objectives. The algorithm operates through a process of selection, crossover, and mutation, similar to natural evolution. It starts with an initial population of candidate solutions and iteratively refines the population over a number of generations. The tool allows users to define their optimisation goals by specifying the objectives, constraints, and variables that guide the evolutionary search process. Users can also set other parameters like the size of the population, the number of generations, and the mutation and crossover rates.
Octopus provides rich visualization and interaction capabilities for the optimisation process. Users can monitor the progress of the optimization and explore the design space through various visualization options such as parallel coordinate plots, scatter plots, and histograms. The solutions can also be inspected and ranked according to user-defined criteria. The tool has been developed as a plugin for Grasshopper3D. This enables seamless integration with other Grasshopper3D components and
Rhino3D geometries, allowing architects and designers to easily set up and execute optimization tasks within their familiar design environment. In this study, various constraints are applied to the building layout generated by Pix2Pix GAN for volume generation, including height limits, plot ratio, and maximum sunshine hours. Due to Octopus’s compatibility with other Grasshopper tools, the user can express the spatial constraints (i.e., height limits and plot ratios) through slider components and calculate the environmental parameters (i.e., maximum sunshine hours) using Ladybug's sunshine calculator.
3. Results from case study
To validate the workflow proposed in Section 2, we present a case study, on which we have applied our approach to a real-world project. The case study addresses the sustainable design of an urban block located in the new city of Belgrade, Republic of Serbia. This case study refers to an urban regeneration project whose design was commissioned to the affiliated organisation of both authors and is currently under development
According to the proposed workflow, the study begins by collecting land and building data from Belgrade, followed by dataset preparation using Python's GeoPandas package. Specifically, GeoPandas was used to extract 2D building footprints for the area-of-interest (AOI) - which included the target plot as well as neighbouring plotscalculate building densities and classify them accordingly. Building densities were categorised into a low-density class (i.e., 0.2-0.5) and a high-density class (i.e., 0.50.8) dataset, as illustrated in Figures 3 and 4.

The Pix2Pix model was then trained using the two datasets, as described in Section 2.2. We then inserted an image of the target plot, i.e., conditioning urban plot in Figure 1, on which the trained model would build different scenarios for low-density and high-density layouts. The most representative results of Pix2Pix generation are shown in Figure 5. The conditioning image (Fig. 5, a) with the target plot is highlighted in a magenta hatch, and the output images (Fig. 5, b&c) are the generated building layouts
It is obvious from Figure 5 that the generated outcomes for both low-density and high-density models exhibit a noticeable level of consistency. Regarding the lowdensity layout, the buildings effectively adhere to the site boundaries while maintaining a central public space. This demonstrates the sophistication of the network algorithm, which learns not only the layout of buildings but also the


relationship between the building groups and the target site. The building density of the result is 0.298, meeting the low-density generation requirements.
In the high-density generation results, the network's consideration for high-density layouts aligns with local patterns and learns from neighbouring E-shaped and Cshaped architectural forms, integrating them into the generated scheme. This integration gives the scheme a more distinctive and locally relevant character. The building density of the result is 0.629, satisfying the high-density requirements.
The next step was to import the generated layouts into Grasshopper 3D so as to optimise the building block according to spatial constraints and environmental criteria. We expressed the spatial constraints (i.e., height limits and plot ratios) through slider components and calculated the environmental parameters (i.e., maximum sunshine hours) using Ladybug's sunshine calculator. Figure 6 presents an overview of our workflow in a Rhino 3D (left) and a Grasshopper 3D (right) environment. Figure 7 depicts the visual algorithm we developed for the environmental analysis of the building blocks using Ladybug Tools, which were later optimised through Octopus in Grasshopper 3D.
The optimisation results are shown in Figure 8. Volumes have been generated for both low-density and high-density layouts, and the designs with the greatest sunlight hours have been showcased within the scope of three plot ratios in Figure 8. The relatively consistent heights of the generated buildings are clearly noticeable, which can be ascribed to the height restrictions applied throughout the optimisation process.



4. Discussion
In this paper, we presented a workflow for producing sustainability-oriented urban design forms through utilising advanced computational methods. Specifically, we described how a combination of GANs and genetic algorithms can further the formfinding process for urban blocks, by generating numerous design alternatives against spatial and environmental criteria. The paper also included a case study to demonstrate the applicability of the proposed workflow in real-world projects
The employment of the Pix2Pix GAN played a crucial role in generating building layouts under certain controllable indicators provided by the conditioning image of the target plot. By training the GAN model on collected land and building data of the area of interest, the network learned the relationships between the building blocks and the site, as well as local patterns and urban design forms. This aspect is important because it can enable the GAN model to capture and understand the intricate relationships and nuances of the overall context. As the design profession swiftly moves towards incorporating automation into different stages of the design process, efficiently trained GANs can assist with generating realistic and contextually appropriate designs, which are harmonised with the existing urban fabric and thus addressing site-specific constraints and design opportunities. By automating the generation of context-sensitive design solutions, professionals can save valuable time during the initial phases of the design process, allowing them to focus more on refining and iterating the design based on other factors such as functionality, aesthetics, and sustainability. Moreover, GAN-generated designs can serve as a source of inspiration and provide design professionals with a broader range of ideas and possibilities to explore, enriching the design process and pushing the boundaries of conventional solutions.
Genetic algorithms, specifically the Octopus tool, greatly contributed to generating building volumes and optimising their arrangements This enabled the simultaneous consideration of multiple design objectives and constraints during the volume generation process. By incorporating environmental criteria - such as maximum sunlight hours - into the design process, we were able to explore a broad range of feasible design solutions, and eventually select the most sustainable solutions, in terms of energy efficiency and enhanced living conditions for future occupants
Thereby, it becomes evident that genetic algorithms enable an efficient exploration of the design solution space, allowing professionals to quickly evaluate a vast number of design alternatives and select the ones that best meet the desired objectives and constraints. They also provide quantitative and objective measures for evaluating design alternatives, thus facilitating well-informed decision-making. This ensures that selected designs are based on empirical evidence rather than intuition alone, leading to more robust and effective solutions. Finally, the role of genetic algorithms in providing optimised solutions in terms of environmental sustainability can be crucial in today's context, where concerns about climate change and resource consumption necessitate a focus on sustainable design practices.
A limitation of our approach concerns the design ambiguity and pixel noise of the generated designs through the Pix2Pix model. For instance, some of the GANproduced images were of little architectural value, as they represented irregular building shapes or urban patterns, especially in regard to complex urban plans. This is because the model cannot understand the topological content of the images, as it only translates the developed visual patterns in pixel values. In the future, we intend to train the model using a greater number of datasets, and possibly include more complex topologies, in order to generate more accurate outputs in design terms. We also plan to augment the multi-objective optimisation process by integrating additional environmental parameters, such as wind impact, light environment, energy consumption, and carbon emissions. This will help simulate the micro-climate of the investigate area with greater precision in a bid to achieve performance-oriented generation of urban design scenarios in a holistic manner.
Overall, combining Generative Adversarial Networks and Genetic Algorithms offers a powerful approach to architecture and urban design, enabling the generation of contextually appropriate and environmentally sustainable solutions. The proposed workflow not only expands the diversity of design alternatives produced by GANs, but also makes up for any GAN-originated instabilities through optimising the design forms in an evolutionary way. This synergistic approach has the potential to significantly assist design professionals with exploring and optimising design solutions through incorporating spatial and environmental criteria as well as facilitating informed decision-making
References
Alkhayyat, A., Elgammal, A., & Al-Atabany, W. (2021). Learning generative models of urban patterns from satellite images using GANs. arXiv preprint arXiv:2102.12337.
Caetano, I., Santos, L., & Leitão, A. (2020). Computational design in architecture: Defining parametric, generative, and algorithmic design. Frontiers of Architectural Research, 9(2), 287–300.
https://doi.org/10.1016/j.foar.2019.12.008
Caldas, L. (2008). Generation of energy-efficient architecture solutions applying GENEARCH: An evolution-based generative design system. Advanced Engineering Informatics, 22(1), 59–70.
https://doi.org/10.1016/J.AEI.2007.08.012
Carpo, M. (2017). The second digital turn: design beyond intelligence. MIT press.
Chaillou, S. (2019). AI architecture towards a new approach. https://www. academia. edu/39599650/AI_Architecture_Towards_a_New_Approach
Deb, K. (2021). Multi-objective optimization using evolutionary algorithms (p. 497). John Wiley & Sons.
https://www.wiley.com/engb/Multi+Objective+Optimization+using+Evolutionary+Algorithms-p-9780471873396
Duering, S., Chronis, A., & Koenig, R.: 2020, Optimizing Urban Systems: Integrated Optimization of Spatial Configurations, Proceedings of SimAUD 2020
Eiben, A. E., & Smith, J. E. (2015). Introduction to evolutionary computing. Springer Berlin Heidelberg.
https://doi.org/10.1007/978-3-662-44874-8
GeoPandas. (2022.). GeoPandas 0.12.2. https://geopandas.org/en/stable/ Gu, Y., Chen, Q., Liu, K., Xie, L., & Kang, C. (2019). GAN-based model for residential load generation considering typical consumption patterns. 2019 IEEE Power & Energy Society Innovative Smart Grid Technologies Conference (ISGT), 1–5. https://doi.org/10.1109/ISGT.2019.8791575
Holland, J. H. (1992). Genetic algorithms. Scientific American, 267(1), 66–73. http://www.jstor.org/stable/24939139
Isola, P., Zhu, J.-Y., Zhou, T., & Efros, A. A. (2018). Image-to-image translation with conditional adversarial networks. In arXiv
Lecun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature 2015 521:7553, 521(7553), 436–444. https://doi.org/10.1038/nature14539
Makki, M., Navarro-Mateu, D., & Showkatbakhsh, M. (2022). Decoding the architectural genome: Multi-objective evolutionary algorithms in design.
Https://Doi.org/10.1080/24751448.2022.2040305, 6(1), 68–79.
https://doi.org/10.1080/24751448.2022.2040305
McNeel. (2022). RhinoRhinoceros 3D. https://www.rhino3d.com/
Newton, D. (2019). Generative deep learning in architectural design. Technology|Architecture + Design, 3(2), 176–189.
https://doi.org/10.1080/24751448.2019.1640536
Ronneberger, O., Fischer, P., & Brox, T. (2015). U-net: Convolutional networks for biomedical image segmentation. Lecture Notes in Computer Science (Including Subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 9351, 234–241. https://doi.org/10.1007/978-3-319-245744_28/COVER
Turrin, M., Von Buelow, P., & Stouffs, R. (2011). Design explorations of performance driven geometry in architectural design using parametric modeling and genetic algorithms. Adv. Eng. Informatics, 25(4), 656–675.
https://doi.org/10.1016/J.AEI.2011.07.009
Wu, A., Stouffs, R., & Biljecki, F. (2022). Generative Adversarial Networks in the built environment: A comprehensive review of the application of GANs across data types and scales. Building and Environment, 223, 109477.
https://doi.org/10.1016/J.BUILDENV.2022.109477
Wu, Y., Shang, J., Chen, P., Zlatanova, S., Hu, X., & Zhou, Z. (2021). Indoor mapping and modeling by parsing floor plan images. International Journal of Geographical Information Science, 35(6), 1205–1231.
https://doi.org/10.1080/13658816.2020.1781130