top of page

> Introduction

This document is a tutorial on using Deep Neural Networks on Grasshopper, with a focus on the PUG plug-in. We will begin with an introduction to Deep Learning and its architecture applications and then explain the basics of Artificial Neural Networks, Multi-Layer Perceptron, Convolutional Neural Networks, and Generative Adversarial Networks. Finally, we will introduce the PUG plug-in and explore examples of supervised and unsupervised learning in Grasshopper.

> AI in Architecture

An example of AI in architecture is using generative design algorithms to explore design space and find optimal solutions based on specific performance criteria such as energy efficiency, structural integrity, and aesthetic preferences. The algorithms can generate many design options, and architects can choose the most suitable one or use the results to inspire their designs. Another example is using computer vision to automatically create 3D building models from 2D floor plans or using machine learning to predict the behavior of buildings in response to various environmental conditions such as wind, heat, and earthquakes.

Here is an article from a thesis submitted in 2019 at Harvard. The authors use nested Generative Adversarial Neural Networks (GANs) to handle the complexity of floor plans and break down the problem into sequential steps. Tap on the image to see more.

1_FVkInvZzXLcJNupTT9FxFw.webp

Another example is the paper titled "HouseDiffusion: Vector Floorplan Generation via a Diffusion Model with Discrete and Continuous Denoising". This paper presents a method for generating floorplans using a diffusion model that integrates both discrete and continuous denoising. The model can generate high fidelity and diversity vectorized floorplans while allowing for control over various parameters such as room layout, size, and door placement. The paper provides a detailed explanation of the model architecture and training process, as well as an evaluation of the model's performance compared to other state-of-the-art methods.

Deep learning is a subfield of machine learning that employs artificial neural networks to process and analyze vast amounts of complex data. In architecture, deep learning can be used for a variety of applications.

​

For example, generative design algorithms that employ deep learning can explore design space and find optimal solutions based on specific performance criteria such as energy efficiency, structural integrity, and aesthetic preferences. Deep learning can also be used for image recognition tasks, such as automatically creating 3D building models from 2D floor plans or predicting the behavior of buildings in response to various environmental conditions such as wind, heat, and earthquakes. Additionally, deep learning can be used for material classification, object recognition, and generative design.

​

Contents

​

> Introduction to PUG plug-in

PUG is a Rhino plugin that integrates the Tensorflow Machine Learning library into Grasshopper. The plugin includes various applications of Machine Learning, such as Supervised Learning, generative Adversarial Networks (GANs), and Deep Reinforcement Learning, using the Keras API.

puglogo.png

Supervised Learning is a type of machine learning where the algorithm makes predictions based on labeled data. This tutorial shows several examples of supervised learning using artificial neural networks (ANNs) on Grasshopper. One example is a regression problem where a neural network predicts the values of new inputs. Another example is binary classification, where a neural network classifies points inside or outside a specified shape. The tutorial includes an image classification example using a convolutional neural network (CNN) on the MNIST dataset.

​

Contents

​

Unsupervised Learning is a type of machine learning where the algorithm learns patterns from unlabeled data. The goal is to discover hidden structures or relationships in the data without explicit supervision. There are two main types of unsupervised learning: clustering and dimensionality reduction. Clustering aims to group similar data points into clusters, while dimensionality reduction aims to reduce the number of features in the data while preserving its essential characteristics.

​

Contents

​

> What is the limitation of PUG?

PUG has a few limitations that may affect its usability. First, the input tensor Y (target data in Keras) for the SL component (Supervised Learner) must have a shape of (1). As a result, the input data shape for the SL component in PUG is limited to one dimension, which means it can only be a 1D Numpy array of numbers instead of a 2D data array. This constraint makes building an autoencoder using PUG difficult since autoencoders typically work with 2D input data.

​

Another limitation is that loading large-weight files may cause the computer to crash, as there is currently no component to import customized data. To resolve this issue, one must write a custom Python script and package it to import larger data files without crashing the computer.

​

​To build a component in Python, one must understand the programming language and the Grasshopper API. Additionally, having experience in developing and packaging plug-ins for Grasshopper may be helpful.

bottom of page