[Note: This was an independent part-time research project extension for my ‘Spatialized Decision Tree: An Architectural Maze‘ project at the Architectural Association. It elaborates on the architectural system design by implementing machine learning to create a generative maze using qualitative datasets.]
[Independent research between January 2023 – August 2023]
Overview:
This research project sits at the intersection of architecture, machine learning, and gamification to bring about a transformative exploration of maze design. Beyond its architectural significance, this project serves as a platform for unveiling certain unethical practices prevalent in corporate architecture firms by immersing participants in an experiential simulation through an architectural maze. The project employs a unique approach rooted in the concept of choreographed temporality, where carefully arranged architectural elements generate temporary spaces and corridors within a maze.Stairs and ramps, strategically organized, obscure visibility, inducing a sense of uncertainty. Doors, characterized as iterative, chronological, or unopenable, challenge participants to navigate through choices with potential repercussions. Static or obstacles corridors present interesting tasks that challenge players to navigate through choices with potential repercussions.
At its core, the project involves the extraction of qualitative datasets from 150 employee interviews. These datasets were used to construct a decision tree for the maze, which was then translated into a spatial maze for the Spatialized Decision Tree: An Architectural Maze‘ project. Now I train a machine learning model to generatively modify the existing decision tree and floor-plan with each new qualitative dataset. Augmented reality is leveraged to visualize and immerse users in the dynamically adaptive maze, creating an environment where the spatial manifestations intricately mirror the nuanced decisions derived from qualitative data.
Beyond its architectural and technological dimensions, this project carries a broader social impact. By using machine learning to translate experiences into a simulation, it provides a powerful tool for more employees to articulate and share their workplace experiences. By engaging in the maze design process, students not only gain insights into the uncertainties of real-world professional landscapes but also become advocates for positive change within the industry.
Here is a flow chart to map the entire project:
Phase 1: Data Collection and Machine Learning Model Training
Phase 1 processes 100 qualitative datasets as input training sets for an SVM (Support Vector Machine) model. Each dataset undergoes meticulous processing to extract spatial and quantitative features. There are 4 spatial categories: Stairs, Ramps, Doors, Cooridors. Each is assigned a quantitative factor from 0, 1 or 2, based on the intensity of the experience. The machine learning framework uses a linear kernel, to discern spatial categories and quantitative subcategories. The TF-IDF vectorization method is applied for effective text representation. TF-IDF ensures a nuanced representation of word importance in the textual corpus. For new qualitative experiences, the code predicts spatial and quantitative attributes, presenting the results in a CSV file, which is used to retrain the model.. The choice of SVM, particularly effective in high-dimensional data scenarios like text classification, aligns with the project’s overall aim to assign a spatial translation to a qualitative dataset.
This table shows each spatial category and possible quantitative factors:
| Quantitative Factor (Based on intensity) | Stairs | Ramps | Doors | Cooridors |
|---|---|---|---|---|
| [0] | 5 steps | 10° | Standard | Single |
| [1] | 25 steps | 35° | Puzzled | Double |
| [2] | 50 steps | 60° | Unopenable | Obstacled |
The detailed model description and code can be found on Github here.
Here is an example of 3 ‘qualitative datasets‘ and their ‘spatial‘ translations, as predicted by the Phase 1 model:
| Input: Qualitative Dataset | Output: Spatial Category | Output: Quantitative Factor | Output: Final Spatial Translation |
|---|---|---|---|
| Negotiating tight project deadlines. | Door | [1] | Puzzle Door |
| Working 5 hours overtime on Friday | Ramp | [2] | 60° Ramp |
| Getting a paid taxi home at 1 am | Stairs | [0] | 5 Steps |
Phase 2: Decision Tree Integration
I have an existing decision tree that lays out possible paths that a player in the maze could take, which was created for the original architectural project. In order to train a machine learning model to read and modify the tree, I need to convert it to a programmatic decision tree constructed only using the spatial categories and translations shown in Table 1. This was done by identifying nodes, branches and associated spatial categories to map quantitative factors to decisions. (Please use the slider to view both versions on the image below).


The decision tree is then updated using machine learning model predictions, introducing generative alterations. This phase ensures that the decision tree dynamically adapts to new qualitative data from phase 1.
Integration Logic:
In Phase 2, the integration logic is governed by specific conditions and thresholds as outlined in the code here. The decision to modify existing decision tree branches or add new ones is contingent on the counts and quantitative factors associated with each spatial category.
The primary condition for modifying existing decision tree branches is determined by the total Spatial Count of instances of a particular spatial category (SC) exceeding or equaling 10. The threshold is a configurable parameter that can be adjusted as needed.
- If the instance count surpasses the threshold, the integration logic proceeds to modify an existing branch. A random node with the same spatial category is selected, and the associated decision tree node is updated with the new quantitative factor. [This helps retain a consistent level of complexity to train the model].
- If the instance count < 10, a new branch is added. A new decision tree node is created, incorporating the spatial category, intensity, and quantitative factor generated from the machine learning model trained in Phase 1.
This adaptive approach ensures that the decision tree structure evolves dynamically based on the observed frequency and intensity of spatial categories, promoting a responsive and nuanced maze design. Animation (A) show how the decision tree is modified by the 3 spatial translations from Table 2.
The current category counts are as follows:
| Stairs | Ramps | Doors | Corridors |
|---|---|---|---|
| 7 | 11 | 28 | 18 |
Therefore, experience 1 [‘Doors’] is integrated as a new branche because SC < 10 and experiences 2 and 3 are integrated by modifying branches because SC ≥ 10.

Therefore, phase 2 successfully integrates spatial translations from phase 1 into the existing decision tree using conditional generative modification.
Phase 3: Floor Plan Modification
Phase 3 of the project encompasses a detailed process of floor plan modification and validation, leveraging both architectural constraints and a trained Convolutional Neural Network (CNN) model for spatial recognition. The code defines a simple Convolutional Neural Network (CNN) model using Keras. It compiles, trains, and evaluates the model on an annotated floor plan dataset. The model designed to identify and categorize different architectural elements such as stairs, ramps, doors, and corridors present in the floor plan. This recognition is crucial for subsequent modifications guided by the decision tree.

IAnimation [B]. shows the existing architectural floor plan from the previous project which will be modified by the CNN model. It shows annotated variations that highlight different spatial categories as an input dataset.
Architectural Viability Constraints
Architectural constraints are explicitly defined, and decision tree modifications are outlined for each constraint. These constraints include rules for the placement of doors, stairs, ramps, and other spatial elements. The constraints also align with safety, accessibility, and functional considerations.
| Decision Tree Mapping | Confusing Intersections | Misleading Signage | Variable Path Width |
|---|---|---|---|
| Constraint | Design intersections with multiple possible choices, some of which lead to dead ends or loops. | Place misleading signage that guides participants in the wrong direction. | Design pathways with varying widths, creating challenges for navigation. |
| Node | Create a decision node representing an intersection. | Create a decision node representing a signage point. | Create a decision node representing a point where path width varies. |
| Branches | Each branch represents a different pathway at the intersection. | Each branch corresponds to a different direction indicated by signage. | Different branches represent pathways with different widths. |
| Quantitative Factor | Introduce a quantitative factor indicating the level of confusion or complexity at the intersection. Higher values correspond to more confusing intersections. | Use a quantitative factor to represent the level of misdirection. Higher values indicate more misleading information. | Use a quantitative factor to indicate the degree of variability in path width. |
| Integration Logic | If the quantitative factor exceeds [1], introduce new branches leading to dead ends or loops, increasing the confusion. | If the quantitative factor exceeds a threshold, modify the decision tree to lead participants in the opposite direction indicated by signage. | Modify the decision tree based on the quantitative factor, introducing new branches or altering existing ones to reflect changes in path width. |
Testing and Iteration
The code includes the iterate_on_integration for implementing iteration logic based on feedback and performance. It helps test the model and decision tree modifications on the same floor plan multiple times. As the model improves on a single layout, the training process is more effective. Images 3-6 show how the model implemented experiences 1-3 from Animation [A].
Experience 1: [New Node] ‘Unopenable Door’.

The model used the green door notation and replicated it onto an empty wall with no doors. The code defines a constraint that a door needs to be between walls on both sides.
Experience 2: [Modified Node] ’60° Ramp’.

When modifying ramps, the model doesn’t quite alter the plan, because the architectural notation for ramps does not mention elevations. Therefore, the notation on plan looks the same for modified ramps.
Experience 3: [Modified Node] ‘5 Steps’.

For Experience 3, the model had to reduce a 15 step stair to a 5 step stair. While it did manage to reduce the length of the stair, it did not replace the correct notation. So the resulting architectural notation for the new 5-step stair does not communicate the direction accurately. However it was commendable that the model identified the right stairway to modify on the plan. For the ramp in experience 2, the model modified a random ramp on the flow.
It took multiple tries to get the model to differentiate between a new and modified node but at the end it would successfully implement simple modifications to the architectural plan for each new dataset.
Conclusion
In conclusion, this multidisciplinary research project represents the convergence of architectural principles, machine learning methodologies, and gamification strategies, offering a paradigm-shifting exploration of maze design. The project has 3 designed phases, each contributing distinctively to the main objective: Designing an adaptive maze design framework to spatialize decision trees. In Phase 1, qualitative datasets are translated into spatial features. Phase 2 introduces a generative decision tree alteration mechanism, dynamically adapting the maze structure based on SVM machine learning model training. In Phase 3, a trained Convolutional Neural Network (CNN) model analyses an existing base architectural floor plan using predefined architectural constraints and spatial recognition It then modifies the floor plan based on the decision tree alterations from Phase 2. The integration of these elements yields a final architectural maze plan, informed by both the decisions extracted from qualitative data and the constraints inherent in real-world architectural scenarios.
Additional Links:
Github Repository for all model-training source code: Link
Original Architectural Game-Design Project: ‘Spatialized DecisionTree: An Architectural Maze‘.
[Independent project completed under the guidance from Oliviu Ghencu at the Architectural Association, January 2023 – August 2023]
