1 Introduction

1.1 Background

In architectural and spatial design disciplines, the end-user is the paramount criterion for evaluating the efficacy of design. Originating from Renaissance humanism, which proclaimed "Man is the measure of all things" (Bailey et al., 2019), this user-centric paradigm persists in modern design methodologies. Contemporary practices strive for a design ethos that meticulously aligns spatial magnitude, morphology, and essence with the nuances of human experience and behavior, thereby ensuring that the resulting spaces resonate with their inhabitants. Gestalt psychology posits that human perceptions of objects stem from the collective relationships rather than isolated elements, a principle that translates to architectural design where the assemblage of spatial elements holistically influences psychological space (Dalton et al., 2016). Variations in quantity and form within a uniform space can alter the overall ambiance, thus impacting psychological perceptions. Additionally, the intricate web of interrelations between spatial components and psychological space underscores the complexity of their influence, affirming that the diversity of these interconnections profoundly dictates the psychological imprint of the space. Consequently, the exploration of how spatial elements and their configurations influence human psychology is of paramount importance. Through the intentional design of architectural spatial elements, one can engineer environments that cater to both physiological and psychological human requisites, thereby crafting spaces that resonate with and support the human experience (Juan & Chen, 2022).

Ergonomics, also known as human factors, is introduced into the field of architectural design methods as an objective system for evaluating spatial quality. Which is the scientific discipline that studies the interactions among humans and other elements of a system, serving as a quantitative index, investigates the dynamic interplay between human volition and objective environmental systems. This field facilitates the analysis of subjective behavioral patterns as individuals engage with and perceive specific spatial forms—both “Virtual” and “Corporeal”. By interfacing with the objective formal attributes of environments, human factors data provides a crucial predictive function in the appraisal and enhancement of design outcomes, offering insights that are integral to the iterative process of design optimization. Ergonomics is dedicated to the meticulous design and strategic organization of user-centric elements to ensure interactions are optimized for efficiency and safety (Tham & Willem, 2010) (Jazizadeh et al., 2014). The objective is to enhance efficiency and the quality of output while concurrently mitigating adverse factors emergent from human–environment interactions.

Thus, the present study is devoted to harnessing the model of human–environment interaction to formulate a generative and feedback mechanism instrumental in driving design results generation. The aim is to establish a direct, formal, and quantitative design methodology that is intrinsically based on the subjective spatial experience of the human body within the design framework of specific environmental settings. During environmental engagement, a deterministic interplay exists between subjective human behavioral patterns and the objective formal environmental attributes. This interaction can be conceptualized as a latent mechanism, where bidirectional feedback is evident. As individuals observe or immerse in an environment, they generate subjective physiological responses to the perceived material attributes, encompassing various somatic and psychological states. Concurrently, environmental perception prompts behavioral anticipation regarding the interplay of environmental elements with the human body, such as spatial visual positioning and prospective interactive actions. This anticipation leads to intentional adjustments of environmental elements to align the ambience with specific experiential desires.

Grounded on this bidirectional feedback mechanism inherent between humans and certain environmental spatial, this study establishes a generative design methodology. It is both propelled and refined by the incorporation of human factors data, ensuring that the resulting designs are acutely attuned to human interactions and experiences. Generative design is a methodology that involves the use of algorithms and computational processes to generate complex forms and structures in architecture, product design, and various other fields. It typically employs iterative processes and rules-based systems to explore a wider range of design alternatives than would be possible through traditional design methods. Within the phase of developing variable parametric models for human–environment interaction, the electroencephalogram (EEG) serves as an essential tool. As a technique for capturing brain activity via electrode measurements, EEG provides a quantifiable and direct reflection of subjective psychological states. Its suitability for physiological assessments of spatial forms against specific parameter sets makes it an invaluable asset. Consequently, EEG data can be employed to indirectly actuate the parametric model, prompting requisite modifications and fine-tuning to align with human responses.

1.2 Previous studies

Research initiatives in architectural space design that harness human-factors data concentrate on built environment quality assessment using sensory data indicators for specific spatial or elements. Prior research have employed a range of methodologies to establish control groups for the comparative analysis of architectural factors, encompassing self-report instruments, human-factor measurements such as electroencephalography (EEG) (Aspinall et al., 2015), electrocardiograms (Zhu et al., 2023), electrodermal activity (EDA) (Yeom et al., 2021), eye-tracking (Tang et al., 2023), and psychological scales designed to assess stress recovery and task-related performance (Juan et al., 2022). Quantitative comparative experiments have been systematically carried out to scrutinize how architectural environmental elements influence physiological parameters, behavioral patterns, and task performance within the studied user population (Yoo & Lee, 2015). Related researches including analyzing spatial configurations through human behavioral patterns (Harrop & Turpin, 2013), establishing spatial scales and furniture dimensions based on human stature and movement studies (Pereira et al., 2020) (Zukowska et al., 2012), enhancing building thermal performance via investigations into environmental thermal comfort (Bogatu et al., 2023), refining built environment quality through the study of attentional markers within human ocular tracking (Simoncelli, 2003) (Liu et al., 2021), and utilizing comprehensive physiological metrics to formulate evaluative judgments on spatial environments (Liu et al., 2019).

Among the above-mentioned researches on evaluating built space based on human-factors data and further guiding the design and optimization of spatial elements, EEG measurement has been widely selected as target data for analysis. In the Correlation between EEG signals and psychological quantities such as human emotion and psychological stress is discussed, it is theoretically feasible to judge people’s emotional characteristics (Kim et al., 2004) (Msa et al., 2021) and quantify people’s degree of relaxation and stress through EEG signals (Katmah et al., 2021) (Devi et al., 2020). The mental state represented by specific EEG characteristics can have a significant positive impact on human psychology and physiology (Sanei & Chambers, 2013) (Fell et al., 2010). Furthermore, the mechanism behind the specific perceptions of users in a built environment is complex. Occupant experiences in a building are shaped by intricate and enduring interactions with the spatial environment (Li et al., 2022) (Frescura et al., 2023). Correspondingly, the establishment of the system that integrates multi-source data acquisition and analysis methods to reflect the human experience influenced by different design features, becomes the focus of multiple studies (Ergan et al., 2019) (Motamedi et al., 2017) (Li et al., 2021) (Zhu et al., 2022).

A distinct correlation exists between human EEG signals and human psychological states and emotions, suggesting the feasibility of utilizing EEG signals with specific characteristics or frequencies as a quantitative foundation for assessing human psychological states. EEG is a method of recording brain activity using electrophysiological indicators. It records the electrical wave changes formed by the sum of postsynaptic potentials synchronized by neurons during brain activity, and is the overall reflection of brain nerve cells on the surface of the cerebral cortex or scalp. In the research of applying EEG measurements as the built environment evaluation index, previous studies focuses on the relationship between human-factors data and environmental characteristics. By analyzing the waveform information from EEG data is able to reveal the positive or negative mental states of the occupants it reflects (Frantzidis et al., 2010). This establishes a direct correlation between spatial elements and human mental perception, and evaluates them as a quantitative indicator of the quality of built environment. This method is used to analyze light comfort assessment (Lu et al., 2020), outdoor thermal comfort for age-specific groups (Ma et al., 2023), human-building feedback mechanism under various indoor temperatures (Shan et al., 2018), interaction feedback between architectural spatial information and human perception (Wu et al., 2020) and the subjective impact caused by visual effects of building materials on occupants thermal sensation (Kim et al., 2023).

While contemporary research has effectively established a unidirectional relationship between ergonomics data and the evaluation of the spatial environment, the applications of human–environment interaction feedback for scenarios generation in architectural design have not been widely explored. Generative design is employed to search innovative solutions, optimize sustainability, and enhance user experiences through data-driven approaches that prioritize efficiency and creativity. Rule-based algorithms play a role in configuring forms which are variously applied in generative design process such us genetic algorithm that is applied to optimize the goal oriented architectural shape (Li, 2012), non-dominated sorting genetic algorithm II that is used for architecture operative design (Bailey & Caldas, 2023) and bio-inspired generative method for supporting structure generation and optimization (Zhang et al., 2020). Besides, Brain-Computer Interface (BCI) tool was already tested and developed as an design tool in the realm of architectural interior windows adjustment (Yang et al., 2023), immersive multi-media science-art installation system (Kovacevic et al., 2015), artistic expression by using EEG signal as painting controls (Kübler & Botrel, 2019), those researches demonstrates that EEG data can serve as an indirect primary parameter for driving the design process, thereby laying the empirical foundation for the establishment of a mutual-feedback generative design mechanism in this study.

1.3 Research aim

While current research has successfully identified a one-way correlation between human-factors data and the spatial-environment evaluation, there remains a significant gap in addressing the establishment of a bidirectional, mutually informative feedback mechanism. Specifically, there is limited discourse on developing a generative design approach driven by psychometric data such as EEG. This research endeavors to forge a universally efficacious digital generative design framework, utilizing EEG data to quantify human emotional and psychological parameters as the impetus and refinement metrics for spatial form creation. Initially, the investigation builds on prior findings related to EEG-driven optimization of window dimensions and color schemes in interior space design (Zhang et al., 2022), aspiring to broaden these methodologies to more extensive built environment applications. The research aims of this study consist of the following three points:

  • Establishment of a universal generative design framework based on Brain-Computer Interface (BCI).

  • Development of a tools system for integrating the methodological framework with various devices to support real-time interactive feedback mechanism based on EEG signals. This system is composed of hardware and software.

  • Empirical application of multi-scale scenarios and multi-domain design objectives orientation.

Methodologically, it necessitates identifying the design generation's focal variables, formulating a generative algorithm to parameterize decision variables across spatial components. Subsequently, EEG signal thresholds are computed, leveraging genetic algorithms as convergence benchmarks for optimizing spatial element configurations. Tool-wise, the study progresses by integrating the methodological framework with various smart devices, establishing an EEG data acquisition and processing suite, crafting a visualization platform, and a data loop for real-time signal transmission. Ultimately, the research applies this methodological and tooling synergy to execute generative design experiments and analyses across diverse scales and scenarios—ranging from volumetric visual elements to architectural elements design—thereby validating the system's applicability in multi-domain environmental and architectural design contexts.

2 Framework: Brain-Computer Interface based Generative Design (BCIGD)

2.1 Overview

This innovative method facilitates the perception of spatial forms, wherein real-time observable psychological data, manifested through EEG data, directly influences the adjustment process of spatial elements. This not only enhances the understanding of human–environment interactions but also underscores the potential for dynamic, data-driven spatial elements design. This framework comprises four distinct stage objectives, meticulously organized in a sequential order within the entire process, shows in Fig. 1.

Fig. 1
figure 1

Framework of Brain-Computer Interface based Generative Design (BCIGD)

2.2 Establishment of stage objectives

2.2.1 Object definition: identifying applicable generative design domains

The paper discusses the criteria and rationale for selecting specific digital design domains suitable for EEG-driven workflows. The focus will be on identifying scenarios where EEG data can significantly influence design outcomes. In this section, a detailed exploration is conducted to define the characteristics of design targets suitable for the EEG-driven generative design method. This exploration is anchored in the premise that eligible design targets must exhibit three key attributes:

  • complex composition of design elements: The targets should comprise a variety of design elements, such as planar or three-dimensional geometries, each with attributes like color and size. This multiplicity and diversity are crucial for enabling detailed definition and manipulation through parametric models.

  • direct visual stimulus or sensory relevance: The design targets should be capable of offering direct visual stimuli or possess attributes that are closely related to human sensory evaluations, leaning towards their artistic expression. This aspect ensures that the design resonates on an aesthetic and emotional level with the observer, making it suitable for EEG-based assessment and optimization.

  • non-intrusive to core structural integrity: In optimizing design targets based on human sensory evaluation, it is imperative that the process does not compromise the intrinsic structural framework, such as architectural layout norms and stability. This consideration ensures that while aesthetic and experiential qualities are enhanced, the fundamental functional integrity of the design target is preserved.

2.2.2 Feature extraction of target elements: parameterization of design elements

In this stage of workflow, the parametrically defining target spatial elements within the chosen design domains should be extracted, focusing on their geometric properties and the relationships between them. This section delves into the methods for parametrically defining target spatial elements, emphasizing their geometric attributes and interrelations. This approach involves a detailed analysis of each element's inherent properties, such as shape, size, and texture, as well as their spatial interplay with other elements in the environment. The methodology for extracting these features systematically from the design space should be elucidated, highlighting how these parameters are essential for creating responsive, EEG data-driven design models. This part of the research is fundamental in bridging the gap between raw EEG data and its practical application in generative design, ensuring that the designs produced are not only aesthetically coherent but also functionally relevant and responsive to human interaction and perception. The section will discuss techniques and tools used for this extraction process, supported by case studies or examples where these methods have been effectively applied.

2.2.3 Rule-based algorithms: form generation and optimization

The next stage focuses on the strategic amalgamation of multiple form-generating algorithms, each contributing distinctively to the overall design process. It delves into the selection and integration of various algorithms that collectively facilitate the transformation of EEG data into architectural forms. The objective is to create a system where these algorithms work in unison, balancing computational efficiency and design intricacy. The algorithms chosen are evaluated for their ability to interpret and respond to EEG signals, translating them into viable and aesthetically variable spatial forms. The discussion includes an exploration of evolutionary algorithms, neural networks, and parametric design tools, each offering unique strengths to the design process. The integration of these diverse algorithmic strategies is crucial for achieving a design that is not only visually compelling but also functionally responsive to the nuances of human psychological and physiological data. This multi-algorithmic approach ensures a dynamic and adaptive design process, where form generation is a fluid and responsive interaction between data input and computational creativity.

2.2.4 Perception-Form interaction mechanism

The final part elaborates on the critical process of linking EEG-derived perception data with the parametrically driven generation of design forms, highlighting the importance of establishing a connection between EEG signals and the parameters that control element generation. This involves a comprehensive analysis of how EEG data, reflective of human cognitive and emotional states, can be translated into actionable design parameters. The methodology includes the development of algorithms that can interpret EEG patterns and convert them into design elements, ensuring that the generated forms are not only aesthetically pleasing but also in sync with the user's psychological and physiological responses. This approach underlines a transformative step in architectural design, where buildings and spaces are not just structures but responsive entities that adapt and resonate with their inhabitants.

3 Methodology

3.1 Establishment of BCIGD framework

In the establishment of BCIGD framework, this study initiates by prioritizing the data-flow within the methodology itself. The concept of data-flow serves as the foundational and unchanging structure within this method, stands as the framework for research endeavors related to tool platforms.

3.2 EEG-driven generative design workflow

3.2.1 EEG and design elements interaction mechanism

This generative design methodology centralizes around structuring decision variables from multiple spatial elements. It leverages specific EEG feature parameters as reference values in the genetic algorithm's operations, crafting an optimization model for spatial elements. Utilizing a multi-objective genetic algorithm, this model is methodically solved to derive relatively optimal solutions for spatial element configurations. These solutions progressively converge towards a predetermined target threshold, ensuring a fine-tuned and data-driven approach to spatial design. Throughout the process, optimization follows a closed-loop progressive structure (see Fig. 2). Within this framework, the data transmission can be summarized as follows as one single loop:

  • Step 1 Variable parameterized element modeling information

  • Step 2 Modeling result observed by the participant.

  • Step 3 EEG signal data monitored from the participant.

  • Step 4 The algorithm optimizes the variable parameterized model, referencing the EEG data to generate new model data.

Fig. 2
figure 2

Establishment of BCIGD framework

3.2.2 Optimisation algorithm

In architectural design, the complex interplay of spatial elements and the multitude of design variables render exhaustive enumeration impractical. The Multi-Objective Evolutionary Algorithm (MOEA), with its capability for iterative optimization, effectively addresses this complexity. It navigates through multivariate and ambiguous choices to identify near-optimal solutions, streamlining the decision-making process in architecture. Non-dominated Sorting Genetic Algorithm II (NSGA-II) is applied in the optimisation method which is widely used algorithm (Deb et al., 2002), particularly suited for optimization problems that need to consider multiple objectives simultaneously. In BCIGD framework the plugin tool Wallacei inserted onto Rhino and Grasshopper platform is selected and NSGA-II operates through an iterative process, where a set of solutions is first generated and then evolved over several generations. Each solution is evaluated based on multiple objectives and ranked overall using non dominant criteria. To maintain diversity, assigning a congestion distance to each solution is beneficial for reducing congestion in the solution. This algorithm selects, crosses, and mutates the best solution to generate offspring, and then merges it with the current population. Rank and evaluate the crowding distance of the merged groups again to form the top-level solution for the next generation. This loop repeats until convergence is achieved, effectively balancing the trade-offs between multiple objectives while ensuring a diverse set of high-quality solutions (Figure 3).

Fig. 3
figure 3

EEG-driven generative design method

3.2.3 Selection of EEG signals based on optimization objectives

Selecting the optimal target EEG band as an evaluation metric is a critical component in the generative design and optimization process outlined earlier. The five fundamental EEG frequencies – alpha, beta, gamma, delta, and theta waves – each reflect varying aspects of the human psychological and mental state, as delineated in Table 1. By correlating these distinct EEG patterns with specific spatial perceptions, we can key into a pivotal methodology for achieving spatial element optimization in design through EEG data. This approach not only bridges the gap between neurophysiological responses and architectural design but also pioneers a data-driven pathway for enhancing spatial design based on human-centric criteria. Furthermore, during the process of measuring EEG signals, EEG devices not only output raw data from above five bands, but also perform feature solving through the device built-in algorithm, which is manifested as Meditation Value data (MVD) and Attention Value data (AVD) (Aftanas & Golocheikine, 2001). These two values typically range from 0 to 100, representing the intensity of the user's current attention and meditation state. MVD here represents people’s sense of calm and pleasure, which is a relaxing EEG feature, and AVD here represents concentration value, which is an EEG feature generated when people pay attention and tension in the brain. Those two EEG values are also important convergence values for genetic algorithm optimization in this method.

Table 1 Classification of EEG signals

3.3 Integrated device system

On the integration of hardware platform, In order to achieve the above workflow, EEG signal data collection equipment, virtual reality (VR) environmental equipment (Li et al., 2020) and related auxiliary data transmission kits are integrated on this system. Comprehensively, in terms of EEG monitoring and analysis equipment selection, this study requires access to up-to-date EEG data, which underscores the importance of using open-source equipment. EEG headbands based on ThinkGear AM (TGAM) and Open BCI modules exhibit potential for secondary development, making them the chosen modules for assembling the EEG monitoring equipment in this study. TGAM module (Yin et al., 2020) could be assembled as a single-electrode ear-clip brainwave head-ring, which has been widely used in scientifc research (Jadhav & Momin, 2018). Besides, we chose OpenBCI module to integrate in this system as an another option, which is a 16-electrode ear-clip type brainwave headgear. Relying on rich open source programming libraries and data interfaces, OpenBCI devices could be easily integrated into existing software and hardware systems to improve the efficiency of biosignal data collection and analysis (Peterson et al., 2020) (Bolaños et al., 2021).

3.3.1 TGAM module based suites

The TGAM, NeuroSky's leading brainwave sensor ASIC module designed for mass consumer applications, processes and delivers a wide range of EEG data, including spectrum, signal quality, raw EEG, and three eSense metrics including attention, meditation, and blinking value. Using simple dry electrodes and advanced noise filtering, it simplifies setup, achieves a balance between portability and precision, and offers high noise immunity for diverse usage scenarios. The raw EEG signal calculation is performed in the chip built into the module. The output of MVD and AVD needs to be pre-programmed in the Arduino development board, its purpose is to capture and process the raw EEG data sent by the TGAM EEG module, convert hexadecimal to binary language, and input it into the computer serial port, through which MVD and AVD can be transmitted to the interface platform. Before this process, the program needs to be burned onto the Arduino board. The EEG telecommunications method used by the Arduino development board to receive the TGAM EEG module is Bluetooth reception (Zouheir et al., 2021). The programming pin connections between TGAM module and Arduino board are listed as follow, Arduino 5 V-VCC; Arduino GND—GND; Arduino Pin10—TXD; Arduino Pin11—RXD. After programming is completed, TXD and RXD need to be connected to Pin0 and Pin1 respectively. After the program is uploaded, the EEG data analyzed by the TGAM module can be transmitted to the computer serial port in real time through changing the pins. The reposition pins diagram and key programming code shows in Fig. 4.

Fig. 4
figure 4

Arduino board pre-programmed method

The TGAM EEG module measurement EEG signals from subjects' frontal lobes, calculating MVD and AVD (ranging from 0 to 100) every second. To ensure accurate EEG feedback relative to observed scenes which contains optimization elements, each scene is displayed for 5 s, discarding data from the first and last seconds. The objective value for the genetic algorithm is determined using the average of the middle three-second EEG readings, providing a more precise measure of subjects' cognitive response to each scene for spatial element optimization. In this experimental setup, EEG data is processed every five seconds to serve as the convergence metric for the optimization algorithm. Unlike previous genetic algorithm research focused on machine-based calculations for rapid optimization, this study incorporates human observation, necessitating a waiting period in the optimization process. To accommodate this, a specialized algorithm is employed, effectively integrating human feedback with the optimization cycle, thus balancing computational efficiency with the dynamics of human response. Detailed methodologies are discussed in our previous study (Zhang et al., 2022).

3.3.2 OpenBCI module based suites

The OpenBCI is an open-source biosignal acquisition device and software platform, designed to provide cost-effective and user-friendly tools for recording and analyzing various biological signals, including EEG, EMG, and ECG. Compared to the TGAM module, the 16 electrode EEG cap composed of the Open BCI module has more precise characteristics. However, compared to TGAM module suites, it is cumbersome to wear and not conducive to integration with virtual reality devices, making it more suitable for testing and experimental processes in non VR environments. OpenBCI versatile hardware platform offers customizable biosignal collectors and accessories to accommodate different user needs. OpenBCI module supports 16 electrodes and can monitor human brain’s alpha, beta, gamma, delta and theta waves in real time. These signals are transmitted via the UDP network, and unlike the TGAM, raw EEG signal processing is not executed within the chip. Instead, it is handled by a java program Open BCI_GU (Fig. 5) running on a computer system built on the X86 architecture. By calling the python external library in the terminal device, use the socket to accept the data from the Open BCI_ UDP data for GUI.

Fig. 5
figure 5

Open BCI_GUI data transmission test

This module is adept at real-time monitoring of human neural activities, encompassing alpha, beta, gamma, delta, and theta wave frequencies. It proficiently translates these complex neural oscillations into quantifiable data, presented as 16 distinct channel values on the visualization interface, offering an intuitive and detailed representation of brainwave dynamics. In the experimental methodology utilizing this EEG module establishment, a fixed interval of 5 s is maintained between successive scene presentations in order to ascertain that subjects generate relevant EEG feedback corresponding to their scene observation. Notably, EEG readings from the initial and final seconds of this period are excluded to mitigate transitional data anomalies ensuring a more precise and representative capture of the subjects' neurophysiological response to each scene. The generation of various frequency bands of EEG is obtained through fast Fourier transform, which is exponential Stacking method (1), which can lead to a large span of some EEG values, resulting in individual experimental data affecting group experiments. In order to better explore the correlation and functional relationship between the human and standard deviation parameters of the data and variables, this study will standardize the EEG data of each frequency band, and the standardization process will be logarithmic to linearize the EEG values that present exponential superposition. The logarithmic normalization processing formula is as follows (2). In program calculations, the logarithm defaults to e as the base.

$$X(\omega )={\int }_{-\infty }^{\infty }x(t){e}^{-i\omega t}dt$$
(1)
$$f\left(x\right)={\text{log}}(x-min+1)/\mathrm{ log}(max-min+1)$$
(2)

3.4 Visual interaction interface

3.4.1 Parametric modeling platform

Leveraging the straightforward operation methods, coupled with the robust integration and scalability features of the widely-used modeling software Rhino and Grasshopper, an EEG based BCI built upon this foundation can seamlessly align with the habitual workflows of designers. Furthermore, this integration not only enhances the user experience but also facilitates the efficient export of optimized model outcomes, thereby streamlining the transition from conceptual visualization to tangible design implementations. Many Simple and user-friendly optimization algorithm plugins such as Galopalos, Octopus, Wallacei, etc. have been integrated on the Grasshopper visual programming platform. This study used the multi-objective genetic algorithm plugin Wallacei based on the NSGA-II algorithm (Deb et al., 2002), which has strong application advantages in the selection of optimization results and result analysis during the optimization operation process. At the same time, it is equipped with the K-means method as the clustering algorithm function, which is conducive to the analysis of a large amount of sample data.

3.4.2 Linkage method of real‑time rendering in VR environment

In order to create a human perception effect as close to the real space as possible, the parameterized model in this study needs to achieve real-time linkage with the virtual reality environment (shows in Fig. 6). The application of this integrated interface in next experiments is based on our previous research (Zhang et al., 2022). In the construction of the software platform, we chose the Twinmotion real-time rendering engine as the renderer that supports virtual reality environment construction. By calling the Rhino modeling software's model refresh (3) and linking instructions to external renderers (4), it is possible to achieve real-time linkage between the Grasshopper platform and Twinmotion, thereby changing the parameters of model variables and causing real-time changes in virtual reality scenes. The key code is as follows:

Fig. 6
figure 6

Integrated visual interaction interface

$${\text{rhino}}\_{\text{brep}}={\text{scriptcontext}}.{\text{doc}}.{\text{bjects}}.{\text{Add}}\left({\text{geometry}},\mathrm{ attributes}\right)$$
(3)
$${\text{rs}}.{\text{Command}}\left("{\text{DatasmithDirectLinkSync}}"\right)$$
(4)

Its function is to add objects from Grasshopper to Rhino and refresh the linkage between Rhino and Twinmotion.

4 Empirical validation of multi-domain generative design applications

In this section, the article elucidates specific research cases that demonstrate the application of the established framework for generative design across various scales and scenarios within the realm of architectural design. Building upon the methodological framework devised in this study, we embark on a journey through diverse fields, selecting three distinct design directions predicated on the target design environment and the scale of human spatial perception. These three design directions encompass 'volumetric visual elements' and 'architectural elements' each representing a different facet of design element scales and application contexts. Within each of these sections, this paper provides a detailed exposition comprising three key components:

  • Workflow Establishment: This entails defining the critical stages, establishing data flows, and configuring the essential tools and parameters.

  • Generation and Optimization Interaction Mechanism Establishment: It delves into the integration of EEG data, the role of algorithms, and the dynamic interaction between generative elements and optimization criteria.

  • Experimental and Design Optimization Results: These results serve as tangible evidence of the framework's effectiveness, showcasing how EEG-driven generative design can translate into innovative and optimized architectural solutions.

Through these research cases, we aim to illustrate the versatility and adaptability of the proposed framework, providing insights into its applicability across diverse design contexts and spatial scales within the architectural domain.

4.1 Volumetric visual elements

4.1.1 Workflow

The objective of this application is to explore the corresponding forms of human EEG data for different stimuli in human scale based interior space with distinct stylistic features design elements.The experiment is primarily oriented towards harnessing human physiological data, manifested in the form of EEG signals, generated in response to auditory (music) and visual (spatial form) stimuli. Due to the simultaneous use of auditory and visual stimuli as factors affecting the spatial perception state of participants, the experiment was divided into two stages. Firstly, by analyzing the impact of six different rhythm types (frequencies) of music on EEG signals, two music types with the highest correlation with human concentration and meditation states were selected. Perform the second experiment again, stimulating and adapting spatial visual elements in these two auditory atmospheres. These data serve as drivers for shaping both the acoustic environment features and spatial element features within virtual environments, resulting in the generation of human-space interaction data. Experimental validation is executed through the utilization of TGAM module based EEG suites and VR devices. Shows in Fig. 7.

Fig. 7
figure 7

workflow of volumetric visual elements generative design

4.1.2 Perception-Form interaction mechanism

  • Object definition: Interior space design elements with distinct stylistic features based on human scale.

  • Elements feature: Space’s openness degree (parameterize as spatial closure angle); Environment color (parameterize as HSL); Ambient sound (parameterize as music genre).

  • Generative rules: This study conducted preliminary experiments to identify music genres that induced the highest MVD and AVD responses among participants when exposed to six ambient music tracks. Country and Rock genres were selected for background audio in two sets of spatial element optimization experiments. In these experiments, the study controlled spatial features by manipulating the spatial closure angle (ranging from 0° to 135° degrees) and adjusting the H (hue: 0°-360°), S (saturation: 0%-100%), and L (lightness: 0&-100%) values of the spatial environment color. The optimization process aimed to minimize the disparity between the average MVD and average AVD values as the convergence target threshold.

4.1.3 Empirical Experiment and generative results

The experiments comprised two main phases (Shows in Fig. 8). Firstly, participants' EEG data were recorded while they listened to six music genres, followed by their responses to an emotion-related questionnaire. In the second phase, a genetic algorithm was constructed using the average meditation and attention values obtained from the first phase. In the preliminary experiments, Country and Rock music show minimal standard deviations in attention values (5.12 and 5.28) and meditation values (5.82 and 6.23). This suggests that Country and Rock music evoke relatively predictable emotions. In general, Country music tend to evoke more relaxed and pay less attention, whereas Rock music tend to evoke more tense and attentive (shows in Fig. 8. Step 1). Consequently, Rock and Country music were selected for the main experiment due to their ability to elicit stable and distinct emotional responses. Subsequently, in the process of optimize generation, shows six formation of the more optimal results from the Country and Rock music ambient sound environments. The formal parameters in the relatively optimal results are listed in the table in Fig. 8.

Fig. 8
figure 8

workflow of volumetric visual elements generative design

4.2 Architectural elements

4.2.1 Workflow

Taking inspiration from the residential designs of traditional high-density neighborhoods, where a thoughtful blend of horizontal and vertical organization fosters a sense of community, we aimed to adapt this concept for contemporary living. Our approach involved strategically incorporating vertical courtyards to cater to diverse lifestyles. Our objective was to achieve a balanced and optimal solution that accommodates individuals' unique needs and preferences in today's dynamic living environments. Experimental validation is executed through the utilization of OpenBCI module based EEG suites and VR devices. Shows in Fig. 9.

Fig. 9
figure 9

workflow of architectural elements generative design

4.2.2 Perception-Form interaction mechanism

  • Object definition: Facade window opening forms of high density vertical residential units.

  • Elements feature: Large Window location (parameterize as spatial coordinate); Large Window size (parameterize as aspect ratio); Small Windows random location (parameterize as random value of multi spatial coordinates); Convex or Concave of facade panel (parameterize as boolean value).

  • Generative rules: In this study, four element feature parameters related to facade window openings were extracted. In the formal design of generating object targets, each facade panel consists of a large-sized central window opening and a group of small-sized subsidiary window openings. At the same time, the direction in which the large-sized window opening moves along the normal vector direction on the facade wall determines the overall shape of the panel's concave protrusions. The position of the central window is determined by the midpoint coordinates (which are the local coordinates of the panel), where the positive or negative value of z depends on the Boolean value of the control concavity (true is positive, indicating protrusion to the outside, false is negative, indicating indentation to the inside). The position and size of the auxiliary window are randomly generated center points and rectangles in the panel through the random function. The optimization process aimed to find the solution that makes participants indoor most relaxing with Alpha wave value higher and to find the solution that makes participants outdoor most active with sum of Beta and Gamma lower.

4.2.3 Empirical experiment

The EEG signal measurement, encompassing both indoor residents and outdoor observers, constitutes a crucial phase within the design process, driven by the quest for equilibrium in the facades' impact on EEG signals for individuals situated both inside and outside the building. Through linear regression data analysis of the results, it can be seen that in the two sets of experiments shown in the figures below, the EEG data of specific bands showed significant optimization performance after multiple rounds of feedback generation. In the optimization experiment for outdoor viewing angles, the proportion of Beta and Gamma in the full band showed a significant downward trend, while the ratio of Alpha showed a slight upward trend. This proves that while the outdoor facade form stimulates the cognitive activity of the subjects, it can also maintain a relatively relaxed psychological state (show in Fig. 10). In the analysis of the facade generation from an indoor perspective, the upward trend in Alpha ratio is not pronounced, but there is an increasing trend in Beta and Gamma ratios. This indicates that from an indoor perspective, the generated architectural forms resulting from the specified facade generation rules tend to evoke features that stimulate concentration and contemplation in the human spatial perception process (show in Fig. 11).

Fig. 10
figure 10

outdoor interface optimization process

Fig. 11
figure 11

indoor interface optimization process

The experimental results reveal distinct preferences: external observers exhibit a penchant for concave facades featuring smaller main windows, while occupants within the atrium space gravitate toward convex facades adorned with larger main windows. These findings underscore the feasibility of conducting further EEG signal testing for each indoor resident, followed by the integration of all collected data, including that of external observers. This comprehensive dataset serves as the foundation for determining the final facade configuration, encompassing its shape, window dimensions, and window placement. Such an approach ensures an architectural design that harmoniously accommodates the nuanced preferences of both internal occupants and external viewers.

5 Conclusion

Human experience within architectural spaces is a dynamic interplay of physiological, emotional, and cognitive states. Ergonomic data emerges as a quantifiable reflection of the intricate physiological responses that individuals exhibit during their interaction with architectural spaces. It serves as an empirical foundation that not only aids in understanding human–environment relationships but also provides valuable insights for optimizing spatial designs to enhance well-being and functionality. From the minute intricacies of volumetric visual elements to the holistic consideration of architectural spatial attributes, the study aims to explore the versatility and adaptability of EEG-driven generative design. It endeavors to establish whether EEG signals can serve as a universal foundation, enabling a cohesive and data-driven approach across diverse design contexts.

To initiate this exploration, the paper delves into an in-depth methodological and tool-based assessment of current research at the intersection of ergonomics and design. It scrutinizes the existing literature and investigates the practicality of EEG integration into generative design processes. This initial analysis provides a critical foundation for understanding the potential and limitations of employing EEG data for design optimization.With a solid groundwork established, the study proceeds to construct a holistic data flow system, fusing together various hardware and software components into a cohesive workflow.

This integrated system acts as the conduit through which EEG data is processed, analyzed, and ultimately used to drive generative design outcomes. Empirical studies, carried out at different scales of application, yield tangible form-generative results, showcasing the method's effectiveness and its capacity to translate human physiological responses into architectural elements. These outcomes substantiate the rationale and feasibility of Brain-Computer Interface based Generative Design (BCIGD) framework, laying the groundwork for future research avenues. As the field continues to evolve, the integration of intelligent algorithmic models promises to further enhance the precision and adaptability of this innovative approach, opening up new horizons in architectural design.