Keywords

1 Introduction

The sudden spread of COVID-19 in 2019 challenged human physiology and had a great impact on human psychology. The long-term isolation has caused extensive socio-economic losses during the epidemic, and the loss of income and livelihood is causing social and psychological distress. On the one hand, people with mental illness are more likely to be infected with neocoronavirus [1], on the other hand, mass isolation measures and mental health factors such as anxiety, depression, and stress are the causes of infection with the neocoronavirus [2].

Besides, the design of the space environment needs to meet human physiological and psychological needs, especially for children, the elderly, and pregnant women in human vulnerable groups. The satisfaction of various elements in architecture and space environment to their mental health is particularly important. Architectural space is closely related to people's psychological space. The color of the enclosure, the light in the environment, the outline of objects, and even the style of buildings will affect people's psychological feelings [3, 4].

Previous studies on the correlation between EEG signals and psychological quantities such as human emotion and psychological stress found that it is theoretically feasible to judge people's emotional characteristics [5] and quantify people's degree of relaxation and stress through EEG signals [6, 7]. To sum up, the mental state represented by specific EEG characteristics can significantly positively impact human psychology and physiology [8,9,10]. Enhancing people's meditation training and enhancing the meditation value corresponding to the TGAM EEG module can reduce people's stress and anxiety to a certain extent [11, 12].

In the field of perceptual engineering, EEG monitoring methods have great research potential in the fields of architecture [13, 14], landscape [15, 16], urban design [17], and art [18]. These studies also fully illustrate the feasibility of applying the EEG method to building evaluation and space design. Through the above research, it can be concluded that human beings will produce different brain wave states under different spatial atmospheres or elements. EEG signals in different states can correspond to different psychological states [19].

However, compared with the field of building physics [20, 21], building structure [22], and other areas [23, 24], the relationship between human physiological data and spatial elements established in the above research does not seem to be accurate to the quantitative level, and the overall optimization suggestions prefer qualitative suggestions.

1.1 Research Aim

This study aims to create an effective architectural design optimization method, which is a quantitative optimization method of architectural space elements based on the physiological data of human emotion and psychological elements. Figure 1 shows the goal vision of this approach.

Fig. 1.
figure 1

EEG-based spatial optimization method

This method is used to form a closed-loop optimization participated by people. People do not need to make active judgments in the optimization process. During optimization, the experimentee observes the virtual reality scene, and the EEG signal is monitored in real-time by the TGAM EEG module. The optimization algorithm changes the parametric linkage model in real-time via referring to the EEG value, to change the virtual reality scene observed by the experimentee. In this study, the specific indexes of meditation value and attention value in human EEG signal are analyzed based on the head ring of TGAM module as the optimization goal, the color of building space and window opening size as the optimization object, multi-objective genetic algorithm as the optimization tool, combined with virtual reality scene and parametric linkage model, the tool platform and workflow to realize this method is established. The realization of the research purpose of this study consists of the following three points:

  • Develop a tool platform for real-time interactive spatial element optimization based on EEG signals. The tool platform is composed of hardware system and software system.

  • Establish the workflow of real-time interactive spatial element optimization based on EEG signals.

  • Carry out multiple groups of optimization experiments of real-time interactive spatial element optimization methods based on EEG signals, complete the evaluation of the optimization methods and propose improvement goals through quantitative analysis of experimental data and optimization results.

2 Method

In the experiment, this research involves electrical signal communication, real-time rendering of virtual reality scene, optimization and linkage of parametric model, and the workflow is relatively complex. The required work platform is divided into hardware platform and software platform.

On the hardware platform, this study assembled a single electrode ear clip brain wave head ring through TGAM EEG module, which can monitor human brain waves in real-time α Wave β Wave γ Wave, etc., and calculate people's meditation value and attention value through the black box (meditation here represents people's sense of calm and pleasure, which is a relaxing EEG feature, and attention here represents concentration value, which is an EEG feature generated when people pay attention and tension in the brain).

In this study, the TGAM EEG module will continuously send human EEG signals through Bluetooth in real-time during the experiment. The EEG signals are preprocessed through the Arduino development board, and the processed meditation value and attention value are sent to the computer serial port. The computer is used to run the optimization program and transmit the changing parametric model to oculus rift s virtual reality glasses through real-time rendering.

On the software platform, the preprocessing of the uploading program of the Arduino development board is completed by writing C language in Arduino ide. Its purpose is to capture and process the original EEG data sent via the TGAM EEG module, convert hexadecimal into binary language and input it into computer serial port. Based on Grasshopper, this research uses the data read from the serial port as the reference of the optimization algorithm in real-time, establishes the standard bedroom unit with variable color and window hole size, links it to the real-time rendering software based on twinmotion platform through the program, and transmits the virtual reality scene to oculus rift s virtual reality glasses through twinmotion. In this study, wallacei multi-objective genetic algorithm based on the Grasshopper platform is used as the main optimization algorithm to optimize the color and window opening size of typical bedroom units with real-time reference to the optimization objectives. Figure 2 shows the workflow of the optimization tool platform.

Fig. 2.
figure 2

EEG-based spatial optimization tool platform workflow

2.1 Workflow

This section includes the establishment of the initialization virtual scene, the establishment of a variable library, and the design of the basic experimental process. The design of the basic flow of the experiment includes the methods of establishing the key steps of this research, such as the real-time reading and processing of EEG data on the Grasshopper platform, the real-time rendering linkage of parametric model and virtual reality scene, and the adaptation of black-box optimization algorithm on the Grasshopper platform.

2.1.1 Establishment of Initial Virtual Reality Scene

The real-time interactive optimization experiment has high requirements for the linkage between software platforms. In this study, a bedroom model with a bay of 4 m and a depth of 5 m, and a height of 3 m is established on the Grasshopper platform. The window is located on the south side, and the initial window size is to scale the south wall shape on its plane to 0.5 times of the original shape. The initial indoor color of this bedroom model is white (all three RGB values are 255). The interior model does not contain other objects, and the color and material characteristics of the floor, wall, and ceiling are the same.

2.1.2 Establishment of Variable Database and Optimization Objectives

As mentioned above, the initialization scene is the optimization subject of this study. The typical bedroom model of this scene will be observed through indoor observation in this study. This subject contains five optimization variables, namely, the variable parameters controlled by the program in the optimization process.

In previous studies, it has been found that light and color will have a great impact on people's psychological feelings in the scene [4, 5]. Therefore, in this study, the window hole size and indoor color that control the amount of light will be optimized, in which the variables controlling the window hole size are X-axis zoom and Y-axis zoom, and X-axis zoom controls the width of the window hole, The Y-axis scaling amount controls the height of the window opening. The color variables in the control room are R, G, and B. Attention represents the degree of tension and concentration, the smaller the better in the calculation, while the value of meditation represents people's degree of relaxation and pleasure, and the larger the better. However, in the experiment of this study, because the characteristic of a genetic algorithm is to find the minimum value of the optimization objective, it is calculated with its negative value in the calculation process.

2.1.3 Arduino Board Program Uploading Method

The EEG signal based on the TGAM EEG module in this study needs to be preprocessed in the Arduino development board to make the Arduino board can read EEG data in real-time and capture the attention value and meditation value in the TGAM module, and then transmit them to Grasshopper platform through the serial port.

Before that, it needs to upload the program to the Arduino board. The EEG mode of receiving the TGAM EEG module on the Arduino board is Bluetooth reception. The pin connection method during program uploading is Arduino 5 V—VCC; Arduino GND—GND; Arduino Pin10—TXD; Arduino Pin11—RXD. After uploading, connect TXD and RXD to pin0 and Pin1 respectively (Fig. 3).

Fig. 3.
figure 3

Arduino board program uploading method

2.2 Adaptation of Optimization Algorithm on Grasshopper Platform

The TGAM EEG module collects the EEG signals of the subjects through the electrodes of the prefrontal lobe and sends the subjects’ current meditation value and attention value every second through the module calculation. Both values range from 0 to 100. This study hopes to obtain the space that can make people have higher meditation value and lower attention value through optimization calculation to reduce people's sense of tension and anxiety in the environment and increase the sense of relaxation.

During the experiment, to ensure that the experimenter can produce more reasonable EEG feedback corresponding to the scene during observation, each scene is stopped in front of the experimenter for 5 s, the EEG values of the first and last seconds are discarded, and the average value of EEG in the middle section is taken as the reference value of genetic algorithm (objective). The specific formula is as follows [4, 13, 15].

$$Average\_Meditation=\frac{\int_{{t}_{0}}^{{t}_{1}}Meditation\cdot dt}{{t}_{1}-{t}_{0}}$$
(1)

Based on the above, a group of EEG processed data can be generated every five seconds during the experiment as the optimization reference of the optimization algorithm. In this research, human observation participation is generated, so the optimization algorithm needs to wait in the process of optimization calculation. Here, the problem is solved by the “time. Sleep (5)” algorithm. Within the time when other calculations stop for 5 s, the meditation value and attention value will accumulate 5 s of data, and at the end of 5 s, input it as a list to calculate the average value (1). The time of the calculation process is proved to be within 0.5 s after many tests, which is lower than the time of the previous second discarded in the average calculation, and will not be superimposed with time, so it will not affect the accuracy of the optimization algorithm. Figure 4 shows the experimental operation interface.

Fig. 4.
figure 4

Experimental operation interface

3 Experiment

To test the applicability of the optimization method in this study, 50 volunteers of different ages were recruited for the optimization experiment. Of the 50 volunteers, 52% were male and 48% female, with 4% children, 76% youth, 16% middle-aged, and 4% elderly. This section will discuss the experimental environment preparation, experimental process, experimental results, and analysis.

As shown in Fig. 5, the experimental environment is a special EEG and Eye movement laboratory. The laboratory provides the subject with an environment with less external interference and allows the researcher to observe the experimental process. Before the experiment, the subjects wear EEG equipment first and then wear VR glasses. After the EEG runs stably, the experiment can be started. The genetic algorithm in the experiment is initially set to iterate (Generation Count) 20 times, with 10 biomass (Generation Size) per generation. The experimental time is estimated by the software to be about 18 min and 31 s.

Fig. 5.
figure 5

Experiment site example

3.1 Experimental Results and Quantitative Analysis

Figures 6 and 7 respectively show the parallel coordinate plot and optimization target distribution diagram of 10,000 optimization target data in the optimization experiment of 50 volunteers.

Fig. 6.
figure 6

Parallel coordinate plot

Fig. 7.
figure 7

Objective space

In the parallel coordinate graph (PCP), each line represents the optimization target value of a single optimization individual, the red line represents the results at the bottom of the ranking, and the blue line represents the results at the top of the ranking. It can be seen from Fig. 4 that the optimization effect of the genetic algorithm is obvious. Through optimization, even one of the experimentees has produced better results with attention as low as 2.5 and meditation as high as 98.5. By indexing the result, it can be got that the index is (Gen: 12 | ind: 3) (Gen: 19 | ind: 3), that is, the 4th individual of the 13th generation and the 4th individual of the 20th generation (the index in the computer starts from 0 by default).

The Objective Space (OS) remaps the optimization target value of the analog output and specifies a different axis for each target. Average_Attention and average_ meditation are displayed on the X and Y axes respectively. In the optimization experiment, the non-dominant Pareto optimal polyline can be calculated from the optimization target distribution map, and the better optimization results of a single experimenter can be obtained. Taking one of the experimentees as an example, it can be got from the results that there are nine non-dominant Pareto optimal solutions of the 20th generation results, and one of them coincides with the optimal solution obtained from the above PCP analysis. To sum up, nine excellent optimization results of the experimentee can be obtained through PCP and OS analysis methods. Table 1 shows the example of optimization results from one of the experimenters.

Table 1. Example of PCP and OS optimization filter results

From the whole optimization process, referring to the generation average value trend chart (MV) of the optimization target, as shown in Fig. 8, it can be got that with the optimization iteration, Average_Attention value decreases obviously in the optimization process, while the Average_Meditation calculated by negative value shows a significant decrease in optimization, that is, the positive value of this value increases significantly. The larger red dot in Fig. 8 represents the average value of the optimization target generation of the results of the 20th generation. It can be seen that the optimization of window opening size and indoor color based on EEG signal in this study is effective.

Fig. 8.
figure 8

Mean value trendline of Average_Attention and Average_Meditation value

4 Conclusion and Discussion

In this paper, it can be found that it is feasible to take human-specific EEG signals as the optimization goal of optimizing building space elements. In the experiment of taking the size of the window opening and the color of the indoor space as an example, the optimization results are selected according to the Pareto optimal method. The optimization effect of the genetic algorithm with the optimization objectives of meditation value and attention value is obvious. This study will further analyze the optimization results in this experiment in further research, and try to analyze the characteristics and scope of the optimization results by clustering.

The closed-loop optimization model established in this study from EEG equipment to grasshopper platform, and then to the real-time rendering engine to VR equipment will be used to further optimize a wider range of scenes involving building volume, architectural style, and landscape elements, etc. The applicability scenario of the optimization algorithm in further research will be expanded and the development of more possibilities of man–machine coupling design in artificial intelligence technology will be promoted. Based on this research, complex multi-objective and multi-factor real-time interactive optimization will become possible.